From owner-svn-src-head@freebsd.org Sun Aug 20 00:41:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AED8DCDB9A; Sun, 20 Aug 2017 00:41:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DECA26B9E3; Sun, 20 Aug 2017 00:41:50 +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 v7K0foOk011926; Sun, 20 Aug 2017 00:41:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7K0foic011925; Sun, 20 Aug 2017 00:41:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201708200041.v7K0foic011925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 20 Aug 2017 00:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322710 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 322710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 00:41:51 -0000 Author: cem Date: Sun Aug 20 00:41:49 2017 New Revision: 322710 URL: https://svnweb.freebsd.org/changeset/base/322710 Log: hwpstate: Add support for family 17h pstate info from MSRs This information is normally available via acpi_perf, but in case it is not, add support for fetching the information via MSRs on AMD family 17h (Zen) processors. Zen uses a slightly different formula than previous generation AMD CPUs. This was inspired by, but does not fix, PR 221621. Reported by: Sean P. R. Reviewed by: mjoras@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12082 Modified: head/sys/x86/cpufreq/hwpstate.c Modified: head/sys/x86/cpufreq/hwpstate.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate.c Sat Aug 19 23:13:33 2017 (r322709) +++ head/sys/x86/cpufreq/hwpstate.c Sun Aug 20 00:41:49 2017 (r322710) @@ -83,6 +83,10 @@ __FBSDID("$FreeBSD$"); #define AMD_10H_11H_CUR_DID(msr) (((msr) >> 6) & 0x07) #define AMD_10H_11H_CUR_FID(msr) ((msr) & 0x3F) +#define AMD_17H_CUR_VID(msr) (((msr) >> 14) & 0xFF) +#define AMD_17H_CUR_DID(msr) (((msr) >> 8) & 0x3F) +#define AMD_17H_CUR_FID(msr) ((msr) & 0xFF) + #define HWPSTATE_DEBUG(dev, msg...) \ do{ \ if(hwpstate_verbose) \ @@ -426,6 +430,15 @@ hwpstate_get_info_from_msr(device_t dev) case 0x15: case 0x16: hwpstate_set[i].freq = (100 * (fid + 0x10)) >> did; + break; + case 0x17: + did = AMD_17H_CUR_DID(msr); + if (did == 0) { + HWPSTATE_DEBUG(dev, "unexpected did: 0\n"); + did = 1; + } + fid = AMD_17H_CUR_FID(msr); + hwpstate_set[i].freq = (200 * fid) / did; break; default: HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family" From owner-svn-src-head@freebsd.org Sun Aug 20 01:40:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB771DD2869; Sun, 20 Aug 2017 01:40:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87AE96D97F; Sun, 20 Aug 2017 01:40:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7K1eOu8033312; Sun, 20 Aug 2017 01:40:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7K1eOXN033310; Sun, 20 Aug 2017 01:40:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708200140.v7K1eOXN033310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 20 Aug 2017 01:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322713 - in head/sys/compat/linuxkpi/common/include: asm linux X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common/include: asm linux X-SVN-Commit-Revision: 322713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 01:40:25 -0000 Author: markj Date: Sun Aug 20 01:40:24 2017 New Revision: 322713 URL: https://svnweb.freebsd.org/changeset/base/322713 Log: Add a couple of trivial headers to the LinuxKPI. MFC after: 1 week Added: head/sys/compat/linuxkpi/common/include/asm/msr.h (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/atomic.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/asm/msr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/msr.h Sun Aug 20 01:40:24 2017 (r322713) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2017 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. + * + * $FreeBSD$ + */ + +#ifndef _ASM_MSR_H_ +#define _ASM_MSR_H_ + +#include + +#define rdmsrl(msr, val) ((val) = rdmsr(msr)) + +#endif /* _ASM_MSR_H_ */ Added: head/sys/compat/linuxkpi/common/include/linux/atomic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/atomic.h Sun Aug 20 01:40:24 2017 (r322713) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2017 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_ATOMIC_H_ +#define _LINUX_ATOMIC_H_ + +#include +#include + +#endif /* _LINUX_ATOMIC_H_ */ From owner-svn-src-head@freebsd.org Sun Aug 20 01:42:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E31A5DD2BD5; Sun, 20 Aug 2017 01:42:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1A2B6DCE6; Sun, 20 Aug 2017 01:42:02 +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 v7K1g1W3036912; Sun, 20 Aug 2017 01:42:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7K1g1D4036911; Sun, 20 Aug 2017 01:42:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708200142.v7K1g1D4036911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 20 Aug 2017 01:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322714 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 322714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 01:42:03 -0000 Author: markj Date: Sun Aug 20 01:42:01 2017 New Revision: 322714 URL: https://svnweb.freebsd.org/changeset/base/322714 Log: Define prefetch() only if it hasn't already been defined. MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/list.h Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Sun Aug 20 01:40:24 2017 (r322713) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Sun Aug 20 01:42:01 2017 (r322714) @@ -70,7 +70,9 @@ #include #include +#ifndef prefetch #define prefetch(x) +#endif #define LINUX_LIST_HEAD_INIT(name) { &(name), &(name) } From owner-svn-src-head@freebsd.org Sun Aug 20 09:03:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B412DE8A80; Sun, 20 Aug 2017 09:03:24 +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 C966A7DEA6; Sun, 20 Aug 2017 09:03:23 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (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 793442600D6; Sun, 20 Aug 2017 11:03:12 +0200 (CEST) Subject: Re: svn commit: r322714 - head/sys/compat/linuxkpi/common/include/linux To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708200142.v7K1g1D4036911@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Sun, 20 Aug 2017 11:00:55 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201708200142.v7K1g1D4036911@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 09:03:24 -0000 On 08/20/17 03:42, Mark Johnston wrote: > +#ifndef prefetch > #define prefetch(x) > +#endif Shouldn't this macro have a do { } while (0) body? --HPS From owner-svn-src-head@freebsd.org Sun Aug 20 09:39:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 798D2DEA1DE; Sun, 20 Aug 2017 09:39:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 473DF7EC94; Sun, 20 Aug 2017 09:39:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7K9dAUg028138; Sun, 20 Aug 2017 09:39:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7K9dAAv028137; Sun, 20 Aug 2017 09:39:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708200939.v7K9dAAv028137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 20 Aug 2017 09:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322718 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 322718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 09:39:11 -0000 Author: kib Date: Sun Aug 20 09:39:10 2017 New Revision: 322718 URL: https://svnweb.freebsd.org/changeset/base/322718 Log: Use ANSI C declaration for trap_pfault(). Style. Reviewed by: bde Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Aug 20 07:06:13 2017 (r322717) +++ head/sys/amd64/amd64/trap.c Sun Aug 20 09:39:10 2017 (r322718) @@ -609,17 +609,20 @@ trap_check(struct trapframe *frame) } static int -trap_pfault(frame, usermode) - struct trapframe *frame; - int usermode; +trap_pfault(struct trapframe *frame, int usermode) { - vm_offset_t va; + struct thread *td; + struct proc *p; vm_map_t map; - int rv = 0; + vm_offset_t va; + int rv; vm_prot_t ftype; - struct thread *td = curthread; - struct proc *p = td->td_proc; - vm_offset_t eva = frame->tf_addr; + vm_offset_t eva; + + td = curthread; + p = td->td_proc; + eva = frame->tf_addr; + rv = 0; if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) { /* From owner-svn-src-head@freebsd.org Sun Aug 20 09:42:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 811B2DEA48E; Sun, 20 Aug 2017 09:42:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4F9127F010; Sun, 20 Aug 2017 09:42:10 +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 v7K9g9BD032206; Sun, 20 Aug 2017 09:42:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7K9g9N1032205; Sun, 20 Aug 2017 09:42:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708200942.v7K9g9N1032205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 20 Aug 2017 09:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322719 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 322719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 09:42:10 -0000 Author: kib Date: Sun Aug 20 09:42:09 2017 New Revision: 322719 URL: https://svnweb.freebsd.org/changeset/base/322719 Log: Trim excessive 'extern' and remove unused declaration. Reviewed by: bde Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Aug 20 09:39:10 2017 (r322718) +++ head/sys/amd64/amd64/trap.c Sun Aug 20 09:42:09 2017 (r322719) @@ -99,9 +99,8 @@ PMC_SOFT_DEFINE( , , page_fault, write); #include #endif -extern void __noinline trap(struct trapframe *frame); -extern void trap_check(struct trapframe *frame); -extern void syscall(struct trapframe *frame); +void __noinline trap(struct trapframe *frame); +void trap_check(struct trapframe *frame); void dblfault_handler(struct trapframe *frame); static int trap_pfault(struct trapframe *, int); From owner-svn-src-head@freebsd.org Sun Aug 20 09:52:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEC96DEAA2D; Sun, 20 Aug 2017 09:52:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE3B7F59F; Sun, 20 Aug 2017 09:52:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7K9qPVN036385; Sun, 20 Aug 2017 09:52:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7K9qPP4036384; Sun, 20 Aug 2017 09:52:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708200952.v7K9qPP4036384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 20 Aug 2017 09:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322720 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 322720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 09:52:26 -0000 Author: kib Date: Sun Aug 20 09:52:25 2017 New Revision: 322720 URL: https://svnweb.freebsd.org/changeset/base/322720 Log: Simplify amd64 trap(). - Use more relevant name 'signo' instead of 'i' for the local variable which contains a signal number to send for the current exception. - Eliminate two labels 'userout' and 'out' which point to the very end of the trap() function. Instead use return directly. - Re-indent the prot_fault_translation block by reducing if() nesting. - Some more monor style changes. Requested and reviewed by: bde Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Aug 20 09:42:09 2017 (r322719) +++ head/sys/amd64/amd64/trap.c Sun Aug 20 09:52:25 2017 (r322720) @@ -172,12 +172,12 @@ trap(struct trapframe *frame) #ifdef KDB register_t dr6; #endif - int i, ucode; + int signo, ucode; u_int type; td = curthread; p = td->td_proc; - i = 0; + signo = 0; ucode = 0; addr = 0; @@ -186,22 +186,20 @@ trap(struct trapframe *frame) #ifdef SMP /* Handler for NMI IPIs used for stopping CPUs. */ - if (type == T_NMI) { - if (ipi_nmi_handler() == 0) - goto out; - } -#endif /* SMP */ + if (type == T_NMI && ipi_nmi_handler() == 0) + return; +#endif #ifdef KDB if (kdb_active) { kdb_reenter(); - goto out; + return; } #endif if (type == T_RESERVED) { trap_fatal(frame, 0); - goto out; + return; } if (type == T_NMI) { @@ -214,18 +212,18 @@ trap(struct trapframe *frame) */ if (pmc_intr != NULL && (*pmc_intr)(PCPU_GET(cpuid), frame) != 0) - goto out; + return; #endif #ifdef STACK if (stack_nmi_handler(frame) != 0) - goto out; + return; #endif } if (type == T_MCHK) { mca_intr(); - goto out; + return; } if ((frame->tf_rflags & PSL_I) == 0) { @@ -269,7 +267,7 @@ trap(struct trapframe *frame) switch (type) { case T_PRIVINFLT: /* privileged instruction fault */ - i = SIGILL; + signo = SIGILL; ucode = ILL_PRVOPC; break; @@ -281,41 +279,41 @@ trap(struct trapframe *frame) fill_frame_regs(frame, ®s); if (dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) - goto out; + return; } #endif frame->tf_rflags &= ~PSL_T; - i = SIGTRAP; + signo = SIGTRAP; ucode = (type == T_TRCTRAP ? TRAP_TRACE : TRAP_BRKPT); break; case T_ARITHTRAP: /* arithmetic trap */ ucode = fputrap_x87(); if (ucode == -1) - goto userout; - i = SIGFPE; + return; + signo = SIGFPE; break; case T_PROTFLT: /* general protection fault */ - i = SIGBUS; + signo = SIGBUS; ucode = BUS_OBJERR; break; case T_STKFLT: /* stack fault */ case T_SEGNPFLT: /* segment not present fault */ - i = SIGBUS; + signo = SIGBUS; ucode = BUS_ADRERR; break; case T_TSSFLT: /* invalid TSS fault */ - i = SIGBUS; + signo = SIGBUS; ucode = BUS_OBJERR; break; case T_ALIGNFLT: - i = SIGBUS; + signo = SIGBUS; ucode = BUS_ADRALN; break; case T_DOUBLEFLT: /* double fault */ default: - i = SIGBUS; + signo = SIGBUS; ucode = BUS_OBJERR; break; @@ -325,67 +323,64 @@ trap(struct trapframe *frame) */ if (*p->p_sysent->sv_trap != NULL && (*p->p_sysent->sv_trap)(td) == 0) - goto userout; + return; addr = frame->tf_addr; - i = trap_pfault(frame, TRUE); - if (i == -1) - goto userout; - if (i == 0) - goto user; - - if (i == SIGSEGV) + signo = trap_pfault(frame, TRUE); + if (signo == -1) + return; + if (signo == 0) + goto userret; + if (signo == SIGSEGV) { ucode = SEGV_MAPERR; - else { - if (prot_fault_translation == 0) { - /* - * Autodetect. - * This check also covers the images - * without the ABI-tag ELF note. - */ - if (SV_CURPROC_ABI() == SV_ABI_FREEBSD - && p->p_osrel >= P_OSREL_SIGSEGV) { - i = SIGSEGV; - ucode = SEGV_ACCERR; - } else { - i = SIGBUS; - ucode = BUS_PAGE_FAULT; - } - } else if (prot_fault_translation == 1) { - /* - * Always compat mode. - */ - i = SIGBUS; - ucode = BUS_PAGE_FAULT; - } else { - /* - * Always SIGSEGV mode. - */ - i = SIGSEGV; + } else if (prot_fault_translation == 0) { + /* + * Autodetect. This check also covers + * the images without the ABI-tag ELF + * note. + */ + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD && + p->p_osrel >= P_OSREL_SIGSEGV) { + signo = SIGSEGV; ucode = SEGV_ACCERR; + } else { + signo = SIGBUS; + ucode = BUS_PAGE_FAULT; } + } else if (prot_fault_translation == 1) { + /* + * Always compat mode. + */ + signo = SIGBUS; + ucode = BUS_PAGE_FAULT; + } else { + /* + * Always SIGSEGV mode. + */ + signo = SIGSEGV; + ucode = SEGV_ACCERR; } break; case T_DIVIDE: /* integer divide fault */ ucode = FPE_INTDIV; - i = SIGFPE; + signo = SIGFPE; break; #ifdef DEV_ISA case T_NMI: nmi_handle_intr(type, frame); - goto out; -#endif /* DEV_ISA */ + return; +#endif case T_OFLOW: /* integer overflow fault */ ucode = FPE_INTOVF; - i = SIGFPE; + signo = SIGFPE; break; case T_BOUND: /* bounds check fault */ ucode = FPE_FLTSUB; - i = SIGFPE; + signo = SIGFPE; break; case T_DNA: @@ -393,18 +388,18 @@ trap(struct trapframe *frame) KASSERT(PCB_USER_FPU(td->td_pcb), ("kernel FPU ctx has leaked")); fpudna(); - goto userout; + return; case T_FPOPFLT: /* FPU operand fetch fault */ ucode = ILL_COPROC; - i = SIGILL; + signo = SIGILL; break; case T_XMMFLT: /* SIMD floating-point exception */ ucode = fputrap_sse(); if (ucode == -1) - goto userout; - i = SIGFPE; + return; + signo = SIGFPE; break; #ifdef KDTRACE_HOOKS case T_DTRACE_RET: @@ -412,8 +407,8 @@ trap(struct trapframe *frame) fill_frame_regs(frame, ®s); if (dtrace_return_probe_ptr != NULL && dtrace_return_probe_ptr(®s) == 0) - goto out; - goto userout; + return; + return; #endif } } else { @@ -424,13 +419,13 @@ trap(struct trapframe *frame) switch (type) { case T_PAGEFLT: /* page fault */ (void) trap_pfault(frame, FALSE); - goto out; + return; case T_DNA: if (PCB_USER_FPU(td->td_pcb)) panic("Unregistered use of FPU in kernel"); fpudna(); - goto out; + return; case T_ARITHTRAP: /* arithmetic trap */ case T_XMMFLT: /* SIMD floating-point exception */ @@ -440,7 +435,7 @@ trap(struct trapframe *frame) * registration for FPU traps is overkill. */ trap_fatal(frame, 0); - goto out; + return; case T_STKFLT: /* stack fault */ case T_PROTFLT: /* general protection fault */ @@ -460,35 +455,35 @@ trap(struct trapframe *frame) */ if (frame->tf_rip == (long)doreti_iret) { frame->tf_rip = (long)doreti_iret_fault; - goto out; + return; } if (frame->tf_rip == (long)ld_ds) { frame->tf_rip = (long)ds_load_fault; - goto out; + return; } if (frame->tf_rip == (long)ld_es) { frame->tf_rip = (long)es_load_fault; - goto out; + return; } if (frame->tf_rip == (long)ld_fs) { frame->tf_rip = (long)fs_load_fault; - goto out; + return; } if (frame->tf_rip == (long)ld_gs) { frame->tf_rip = (long)gs_load_fault; - goto out; + return; } if (frame->tf_rip == (long)ld_gsbase) { frame->tf_rip = (long)gsbase_load_fault; - goto out; + return; } if (frame->tf_rip == (long)ld_fsbase) { frame->tf_rip = (long)fsbase_load_fault; - goto out; + return; } if (curpcb->pcb_onfault != NULL) { frame->tf_rip = (long)curpcb->pcb_onfault; - goto out; + return; } break; @@ -504,7 +499,7 @@ trap(struct trapframe *frame) */ if (frame->tf_rflags & PSL_NT) { frame->tf_rflags &= ~PSL_NT; - goto out; + return; } break; @@ -525,7 +520,7 @@ trap(struct trapframe *frame) * processor doesn't */ load_dr6(rdr6() & ~0xf); - goto out; + return; } /* * FALLTHROUGH (TRCTRAP kernel mode, kernel address) @@ -540,27 +535,27 @@ trap(struct trapframe *frame) dr6 = rdr6(); load_dr6(dr6 & ~0x4000); if (kdb_trap(type, dr6, frame)) - goto out; + return; #endif break; #ifdef DEV_ISA case T_NMI: nmi_handle_intr(type, frame); - goto out; -#endif /* DEV_ISA */ + return; +#endif } trap_fatal(frame, 0); - goto out; + return; } /* Translate fault for emulators (e.g. Linux) */ - if (*p->p_sysent->sv_transtrap) - i = (*p->p_sysent->sv_transtrap)(i, type); + if (*p->p_sysent->sv_transtrap != NULL) + signo = (*p->p_sysent->sv_transtrap)(signo, type); ksiginfo_init_trap(&ksi); - ksi.ksi_signo = i; + ksi.ksi_signo = signo; ksi.ksi_code = ucode; ksi.ksi_trapno = type; ksi.ksi_addr = (void *)addr; @@ -568,8 +563,8 @@ trap(struct trapframe *frame) uprintf("pid %d comm %s: signal %d err %lx code %d type %d " "addr 0x%lx rsp 0x%lx rip 0x%lx " "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", - p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, - frame->tf_rsp, frame->tf_rip, + p->p_pid, p->p_comm, signo, frame->tf_err, ucode, type, + addr, frame->tf_rsp, frame->tf_rip, fubyte((void *)(frame->tf_rip + 0)), fubyte((void *)(frame->tf_rip + 1)), fubyte((void *)(frame->tf_rip + 2)), @@ -581,14 +576,10 @@ trap(struct trapframe *frame) } KASSERT((read_rflags() & PSL_I) != 0, ("interrupts disabled")); trapsignal(td, &ksi); - -user: +userret: userret(td, frame); KASSERT(PCB_USER_FPU(td->td_pcb), ("Return from trap with kernel FPU ctx leaked")); -userout: -out: - return; } /* From owner-svn-src-head@freebsd.org Sun Aug 20 10:07:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9F4FDEB2EE; Sun, 20 Aug 2017 10:07:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A78987FAF3; Sun, 20 Aug 2017 10:07:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7KA7jOO040592; Sun, 20 Aug 2017 10:07:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7KA7jZP040590; Sun, 20 Aug 2017 10:07:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708201007.v7KA7jZP040590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 20 Aug 2017 10:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322721 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 322721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 10:07:47 -0000 Author: kib Date: Sun Aug 20 10:07:45 2017 New Revision: 322721 URL: https://svnweb.freebsd.org/changeset/base/322721 Log: Allow vinvalbuf() to operate with the shared vnode lock. This mode allows other clean buffers to arrive while we flush the buf lists for the vnode, which is fine for the targeted use. We only need that all buffers existed at the time of the function start were flushed. In fact, only one assert has to be relaxed. In collaboration with: pho Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D12083 Modified: head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Aug 20 09:52:25 2017 (r322720) +++ head/sys/kern/vfs_subr.c Sun Aug 20 10:07:45 2017 (r322721) @@ -1698,9 +1698,13 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int slpf #ifdef INVARIANTS BO_LOCK(bo); - if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO)) == 0 && - (bo->bo_dirty.bv_cnt > 0 || bo->bo_clean.bv_cnt > 0)) + if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO | + V_ALLOWCLEAN)) == 0 && (bo->bo_dirty.bv_cnt > 0 || + bo->bo_clean.bv_cnt > 0)) panic("vinvalbuf: flush failed"); + if ((flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO)) == 0 && + bo->bo_dirty.bv_cnt > 0) + panic("vinvalbuf: flush dirty failed"); BO_UNLOCK(bo); #endif return (0); Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Aug 20 09:52:25 2017 (r322720) +++ head/sys/sys/vnode.h Sun Aug 20 10:07:45 2017 (r322721) @@ -399,6 +399,7 @@ extern int vttoif_tab[]; #define V_NORMAL 0x0004 /* vinvalbuf: invalidate only regular bufs */ #define V_CLEANONLY 0x0008 /* vinvalbuf: invalidate only clean bufs */ #define V_VMIO 0x0010 /* vinvalbuf: called during pageout */ +#define V_ALLOWCLEAN 0x0020 /* vinvalbuf: allow clean buffers after flush */ #define REVOKEALL 0x0001 /* vop_revoke: revoke all aliases */ #define V_WAIT 0x0001 /* vn_start_write: sleep for suspend */ #define V_NOWAIT 0x0002 /* vn_start_write: don't sleep for suspend */ From owner-svn-src-head@freebsd.org Sun Aug 20 10:08:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FBDBDEB3CA; Sun, 20 Aug 2017 10:08:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C65A7FC40; Sun, 20 Aug 2017 10:08:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7KA8kWh040672; Sun, 20 Aug 2017 10:08:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7KA8jRv040666; Sun, 20 Aug 2017 10:08:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708201008.v7KA8jRv040666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 20 Aug 2017 10:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322722 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 322722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 10:08:47 -0000 Author: kib Date: Sun Aug 20 10:08:45 2017 New Revision: 322722 URL: https://svnweb.freebsd.org/changeset/base/322722 Log: Do not drop NFS vnode lock when performing consistency checks. Currently several paths in the NFS client upgrade the shared vnode lock to exclusive, which might cause temporal dropping of the lock. This action appears to be fatal for nullfs mounts over NFS. If the operation is performed over nullfs vnode, then bypassed down to NFS VOP, and the lock is dropped, other thread might reclaim the upper nullfs vnode. Since on reclaim the nullfs vnode lock and NFS vnode lock are split, the original lock state of the nullfs vnode is not restored. As result, VFS operations receive not locked vnode after a VOP call. Stop upgrading the vnode lock when we check the consistency or flush buffers as result of detected inconsistency. Instead, allocate a new lockmgr lock for each NFS node, which is locked exclusive instead of the vnode lock upgrade. In other words, the other parallel modification of the vnode are excluded by either vnode lock conflict or exclusivity of the new lock when the vnode lock is shared. Also revert r316529 because now the vnode cannot be reclaimed during ncl_vinvalbuf(). In collaboration with: pho Reviewed by: rmacklem Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D12083 Modified: head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clsubs.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsclient/nfsnode.h Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Sun Aug 20 10:07:45 2017 (r322721) +++ head/sys/fs/nfsclient/nfs_clbio.c Sun Aug 20 10:08:45 2017 (r322722) @@ -365,20 +365,13 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread int error = 0; struct vattr vattr; struct nfsnode *np = VTONFS(vp); - int old_lock; + bool old_lock; /* - * Grab the exclusive lock before checking whether the cache is - * consistent. - * XXX - We can make this cheaper later (by acquiring cheaper locks). - * But for now, this suffices. + * Ensure the exclusove access to the node before checking + * whether the cache is consistent. */ - old_lock = ncl_upgrade_vnlock(vp); - if (vp->v_iflag & VI_DOOMED) { - error = EBADF; - goto out; - } - + old_lock = ncl_excl_start(vp); mtx_lock(&np->n_mtx); if (np->n_flag & NMODIFIED) { mtx_unlock(&np->n_mtx); @@ -386,9 +379,7 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread if (vp->v_type != VDIR) panic("nfs: bioread, not dir"); ncl_invaldir(vp); - error = ncl_vinvalbuf(vp, V_SAVE, td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - error = EBADF; + error = ncl_vinvalbuf(vp, V_SAVE | V_ALLOWCLEAN, td, 1); if (error != 0) goto out; } @@ -404,16 +395,14 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread mtx_unlock(&np->n_mtx); error = VOP_GETATTR(vp, &vattr, cred); if (error) - return (error); + goto out; mtx_lock(&np->n_mtx); if ((np->n_flag & NSIZECHANGED) || (NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime))) { mtx_unlock(&np->n_mtx); if (vp->v_type == VDIR) ncl_invaldir(vp); - error = ncl_vinvalbuf(vp, V_SAVE, td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - error = EBADF; + error = ncl_vinvalbuf(vp, V_SAVE | V_ALLOWCLEAN, td, 1); if (error != 0) goto out; mtx_lock(&np->n_mtx); @@ -423,7 +412,7 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread mtx_unlock(&np->n_mtx); } out: - ncl_downgrade_vnlock(vp, old_lock); + ncl_excl_finish(vp, old_lock); return (error); } @@ -608,8 +597,6 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof while (error == NFSERR_BAD_COOKIE) { ncl_invaldir(vp); error = ncl_vinvalbuf(vp, 0, td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - return (EBADF); /* * Yuck! The directory has been modified on the @@ -933,8 +920,6 @@ ncl_write(struct vop_write_args *ap) KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = ncl_vinvalbuf(vp, V_SAVE | ((ioflag & IO_VMIO) != 0 ? V_VMIO : 0), td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - error = EBADF; if (error != 0) return (error); } else @@ -1016,9 +1001,6 @@ ncl_write(struct vop_write_args *ap) KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = ncl_vinvalbuf(vp, V_SAVE | ((ioflag & IO_VMIO) != 0 ? V_VMIO : 0), td, 1); - if (error == 0 && - (vp->v_iflag & VI_DOOMED) != 0) - error = EBADF; if (error != 0) return (error); wouldcommit = biosize; @@ -1336,7 +1318,7 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thre struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp = VFSTONFS(vp->v_mount); int error = 0, slpflag, slptimeo; - int old_lock = 0; + bool old_lock; ASSERT_VOP_LOCKED(vp, "ncl_vinvalbuf"); @@ -1352,16 +1334,9 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thre slptimeo = 0; } - old_lock = ncl_upgrade_vnlock(vp); - if (vp->v_iflag & VI_DOOMED) { - /* - * Since vgonel() uses the generic vinvalbuf() to flush - * dirty buffers and it does not call this function, it - * is safe to just return OK when VI_DOOMED is set. - */ - ncl_downgrade_vnlock(vp, old_lock); - return (0); - } + old_lock = ncl_excl_start(vp); + if (old_lock) + flags |= V_ALLOWCLEAN; /* * Now, flush as required. @@ -1400,7 +1375,7 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thre np->n_flag &= ~NMODIFIED; mtx_unlock(&np->n_mtx); out: - ncl_downgrade_vnlock(vp, old_lock); + ncl_excl_finish(vp, old_lock); return error; } Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Sun Aug 20 10:07:45 2017 (r322721) +++ head/sys/fs/nfsclient/nfs_clnode.c Sun Aug 20 10:08:45 2017 (r322722) @@ -141,6 +141,9 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize * happened to return an error no special casing is needed). */ mtx_init(&np->n_mtx, "NEWNFSnode lock", NULL, MTX_DEF | MTX_DUPOK); + lockinit(&np->n_excl, PVFS, "nfsupg", VLKTIMEOUT, LK_NOSHARE | + LK_CANRECURSE); + /* * NFS supports recursive and shared locking. */ @@ -167,6 +170,7 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize *npp = NULL; FREE((caddr_t)np->n_fhp, M_NFSFH); mtx_destroy(&np->n_mtx); + lockdestroy(&np->n_excl); uma_zfree(newnfsnode_zone, np); return (error); } @@ -332,6 +336,7 @@ ncl_reclaim(struct vop_reclaim_args *ap) if (np->n_v4 != NULL) FREE((caddr_t)np->n_v4, M_NFSV4NODE); mtx_destroy(&np->n_mtx); + lockdestroy(&np->n_excl); uma_zfree(newnfsnode_zone, vp->v_data); vp->v_data = NULL; return (0); Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sun Aug 20 10:07:45 2017 (r322721) +++ head/sys/fs/nfsclient/nfs_clport.c Sun Aug 20 10:08:45 2017 (r322722) @@ -230,6 +230,8 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, stru * happened to return an error no special casing is needed). */ mtx_init(&np->n_mtx, "NEWNFSnode lock", NULL, MTX_DEF | MTX_DUPOK); + lockinit(&np->n_excl, PVFS, "nfsupg", VLKTIMEOUT, LK_NOSHARE | + LK_CANRECURSE); /* * Are we getting the root? If so, make sure the vnode flags @@ -271,6 +273,7 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, stru if (error != 0) { *npp = NULL; mtx_destroy(&np->n_mtx); + lockdestroy(&np->n_excl); FREE((caddr_t)nfhp, M_NFSFH); if (np->n_v4 != NULL) FREE((caddr_t)np->n_v4, M_NFSV4NODE); Modified: head/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clsubs.c Sun Aug 20 10:07:45 2017 (r322721) +++ head/sys/fs/nfsclient/nfs_clsubs.c Sun Aug 20 10:08:45 2017 (r322722) @@ -135,30 +135,33 @@ ncl_dircookie_unlock(struct nfsnode *np) mtx_unlock(&np->n_mtx); } -int -ncl_upgrade_vnlock(struct vnode *vp) +bool +ncl_excl_start(struct vnode *vp) { - int old_lock; + struct nfsnode *np; + int vn_lk; - ASSERT_VOP_LOCKED(vp, "ncl_upgrade_vnlock"); - old_lock = NFSVOPISLOCKED(vp); - if (old_lock != LK_EXCLUSIVE) { - KASSERT(old_lock == LK_SHARED, - ("ncl_upgrade_vnlock: wrong old_lock %d", old_lock)); - /* Upgrade to exclusive lock, this might block */ - NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); - } - return (old_lock); + ASSERT_VOP_LOCKED(vp, "ncl_excl_start"); + vn_lk = NFSVOPISLOCKED(vp); + if (vn_lk == LK_EXCLUSIVE) + return (false); + KASSERT(vn_lk == LK_SHARED, + ("ncl_excl_start: wrong vnode lock %d", vn_lk)); + /* Ensure exclusive access, this might block */ + np = VTONFS(vp); + lockmgr(&np->n_excl, LK_EXCLUSIVE, NULL); + return (true); } void -ncl_downgrade_vnlock(struct vnode *vp, int old_lock) +ncl_excl_finish(struct vnode *vp, bool old_lock) { - if (old_lock != LK_EXCLUSIVE) { - KASSERT(old_lock == LK_SHARED, ("wrong old_lock %d", old_lock)); - /* Downgrade from exclusive lock. */ - NFSVOPLOCK(vp, LK_DOWNGRADE | LK_RETRY); - } + struct nfsnode *np; + + if (!old_lock) + return; + np = VTONFS(vp); + lockmgr(&np->n_excl, LK_RELEASE, NULL); } #ifdef NFS_ACDEBUG Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun Aug 20 10:07:45 2017 (r322721) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun Aug 20 10:08:45 2017 (r322722) @@ -520,8 +520,6 @@ nfs_open(struct vop_open_args *ap) if (np->n_flag & NMODIFIED) { mtx_unlock(&np->n_mtx); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - return (EBADF); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); @@ -558,8 +556,6 @@ nfs_open(struct vop_open_args *ap) np->n_direofoffset = 0; mtx_unlock(&np->n_mtx); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - return (EBADF); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); @@ -580,8 +576,6 @@ nfs_open(struct vop_open_args *ap) if (np->n_directio_opens == 0) { mtx_unlock(&np->n_mtx); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - return (EBADF); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); @@ -722,8 +716,6 @@ nfs_close(struct vop_close_args *ap) } } else { error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - return (EBADF); } mtx_lock(&np->n_mtx); } @@ -942,9 +934,7 @@ nfs_setattr(struct vop_setattr_args *ap) mtx_unlock(&np->n_mtx); error = ncl_vinvalbuf(vp, vap->va_size == 0 ? 0 : V_SAVE, td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - error = EBADF; - if (error != 0) { + if (error != 0) { vnode_pager_setsize(vp, tsize); return (error); } @@ -971,8 +961,6 @@ nfs_setattr(struct vop_setattr_args *ap) (np->n_flag & NMODIFIED) && vp->v_type == VREG) { mtx_unlock(&np->n_mtx); error = ncl_vinvalbuf(vp, V_SAVE, td, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - return (EBADF); if (error == EINTR || error == EIO) return (error); } else @@ -1676,9 +1664,7 @@ nfs_remove(struct vop_remove_args *ap) * unnecessary delayed writes later. */ error = ncl_vinvalbuf(vp, 0, cnp->cn_thread, 1); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) - error = EBADF; - else if (error != EINTR && error != EIO) + if (error != EINTR && error != EIO) /* Do the rpc */ error = nfs_removerpc(dvp, vp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread); @@ -3089,10 +3075,6 @@ nfs_advlock(struct vop_advlock_args *ap) if ((np->n_flag & NMODIFIED) || ret || np->n_change != va.va_filerev) { (void) ncl_vinvalbuf(vp, V_SAVE, td, 1); - if ((vp->v_iflag & VI_DOOMED) != 0) { - NFSVOPUNLOCK(vp, 0); - return (EBADF); - } np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); ret = VOP_GETATTR(vp, &va, cred); Modified: head/sys/fs/nfsclient/nfsnode.h ============================================================================== --- head/sys/fs/nfsclient/nfsnode.h Sun Aug 20 10:07:45 2017 (r322721) +++ head/sys/fs/nfsclient/nfsnode.h Sun Aug 20 10:08:45 2017 (r322722) @@ -92,6 +92,8 @@ struct nfs_accesscache { */ struct nfsnode { struct mtx n_mtx; /* Protects all of these members */ + struct lock n_excl; /* Exclusive helper for shared + vnode lock */ u_quad_t n_size; /* Current size of file */ u_quad_t n_brev; /* Modify rev when cached */ u_quad_t n_lrev; /* Modify rev for lease */ @@ -184,8 +186,8 @@ int ncl_removeit(struct sillyrename *, struct vnode *) int ncl_nget(struct mount *, u_int8_t *, int, struct nfsnode **, int); nfsuint64 *ncl_getcookie(struct nfsnode *, off_t, int); void ncl_invaldir(struct vnode *); -int ncl_upgrade_vnlock(struct vnode *); -void ncl_downgrade_vnlock(struct vnode *, int); +bool ncl_excl_start(struct vnode *); +void ncl_excl_finish(struct vnode *, bool old_lock); void ncl_dircookie_lock(struct nfsnode *); void ncl_dircookie_unlock(struct nfsnode *); From owner-svn-src-head@freebsd.org Sun Aug 20 10:42:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2F2ADC62FC for ; Sun, 20 Aug 2017 10:42:03 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-vk0-x22f.google.com (mail-vk0-x22f.google.com [IPv6:2607:f8b0:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E9C181575 for ; Sun, 20 Aug 2017 10:42:03 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-vk0-x22f.google.com with SMTP id r199so43181441vke.4 for ; Sun, 20 Aug 2017 03:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NE5iCSOAIbrnJdgvywOLVWbIvVIeRgdSs9uPpUjwjcc=; b=b45Vr2OsMe+r4GMyuIr/upKFhTdunx7Uf1sZaJw1PXo9Xj2N+EX9X/WTmD6wgT94hQ OfG+pVxUt3vzECFQjz7Kk4jVzibZsYz6wEbTMRb+QrcVn4MHVYcQvk9pfExkRqoGNsos eH8xpFnKwlyj73I18TiSNwlbf6u4mLoKsoA/whwpadAve/kGBWfKPAZLqnrdKy25axjK 2/sV6xkDQ6/W5Bvl6mC5nGBKGWN8h8fC0/FNbl8fZfy46GQe7DGpngdAFIgicIzyhNgZ dUQceYUDyhKg8HYtWcG063XJSro2g4Ob2g93exatQ8ikmpxBp7TMpp/4leFCPvMejP4Y gFdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NE5iCSOAIbrnJdgvywOLVWbIvVIeRgdSs9uPpUjwjcc=; b=LRRpGJRTyAEtE7+YKh+nEqiKIgDuXj/sfXIJXqJHLTuirOQyEccJ6KwU5GVjcwE+yR 9xMW4lKAnmp73q4cxtB3ZEMGjrbKodQWbDdpUfANCF4DjoGx1PMMk2sCO+VxqwyE93Gg vWUdpRN7wRljXxUvSkQk5UMxzdaDrf/L2QCU4kakwDk7MS/Vt3IM9eWTqYMDb0RUV8RD sD78X+8znO55bp9NtaGWAx+wWJUArvikqxLINM9H91W61Wnd3xYMst19jlsxh6ieTG7Q aMuE/VJKvJmQpG+uBUyKHvqX5sU70L61LxzgQRHkt6WzskBne6AJ7OF4clxupeCUiwZ7 WxGA== X-Gm-Message-State: AHYfb5hAMy88CLD1Rdw9DMLNBgKVZZA5VFpjdYWp/+8jjFWHlUSGubQ7 H7f02fTzg7EZqjImekz1KpqfvDU0RmQZ X-Received: by 10.31.16.196 with SMTP id 65mr4215295vkq.37.1503225722309; Sun, 20 Aug 2017 03:42:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.8.70 with HTTP; Sun, 20 Aug 2017 03:42:01 -0700 (PDT) In-Reply-To: <201708200952.v7K9qPP4036384@repo.freebsd.org> References: <201708200952.v7K9qPP4036384@repo.freebsd.org> From: Oliver Pinter Date: Sun, 20 Aug 2017 12:42:01 +0200 Message-ID: Subject: Re: svn commit: r322720 - head/sys/amd64/amd64 To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 10:42:04 -0000 On Sunday, August 20, 2017, Konstantin Belousov wrote: > Author: kib > Date: Sun Aug 20 09:52:25 2017 > New Revision: 322720 > URL: https://svnweb.freebsd.org/changeset/base/322720 > > Log: > Simplify amd64 trap(). > > - Use more relevant name 'signo' instead of 'i' for the local variable > which contains a signal number to send for the current exception. > - Eliminate two labels 'userout' and 'out' which point to the very end > of the trap() function. Instead use return directly. > - Re-indent the prot_fault_translation block by reducing if() nesting. > - Some more monor style changes. > > Requested and reviewed by: bde > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > Modified: > head/sys/amd64/amd64/trap.c > > Modified: head/sys/amd64/amd64/trap.c > ============================================================ > ================== > --- head/sys/amd64/amd64/trap.c Sun Aug 20 09:42:09 2017 (r322719) > +++ head/sys/amd64/amd64/trap.c Sun Aug 20 09:52:25 2017 (r322720) > @@ -172,12 +172,12 @@ trap(struct trapframe *frame) > #ifdef KDB > register_t dr6; > #endif > - int i, ucode; > + int signo, ucode; > u_int type; > > td = curthread; > p = td->td_proc; > - i = 0; > + signo = 0; > ucode = 0; > addr = 0; > > @@ -186,22 +186,20 @@ trap(struct trapframe *frame) > > #ifdef SMP > /* Handler for NMI IPIs used for stopping CPUs. */ > - if (type == T_NMI) { > - if (ipi_nmi_handler() == 0) > - goto out; > - } > -#endif /* SMP */ > + if (type == T_NMI && ipi_nmi_handler() == 0) > + return; > +#endif > > #ifdef KDB > if (kdb_active) { > kdb_reenter(); > - goto out; > + return; > } > #endif > > if (type == T_RESERVED) { > trap_fatal(frame, 0); > - goto out; > + return; > } > > if (type == T_NMI) { > @@ -214,18 +212,18 @@ trap(struct trapframe *frame) > */ > if (pmc_intr != NULL && > (*pmc_intr)(PCPU_GET(cpuid), frame) != 0) > - goto out; > + return; > #endif > > #ifdef STACK > if (stack_nmi_handler(frame) != 0) > - goto out; > + return; > #endif > } > > if (type == T_MCHK) { > mca_intr(); > - goto out; > + return; > } > > if ((frame->tf_rflags & PSL_I) == 0) { > @@ -269,7 +267,7 @@ trap(struct trapframe *frame) > > switch (type) { > case T_PRIVINFLT: /* privileged instruction fault */ > - i = SIGILL; > + signo = SIGILL; > ucode = ILL_PRVOPC; > break; > > @@ -281,41 +279,41 @@ trap(struct trapframe *frame) > fill_frame_regs(frame, ®s); > if (dtrace_pid_probe_ptr != NULL && > dtrace_pid_probe_ptr(®s) == 0) > - goto out; > + return; > } > #endif > frame->tf_rflags &= ~PSL_T; > - i = SIGTRAP; > + signo = SIGTRAP; > ucode = (type == T_TRCTRAP ? TRAP_TRACE : > TRAP_BRKPT); > break; > > case T_ARITHTRAP: /* arithmetic trap */ > ucode = fputrap_x87(); > if (ucode == -1) > - goto userout; > - i = SIGFPE; > + return; > + signo = SIGFPE; > break; > > case T_PROTFLT: /* general protection fault */ > - i = SIGBUS; > + signo = SIGBUS; > ucode = BUS_OBJERR; > break; > case T_STKFLT: /* stack fault */ > case T_SEGNPFLT: /* segment not present fault */ > - i = SIGBUS; > + signo = SIGBUS; > ucode = BUS_ADRERR; > break; > case T_TSSFLT: /* invalid TSS fault */ > - i = SIGBUS; > + signo = SIGBUS; > ucode = BUS_OBJERR; > break; > case T_ALIGNFLT: > - i = SIGBUS; > + signo = SIGBUS; > ucode = BUS_ADRALN; > break; > case T_DOUBLEFLT: /* double fault */ > default: > - i = SIGBUS; > + signo = SIGBUS; > ucode = BUS_OBJERR; > break; > > @@ -325,67 +323,64 @@ trap(struct trapframe *frame) > */ > if (*p->p_sysent->sv_trap != NULL && > (*p->p_sysent->sv_trap)(td) == 0) > - goto userout; > + return; > > addr = frame->tf_addr; > - i = trap_pfault(frame, TRUE); > - if (i == -1) > - goto userout; > - if (i == 0) > - goto user; > - > - if (i == SIGSEGV) > + signo = trap_pfault(frame, TRUE); > + if (signo == -1) > + return; > + if (signo == 0) > + goto userret; > + if (signo == SIGSEGV) { > ucode = SEGV_MAPERR; > - else { > - if (prot_fault_translation == 0) { > - /* > - * Autodetect. > - * This check also covers the > images > - * without the ABI-tag ELF note. > - */ > - if (SV_CURPROC_ABI() == > SV_ABI_FREEBSD > - && p->p_osrel >= > P_OSREL_SIGSEGV) { > - i = SIGSEGV; > - ucode = SEGV_ACCERR; > - } else { > - i = SIGBUS; > - ucode = BUS_PAGE_FAULT; > - } > - } else if (prot_fault_translation == 1) { > - /* > - * Always compat mode. > - */ > - i = SIGBUS; > - ucode = BUS_PAGE_FAULT; > - } else { > - /* > - * Always SIGSEGV mode. > - */ > - i = SIGSEGV; > + } else if (prot_fault_translation == 0) { > + /* > + * Autodetect. This check also covers > + * the images without the ABI-tag ELF > + * note. > + */ > + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD && > + p->p_osrel >= P_OSREL_SIGSEGV) { > + signo = SIGSEGV; > ucode = SEGV_ACCERR; > + } else { > + signo = SIGBUS; > + ucode = BUS_PAGE_FAULT; > } > + } else if (prot_fault_translation == 1) { > + /* > + * Always compat mode. > + */ > + signo = SIGBUS; > + ucode = BUS_PAGE_FAULT; > + } else { > + /* > + * Always SIGSEGV mode. > + */ > + signo = SIGSEGV; > + ucode = SEGV_ACCERR; > } > break; > > case T_DIVIDE: /* integer divide fault */ > ucode = FPE_INTDIV; > - i = SIGFPE; > + signo = SIGFPE; > break; > > #ifdef DEV_ISA > case T_NMI: > nmi_handle_intr(type, frame); > - goto out; > -#endif /* DEV_ISA */ > + return; > +#endif > > case T_OFLOW: /* integer overflow fault */ > ucode = FPE_INTOVF; > - i = SIGFPE; > + signo = SIGFPE; > break; > > case T_BOUND: /* bounds check fault */ > ucode = FPE_FLTSUB; > - i = SIGFPE; > + signo = SIGFPE; > break; > > case T_DNA: > @@ -393,18 +388,18 @@ trap(struct trapframe *frame) > KASSERT(PCB_USER_FPU(td->td_pcb), > ("kernel FPU ctx has leaked")); > fpudna(); > - goto userout; > + return; > > case T_FPOPFLT: /* FPU operand fetch fault */ > ucode = ILL_COPROC; > - i = SIGILL; > + signo = SIGILL; > break; > > case T_XMMFLT: /* SIMD floating-point exception */ > ucode = fputrap_sse(); > if (ucode == -1) > - goto userout; > - i = SIGFPE; > + return; > + signo = SIGFPE; > break; > #ifdef KDTRACE_HOOKS > case T_DTRACE_RET: > @@ -412,8 +407,8 @@ trap(struct trapframe *frame) > fill_frame_regs(frame, ®s); > if (dtrace_return_probe_ptr != NULL && > dtrace_return_probe_ptr(®s) == 0) > - goto out; > - goto userout; > + return; > + return; This part of code - the double return - looks weird. Probably it was left here to document the original "behavior". > #endif > } > } else { > @@ -424,13 +419,13 @@ trap(struct trapframe *frame) > switch (type) { > case T_PAGEFLT: /* page fault */ > (void) trap_pfault(frame, FALSE); > - goto out; > + return; > > case T_DNA: > if (PCB_USER_FPU(td->td_pcb)) > panic("Unregistered use of FPU in kernel"); > fpudna(); > - goto out; > + return; > > case T_ARITHTRAP: /* arithmetic trap */ > case T_XMMFLT: /* SIMD floating-point exception */ > @@ -440,7 +435,7 @@ trap(struct trapframe *frame) > * registration for FPU traps is overkill. > */ > trap_fatal(frame, 0); > - goto out; > + return; > > case T_STKFLT: /* stack fault */ > case T_PROTFLT: /* general protection fault */ > @@ -460,35 +455,35 @@ trap(struct trapframe *frame) > */ > if (frame->tf_rip == (long)doreti_iret) { > frame->tf_rip = (long)doreti_iret_fault; > - goto out; > + return; > } > if (frame->tf_rip == (long)ld_ds) { > frame->tf_rip = (long)ds_load_fault; > - goto out; > + return; > } > if (frame->tf_rip == (long)ld_es) { > frame->tf_rip = (long)es_load_fault; > - goto out; > + return; > } > if (frame->tf_rip == (long)ld_fs) { > frame->tf_rip = (long)fs_load_fault; > - goto out; > + return; > } > if (frame->tf_rip == (long)ld_gs) { > frame->tf_rip = (long)gs_load_fault; > - goto out; > + return; > } > if (frame->tf_rip == (long)ld_gsbase) { > frame->tf_rip = (long)gsbase_load_fault; > - goto out; > + return; > } > if (frame->tf_rip == (long)ld_fsbase) { > frame->tf_rip = (long)fsbase_load_fault; > - goto out; > + return; > } > if (curpcb->pcb_onfault != NULL) { > frame->tf_rip = (long)curpcb->pcb_onfault; > - goto out; > + return; > } > break; > > @@ -504,7 +499,7 @@ trap(struct trapframe *frame) > */ > if (frame->tf_rflags & PSL_NT) { > frame->tf_rflags &= ~PSL_NT; > - goto out; > + return; > } > break; > > @@ -525,7 +520,7 @@ trap(struct trapframe *frame) > * processor doesn't > */ > load_dr6(rdr6() & ~0xf); > - goto out; > + return; > } > /* > * FALLTHROUGH (TRCTRAP kernel mode, kernel > address) > @@ -540,27 +535,27 @@ trap(struct trapframe *frame) > dr6 = rdr6(); > load_dr6(dr6 & ~0x4000); > if (kdb_trap(type, dr6, frame)) > - goto out; > + return; > #endif > break; > > #ifdef DEV_ISA > case T_NMI: > nmi_handle_intr(type, frame); > - goto out; > -#endif /* DEV_ISA */ > + return; > +#endif > } > > trap_fatal(frame, 0); > - goto out; > + return; > } > > /* Translate fault for emulators (e.g. Linux) */ > - if (*p->p_sysent->sv_transtrap) > - i = (*p->p_sysent->sv_transtrap)(i, type); > + if (*p->p_sysent->sv_transtrap != NULL) > + signo = (*p->p_sysent->sv_transtrap)(signo, type); > > ksiginfo_init_trap(&ksi); > - ksi.ksi_signo = i; > + ksi.ksi_signo = signo; > ksi.ksi_code = ucode; > ksi.ksi_trapno = type; > ksi.ksi_addr = (void *)addr; > @@ -568,8 +563,8 @@ trap(struct trapframe *frame) > uprintf("pid %d comm %s: signal %d err %lx code %d type %d > " > "addr 0x%lx rsp 0x%lx rip 0x%lx " > "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", > - p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, > addr, > - frame->tf_rsp, frame->tf_rip, > + p->p_pid, p->p_comm, signo, frame->tf_err, ucode, type, > + addr, frame->tf_rsp, frame->tf_rip, > fubyte((void *)(frame->tf_rip + 0)), > fubyte((void *)(frame->tf_rip + 1)), > fubyte((void *)(frame->tf_rip + 2)), > @@ -581,14 +576,10 @@ trap(struct trapframe *frame) > } > KASSERT((read_rflags() & PSL_I) != 0, ("interrupts disabled")); > trapsignal(td, &ksi); > - > -user: > +userret: > userret(td, frame); > KASSERT(PCB_USER_FPU(td->td_pcb), > ("Return from trap with kernel FPU ctx leaked")); > -userout: > -out: > - return; > } > > /* > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org > " > From owner-svn-src-head@freebsd.org Sun Aug 20 11:18:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1445FDC8394; Sun, 20 Aug 2017 11:18:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D21D4826AB; Sun, 20 Aug 2017 11:18:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7KBIGYZ069413; Sun, 20 Aug 2017 11:18:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7KBIGxH069412; Sun, 20 Aug 2017 11:18:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708201118.v7KBIGxH069412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 20 Aug 2017 11:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322723 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 322723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 11:18:18 -0000 Author: kib Date: Sun Aug 20 11:18:16 2017 New Revision: 322723 URL: https://svnweb.freebsd.org/changeset/base/322723 Log: Simplify the code. Noted by: Oliver Pinter Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Aug 20 10:08:45 2017 (r322722) +++ head/sys/amd64/amd64/trap.c Sun Aug 20 11:18:16 2017 (r322723) @@ -405,9 +405,8 @@ trap(struct trapframe *frame) case T_DTRACE_RET: enable_intr(); fill_frame_regs(frame, ®s); - if (dtrace_return_probe_ptr != NULL && - dtrace_return_probe_ptr(®s) == 0) - return; + if (dtrace_return_probe_ptr != NULL) + dtrace_return_probe_ptr(®s); return; #endif } From owner-svn-src-head@freebsd.org Sun Aug 20 11:19:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D094FDC8469; Sun, 20 Aug 2017 11:19:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C342827F0; Sun, 20 Aug 2017 11:19:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v7KBIsp6058495 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 20 Aug 2017 14:18:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v7KBIsp6058495 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v7KBIsS8058494; Sun, 20 Aug 2017 14:18:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 20 Aug 2017 14:18:54 +0300 From: Konstantin Belousov To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r322720 - head/sys/amd64/amd64 Message-ID: <20170820111854.GA1700@kib.kiev.ua> References: <201708200952.v7K9qPP4036384@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 11:19:03 -0000 On Sun, Aug 20, 2017 at 12:42:01PM +0200, Oliver Pinter wrote: > > @@ -412,8 +407,8 @@ trap(struct trapframe *frame) > > fill_frame_regs(frame, ®s); > > if (dtrace_return_probe_ptr != NULL && > > dtrace_return_probe_ptr(®s) == 0) > > - goto out; > > - goto userout; > > + return; > > + return; > > > This part of code - the double return - looks weird. Probably it was left > here to document the original "behavior". Indeed it is weird. I think that the original code was written at the time when userout and out were different return paths. Another possibility was that it actually wanted to do goto userret instead of goto userout, i.e. to call userret() before returning to usermode. Anyway, I cleaned this up without changing the algorithm. From owner-svn-src-head@freebsd.org Sun Aug 20 20:38:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC4C8DEC29F; Sun, 20 Aug 2017 20:38:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98E227233A; Sun, 20 Aug 2017 20:38:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7KKcF5G003817; Sun, 20 Aug 2017 20:38:15 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7KKcF9d003816; Sun, 20 Aug 2017 20:38:15 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708202038.v7KKcF9d003816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 20 Aug 2017 20:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322726 - head/etc/periodic/daily X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/etc/periodic/daily X-SVN-Commit-Revision: 322726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Aug 2017 20:38:16 -0000 Author: marius Date: Sun Aug 20 20:38:15 2017 New Revision: 322726 URL: https://svnweb.freebsd.org/changeset/base/322726 Log: Bring back the much more readable unified format for differences in /etc/{group,master.passwd}. This was originally turned on for all of /etc/{aliases,group,master.passwd} in r55196, but then backed out only for the latter two in r56697, as the adaption of the sed(1)ing done in r56308 was incorrect. This left us with inconsistent diff(1) formats in the daily output of periodic(8) ever since, despite in r56697 having been promised to be revisited. So properly adapt the password hash filtering to the unified format and turn the later on again for /etc/{group,master.passwd}, too. Modified: head/etc/periodic/daily/200.backup-passwd Modified: head/etc/periodic/daily/200.backup-passwd ============================================================================== --- head/etc/periodic/daily/200.backup-passwd Sun Aug 20 19:21:06 2017 (r322725) +++ head/etc/periodic/daily/200.backup-passwd Sun Aug 20 20:38:15 2017 (r322726) @@ -41,8 +41,8 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host passwd diffs:" - diff -I '^#' $bak/master.passwd.bak /etc/master.passwd |\ - sed 's/^\([<>] [^:]*\):[^:]*:/\1:(password):/' + diff -uI '^#' $bak/master.passwd.bak /etc/master.passwd |\ + sed 's/^\([-+][^-+:]*\):[^:]*:/\1:(password):/' mv $bak/master.passwd.bak $bak/master.passwd.bak2 cp -p /etc/master.passwd $bak/master.passwd.bak || rc=3 fi @@ -58,7 +58,7 @@ case "$daily_backup_passwd_enable" in then [ $rc -lt 1 ] && rc=1 echo "$host group diffs:" - diff $bak/group.bak /etc/group + diff -u $bak/group.bak /etc/group mv $bak/group.bak $bak/group.bak2 cp -p /etc/group $bak/group.bak || rc=3 fi From owner-svn-src-head@freebsd.org Mon Aug 21 07:03:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3A7DDEC39C; Mon, 21 Aug 2017 07:03:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4279E36B5; Mon, 21 Aug 2017 07:03:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7L736pW059746; Mon, 21 Aug 2017 07:03:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7L732rA059718; Mon, 21 Aug 2017 07:03:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201708210703.v7L732rA059718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 21 Aug 2017 07:03:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322740 - in head: contrib/libc++/include contrib/llvm/include/llvm/CodeGen contrib/llvm/include/llvm/ExecutionEngine/Orc contrib/llvm/include/llvm/Object contrib/llvm/lib/Analysis cont... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/libc++/include contrib/llvm/include/llvm/CodeGen contrib/llvm/include/llvm/ExecutionEngine/Orc contrib/llvm/include/llvm/Object contrib/llvm/lib/Analysis contrib/llvm/lib/CodeGen cont... X-SVN-Commit-Revision: 322740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 07:03:07 -0000 Author: dim Date: Mon Aug 21 07:03:02 2017 New Revision: 322740 URL: https://svnweb.freebsd.org/changeset/base/322740 Log: Upgrade our copies of clang, llvm, lld and libc++ to r311219 from the upstream release_50 branch. MFC after: 2 months X-MFC-with: r321369 Modified: head/contrib/libc++/include/string head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h head/contrib/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h head/contrib/llvm/include/llvm/Object/COFFImportFile.h head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/Analysis/ValueTracking.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp head/contrib/llvm/lib/Object/COFFImportFile.cpp head/contrib/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td head/contrib/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp head/contrib/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp head/contrib/llvm/lib/Transforms/Scalar/BDCE.cpp head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h head/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/CrossWindows.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/CrossWindows.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Darwin.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Gnu.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Gnu.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/MSVC.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/MSVC.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/MinGW.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/MinGW.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/NetBSD.h head/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm/tools/lld/COFF/Driver.cpp head/contrib/llvm/tools/lld/ELF/Driver.cpp head/contrib/llvm/tools/lld/ELF/Options.td head/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/lld/Config/Version.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/contrib/libc++/include/string ============================================================================== --- head/contrib/libc++/include/string Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/libc++/include/string Mon Aug 21 07:03:02 2017 (r322740) @@ -556,6 +556,8 @@ template operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y); +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS string operator+, allocator >(char const*, string const&)) + template class _LIBCPP_TEMPLATE_VIS __basic_string_common { @@ -3999,7 +4001,6 @@ basic_string<_CharT, _Traits, _Allocator>::__subscript _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string) _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS string operator+, allocator >(char const*, string const&)) #if _LIBCPP_STD_VER > 11 // Literal suffixes for basic_string [basic.string.literals] Modified: head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h Mon Aug 21 07:03:02 2017 (r322740) @@ -1220,8 +1220,9 @@ class SelectionDAG { (public) /// If an existing load has uses of its chain, create a token factor node with /// that chain and the new memory node's chain and update users of the old /// chain to the token factor. This ensures that the new memory node will have - /// the same relative memory dependency position as the old load. - void makeEquivalentMemoryOrdering(LoadSDNode *Old, SDValue New); + /// the same relative memory dependency position as the old load. Returns the + /// new merged load chain. + SDValue makeEquivalentMemoryOrdering(LoadSDNode *Old, SDValue New); /// Topological-sort the AllNodes list and a /// assign a unique node id for each node in the DAG based on their Modified: head/contrib/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h ============================================================================== --- head/contrib/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h Mon Aug 21 07:03:02 2017 (r322740) @@ -94,9 +94,9 @@ template class LazyEmittingLayer llvm_unreachable("Invalid emit-state."); } - void removeModuleFromBaseLayer(BaseLayerT &BaseLayer) { - if (EmitState != NotEmitted) - BaseLayer.removeModule(Handle); + Error removeModuleFromBaseLayer(BaseLayerT& BaseLayer) { + return EmitState != NotEmitted ? BaseLayer.removeModule(Handle) + : Error::success(); } void emitAndFinalize(BaseLayerT &BaseLayer) { @@ -226,9 +226,9 @@ template class LazyEmittingLayer /// This method will free the memory associated with the given module, both /// in this layer, and the base layer. Error removeModule(ModuleHandleT H) { - (*H)->removeModuleFromBaseLayer(BaseLayer); + Error Err = (*H)->removeModuleFromBaseLayer(BaseLayer); ModuleList.erase(H); - return Error::success(); + return Err; } /// @brief Search for the given named symbol. Modified: head/contrib/llvm/include/llvm/Object/COFFImportFile.h ============================================================================== --- head/contrib/llvm/include/llvm/Object/COFFImportFile.h Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/include/llvm/Object/COFFImportFile.h Mon Aug 21 07:03:02 2017 (r322740) @@ -73,6 +73,7 @@ class COFFImportFile : public SymbolicFile { (private) struct COFFShortExport { std::string Name; std::string ExtName; + std::string SymbolName; uint16_t Ordinal = 0; bool Noname = false; @@ -98,7 +99,8 @@ struct COFFShortExport { std::error_code writeImportLibrary(StringRef ImportName, StringRef Path, ArrayRef Exports, - COFF::MachineTypes Machine); + COFF::MachineTypes Machine, + bool MakeWeakAliases); } // namespace object } // namespace llvm Modified: head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -162,6 +162,11 @@ static cl::opt cl::desc("Maximum depth of recursive SExt/ZExt"), cl::init(8)); +static cl::opt + MaxAddRecSize("scalar-evolution-max-add-rec-size", cl::Hidden, + cl::desc("Max coefficients in AddRec during evolving"), + cl::init(16)); + //===----------------------------------------------------------------------===// // SCEV class definitions //===----------------------------------------------------------------------===// @@ -2878,6 +2883,12 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImp if (!OtherAddRec || OtherAddRec->getLoop() != AddRecLoop) continue; + // Limit max number of arguments to avoid creation of unreasonably big + // SCEVAddRecs with very complex operands. + if (AddRec->getNumOperands() + OtherAddRec->getNumOperands() - 1 > + MaxAddRecSize) + continue; + bool Overflow = false; Type *Ty = AddRec->getType(); bool LargerThan64Bits = getTypeSizeInBits(Ty) > 64; @@ -7582,6 +7593,25 @@ const SCEV *ScalarEvolution::computeSCEVAtScope(const const SCEV *BackedgeTakenCount = getBackedgeTakenCount(LI); if (const SCEVConstant *BTCC = dyn_cast(BackedgeTakenCount)) { + + // This trivial case can show up in some degenerate cases where + // the incoming IR has not yet been fully simplified. + if (BTCC->getValue()->isZero()) { + Value *InitValue = nullptr; + bool MultipleInitValues = false; + for (unsigned i = 0; i < PN->getNumIncomingValues(); i++) { + if (!LI->contains(PN->getIncomingBlock(i))) { + if (!InitValue) + InitValue = PN->getIncomingValue(i); + else if (InitValue != PN->getIncomingValue(i)) { + MultipleInitValues = true; + break; + } + } + if (!MultipleInitValues && InitValue) + return getSCEV(InitValue); + } + } // Okay, we know how many times the containing loop executes. If // this is a constant evolving PHI node, get the final value at // the specified iteration number. Modified: head/contrib/llvm/lib/Analysis/ValueTracking.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/ValueTracking.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Analysis/ValueTracking.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -4458,6 +4458,10 @@ Optional llvm::isImpliedCondition(const Value *L unsigned Depth, AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT) { + // Bail out when we hit the limit. + if (Depth == MaxDepth) + return None; + // A mismatch occurs when we compare a scalar cmp to a vector cmp, for example. if (LHS->getType() != RHS->getType()) return None; Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -302,7 +302,21 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_SCALAR_TO_VE } SDValue DAGTypeLegalizer::ScalarizeVecRes_VSELECT(SDNode *N) { - SDValue Cond = GetScalarizedVector(N->getOperand(0)); + SDValue Cond = N->getOperand(0); + EVT OpVT = Cond.getValueType(); + SDLoc DL(N); + // The vselect result and true/value operands needs scalarizing, but it's + // not a given that the Cond does. For instance, in AVX512 v1i1 is legal. + // See the similar logic in ScalarizeVecRes_VSETCC + if (getTypeAction(OpVT) == TargetLowering::TypeScalarizeVector) { + Cond = GetScalarizedVector(Cond); + } else { + EVT VT = OpVT.getVectorElementType(); + Cond = DAG.getNode( + ISD::EXTRACT_VECTOR_ELT, DL, VT, Cond, + DAG.getConstant(0, DL, TLI.getVectorIdxTy(DAG.getDataLayout()))); + } + SDValue LHS = GetScalarizedVector(N->getOperand(1)); TargetLowering::BooleanContent ScalarBool = TLI.getBooleanContents(false, false); Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -7262,22 +7262,23 @@ void SelectionDAG::TransferDbgValues(SDValue From, SDV AddDbgValue(I, ToNode, false); } -void SelectionDAG::makeEquivalentMemoryOrdering(LoadSDNode *OldLoad, - SDValue NewMemOp) { +SDValue SelectionDAG::makeEquivalentMemoryOrdering(LoadSDNode *OldLoad, + SDValue NewMemOp) { assert(isa(NewMemOp.getNode()) && "Expected a memop node"); - if (!OldLoad->hasAnyUseOfValue(1)) - return; - // The new memory operation must have the same position as the old load in // terms of memory dependency. Create a TokenFactor for the old load and new // memory operation and update uses of the old load's output chain to use that // TokenFactor. SDValue OldChain = SDValue(OldLoad, 1); SDValue NewChain = SDValue(NewMemOp.getNode(), 1); + if (!OldLoad->hasAnyUseOfValue(1)) + return NewChain; + SDValue TokenFactor = getNode(ISD::TokenFactor, SDLoc(OldLoad), MVT::Other, OldChain, NewChain); ReplaceAllUsesOfValueWith(OldChain, TokenFactor); UpdateNodeOperands(TokenFactor.getNode(), OldChain, NewChain); + return TokenFactor; } //===----------------------------------------------------------------------===// Modified: head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -180,6 +180,7 @@ class VirtRegRewriter : public MachineFunctionPass { void addLiveInsForSubRanges(const LiveInterval &LI, unsigned PhysReg) const; void handleIdentityCopy(MachineInstr &MI) const; void expandCopyBundle(MachineInstr &MI) const; + bool subRegLiveThrough(const MachineInstr &MI, unsigned SuperPhysReg) const; public: static char ID; @@ -415,6 +416,32 @@ void VirtRegRewriter::expandCopyBundle(MachineInstr &M } } +/// Check whether (part of) \p SuperPhysReg is live through \p MI. +/// \pre \p MI defines a subregister of a virtual register that +/// has been assigned to \p SuperPhysReg. +bool VirtRegRewriter::subRegLiveThrough(const MachineInstr &MI, + unsigned SuperPhysReg) const { + SlotIndex MIIndex = LIS->getInstructionIndex(MI); + SlotIndex BeforeMIUses = MIIndex.getBaseIndex(); + SlotIndex AfterMIDefs = MIIndex.getBoundaryIndex(); + for (MCRegUnitIterator Unit(SuperPhysReg, TRI); Unit.isValid(); ++Unit) { + const LiveRange &UnitRange = LIS->getRegUnit(*Unit); + // If the regunit is live both before and after MI, + // we assume it is live through. + // Generally speaking, this is not true, because something like + // "RU = op RU" would match that description. + // However, we know that we are trying to assess whether + // a def of a virtual reg, vreg, is live at the same time of RU. + // If we are in the "RU = op RU" situation, that means that vreg + // is defined at the same time as RU (i.e., "vreg, RU = op RU"). + // Thus, vreg and RU interferes and vreg cannot be assigned to + // SuperPhysReg. Therefore, this situation cannot happen. + if (UnitRange.liveAt(AfterMIDefs) && UnitRange.liveAt(BeforeMIUses)) + return true; + } + return false; +} + void VirtRegRewriter::rewrite() { bool NoSubRegLiveness = !MRI->subRegLivenessEnabled(); SmallVector SuperDeads; @@ -452,7 +479,8 @@ void VirtRegRewriter::rewrite() { // A virtual register kill refers to the whole register, so we may // have to add operands for the super-register. A // partial redef always kills and redefines the super-register. - if (MO.readsReg() && (MO.isDef() || MO.isKill())) + if ((MO.readsReg() && (MO.isDef() || MO.isKill())) || + (MO.isDef() && subRegLiveThrough(*MI, PhysReg))) SuperKills.push_back(PhysReg); if (MO.isDef()) { Modified: head/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp ============================================================================== --- head/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -134,13 +134,13 @@ dumpDWARFv5StringOffsetsSection(raw_ostream &OS, Strin uint64_t StringOffset = StrOffsetExt.getRelocatedValue(EntrySize, &Offset); if (Format == DWARF32) { - OS << format("%8.8x ", StringOffset); uint32_t StringOffset32 = (uint32_t)StringOffset; + OS << format("%8.8x ", StringOffset32); const char *S = StrData.getCStr(&StringOffset32); if (S) OS << format("\"%s\"", S); } else - OS << format("%16.16x ", StringOffset); + OS << format("%16.16" PRIx64 " ", StringOffset); OS << "\n"; } } Modified: head/contrib/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp ============================================================================== --- head/contrib/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -196,7 +196,7 @@ unsigned DWARFVerifier::verifyDebugInfoAttribute(const ++NumErrors; OS << "error: DW_AT_stmt_list offset is beyond .debug_line " "bounds: " - << format("0x%08" PRIx32, *SectionOffset) << "\n"; + << format("0x%08" PRIx64, *SectionOffset) << "\n"; Die.dump(OS, 0); OS << "\n"; } @@ -234,7 +234,7 @@ unsigned DWARFVerifier::verifyDebugInfoForm(const DWAR if (CUOffset >= CUSize) { ++NumErrors; OS << "error: " << FormEncodingString(Form) << " CU offset " - << format("0x%08" PRIx32, CUOffset) + << format("0x%08" PRIx64, CUOffset) << " is invalid (must be less than CU size of " << format("0x%08" PRIx32, CUSize) << "):\n"; Die.dump(OS, 0); @@ -366,7 +366,7 @@ void DWARFVerifier::verifyDebugLineRows() { if (Row.Address < PrevAddress) { ++NumDebugLineErrors; OS << "error: .debug_line[" - << format("0x%08" PRIx32, + << format("0x%08" PRIx64, *toSectionOffset(Die.find(DW_AT_stmt_list))) << "] row[" << RowIndex << "] decreases in address from previous row:\n"; @@ -381,7 +381,7 @@ void DWARFVerifier::verifyDebugLineRows() { if (Row.File > MaxFileIndex) { ++NumDebugLineErrors; OS << "error: .debug_line[" - << format("0x%08" PRIx32, + << format("0x%08" PRIx64, *toSectionOffset(Die.find(DW_AT_stmt_list))) << "][" << RowIndex << "] has invalid file index " << Row.File << " (valid values are [1," << MaxFileIndex << "]):\n"; Modified: head/contrib/llvm/lib/Object/COFFImportFile.cpp ============================================================================== --- head/contrib/llvm/lib/Object/COFFImportFile.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Object/COFFImportFile.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -557,7 +557,7 @@ NewArchiveMember ObjectFactory::createWeakExternal(Str std::error_code writeImportLibrary(StringRef ImportName, StringRef Path, ArrayRef Exports, - MachineTypes Machine) { + MachineTypes Machine, bool MakeWeakAliases) { std::vector Members; ObjectFactory OF(llvm::sys::path::filename(ImportName), Machine); @@ -575,7 +575,7 @@ std::error_code writeImportLibrary(StringRef ImportNam if (E.Private) continue; - if (E.isWeak()) { + if (E.isWeak() && MakeWeakAliases) { Members.push_back(OF.createWeakExternal(E.Name, E.ExtName, false)); Members.push_back(OF.createWeakExternal(E.Name, E.ExtName, true)); continue; @@ -587,7 +587,7 @@ std::error_code writeImportLibrary(StringRef ImportNam if (E.Constant) ImportType = IMPORT_CONST; - StringRef SymbolName = E.isWeak() ? E.ExtName : E.Name; + StringRef SymbolName = E.SymbolName.empty() ? E.Name : E.SymbolName; ImportNameType NameType = getNameType(SymbolName, E.Name, Machine); Expected Name = E.ExtName.empty() ? SymbolName Modified: head/contrib/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -388,6 +388,10 @@ static unsigned isMatchingStore(MachineInstr &LoadInst } static unsigned getPreIndexedOpcode(unsigned Opc) { + // FIXME: We don't currently support creating pre-indexed loads/stores when + // the load or store is the unscaled version. If we decide to perform such an + // optimization in the future the cases for the unscaled loads/stores will + // need to be added here. switch (Opc) { default: llvm_unreachable("Opcode has no pre-indexed equivalent!"); @@ -451,32 +455,42 @@ static unsigned getPostIndexedOpcode(unsigned Opc) { default: llvm_unreachable("Opcode has no post-indexed wise equivalent!"); case AArch64::STRSui: + case AArch64::STURSi: return AArch64::STRSpost; case AArch64::STRDui: + case AArch64::STURDi: return AArch64::STRDpost; case AArch64::STRQui: + case AArch64::STURQi: return AArch64::STRQpost; case AArch64::STRBBui: return AArch64::STRBBpost; case AArch64::STRHHui: return AArch64::STRHHpost; case AArch64::STRWui: + case AArch64::STURWi: return AArch64::STRWpost; case AArch64::STRXui: + case AArch64::STURXi: return AArch64::STRXpost; case AArch64::LDRSui: + case AArch64::LDURSi: return AArch64::LDRSpost; case AArch64::LDRDui: + case AArch64::LDURDi: return AArch64::LDRDpost; case AArch64::LDRQui: + case AArch64::LDURQi: return AArch64::LDRQpost; case AArch64::LDRBBui: return AArch64::LDRBBpost; case AArch64::LDRHHui: return AArch64::LDRHHpost; case AArch64::LDRWui: + case AArch64::LDURWi: return AArch64::LDRWpost; case AArch64::LDRXui: + case AArch64::LDURXi: return AArch64::LDRXpost; case AArch64::LDRSWui: return AArch64::LDRSWpost; @@ -1694,8 +1708,9 @@ bool AArch64LoadStoreOpt::optimizeBlock(MachineBasicBl ++NumPostFolded; break; } - // Don't know how to handle pre/post-index versions, so move to the next - // instruction. + + // Don't know how to handle unscaled pre/post-index versions below, so + // move to the next instruction. if (TII->isUnscaledLdSt(Opc)) { ++MBBI; break; Modified: head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -769,8 +769,7 @@ bool ARMExpandPseudo::ExpandCMP_SWAP(MachineBasicBlock MachineInstr &MI = *MBBI; DebugLoc DL = MI.getDebugLoc(); const MachineOperand &Dest = MI.getOperand(0); - unsigned StatusReg = MI.getOperand(1).getReg(); - bool StatusDead = MI.getOperand(1).isDead(); + unsigned TempReg = MI.getOperand(1).getReg(); // Duplicating undef operands into 2 instructions does not guarantee the same // value on both; However undef should be replaced by xzr anyway. assert(!MI.getOperand(2).isUndef() && "cannot handle undef"); @@ -797,23 +796,9 @@ bool ARMExpandPseudo::ExpandCMP_SWAP(MachineBasicBlock } // .Lloadcmp: - // mov wStatus, #0 // ldrex rDest, [rAddr] // cmp rDest, rDesired // bne .Ldone - if (!StatusDead) { - if (IsThumb) { - BuildMI(LoadCmpBB, DL, TII->get(ARM::tMOVi8), StatusReg) - .addDef(ARM::CPSR, RegState::Dead) - .addImm(0) - .add(predOps(ARMCC::AL)); - } else { - BuildMI(LoadCmpBB, DL, TII->get(ARM::MOVi), StatusReg) - .addImm(0) - .add(predOps(ARMCC::AL)) - .add(condCodeOp()); - } - } MachineInstrBuilder MIB; MIB = BuildMI(LoadCmpBB, DL, TII->get(LdrexOp), Dest.getReg()); @@ -836,10 +821,10 @@ bool ARMExpandPseudo::ExpandCMP_SWAP(MachineBasicBlock LoadCmpBB->addSuccessor(StoreBB); // .Lstore: - // strex rStatus, rNew, [rAddr] - // cmp rStatus, #0 + // strex rTempReg, rNew, [rAddr] + // cmp rTempReg, #0 // bne .Lloadcmp - MIB = BuildMI(StoreBB, DL, TII->get(StrexOp), StatusReg) + MIB = BuildMI(StoreBB, DL, TII->get(StrexOp), TempReg) .addReg(NewReg) .addReg(AddrReg); if (StrexOp == ARM::t2STREX) @@ -848,7 +833,7 @@ bool ARMExpandPseudo::ExpandCMP_SWAP(MachineBasicBlock unsigned CMPri = IsThumb ? ARM::t2CMPri : ARM::CMPri; BuildMI(StoreBB, DL, TII->get(CMPri)) - .addReg(StatusReg, getKillRegState(StatusDead)) + .addReg(TempReg, RegState::Kill) .addImm(0) .add(predOps(ARMCC::AL)); BuildMI(StoreBB, DL, TII->get(Bcc)) @@ -904,8 +889,7 @@ bool ARMExpandPseudo::ExpandCMP_SWAP_64(MachineBasicBl MachineInstr &MI = *MBBI; DebugLoc DL = MI.getDebugLoc(); MachineOperand &Dest = MI.getOperand(0); - unsigned StatusReg = MI.getOperand(1).getReg(); - bool StatusDead = MI.getOperand(1).isDead(); + unsigned TempReg = MI.getOperand(1).getReg(); // Duplicating undef operands into 2 instructions does not guarantee the same // value on both; However undef should be replaced by xzr anyway. assert(!MI.getOperand(2).isUndef() && "cannot handle undef"); @@ -931,7 +915,7 @@ bool ARMExpandPseudo::ExpandCMP_SWAP_64(MachineBasicBl // .Lloadcmp: // ldrexd rDestLo, rDestHi, [rAddr] // cmp rDestLo, rDesiredLo - // sbcs rStatus, rDestHi, rDesiredHi + // sbcs rTempReg, rDestHi, rDesiredHi // bne .Ldone unsigned LDREXD = IsThumb ? ARM::t2LDREXD : ARM::LDREXD; MachineInstrBuilder MIB; @@ -959,17 +943,17 @@ bool ARMExpandPseudo::ExpandCMP_SWAP_64(MachineBasicBl LoadCmpBB->addSuccessor(StoreBB); // .Lstore: - // strexd rStatus, rNewLo, rNewHi, [rAddr] - // cmp rStatus, #0 + // strexd rTempReg, rNewLo, rNewHi, [rAddr] + // cmp rTempReg, #0 // bne .Lloadcmp unsigned STREXD = IsThumb ? ARM::t2STREXD : ARM::STREXD; - MIB = BuildMI(StoreBB, DL, TII->get(STREXD), StatusReg); + MIB = BuildMI(StoreBB, DL, TII->get(STREXD), TempReg); addExclusiveRegPair(MIB, New, 0, IsThumb, TRI); MIB.addReg(AddrReg).add(predOps(ARMCC::AL)); unsigned CMPri = IsThumb ? ARM::t2CMPri : ARM::CMPri; BuildMI(StoreBB, DL, TII->get(CMPri)) - .addReg(StatusReg, getKillRegState(StatusDead)) + .addReg(TempReg, RegState::Kill) .addImm(0) .add(predOps(ARMCC::AL)); BuildMI(StoreBB, DL, TII->get(Bcc)) Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Mon Aug 21 07:03:02 2017 (r322740) @@ -6053,21 +6053,21 @@ def SPACE : PseudoInst<(outs GPR:$Rd), (ins i32imm:$si // significantly more naive than the standard expansion: we conservatively // assume seq_cst, strong cmpxchg and omit clrex on failure. -let Constraints = "@earlyclobber $Rd,@earlyclobber $status", +let Constraints = "@earlyclobber $Rd,@earlyclobber $temp", mayLoad = 1, mayStore = 1 in { -def CMP_SWAP_8 : PseudoInst<(outs GPR:$Rd, GPR:$status), +def CMP_SWAP_8 : PseudoInst<(outs GPR:$Rd, GPR:$temp), (ins GPR:$addr, GPR:$desired, GPR:$new), NoItinerary, []>, Sched<[]>; -def CMP_SWAP_16 : PseudoInst<(outs GPR:$Rd, GPR:$status), +def CMP_SWAP_16 : PseudoInst<(outs GPR:$Rd, GPR:$temp), (ins GPR:$addr, GPR:$desired, GPR:$new), NoItinerary, []>, Sched<[]>; -def CMP_SWAP_32 : PseudoInst<(outs GPR:$Rd, GPR:$status), +def CMP_SWAP_32 : PseudoInst<(outs GPR:$Rd, GPR:$temp), (ins GPR:$addr, GPR:$desired, GPR:$new), NoItinerary, []>, Sched<[]>; -def CMP_SWAP_64 : PseudoInst<(outs GPRPair:$Rd, GPR:$status), +def CMP_SWAP_64 : PseudoInst<(outs GPRPair:$Rd, GPR:$temp), (ins GPR:$addr, GPRPair:$desired, GPRPair:$new), NoItinerary, []>, Sched<[]>; } Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -419,6 +419,11 @@ X86TargetLowering::X86TargetLowering(const X86TargetMa setOperationAction(ISD::SELECT, VT, Custom); setOperationAction(ISD::SETCC, VT, Custom); } + + // Custom action for SELECT MMX and expand action for SELECT_CC MMX + setOperationAction(ISD::SELECT, MVT::x86mmx, Custom); + setOperationAction(ISD::SELECT_CC, MVT::x86mmx, Expand); + setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); // NOTE: EH_SJLJ_SETJMP/_LONGJMP supported here is NOT intended to support // SjLj exception handling but a light-weight setjmp/longjmp replacement to @@ -1383,7 +1388,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMa // (result) is 256-bit but the source is 512-bit wide. // 128-bit was made Custom under AVX1. for (auto VT : { MVT::v32i8, MVT::v16i16, MVT::v8i32, MVT::v4i64, - MVT::v8f32, MVT::v4f64 }) + MVT::v8f32, MVT::v4f64, MVT::v1i1 }) setOperationAction(ISD::EXTRACT_SUBVECTOR, VT, Custom); for (auto VT : { MVT::v2i1, MVT::v4i1, MVT::v8i1, MVT::v16i1, MVT::v32i1, MVT::v64i1 }) @@ -14570,6 +14575,21 @@ static SDValue LowerEXTRACT_SUBVECTOR(SDValue Op, cons unsigned IdxVal = cast(Idx)->getZExtValue(); MVT ResVT = Op.getSimpleValueType(); + // When v1i1 is legal a scalarization of a vselect with a vXi1 Cond + // would result with: v1i1 = extract_subvector(vXi1, idx). + // Lower these into extract_vector_elt which is already selectable. + if (ResVT == MVT::v1i1) { + assert(Subtarget.hasAVX512() && + "Boolean EXTRACT_SUBVECTOR requires AVX512"); + + MVT EltVT = ResVT.getVectorElementType(); + const TargetLowering &TLI = DAG.getTargetLoweringInfo(); + MVT LegalVT = + (TLI.getTypeToTransformTo(*DAG.getContext(), EltVT)).getSimpleVT(); + SDValue Res = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, LegalVT, In, Idx); + return DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, ResVT, Res); + } + assert((In.getSimpleValueType().is256BitVector() || In.getSimpleValueType().is512BitVector()) && "Can only extract from 256-bit or 512-bit vectors"); @@ -20651,8 +20671,8 @@ static SDValue LowerINTRINSIC_W_CHAIN(SDValue Op, cons } // ADC/ADCX/SBB case ADX: { - SDVTList CFVTs = DAG.getVTList(Op->getValueType(0), MVT::Other); - SDVTList VTs = DAG.getVTList(Op.getOperand(3)->getValueType(0), MVT::Other); + SDVTList CFVTs = DAG.getVTList(Op->getValueType(0), MVT::i32); + SDVTList VTs = DAG.getVTList(Op.getOperand(3)->getValueType(0), MVT::i32); SDValue GenCF = DAG.getNode(X86ISD::ADD, dl, CFVTs, Op.getOperand(2), DAG.getConstant(-1, dl, MVT::i8)); SDValue Res = DAG.getNode(IntrData->Opc0, dl, VTs, Op.getOperand(3), @@ -30663,6 +30683,14 @@ static SDValue combineSelect(SDNode *N, SelectionDAG & return SDValue(N, 0); } + // Custom action for SELECT MMX + if (VT == MVT::x86mmx) { + LHS = DAG.getBitcast(MVT::i64, LHS); + RHS = DAG.getBitcast(MVT::i64, RHS); + SDValue newSelect = DAG.getNode(ISD::SELECT, DL, MVT::i64, Cond, LHS, RHS); + return DAG.getBitcast(VT, newSelect); + } + return SDValue(); } @@ -33358,7 +33386,8 @@ static SDValue combineStore(SDNode *N, SelectionDAG &D SDValue NewLd = DAG.getLoad(LdVT, LdDL, Ld->getChain(), Ld->getBasePtr(), Ld->getPointerInfo(), Ld->getAlignment(), Ld->getMemOperand()->getFlags()); - SDValue NewChain = NewLd.getValue(1); + // Make sure new load is placed in same chain order. + SDValue NewChain = DAG.makeEquivalentMemoryOrdering(Ld, NewLd); if (TokenFactorIndex >= 0) { Ops.push_back(NewChain); NewChain = DAG.getNode(ISD::TokenFactor, LdDL, MVT::Other, Ops); @@ -33379,11 +33408,12 @@ static SDValue combineStore(SDNode *N, SelectionDAG &D Ld->getPointerInfo().getWithOffset(4), MinAlign(Ld->getAlignment(), 4), Ld->getMemOperand()->getFlags()); + // Make sure new loads are placed in same chain order. + SDValue NewChain = DAG.makeEquivalentMemoryOrdering(Ld, LoLd); + NewChain = DAG.makeEquivalentMemoryOrdering(Ld, HiLd); - SDValue NewChain = LoLd.getValue(1); if (TokenFactorIndex >= 0) { - Ops.push_back(LoLd); - Ops.push_back(HiLd); + Ops.push_back(NewChain); NewChain = DAG.getNode(ISD::TokenFactor, LdDL, MVT::Other, Ops); } Modified: head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td Mon Aug 21 07:03:02 2017 (r322740) @@ -978,6 +978,44 @@ multiclass avx512_int_broadcast_reg opc, X86Ve (_.VT (OpNode SrcRC:$src))>, T8PD, EVEX; } +multiclass avx512_int_broadcastbw_reg opc, string Name, + X86VectorVTInfo _, SDPatternOperator OpNode, + RegisterClass SrcRC, SubRegIndex Subreg> { + let ExeDomain = _.ExeDomain in + defm r : AVX512_maskable_custom, T8PD, EVEX; + + def : Pat <(_.VT (OpNode SrcRC:$src)), + (!cast(Name#r) + (i32 (INSERT_SUBREG (i32 (IMPLICIT_DEF)), SrcRC:$src, Subreg)))>; + + def : Pat <(vselect _.KRCWM:$mask, (_.VT (OpNode SrcRC:$src)), _.RC:$src0), + (!cast(Name#rk) _.RC:$src0, _.KRCWM:$mask, + (i32 (INSERT_SUBREG (i32 (IMPLICIT_DEF)), SrcRC:$src, Subreg)))>; + + def : Pat <(vselect _.KRCWM:$mask, (_.VT (OpNode SrcRC:$src)), _.ImmAllZerosV), + (!cast(Name#rkz) _.KRCWM:$mask, + (i32 (INSERT_SUBREG (i32 (IMPLICIT_DEF)), SrcRC:$src, Subreg)))>; +} + +multiclass avx512_int_broadcastbw_reg_vl opc, string Name, + AVX512VLVectorVTInfo _, SDPatternOperator OpNode, + RegisterClass SrcRC, SubRegIndex Subreg, Predicate prd> { + let Predicates = [prd] in + defm Z : avx512_int_broadcastbw_reg, EVEX_V512; + let Predicates = [prd, HasVLX] in { + defm Z256 : avx512_int_broadcastbw_reg, EVEX_V256; + defm Z128 : avx512_int_broadcastbw_reg, EVEX_V128; + } +} + multiclass avx512_int_broadcast_reg_vl opc, AVX512VLVectorVTInfo _, SDPatternOperator OpNode, RegisterClass SrcRC, Predicate prd> { @@ -989,18 +1027,11 @@ multiclass avx512_int_broadcast_reg_vl opc, AV } } -let isCodeGenOnly = 1 in { -defm VPBROADCASTBr : avx512_int_broadcast_reg_vl<0x7A, avx512vl_i8_info, - X86VBroadcast, GR8, HasBWI>; -defm VPBROADCASTWr : avx512_int_broadcast_reg_vl<0x7B, avx512vl_i16_info, - X86VBroadcast, GR16, HasBWI>; -} -let isAsmParserOnly = 1 in { - defm VPBROADCASTBr_Alt : avx512_int_broadcast_reg_vl<0x7A, avx512vl_i8_info, - null_frag, GR32, HasBWI>; - defm VPBROADCASTWr_Alt : avx512_int_broadcast_reg_vl<0x7B, avx512vl_i16_info, - null_frag, GR32, HasBWI>; -} +defm VPBROADCASTBr : avx512_int_broadcastbw_reg_vl<0x7A, "VPBROADCASTBr", + avx512vl_i8_info, X86VBroadcast, GR8, sub_8bit, HasBWI>; +defm VPBROADCASTWr : avx512_int_broadcastbw_reg_vl<0x7B, "VPBROADCASTWr", + avx512vl_i16_info, X86VBroadcast, GR16, sub_16bit, + HasBWI>; defm VPBROADCASTDr : avx512_int_broadcast_reg_vl<0x7C, avx512vl_i32_info, X86VBroadcast, GR32, HasAVX512>; defm VPBROADCASTQr : avx512_int_broadcast_reg_vl<0x7C, avx512vl_i64_info, Modified: head/contrib/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp ============================================================================== --- head/contrib/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -60,11 +60,13 @@ std::vector> OwningMBs; // Opens a file. Path has to be resolved already. // Newly created memory buffers are owned by this driver. -MemoryBufferRef openFile(StringRef Path) { +Optional openFile(StringRef Path) { ErrorOr> MB = MemoryBuffer::getFile(Path); - if (std::error_code EC = MB.getError()) + if (std::error_code EC = MB.getError()) { llvm::errs() << "fail openFile: " << EC.message() << "\n"; + return None; + } MemoryBufferRef MBRef = MB.get()->getMemBufferRef(); OwningMBs.push_back(std::move(MB.get())); // take ownership @@ -114,11 +116,16 @@ int llvm::dlltoolDriverMain(llvm::ArrayRefgetSpelling() << "\n"; - MemoryBufferRef MB; - if (auto *Arg = Args.getLastArg(OPT_d)) - MB = openFile(Arg->getValue()); + if (!Args.hasArg(OPT_d)) { + llvm::errs() << "no definition file specified\n"; + return 1; + } - if (!MB.getBufferSize()) { + Optional MB = openFile(Args.getLastArg(OPT_d)->getValue()); + if (!MB) + return 1; + + if (!MB->getBufferSize()) { llvm::errs() << "definition file empty\n"; return 1; } @@ -133,7 +140,7 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef Def = - parseCOFFModuleDefinition(MB, Machine, true); + parseCOFFModuleDefinition(*MB, Machine, true); if (!Def) { llvm::errs() << "error parsing definition\n" @@ -154,7 +161,7 @@ int llvm::dlltoolDriverMain(llvm::ArrayRefOutputFile); - if (writeImportLibrary(Def->OutputFile, Path, Def->Exports, Machine)) + if (writeImportLibrary(Def->OutputFile, Path, Def->Exports, Machine, true)) return 1; return 0; } Modified: head/contrib/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -1470,6 +1470,7 @@ void DFSanVisitor::visitCallSite(CallSite CS) { } i = CS.arg_begin(); + const unsigned ShadowArgStart = Args.size(); for (unsigned n = FT->getNumParams(); n != 0; ++i, --n) Args.push_back(DFSF.getShadow(*i)); @@ -1504,6 +1505,15 @@ void DFSanVisitor::visitCallSite(CallSite CS) { CallInst *CustomCI = IRB.CreateCall(CustomF, Args); CustomCI->setCallingConv(CI->getCallingConv()); CustomCI->setAttributes(CI->getAttributes()); + + // Update the parameter attributes of the custom call instruction to + // zero extend the shadow parameters. This is required for targets + // which consider ShadowTy an illegal type. + for (unsigned n = 0; n < FT->getNumParams(); n++) { + const unsigned ArgNo = ShadowArgStart + n; + if (CustomCI->getArgOperand(ArgNo)->getType() == DFSF.DFS.ShadowTy) + CustomCI->addParamAttr(ArgNo, Attribute::ZExt); + } if (!FT->getReturnType()->isVoidTy()) { LoadInst *LabelLoad = IRB.CreateLoad(DFSF.LabelReturnAlloca); Modified: head/contrib/llvm/lib/Transforms/Scalar/BDCE.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Scalar/BDCE.cpp Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/lib/Transforms/Scalar/BDCE.cpp Mon Aug 21 07:03:02 2017 (r322740) @@ -15,6 +15,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar/BDCE.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/DemandedBits.h" @@ -35,6 +36,46 @@ using namespace llvm; STATISTIC(NumRemoved, "Number of instructions removed (unused)"); STATISTIC(NumSimplified, "Number of instructions trivialized (dead bits)"); +/// If an instruction is trivialized (dead), then the chain of users of that +/// instruction may need to be cleared of assumptions that can no longer be +/// guaranteed correct. +static void clearAssumptionsOfUsers(Instruction *I, DemandedBits &DB) { + assert(I->getType()->isIntegerTy() && "Trivializing a non-integer value?"); + + // Initialize the worklist with eligible direct users. + SmallVector WorkList; + for (User *JU : I->users()) { + // If all bits of a user are demanded, then we know that nothing below that + // in the def-use chain needs to be changed. + auto *J = dyn_cast(JU); + if (J && !DB.getDemandedBits(J).isAllOnesValue()) + WorkList.push_back(J); + } + + // DFS through subsequent users while tracking visits to avoid cycles. + SmallPtrSet Visited; + while (!WorkList.empty()) { + Instruction *J = WorkList.pop_back_val(); + + // NSW, NUW, and exact are based on operands that might have changed. + J->dropPoisonGeneratingFlags(); + + // We do not have to worry about llvm.assume or range metadata: + // 1. llvm.assume demands its operand, so trivializing can't change it. + // 2. range metadata only applies to memory accesses which demand all bits. + + Visited.insert(J); + + for (User *KU : J->users()) { + // If all bits of a user are demanded, then we know that nothing below + // that in the def-use chain needs to be changed. + auto *K = dyn_cast(KU); + if (K && !Visited.count(K) && !DB.getDemandedBits(K).isAllOnesValue()) + WorkList.push_back(K); + } + } +} + static bool bitTrackingDCE(Function &F, DemandedBits &DB) { SmallVector Worklist; bool Changed = false; @@ -51,6 +92,9 @@ static bool bitTrackingDCE(Function &F, DemandedBits & // replacing all uses with something else. Then, if they don't need to // remain live (because they have side effects, etc.) we can remove them. DEBUG(dbgs() << "BDCE: Trivializing: " << I << " (all bits dead)\n"); + + clearAssumptionsOfUsers(&I, DB); + // FIXME: In theory we could substitute undef here instead of zero. // This should be reconsidered once we settle on the semantics of // undef, poison, etc. Modified: head/contrib/llvm/tools/clang/include/clang-c/Index.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang-c/Index.h Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/tools/clang/include/clang-c/Index.h Mon Aug 21 07:03:02 2017 (r322740) @@ -3206,6 +3206,8 @@ enum CXCallingConv { CXCallingConv_X86RegCall = 8, CXCallingConv_IntelOclBicc = 9, CXCallingConv_Win64 = 10, + /* Alias for compatibility with older versions of API. */ + CXCallingConv_X86_64Win64 = CXCallingConv_Win64, CXCallingConv_X86_64SysV = 11, CXCallingConv_X86VectorCall = 12, CXCallingConv_Swift = 13, Modified: head/contrib/llvm/tools/clang/include/clang/AST/Decl.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/AST/Decl.h Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/tools/clang/include/clang/AST/Decl.h Mon Aug 21 07:03:02 2017 (r322740) @@ -1666,8 +1666,7 @@ class FunctionDecl : public DeclaratorDecl, public Dec unsigned HasSkippedBody : 1; /// Indicates if the function declaration will have a body, once we're done - /// parsing it. (We don't set it to false when we're done parsing, in the - /// hopes this is simpler.) + /// parsing it. unsigned WillHaveBody : 1; /// \brief End part of this FunctionDecl's source range. Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td Mon Aug 21 07:03:02 2017 (r322740) @@ -138,9 +138,10 @@ def err_drv_cc_print_options_failure : Error< def err_drv_lto_without_lld : Error<"LTO requires -fuse-ld=lld">; def err_drv_preamble_format : Error< "incorrect format for -preamble-bytes=N,END">; -def err_invalid_ios_deployment_target : Error< +def warn_invalid_ios_deployment_target : Warning< "invalid iOS deployment version '%0', iOS 10 is the maximum deployment " - "target for 32-bit targets">; + "target for 32-bit targets">, InGroup, + DefaultError; def err_drv_conflicting_deployment_targets : Error< "conflicting deployment targets, both '%0' and '%1' are present in environment">; def err_arc_unsupported_on_runtime : Error< Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td Mon Aug 21 07:03:02 2017 (r322740) @@ -151,9 +151,13 @@ def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexi def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">; def FormatExtraArgs : DiagGroup<"format-extra-args">; def FormatZeroLength : DiagGroup<"format-zero-length">; -def CXX1zCompatMangling : DiagGroup<"c++1z-compat-mangling">; + +def InvalidIOSDeploymentTarget : DiagGroup<"invalid-ios-deployment-target">; + +def CXX17CompatMangling : DiagGroup<"c++17-compat-mangling">; +def : DiagGroup<"c++1z-compat-mangling", [CXX17CompatMangling]>; // Name of this warning in GCC. -def NoexceptType : DiagGroup<"noexcept-type", [CXX1zCompatMangling]>; +def NoexceptType : DiagGroup<"noexcept-type", [CXX17CompatMangling]>; // Warnings for C++1y code which is not compatible with prior C++ standards. def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">; @@ -215,9 +219,10 @@ def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre1zC def CXX14CompatPedantic : DiagGroup<"c++14-compat-pedantic", [CXXPre1zCompatPedantic]>; -def CXX1zCompat : DiagGroup<"c++1z-compat", [DeprecatedRegister, +def CXX17Compat : DiagGroup<"c++17-compat", [DeprecatedRegister, DeprecatedIncrementBool, - CXX1zCompatMangling]>; + CXX17CompatMangling]>; +def : DiagGroup<"c++1z-compat", [CXX17Compat]>; def ExitTimeDestructors : DiagGroup<"exit-time-destructors">; def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">; @@ -769,10 +774,11 @@ def CXX14 : DiagGroup<"c++14-extensions", [CXX14Binary // A warning group for warnings about using C++1z features as extensions in // earlier C++ versions. -def CXX1z : DiagGroup<"c++1z-extensions">; +def CXX17 : DiagGroup<"c++17-extensions">; def : DiagGroup<"c++0x-extensions", [CXX11]>; def : DiagGroup<"c++1y-extensions", [CXX14]>; +def : DiagGroup<"c++1z-extensions", [CXX17]>; def DelegatingCtorCycles : DiagGroup<"delegating-ctor-cycles">; Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td Mon Aug 21 07:03:02 2017 (r322740) @@ -181,10 +181,10 @@ def err_hex_constant_requires : Error< def ext_hex_constant_invalid : Extension< "hexadecimal floating constants are a C99 feature">, InGroup; def ext_hex_literal_invalid : Extension< - "hexadecimal floating literals are a C++1z feature">, InGroup; + "hexadecimal floating literals are a C++17 feature">, InGroup; def warn_cxx1z_hex_literal : Warning< "hexadecimal floating literals are incompatible with " - "C++ standards before C++1z">, + "C++ standards before C++17">, InGroup, DefaultIgnore; def ext_binary_literal : Extension< "binary integer literals are a GNU extension">, InGroup; @@ -208,7 +208,7 @@ def warn_cxx98_compat_unicode_literal : Warning< "unicode literals are incompatible with C++98">, InGroup, DefaultIgnore; def warn_cxx14_compat_u8_character_literal : Warning< - "unicode literals are incompatible with C++ standards before C++1z">, + "unicode literals are incompatible with C++ standards before C++17">, InGroup, DefaultIgnore; def warn_cxx11_compat_user_defined_literal : Warning< "identifier after literal will be treated as a user-defined literal suffix " Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td Mon Aug 21 05:25:30 2017 (r322739) +++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td Mon Aug 21 07:03:02 2017 (r322740) @@ -211,10 +211,10 @@ def err_inline_namespace_alias : Error<"namespace alia def err_namespace_nonnamespace_scope : Error< "namespaces can only be defined in global or namespace scope">; def ext_nested_namespace_definition : ExtWarn< - "nested namespace definition is a C++1z extension; " - "define each namespace separately">, InGroup; + "nested namespace definition is a C++17 extension; " + "define each namespace separately">, InGroup; def warn_cxx14_compat_nested_namespace_definition : Warning< - "nested namespace definition is incompatible with C++ standards before C++1z">, + "nested namespace definition is incompatible with C++ standards before C++17">, InGroup, DefaultIgnore; def err_inline_nested_namespace_definition : Error< "nested namespace definition cannot be 'inline'">; @@ -358,7 +358,7 @@ def err_expected_coloncolon_after_super : Error< "expected '::' after '__super'">; def ext_decomp_decl_empty : ExtWarn< - "ISO C++1z does not allow a decomposition group to be empty">, + "ISO C++17 does not allow a decomposition group to be empty">, InGroup>; /// Objective-C parser diagnostics @@ -522,16 +522,16 @@ def err_function_is_not_record : Error< def err_super_in_using_declaration : Error< "'__super' cannot be used with a using declaration">; def ext_constexpr_if : ExtWarn< - "constexpr if is a C++1z extension">, InGroup; + "constexpr if is a C++17 extension">, InGroup; def warn_cxx14_compat_constexpr_if : Warning< - "constexpr if is incompatible with C++ standards before C++1z">, + "constexpr if is incompatible with C++ standards before C++17">, DefaultIgnore, InGroup; def ext_init_statement : ExtWarn< - "'%select{if|switch}0' initialization statements are a C++1z extension">, - InGroup; + "'%select{if|switch}0' initialization statements are a C++17 extension">, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 21 11:51:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C656DD53F1; Mon, 21 Aug 2017 11:51:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id 290BA6C1A3; Mon, 21 Aug 2017 11:51:41 +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 v7LBpeYI077808; Mon, 21 Aug 2017 11:51:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LBpeH2077807; Mon, 21 Aug 2017 11:51:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708211151.v7LBpeH2077807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 21 Aug 2017 11:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322746 - 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: 322746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 11:51:41 -0000 Author: hselasky Date: Mon Aug 21 11:51:40 2017 New Revision: 322746 URL: https://svnweb.freebsd.org/changeset/base/322746 Log: Fix for deadlock situation in the LinuxKPI's RCU synchronize API. Deadlock condition: The return value of TDQ_LOCKPTR(td) is the same for two threads. 1) The first thread signals a wakeup while keeping the rcu_read_lock(). This invokes sched_add() which in turn will try to lock TDQ_LOCK(). 2) The second thread is calling synchronize_rcu() calling mi_switch() over and over again trying to yield(). This prevents the first thread from running and releasing the RCU reader lock. Solution: Release the thread lock while yielding to allow other threads to acquire the lock pointed to by TDQ_LOCKPTR(td). Found by: KrishnamRaju ErapaRaju MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_rcu.c Mon Aug 21 10:26:11 2017 (r322745) +++ head/sys/compat/linuxkpi/common/src/linux_rcu.c Mon Aug 21 11:51:40 2017 (r322746) @@ -258,6 +258,15 @@ linux_synchronize_rcu_cb(ck_epoch_t *epoch __unused, c sched_prio(td, prio); /* task switch */ mi_switch(SW_VOL | SWT_RELINQUISH, NULL); + + /* + * Release the thread lock while yielding to + * allow other threads to acquire the lock + * pointed to by TDQ_LOCKPTR(td). Else a + * deadlock like situation might happen. + */ + thread_unlock(td); + thread_lock(td); } } else { /* From owner-svn-src-head@freebsd.org Mon Aug 21 12:42:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAFC9DD8B4A; Mon, 21 Aug 2017 12:42:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id A956C6DD4B; Mon, 21 Aug 2017 12:42:06 +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 v7LCg5LI098004; Mon, 21 Aug 2017 12:42:05 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LCg53G098003; Mon, 21 Aug 2017 12:42:05 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201708211242.v7LCg53G098003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 21 Aug 2017 12:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322749 - head/kerberos5/libexec/kpasswdd X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/kerberos5/libexec/kpasswdd X-SVN-Commit-Revision: 322749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 12:42:07 -0000 Author: cy Date: Mon Aug 21 12:42:05 2017 New Revision: 322749 URL: https://svnweb.freebsd.org/changeset/base/322749 Log: Replace the include path using CURDIR with KRB5DIR. This is consistent with the rest of the Makefiles in kerberos5/. MFC after: 1 week Modified: head/kerberos5/libexec/kpasswdd/Makefile Modified: head/kerberos5/libexec/kpasswdd/Makefile ============================================================================== --- head/kerberos5/libexec/kpasswdd/Makefile Mon Aug 21 12:23:11 2017 (r322748) +++ head/kerberos5/libexec/kpasswdd/Makefile Mon Aug 21 12:42:05 2017 (r322749) @@ -2,7 +2,7 @@ PROG= kpasswdd MAN= kpasswdd.8 -CFLAGS+=-I${KRB5DIR}/lib/roken -I${.CURDIR:H:H}/lib/libhdb ${LDAPCFLAGS} +CFLAGS+=-I${KRB5DIR}/lib/roken -I${KRB5DIR}/lib/libhdb ${LDAPCFLAGS} LIBADD= kadm5srv hdb krb5 roken vers asn1 DPADD= ${LDAPDPADD} LDADD= ${LDAPLDADD} From owner-svn-src-head@freebsd.org Mon Aug 21 13:49:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71CCADDCAB1; Mon, 21 Aug 2017 13:49:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A12D70626; Mon, 21 Aug 2017 13:49:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x235.google.com with SMTP id 76so32685209ith.0; Mon, 21 Aug 2017 06:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=dqTROEsrc28jO2oUofNX9X5cvIXjG3vHOdCE7SUB8b4=; b=BJvjPnZ7NPlTdKaU4r9hsiNrRWV122F6TlHco90ViGxlpVpZtIvZ0P4RtwCmtsf1ar +yE5XZV7bvatK70hM/TIMLoGc2vF/3nMAofl7QVHBHlo64BvZ4nxBdzEWvXLJfjZex9L smzLr6yXGETrFrxQFFZKKJy6ymbuOCaa6vcjfVhaQsm8JZk6GB3O1YbfrIQWQ7/lgQkP tYJEcQuC+e3wdtAcJf0lQVlJ0SnBC2QP3gweG9zD70mdLoRL6CgNfMxClGJO7pJBzSYP jmbUQaJ1JFbu2vlPre4pJoBb/Up1CdsVXh2b8w3aI9f3qA1fOlx7DFG9biJWKFxfZ09x WDIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=dqTROEsrc28jO2oUofNX9X5cvIXjG3vHOdCE7SUB8b4=; b=B/yFkBcz0/oWseaMvZQmf44iBvPkFoASWnttcEqxw81SKiSiT+aXnAIULD4xRasbPf r1sAraECU9M7VTIA9H9XHfgcbHPvcF1UMLHMwQuhWbXr0vMYZIVmK9iGTP5dJDlc3d+n MEXct5P4T85fKkTddraOqC4KpS+BCug6xCsDllX7ius4ef9gy/FjroVMKxU7RHIfvF4P 5b7QJmL1TQPR5V5e1gEDAJTYIKbrkRBToQE43N9tP//cflSCp34W2N3PHQUYbw2/5CNj cFdvkN0k6baIUetGSmxwt5fx0RGIH7SsaEMh2Tb5NhiEWwgBwOgxRqWdHiJ8ItQNKTKm 8rgQ== X-Gm-Message-State: AHYfb5gCP0bh4WxU+SEeooZKP+zShMoFVBdtgBt11LF4BJgVn2imzN84 Y4sXGhDp30FL9T7ijPD+6kulRbj1Ng== X-Received: by 10.36.19.11 with SMTP id 11mr184741itz.153.1503323382597; Mon, 21 Aug 2017 06:49:42 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.24.66 with HTTP; Mon, 21 Aug 2017 06:49:22 -0700 (PDT) In-Reply-To: References: <201708190032.v7J0WQAa017551@repo.freebsd.org> From: Ed Maste Date: Mon, 21 Aug 2017 09:49:22 -0400 X-Google-Sender-Auth: 6FYH1XUVSxrT3vQMkYWXJT8F0vo Message-ID: Subject: Re: svn commit: r322678 - in head/usr.sbin/pw: . tests To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 13:49:43 -0000 On 18 August 2017 at 21:08, Ngie Cooper (yaneurabeya) wrote: > >> On Aug 18, 2017, at 17:32, Ed Maste wrote: >> >> Author: emaste >> Date: Sat Aug 19 00:32:26 2017 >> New Revision: 322678 >> URL: https://svnweb.freebsd.org/changeset/base/322678 >> >> Log: >> pw useradd: Validate the user name before creating the entry >> >> Previouly it was possible to create users with spaces in the name with: >> pw useradd -u 1234 -g 1234 -n 'test user' >> >> The "-g 1234" is relevant, without it the name was already rejected >> as expected: ... > > Usernames with passwords are permitted in some cases, e.g., AD. I assume you meant "usernames with spaces"? Note that this change only addresses the discrepancy between "pw useradd 'test user'" (which was previously rejected) and "pw useradd 'test user' -g " (which was accepted prior to this change). From owner-svn-src-head@freebsd.org Mon Aug 21 13:52:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85F51DDCE4B; Mon, 21 Aug 2017 13:52:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id 61C1370A07; Mon, 21 Aug 2017 13:52:22 +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 v7LDqLOM033413; Mon, 21 Aug 2017 13:52:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LDqLjW033409; Mon, 21 Aug 2017 13:52:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201708211352.v7LDqLjW033409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 21 Aug 2017 13:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322750 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 322750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 13:52:22 -0000 Author: ae Date: Mon Aug 21 13:52:21 2017 New Revision: 322750 URL: https://svnweb.freebsd.org/changeset/base/322750 Log: Fix the regression introduced in r275710. When a security policy should match TCP connection with specific ports, the SYN+ACK segment send by syncache_respond() is considered as forwarded packet, because at this moment TCP connection does not have PCB structure, and ip_output() is called without inpcb pointer. In this case SPIDX filled for SP lookup will not contain TCP ports and security policy will not be found. This can lead to unencrypted SYN+ACK on the wire. This patch restores the old behavior, when ports will not be filled only for forwarded packets. Reported by: Dewayne Geraghty MFC after: 1 week Modified: head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec6.h head/sys/netipsec/ipsec_output.c Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Mon Aug 21 12:42:05 2017 (r322749) +++ head/sys/netipsec/ipsec.c Mon Aug 21 13:52:21 2017 (r322750) @@ -563,7 +563,8 @@ ipsec4_setspidx_ipaddr(const struct mbuf *m, struct se } static struct secpolicy * -ipsec4_getpolicy(const struct mbuf *m, struct inpcb *inp, u_int dir) +ipsec4_getpolicy(const struct mbuf *m, struct inpcb *inp, u_int dir, + int needport) { struct secpolicyindex spidx; struct secpolicy *sp; @@ -573,7 +574,7 @@ ipsec4_getpolicy(const struct mbuf *m, struct inpcb *i /* Make an index to look for a policy. */ ipsec4_setspidx_ipaddr(m, &spidx); /* Fill ports in spidx if we have inpcb. */ - ipsec4_get_ulp(m, &spidx, inp != NULL); + ipsec4_get_ulp(m, &spidx, needport); spidx.dir = dir; sp = key_allocsp(&spidx, dir); } @@ -586,12 +587,13 @@ ipsec4_getpolicy(const struct mbuf *m, struct inpcb *i * Check security policy for *OUTBOUND* IPv4 packet. */ struct secpolicy * -ipsec4_checkpolicy(const struct mbuf *m, struct inpcb *inp, int *error) +ipsec4_checkpolicy(const struct mbuf *m, struct inpcb *inp, int *error, + int needport) { struct secpolicy *sp; *error = 0; - sp = ipsec4_getpolicy(m, inp, IPSEC_DIR_OUTBOUND); + sp = ipsec4_getpolicy(m, inp, IPSEC_DIR_OUTBOUND, needport); if (sp != NULL) sp = ipsec_checkpolicy(sp, inp, error); if (sp == NULL) { @@ -623,7 +625,7 @@ ipsec4_in_reject(const struct mbuf *m, struct inpcb *i struct secpolicy *sp; int result; - sp = ipsec4_getpolicy(m, inp, IPSEC_DIR_INBOUND); + sp = ipsec4_getpolicy(m, inp, IPSEC_DIR_INBOUND, 0); result = ipsec_in_reject(sp, inp, m); key_freesp(&sp); if (result != 0) @@ -731,7 +733,8 @@ ipsec6_setspidx_ipaddr(const struct mbuf *m, struct se } static struct secpolicy * -ipsec6_getpolicy(const struct mbuf *m, struct inpcb *inp, u_int dir) +ipsec6_getpolicy(const struct mbuf *m, struct inpcb *inp, u_int dir, + int needport) { struct secpolicyindex spidx; struct secpolicy *sp; @@ -741,7 +744,7 @@ ipsec6_getpolicy(const struct mbuf *m, struct inpcb *i /* Make an index to look for a policy. */ ipsec6_setspidx_ipaddr(m, &spidx); /* Fill ports in spidx if we have inpcb. */ - ipsec6_get_ulp(m, &spidx, inp != NULL); + ipsec6_get_ulp(m, &spidx, needport); spidx.dir = dir; sp = key_allocsp(&spidx, dir); } @@ -754,12 +757,13 @@ ipsec6_getpolicy(const struct mbuf *m, struct inpcb *i * Check security policy for *OUTBOUND* IPv6 packet. */ struct secpolicy * -ipsec6_checkpolicy(const struct mbuf *m, struct inpcb *inp, int *error) +ipsec6_checkpolicy(const struct mbuf *m, struct inpcb *inp, int *error, + int needport) { struct secpolicy *sp; *error = 0; - sp = ipsec6_getpolicy(m, inp, IPSEC_DIR_OUTBOUND); + sp = ipsec6_getpolicy(m, inp, IPSEC_DIR_OUTBOUND, needport); if (sp != NULL) sp = ipsec_checkpolicy(sp, inp, error); if (sp == NULL) { @@ -791,7 +795,7 @@ ipsec6_in_reject(const struct mbuf *m, struct inpcb *i struct secpolicy *sp; int result; - sp = ipsec6_getpolicy(m, inp, IPSEC_DIR_INBOUND); + sp = ipsec6_getpolicy(m, inp, IPSEC_DIR_INBOUND, 0); result = ipsec_in_reject(sp, inp, m); key_freesp(&sp); if (result) Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Mon Aug 21 12:42:05 2017 (r322749) +++ head/sys/netipsec/ipsec.h Mon Aug 21 13:52:21 2017 (r322750) @@ -320,7 +320,7 @@ int ipsec_if_input(struct mbuf *, struct secasvar *, u struct ipsecrequest *ipsec_newisr(void); void ipsec_delisr(struct ipsecrequest *); struct secpolicy *ipsec4_checkpolicy(const struct mbuf *, struct inpcb *, - int *); + int *, int); u_int ipsec_get_reqlevel(struct secpolicy *, u_int); Modified: head/sys/netipsec/ipsec6.h ============================================================================== --- head/sys/netipsec/ipsec6.h Mon Aug 21 12:42:05 2017 (r322749) +++ head/sys/netipsec/ipsec6.h Mon Aug 21 13:52:21 2017 (r322750) @@ -60,7 +60,7 @@ VNET_DECLARE(int, ip6_ipsec_ecn); struct inpcb; struct secpolicy *ipsec6_checkpolicy(const struct mbuf *, - struct inpcb *, int *); + struct inpcb *, int *, int); void ipsec6_setsockaddrs(const struct mbuf *, union sockaddr_union *, union sockaddr_union *); Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Mon Aug 21 12:42:05 2017 (r322749) +++ head/sys/netipsec/ipsec_output.c Mon Aug 21 13:52:21 2017 (r322750) @@ -297,7 +297,7 @@ ipsec4_common_output(struct mbuf *m, struct inpcb *inp int error; /* Lookup for the corresponding outbound security policy */ - sp = ipsec4_checkpolicy(m, inp, &error); + sp = ipsec4_checkpolicy(m, inp, &error, !forwarding); if (sp == NULL) { if (error == -EINVAL) { /* Discarded by policy. */ @@ -599,7 +599,7 @@ ipsec6_common_output(struct mbuf *m, struct inpcb *inp int error; /* Lookup for the corresponding outbound security policy */ - sp = ipsec6_checkpolicy(m, inp, &error); + sp = ipsec6_checkpolicy(m, inp, &error, !forwarding); if (sp == NULL) { if (error == -EINVAL) { /* Discarded by policy. */ From owner-svn-src-head@freebsd.org Mon Aug 21 13:54:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B44DDD066; Mon, 21 Aug 2017 13:54:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F66270C9D; Mon, 21 Aug 2017 13:54:30 +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 v7LDsUDY033522; Mon, 21 Aug 2017 13:54:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LDsUIL033521; Mon, 21 Aug 2017 13:54:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201708211354.v7LDsUIL033521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 21 Aug 2017 13:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322751 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 322751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 13:54:31 -0000 Author: ae Date: Mon Aug 21 13:54:29 2017 New Revision: 322751 URL: https://svnweb.freebsd.org/changeset/base/322751 Log: Remove stale comments. MFC after: 1 week Modified: head/sys/netipsec/ipsec.c Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Mon Aug 21 13:52:21 2017 (r322750) +++ head/sys/netipsec/ipsec.c Mon Aug 21 13:54:29 2017 (r322751) @@ -573,7 +573,6 @@ ipsec4_getpolicy(const struct mbuf *m, struct inpcb *i if (sp == NULL && key_havesp(dir)) { /* Make an index to look for a policy. */ ipsec4_setspidx_ipaddr(m, &spidx); - /* Fill ports in spidx if we have inpcb. */ ipsec4_get_ulp(m, &spidx, needport); spidx.dir = dir; sp = key_allocsp(&spidx, dir); @@ -743,7 +742,6 @@ ipsec6_getpolicy(const struct mbuf *m, struct inpcb *i if (sp == NULL && key_havesp(dir)) { /* Make an index to look for a policy. */ ipsec6_setspidx_ipaddr(m, &spidx); - /* Fill ports in spidx if we have inpcb. */ ipsec6_get_ulp(m, &spidx, needport); spidx.dir = dir; sp = key_allocsp(&spidx, dir); From owner-svn-src-head@freebsd.org Mon Aug 21 14:14:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09AEDDDE539; Mon, 21 Aug 2017 14:14:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id CBD3A71949; Mon, 21 Aug 2017 14:14:14 +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 v7LEEEuJ041690; Mon, 21 Aug 2017 14:14:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LEEEiJ041689; Mon, 21 Aug 2017 14:14:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201708211414.v7LEEEiJ041689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 21 Aug 2017 14:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322752 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 322752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 14:14:15 -0000 Author: gjb Date: Mon Aug 21 14:14:13 2017 New Revision: 322752 URL: https://svnweb.freebsd.org/changeset/base/322752 Log: Update the tests(7) manual page to note the test suite is installed by default as of 11.0-RELEASE. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man7/tests.7 Modified: head/share/man/man7/tests.7 ============================================================================== --- head/share/man/man7/tests.7 Mon Aug 21 13:54:29 2017 (r322751) +++ head/share/man/man7/tests.7 Mon Aug 21 14:14:13 2017 (r322752) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 22, 2017 +.Dd August 21, 2017 .Dt TESTS 7 .Os .Sh NAME @@ -59,10 +59,9 @@ hierarchy. This manual page describes how to run the test suite and how to configure some of its optional features. .Ss Installing the test suite -The test suite is not yet installed by default as part of -.Fx , -but this is bound to change during the development of -.Fx 11.0 . +The test suite is installed by default as of +.Fx +11.0-RELEASE. .Pp If the .Pa /usr/tests From owner-svn-src-head@freebsd.org Mon Aug 21 16:16:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56322DE58B1; Mon, 21 Aug 2017 16:16:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 239D9760A8; Mon, 21 Aug 2017 16:16:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7LGG26q090803; Mon, 21 Aug 2017 16:16:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LGG2XM090802; Mon, 21 Aug 2017 16:16:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708211616.v7LGG2XM090802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Aug 2017 16:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322756 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 322756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 16:16:03 -0000 Author: kib Date: Mon Aug 21 16:16:02 2017 New Revision: 322756 URL: https://svnweb.freebsd.org/changeset/base/322756 Log: Style. Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Aug 21 15:44:57 2017 (r322755) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Aug 21 16:16:02 2017 (r322756) @@ -14059,7 +14059,7 @@ softdep_count_dependencies(bp, wantcount) } out: FREE_LOCK(ump); - return retval; + return (retval); } /* From owner-svn-src-head@freebsd.org Mon Aug 21 16:23:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA64FDE623F; Mon, 21 Aug 2017 16:23: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 mx1.freebsd.org (Postfix) with ESMTPS id B9F9C7663F; Mon, 21 Aug 2017 16:23: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 v7LGNixF094839; Mon, 21 Aug 2017 16:23:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LGNiuc094838; Mon, 21 Aug 2017 16:23:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708211623.v7LGNiuc094838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Aug 2017 16:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322757 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 322757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 16:23:46 -0000 Author: kib Date: Mon Aug 21 16:23:44 2017 New Revision: 322757 URL: https://svnweb.freebsd.org/changeset/base/322757 Log: Avoid dereferencing potentially freed workitem in softdep_count_dependencies(). Buffer's b_dep list is protected by the SU mount lock. Owning the buffer lock is not enough to guarantee the stability of the list. Calculation of the UFS mount owning the workitems from the buffer must be much more careful to not dereference the work item which might be freed meantime. To get to ump, use the pointers chain which does not involve workitems at all. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Aug 21 16:16:02 2017 (r322756) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Aug 21 16:23:44 2017 (r322757) @@ -13919,12 +13919,36 @@ softdep_count_dependencies(bp, wantcount) struct newblk *newblk; struct mkdir *mkdir; struct diradd *dap; + struct vnode *vp; + struct mount *mp; int i, retval; retval = 0; - if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) + if (LIST_EMPTY(&bp->b_dep)) return (0); - ump = VFSTOUFS(wk->wk_mp); + vp = bp->b_vp; + + /* + * The ump mount point is stable after we get a correct + * pointer, since bp is locked and this prevents unmount from + * proceed. But to get to it, we cannot dereference bp->b_dep + * head wk_mp, because we do not yet own SU ump lock and + * workitem might be freed while dereferenced. + */ +retry: + if (vp->v_type == VCHR) { + VOP_LOCK(vp, LK_RETRY | LK_EXCLUSIVE); + mp = vp->v_type == VCHR ? vp->v_rdev->si_mountpt : NULL; + VOP_UNLOCK(vp, 0); + if (mp == NULL) + goto retry; + } else if (vp->v_type == VREG) { + mp = vp->v_mount; + } else { + return (0); + } + ump = VFSTOUFS(mp); + ACQUIRE_LOCK(ump); LIST_FOREACH(wk, &bp->b_dep, wk_list) { switch (wk->wk_type) { From owner-svn-src-head@freebsd.org Mon Aug 21 17:38:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D46A6DEA2AD; Mon, 21 Aug 2017 17:38:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 879207D08A; Mon, 21 Aug 2017 17:38:04 +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 v7LHc3oK023720; Mon, 21 Aug 2017 17:38:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LHc2Li023711; Mon, 21 Aug 2017 17:38:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708211738.v7LHc2Li023711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Aug 2017 17:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322762 - in head/sys: amd64/amd64 amd64/include sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include sys X-SVN-Commit-Revision: 322762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 17:38:04 -0000 Author: kib Date: Mon Aug 21 17:38:02 2017 New Revision: 322762 URL: https://svnweb.freebsd.org/changeset/base/322762 Log: Make WRFSBASE and WRGSBASE instructions functional. Right now, we enable the CR4.FSGSBASE bit on CPUs which support the facility (Ivy and later), to allow usermode to read fs and gs bases without syscalls. This bit also controls the write access to bases from userspace, but WRFSBASE and WRGSBASE instructions currently cannot be used, because return path from both exceptions or interrupts overrides bases with the values from pcb. Supporting the instructions is useful because this means that usermode can implement green-threads completely in userspace without issuing syscalls to change all of the machine context. Support is implemented by saving the fs base and user gs base when PCB_FULL_IRET flag is set. The flag is set on the context switch, which potentially causes clobber of the bases due to activation of another context, and when explicit modification of the user context by a syscall or exception handler is performed. In particular, the patch moves setting of the flag before syscalls change context. The changes to doreti_exit and PUSH_FRAME to clear PCB_FULL_IRET on entry from userspace can be considered a bug fixes on its own. Reviewed by: jhb (previous version) Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D12023 Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/ptrace_machdep.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/asmacros.h head/sys/amd64/include/pcb.h head/sys/sys/param.h Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Mon Aug 21 17:35:04 2017 (r322761) +++ head/sys/amd64/amd64/cpu_switch.S Mon Aug 21 17:38:02 2017 (r322762) @@ -87,7 +87,6 @@ END(cpu_throw) ENTRY(cpu_switch) /* Switch to new thread. First, save context. */ movq TD_PCB(%rdi),%r8 - orl $PCB_FULL_IRET,PCB_FLAGS(%r8) movq (%rsp),%rax /* Hardware registers */ movq %r15,PCB_R15(%r8) @@ -99,6 +98,30 @@ ENTRY(cpu_switch) movq %rbx,PCB_RBX(%r8) movq %rax,PCB_RIP(%r8) + testl $PCB_FULL_IRET,PCB_FLAGS(%r8) + jnz 2f + orl $PCB_FULL_IRET,PCB_FLAGS(%r8) + testl $TDP_KTHREAD,TD_PFLAGS(%rdi) + jnz 2f + testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) + jz 2f + movl %fs,%eax + cmpl $KUF32SEL,%eax + jne 1f + rdfsbaseq %rax + movq %rax,PCB_FSBASE(%r8) +1: movl %gs,%eax + cmpl $KUG32SEL,%eax + jne 2f + movq %rdx,%r12 + movl $MSR_KGSBASE,%ecx /* Read user gs base */ + rdmsr + shlq $32,%rdx + orq %rdx,%rax + movq %rax,PCB_GSBASE(%r8) + movq %r12,%rdx + +2: testl $PCB_DBREGS,PCB_FLAGS(%r8) jnz store_dr /* static predict not taken */ done_store_dr: Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Mon Aug 21 17:35:04 2017 (r322761) +++ head/sys/amd64/amd64/exception.S Mon Aug 21 17:38:02 2017 (r322762) @@ -187,12 +187,13 @@ alltraps_testi: jz alltraps_pushregs_no_rdi sti alltraps_pushregs_no_rdi: - movq %rsi,TF_RSI(%rsp) movq %rdx,TF_RDX(%rsp) + movq %rax,TF_RAX(%rsp) +alltraps_pushregs_no_rax: + movq %rsi,TF_RSI(%rsp) movq %rcx,TF_RCX(%rsp) movq %r8,TF_R8(%rsp) movq %r9,TF_R9(%rsp) - movq %rax,TF_RAX(%rsp) movq %rbx,TF_RBX(%rsp) movq %rbp,TF_RBP(%rsp) movq %r10,TF_R10(%rsp) @@ -326,31 +327,53 @@ IDTVEC(prot) prot_addrf: movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ + movq %rax,TF_RAX(%rsp) + movq %rdx,TF_RDX(%rsp) + movw %fs,TF_FS(%rsp) + movw %gs,TF_GS(%rsp) leaq doreti_iret(%rip),%rdi cmpq %rdi,TF_RIP(%rsp) - je 1f /* kernel but with user gsbase!! */ + je 5f /* kernel but with user gsbase!! */ testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 2f /* already running with kernel GS.base */ -1: swapgs -2: movq PCPU(CURPCB),%rdi - orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) /* always full iret from GPF */ - movw %fs,TF_FS(%rsp) - movw %gs,TF_GS(%rsp) + jz 6f /* already running with kernel GS.base */ + testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) + jz 2f + cmpw $KUF32SEL,TF_FS(%rsp) + jne 1f + rdfsbaseq %rax +1: cmpw $KUG32SEL,TF_GS(%rsp) + jne 2f + rdgsbaseq %rdx +2: swapgs + movq PCPU(CURPCB),%rdi + testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) + jz 4f + cmpw $KUF32SEL,TF_FS(%rsp) + jne 3f + movq %rax,PCB_FSBASE(%rdi) +3: cmpw $KUG32SEL,TF_GS(%rsp) + jne 4f + movq %rdx,PCB_GSBASE(%rdi) +4: orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) /* always full iret from GPF */ movw %es,TF_ES(%rsp) movw %ds,TF_DS(%rsp) testl $PSL_I,TF_RFLAGS(%rsp) - jz alltraps_pushregs_no_rdi + jz alltraps_pushregs_no_rax sti - jmp alltraps_pushregs_no_rdi + jmp alltraps_pushregs_no_rax +5: swapgs +6: movq PCPU(CURPCB),%rdi + jmp 4b + /* * Fast syscall entry point. We enter here with just our new %cs/%ss set, * and the new privilige level. We are still running on the old user stack * pointer. We have to juggle a few things around to find our stack etc. * swapgs gives us access to our PCPU space only. * - * We do not support invoking this from a custom %cs or %ss (e.g. using - * entries from an LDT). + * We do not support invoking this from a custom segment registers, + * esp. %cs, %ss, %fs, %gs, e.g. using entries from an LDT. */ IDTVEC(fast_syscall) swapgs @@ -503,6 +526,23 @@ IDTVEC(nmi) nmi_fromuserspace: incl %ebx swapgs + testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) + jz 2f + movq PCPU(CURPCB),%rdi + testq %rdi,%rdi + jz 2f + cmpw $KUF32SEL,TF_FS(%rsp) + jne 1f + rdfsbaseq %rax + movq %rax,PCB_FSBASE(%rdi) +1: cmpw $KUG32SEL,TF_GS(%rsp) + jne 2f + movl $MSR_KGSBASE,%ecx + rdmsr + shlq $32,%rdx + orq %rdx,%rax + movq %rax,PCB_GSBASE(%rdi) +2: /* Note: this label is also used by ddb and gdb: */ nmi_calltrap: FAKE_MCOUNT(TF_RIP(%rsp)) @@ -705,6 +745,7 @@ doreti_exit: jz ld_regs testl $PCB_FULL_IRET,PCB_FLAGS(%r8) jz ld_regs + andl $~PCB_FULL_IRET,PCB_FLAGS(%r8) testl $TF_HASSEGS,TF_FLAGS(%rsp) je set_segs Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Aug 21 17:35:04 2017 (r322761) +++ head/sys/amd64/amd64/machdep.c Mon Aug 21 17:38:02 2017 (r322762) @@ -372,6 +372,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ get_fpcontext(td, &sf.sf_uc.uc_mcontext, xfpusave, xfpusave_len); fpstate_drop(td); + update_pcb_bases(pcb); sf.sf_uc.uc_mcontext.mc_fsbase = pcb->pcb_fsbase; sf.sf_uc.uc_mcontext.mc_gsbase = pcb->pcb_gsbase; bzero(sf.sf_uc.uc_mcontext.mc_spare, @@ -442,7 +443,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask regs->tf_fs = _ufssel; regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; - set_pcb_flags(pcb, PCB_FULL_IRET); PROC_LOCK(p); mtx_lock(&psp->ps_mtx); } @@ -548,6 +548,7 @@ sys_sigreturn(td, uap) return (ret); } bcopy(&ucp->uc_mcontext.mc_rdi, regs, sizeof(*regs)); + update_pcb_bases(pcb); pcb->pcb_fsbase = ucp->uc_mcontext.mc_fsbase; pcb->pcb_gsbase = ucp->uc_mcontext.mc_gsbase; @@ -559,7 +560,6 @@ sys_sigreturn(td, uap) #endif kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); - set_pcb_flags(pcb, PCB_FULL_IRET); return (EJUSTRETURN); } @@ -587,11 +587,11 @@ exec_setregs(struct thread *td, struct image_params *i else mtx_unlock(&dt_lock); + update_pcb_bases(pcb); pcb->pcb_fsbase = 0; pcb->pcb_gsbase = 0; clear_pcb_flags(pcb, PCB_32BIT); pcb->pcb_initial_fpucw = __INITIAL_FPUCW__; - set_pcb_flags(pcb, PCB_FULL_IRET); bzero((char *)regs, sizeof(struct trapframe)); regs->tf_rip = imgp->entry_addr; @@ -2135,6 +2135,7 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int f mcp->mc_flags = tp->tf_flags; mcp->mc_len = sizeof(*mcp); get_fpcontext(td, mcp, NULL, 0); + update_pcb_bases(pcb); mcp->mc_fsbase = pcb->pcb_fsbase; mcp->mc_gsbase = pcb->pcb_gsbase; mcp->mc_xfpustate = 0; @@ -2205,11 +2206,11 @@ set_mcontext(struct thread *td, mcontext_t *mcp) tp->tf_fs = mcp->mc_fs; tp->tf_gs = mcp->mc_gs; } + set_pcb_flags(pcb, PCB_FULL_IRET); if (mcp->mc_flags & _MC_HASBASES) { pcb->pcb_fsbase = mcp->mc_fsbase; pcb->pcb_gsbase = mcp->mc_gsbase; } - set_pcb_flags(pcb, PCB_FULL_IRET); return (0); } @@ -2478,6 +2479,71 @@ user_dbreg_trap(void) * None of the breakpoints are in user space. */ return 0; +} + +/* + * The pcb_flags is only modified by current thread, or by other threads + * when current thread is stopped. However, current thread may change it + * from the interrupt context in cpu_switch(), or in the trap handler. + * When we read-modify-write pcb_flags from C sources, compiler may generate + * code that is not atomic regarding the interrupt handler. If a trap or + * interrupt happens and any flag is modified from the handler, it can be + * clobbered with the cached value later. Therefore, we implement setting + * and clearing flags with single-instruction functions, which do not race + * with possible modification of the flags from the trap or interrupt context, + * because traps and interrupts are executed only on instruction boundary. + */ +void +set_pcb_flags_raw(struct pcb *pcb, const u_int flags) +{ + + __asm __volatile("orl %1,%0" + : "=m" (pcb->pcb_flags) : "ir" (flags), "m" (pcb->pcb_flags) + : "cc", "memory"); + +} + +/* + * The support for RDFSBASE, WRFSBASE and similar instructions for %gs + * base requires that kernel saves MSR_FSBASE and MSR_{K,}GSBASE into + * pcb if user space modified the bases. We must save on the context + * switch or if the return to usermode happens through the doreti. + * + * Tracking of both events is performed by the pcb flag PCB_FULL_IRET, + * which have a consequence that the base MSRs must be saved each time + * the PCB_FULL_IRET flag is set. We disable interrupts to sync with + * context switches. + */ +void +set_pcb_flags(struct pcb *pcb, const u_int flags) +{ + register_t r; + + if (curpcb == pcb && + (flags & PCB_FULL_IRET) != 0 && + (pcb->pcb_flags & PCB_FULL_IRET) == 0 && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) { + r = intr_disable(); + if ((pcb->pcb_flags & PCB_FULL_IRET) == 0) { + if (rfs() == _ufssel) + pcb->pcb_fsbase = rdfsbase(); + if (rgs() == _ugssel) + pcb->pcb_gsbase = rdmsr(MSR_KGSBASE); + } + set_pcb_flags_raw(pcb, flags); + intr_restore(r); + } else { + set_pcb_flags_raw(pcb, flags); + } +} + +void +clear_pcb_flags(struct pcb *pcb, const u_int flags) +{ + + __asm __volatile("andl %1,%0" + : "=m" (pcb->pcb_flags) : "ir" (~flags), "m" (pcb->pcb_flags) + : "cc", "memory"); } #ifdef KDB Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Mon Aug 21 17:35:04 2017 (r322761) +++ head/sys/amd64/amd64/ptrace_machdep.c Mon Aug 21 17:38:02 2017 (r322762) @@ -117,15 +117,17 @@ cpu_ptrace_xstate(struct thread *td, int req, void *ad static void cpu_ptrace_setbase(struct thread *td, int req, register_t r) { + struct pcb *pcb; + pcb = td->td_pcb; + set_pcb_flags(pcb, PCB_FULL_IRET); if (req == PT_SETFSBASE) { - td->td_pcb->pcb_fsbase = r; + pcb->pcb_fsbase = r; td->td_frame->tf_fs = _ufssel; } else { - td->td_pcb->pcb_gsbase = r; + pcb->pcb_gsbase = r; td->td_frame->tf_gs = _ugssel; } - set_pcb_flags(td->td_pcb, PCB_FULL_IRET); } #ifdef COMPAT_FREEBSD32 @@ -136,6 +138,7 @@ static int cpu32_ptrace(struct thread *td, int req, void *addr, int data) { struct savefpu *fpstate; + struct pcb *pcb; uint32_t r; int error; @@ -167,8 +170,10 @@ cpu32_ptrace(struct thread *td, int req, void *addr, i error = EINVAL; break; } - r = req == PT_GETFSBASE ? td->td_pcb->pcb_fsbase : - td->td_pcb->pcb_gsbase; + pcb = td->td_pcb; + if (td == curthread) + update_pcb_bases(pcb); + r = req == PT_GETFSBASE ? pcb->pcb_fsbase : pcb->pcb_gsbase; error = copyout(&r, addr, sizeof(r)); break; @@ -197,6 +202,7 @@ int cpu_ptrace(struct thread *td, int req, void *addr, int data) { register_t *r, rv; + struct pcb *pcb; int error; #ifdef COMPAT_FREEBSD32 @@ -221,8 +227,10 @@ cpu_ptrace(struct thread *td, int req, void *addr, int case PT_GETFSBASE: case PT_GETGSBASE: - r = req == PT_GETFSBASE ? &td->td_pcb->pcb_fsbase : - &td->td_pcb->pcb_gsbase; + pcb = td->td_pcb; + if (td == curthread) + update_pcb_bases(pcb); + r = req == PT_GETFSBASE ? &pcb->pcb_fsbase : &pcb->pcb_gsbase; error = copyout(r, addr, sizeof(*r)); break; Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Mon Aug 21 17:35:04 2017 (r322761) +++ head/sys/amd64/amd64/sys_machdep.c Mon Aug 21 17:38:02 2017 (r322762) @@ -254,39 +254,45 @@ sysarch(struct thread *td, struct sysarch_args *uap) error = amd64_set_ioperm(td, &iargs); break; case I386_GET_FSBASE: + update_pcb_bases(pcb); i386base = pcb->pcb_fsbase; error = copyout(&i386base, uap->parms, sizeof(i386base)); break; case I386_SET_FSBASE: error = copyin(uap->parms, &i386base, sizeof(i386base)); if (!error) { + set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_fsbase = i386base; td->td_frame->tf_fs = _ufssel; update_gdt_fsbase(td, i386base); } break; case I386_GET_GSBASE: + update_pcb_bases(pcb); i386base = pcb->pcb_gsbase; error = copyout(&i386base, uap->parms, sizeof(i386base)); break; case I386_SET_GSBASE: error = copyin(uap->parms, &i386base, sizeof(i386base)); if (!error) { + set_pcb_flags(pcb, PCB_FULL_IRET); pcb->pcb_gsbase = i386base; td->td_frame->tf_gs = _ugssel; update_gdt_gsbase(td, i386base); } break; case AMD64_GET_FSBASE: - error = copyout(&pcb->pcb_fsbase, uap->parms, sizeof(pcb->pcb_fsbase)); + update_pcb_bases(pcb); + error = copyout(&pcb->pcb_fsbase, uap->parms, + sizeof(pcb->pcb_fsbase)); break; case AMD64_SET_FSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); if (!error) { if (a64base < VM_MAXUSER_ADDRESS) { - pcb->pcb_fsbase = a64base; set_pcb_flags(pcb, PCB_FULL_IRET); + pcb->pcb_fsbase = a64base; td->td_frame->tf_fs = _ufssel; } else error = EINVAL; @@ -294,15 +300,17 @@ sysarch(struct thread *td, struct sysarch_args *uap) break; case AMD64_GET_GSBASE: - error = copyout(&pcb->pcb_gsbase, uap->parms, sizeof(pcb->pcb_gsbase)); + update_pcb_bases(pcb); + error = copyout(&pcb->pcb_gsbase, uap->parms, + sizeof(pcb->pcb_gsbase)); break; case AMD64_SET_GSBASE: error = copyin(uap->parms, &a64base, sizeof(a64base)); if (!error) { if (a64base < VM_MAXUSER_ADDRESS) { - pcb->pcb_gsbase = a64base; set_pcb_flags(pcb, PCB_FULL_IRET); + pcb->pcb_gsbase = a64base; td->td_frame->tf_gs = _ugssel; } else error = EINVAL; Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Mon Aug 21 17:35:04 2017 (r322761) +++ head/sys/amd64/amd64/vm_machdep.c Mon Aug 21 17:38:02 2017 (r322762) @@ -238,7 +238,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t pcb2->pcb_tssp = NULL; /* New segment registers. */ - set_pcb_flags(pcb2, PCB_FULL_IRET); + set_pcb_flags_raw(pcb2, PCB_FULL_IRET); /* Copy the LDT, if necessary. */ mdp1 = &td1->td_proc->p_md; @@ -439,7 +439,7 @@ cpu_copy_thread(struct thread *td, struct thread *td0) pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, cpu_max_ext_state_size); - set_pcb_flags(pcb2, PCB_FULL_IRET); + set_pcb_flags_raw(pcb2, PCB_FULL_IRET); /* * Create a new fresh stack for the new thread. Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Mon Aug 21 17:35:04 2017 (r322761) +++ head/sys/amd64/include/asmacros.h Mon Aug 21 17:38:02 2017 (r322762) @@ -177,7 +177,12 @@ movw %es,TF_ES(%rsp) ; \ movw %ds,TF_DS(%rsp) ; \ movl $TF_HASSEGS,TF_FLAGS(%rsp) ; \ - cld + cld ; \ + testb $SEL_RPL_MASK,TF_CS(%rsp) ; /* come from kernel ? */ \ + jz 2f ; /* yes, leave PCB_FULL_IRET alone */ \ + movq PCPU(CURPCB),%r8 ; \ + andl $~PCB_FULL_IRET,PCB_FLAGS(%r8) ; \ +2: #define POP_FRAME \ movq TF_RDI(%rsp),%rdi ; \ Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Mon Aug 21 17:35:04 2017 (r322761) +++ head/sys/amd64/include/pcb.h Mon Aug 21 17:38:02 2017 (r322762) @@ -119,40 +119,15 @@ struct susppcb { #ifdef _KERNEL struct trapframe; -/* - * The pcb_flags is only modified by current thread, or by other threads - * when current thread is stopped. However, current thread may change it - * from the interrupt context in cpu_switch(), or in the trap handler. - * When we read-modify-write pcb_flags from C sources, compiler may generate - * code that is not atomic regarding the interrupt handler. If a trap or - * interrupt happens and any flag is modified from the handler, it can be - * clobbered with the cached value later. Therefore, we implement setting - * and clearing flags with single-instruction functions, which do not race - * with possible modification of the flags from the trap or interrupt context, - * because traps and interrupts are executed only on instruction boundary. - */ -static __inline void -set_pcb_flags(struct pcb *pcb, const u_int flags) -{ - - __asm __volatile("orl %1,%0" - : "=m" (pcb->pcb_flags) : "ir" (flags), "m" (pcb->pcb_flags) - : "cc"); -} - -static __inline void -clear_pcb_flags(struct pcb *pcb, const u_int flags) -{ - - __asm __volatile("andl %1,%0" - : "=m" (pcb->pcb_flags) : "ir" (~flags), "m" (pcb->pcb_flags) - : "cc"); -} - +void clear_pcb_flags(struct pcb *pcb, const u_int flags); void makectx(struct trapframe *, struct pcb *); +void set_pcb_flags(struct pcb *pcb, const u_int flags); +void set_pcb_flags_raw(struct pcb *pcb, const u_int flags); int savectx(struct pcb *) __returns_twice; void resumectx(struct pcb *); +/* Ensure that pcb_gsbase and pcb_fsbase are up to date */ +#define update_pcb_bases(pcb) set_pcb_flags((pcb), PCB_FULL_IRET) #endif #endif /* _AMD64_PCB_H_ */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Aug 21 17:35:04 2017 (r322761) +++ head/sys/sys/param.h Mon Aug 21 17:38:02 2017 (r322762) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200040 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200041 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, @@ -83,6 +83,7 @@ #define P_OSREL_MAP_FSTRICT 1100036 #define P_OSREL_SHUTDOWN_ENOTCONN 1100077 #define P_OSREL_MAP_GUARD 1200035 +#define P_OSREL_WRFSBASE 1200041 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif From owner-svn-src-head@freebsd.org Mon Aug 21 17:39:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5713DEA383; Mon, 21 Aug 2017 17:39:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F94F7D1E5; Mon, 21 Aug 2017 17:39:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7LHdDlG023812; Mon, 21 Aug 2017 17:39:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LHdD6k023805; Mon, 21 Aug 2017 17:39:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708211739.v7LHdD6k023805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Aug 2017 17:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322763 - head/lib/libc/amd64/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/amd64/sys X-SVN-Commit-Revision: 322763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 17:39:14 -0000 Author: kib Date: Mon Aug 21 17:39:12 2017 New Revision: 322763 URL: https://svnweb.freebsd.org/changeset/base/322763 Log: Optimize libc to get and set TLS using the RDFSBASE and RDGSBASE instructions, if supported both by CPU and kernel. Reviewed by: jhb (previous version) Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D12023 Added: head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c (contents, props changed) head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h (contents, props changed) Modified: head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/amd64/sys/amd64_get_fsbase.c head/lib/libc/amd64/sys/amd64_get_gsbase.c head/lib/libc/amd64/sys/amd64_set_fsbase.c head/lib/libc/amd64/sys/amd64_set_gsbase.c Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Mon Aug 21 17:38:02 2017 (r322762) +++ head/lib/libc/amd64/sys/Makefile.inc Mon Aug 21 17:39:12 2017 (r322763) @@ -1,7 +1,11 @@ # from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp # $FreeBSD$ -SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ +SRCS+= \ + amd64_detect_rdfsgsbase.c \ + amd64_get_fsbase.c \ + amd64_get_gsbase.c \ + amd64_set_fsbase.c \ amd64_set_gsbase.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ Added: head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c Mon Aug 21 17:39:12 2017 (r322763) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2017 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#define IN_RTLD 1 +#include +#undef IN_RTLD +#include +#include +#include "amd64_detect_rdfsgsbase.h" +#include "libc_private.h" + +static int state = RDFSGS_UNKNOWN; + +int +amd64_detect_rdfsgsbase(void) +{ + u_int p[4]; + + if (__predict_true(state != RDFSGS_UNKNOWN)) + return (state); + + if (__getosreldate() >= P_OSREL_WRFSBASE) { + do_cpuid(0x0, p); + if (p[0] >= 0x7) { + cpuid_count(0x7, 0x0, p); + if ((p[1] & CPUID_STDEXT_FSGSBASE) != 0) { + state = RDFSGS_SUPPORTED; + return (state); + } + } + } + state = RDFSGS_UNSUPPORTED; + return (state); +} Added: head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h Mon Aug 21 17:39:12 2017 (r322763) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2017 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _AMD64_DETECT_RDFSGSBASE_H_ +#define _AMD64_DETECT_RDFSGSBASE_H_ + +enum { + RDFSGS_UNKNOWN, + RDFSGS_SUPPORTED, + RDFSGS_UNSUPPORTED, +}; + +int amd64_detect_rdfsgsbase(void); + +#endif Modified: head/lib/libc/amd64/sys/amd64_get_fsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_get_fsbase.c Mon Aug 21 17:38:02 2017 (r322762) +++ head/lib/libc/amd64/sys/amd64_get_fsbase.c Mon Aug 21 17:39:12 2017 (r322763) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,11 +31,18 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include +#include "amd64_detect_rdfsgsbase.h" int amd64_get_fsbase(void **addr) { + if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { + *addr = (void *)rdfsbase(); + return (0); + } return (sysarch(AMD64_GET_FSBASE, addr)); } Modified: head/lib/libc/amd64/sys/amd64_get_gsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_get_gsbase.c Mon Aug 21 17:38:02 2017 (r322762) +++ head/lib/libc/amd64/sys/amd64_get_gsbase.c Mon Aug 21 17:39:12 2017 (r322763) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,11 +31,18 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include +#include "amd64_detect_rdfsgsbase.h" int amd64_get_gsbase(void **addr) { + if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { + *addr = (void *)rdgsbase(); + return (0); + } return (sysarch(AMD64_GET_GSBASE, addr)); } Modified: head/lib/libc/amd64/sys/amd64_set_fsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_set_fsbase.c Mon Aug 21 17:38:02 2017 (r322762) +++ head/lib/libc/amd64/sys/amd64_set_fsbase.c Mon Aug 21 17:39:12 2017 (r322763) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,11 +31,18 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include +#include "amd64_detect_rdfsgsbase.h" int amd64_set_fsbase(void *addr) { + if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { + wrfsbase((uintptr_t)addr); + return (0); + } return (sysarch(AMD64_SET_FSBASE, &addr)); } Modified: head/lib/libc/amd64/sys/amd64_set_gsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_set_gsbase.c Mon Aug 21 17:38:02 2017 (r322762) +++ head/lib/libc/amd64/sys/amd64_set_gsbase.c Mon Aug 21 17:39:12 2017 (r322763) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,11 +31,18 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include +#include "amd64_detect_rdfsgsbase.h" int amd64_set_gsbase(void *addr) { + if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { + wrgsbase((uintptr_t)addr); + return (0); + } return (sysarch(AMD64_SET_GSBASE, &addr)); } From owner-svn-src-head@freebsd.org Mon Aug 21 17:45:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB43DDEA919; Mon, 21 Aug 2017 17:45:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 87A3B7D796; Mon, 21 Aug 2017 17:45:07 +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 v7LHj6t5027647; Mon, 21 Aug 2017 17:45:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LHj686027646; Mon, 21 Aug 2017 17:45:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708211745.v7LHj686027646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Aug 2017 17:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322765 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Commit-Revision: 322765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 17:45:07 -0000 Author: jhb Date: Mon Aug 21 17:45:06 2017 New Revision: 322765 URL: https://svnweb.freebsd.org/changeset/base/322765 Log: Add a guard around _ILP32 for mips. This is already done for other architectures in this file and fixes the build with clang. Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Mon Aug 21 17:40:51 2017 (r322764) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Mon Aug 21 17:45:06 2017 (r322765) @@ -525,7 +525,9 @@ extern "C" { /* * Define the appropriate "implementation choices". */ +#if !defined(_ILP32) #define _ILP32 +#endif #if !defined(_I32LPx) && defined(_KERNEL) #define _I32LPx #endif From owner-svn-src-head@freebsd.org Mon Aug 21 17:49:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F7A9DEAD5D; Mon, 21 Aug 2017 17:49:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6D6C77DB93; Mon, 21 Aug 2017 17:49:02 +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 v7LHn1JJ027911; Mon, 21 Aug 2017 17:49:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LHn1q7027907; Mon, 21 Aug 2017 17:49:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708211749.v7LHn1q7027907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Aug 2017 17:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322766 - in head/lib: libc/mips libcompiler_rt X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/lib: libc/mips libcompiler_rt X-SVN-Commit-Revision: 322766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 17:49:02 -0000 Author: jhb Date: Mon Aug 21 17:49:01 2017 New Revision: 322766 URL: https://svnweb.freebsd.org/changeset/base/322766 Log: Include {u,}{div,mod}si3() on mips in libcompiler_rt. These builtins were listed in the mips-specific Symbol.map for libc but were not implemented. Compiling mips with recent clang requires these symbols. Sponsored by: DARPA / AFRL Modified: head/lib/libc/mips/Symbol.map head/lib/libcompiler_rt/Makefile.inc Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Mon Aug 21 17:45:06 2017 (r322765) +++ head/lib/libc/mips/Symbol.map Mon Aug 21 17:49:01 2017 (r322766) @@ -43,10 +43,6 @@ FBSDprivate_1.0 { _set_tp; ___longjmp; - __umodsi3; - __modsi3; - __udivsi3; - __divsi3; __makecontext; __longjmp; signalcontext; Modified: head/lib/libcompiler_rt/Makefile.inc ============================================================================== --- head/lib/libcompiler_rt/Makefile.inc Mon Aug 21 17:45:06 2017 (r322765) +++ head/lib/libcompiler_rt/Makefile.inc Mon Aug 21 17:49:01 2017 (r322766) @@ -32,6 +32,7 @@ SRCF+= divdi3 SRCF+= divmoddi4 SRCF+= divmodsi4 SRCF+= divsc3 +SRCF+= divsi3 SRCF+= divtc3 SRCF+= divti3 SRCF+= divxc3 @@ -78,6 +79,7 @@ SRCF+= int_util SRCF+= lshrdi3 SRCF+= lshrti3 SRCF+= moddi3 +SRCF+= modsi3 SRCF+= modti3 SRCF+= muldc3 SRCF+= muldi3 @@ -120,8 +122,10 @@ SRCF+= udivdi3 SRCF+= udivmoddi4 SRCF+= udivmodsi4 SRCF+= udivmodti4 +SRCF+= udivsi3 SRCF+= udivti3 SRCF+= umoddi3 +SRCF+= umodsi3 SRCF+= umodti3 # __cpu_model support, only used on x86 @@ -174,13 +178,6 @@ SRCF+= truncdfsf2 .if ${MACHINE_CPUARCH} != "arm" SRCF+= comparedf2 SRCF+= comparesf2 -.endif - -.if ${MACHINE_CPUARCH} != "mips" -SRCF+= divsi3 -SRCF+= modsi3 -SRCF+= udivsi3 -SRCF+= umodsi3 .endif # FreeBSD-specific atomic intrinsics. From owner-svn-src-head@freebsd.org Mon Aug 21 17:52:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 251D3DEB18C; Mon, 21 Aug 2017 17:52:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id E6F367DF99; Mon, 21 Aug 2017 17:52:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7LHq9Uf030880; Mon, 21 Aug 2017 17:52:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LHq9rD030879; Mon, 21 Aug 2017 17:52:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708211752.v7LHq9rD030879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Aug 2017 17:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322767 - head/contrib/top X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/contrib/top X-SVN-Commit-Revision: 322767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 17:52:11 -0000 Author: jhb Date: Mon Aug 21 17:52:09 2017 New Revision: 322767 URL: https://svnweb.freebsd.org/changeset/base/322767 Log: Fix FreeBSD-presence macro to fix the build on mips with clang. GCC doesn't define 'mips' which is why it doesn't trip over this. Sponsored by: DARPA / AFRL Modified: head/contrib/top/loadavg.h Modified: head/contrib/top/loadavg.h ============================================================================== --- head/contrib/top/loadavg.h Mon Aug 21 17:49:01 2017 (r322766) +++ head/contrib/top/loadavg.h Mon Aug 21 17:52:09 2017 (r322767) @@ -19,7 +19,7 @@ * * Defined types: load_avg for load averages, pctcpu for cpu percentages. */ -#if defined(mips) && !(defined(NetBSD) || defined(FreeBSD)) +#if defined(mips) && !(defined(NetBSD) || defined(__FreeBSD__)) # include # if defined(FBITS) && !defined(FSCALE) # define FSCALE (1 << FBITS) /* RISC/os on mips */ From owner-svn-src-head@freebsd.org Mon Aug 21 18:12:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CC35DEC267; Mon, 21 Aug 2017 18:12:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5BE7B7EB5B; Mon, 21 Aug 2017 18:12:33 +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 v7LICW8t039996; Mon, 21 Aug 2017 18:12:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LICWEO039995; Mon, 21 Aug 2017 18:12:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708211812.v7LICWEO039995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 21 Aug 2017 18:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322769 - 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: 322769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 18:12:33 -0000 Author: andrew Date: Mon Aug 21 18:12:32 2017 New Revision: 322769 URL: https://svnweb.freebsd.org/changeset/base/322769 Log: Improve the performance of the arm64 thread switching code. The full system memory barrier around a TLB invalidation is stricter than required. It needs to wait on accesses to main memory, with just the weaker store variant before the invalidate. As such use the dsb istst, tlbi, dlb ish sequence already used in pmap. The tlbi instruction in this sequence is also unnecessarily using a broadcast invalidate when it just needs to invalidate the local CPUs TLB. Switch to a non-broadcast variant of this instruction. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/swtch.S Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Mon Aug 21 18:00:26 2017 (r322768) +++ head/sys/arm64/arm64/swtch.S Mon Aug 21 18:12:32 2017 (r322769) @@ -91,9 +91,9 @@ ENTRY(cpu_throw) isb /* Invalidate the TLB */ - dsb sy - tlbi vmalle1is - dsb sy + dsb ishst + tlbi vmalle1 + dsb ish isb /* If we are single stepping, enable it */ @@ -192,9 +192,9 @@ ENTRY(cpu_switch) isb /* Invalidate the TLB */ - dsb sy - tlbi vmalle1is - dsb sy + dsb ishst + tlbi vmalle1 + dsb ish isb /* From owner-svn-src-head@freebsd.org Mon Aug 21 20:23:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BEA4DCF45E; Mon, 21 Aug 2017 20:23:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id EDDFF8345C; Mon, 21 Aug 2017 20:23:06 +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 v7LKN6hf093358; Mon, 21 Aug 2017 20:23:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LKN654093357; Mon, 21 Aug 2017 20:23:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201708212023.v7LKN654093357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 21 Aug 2017 20:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322770 - head/usr.sbin/chown/tests X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/usr.sbin/chown/tests X-SVN-Commit-Revision: 322770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 20:23:07 -0000 Author: gjb Date: Mon Aug 21 20:23:05 2017 New Revision: 322770 URL: https://svnweb.freebsd.org/changeset/base/322770 Log: Apply changes from bin/chmod/tests/chmod_test.sh (r321949, r321950, and r322101), adding atf_expect_fail() before chflags(8) is invoked if the filesystem is ZFS, which does not support UF_IMMUTABLE. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/chown/tests/chown_test.sh Modified: head/usr.sbin/chown/tests/chown_test.sh ============================================================================== --- head/usr.sbin/chown/tests/chown_test.sh Mon Aug 21 18:12:32 2017 (r322769) +++ head/usr.sbin/chown/tests/chown_test.sh Mon Aug 21 20:23:05 2017 (r322770) @@ -25,6 +25,13 @@ # # $FreeBSD$ +get_filesystem() +{ + local mountpoint=$1 + + df -T $mountpoint | tail -n 1 | cut -wf 2 +} + atf_test_case RH_flag RH_flag_head() { @@ -98,6 +105,11 @@ f_flag_body() { atf_check truncate -s 0 foo bar atf_check chown 0:0 foo bar + case "$(get_filesystem .)" in + zfs) + atf_expect_fail "ZFS does not support UF_IMMUTABLE; returns EPERM" + ;; + esac atf_check chflags uchg foo atf_check -e not-empty -s not-exit:0 chown 42:42 foo bar atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar @@ -107,7 +119,7 @@ f_flag_body() f_flag_cleanup() { - atf_check chflags 0 foo + chflags 0 foo || : } atf_test_case h_flag @@ -144,6 +156,11 @@ v_flag_body() atf_check truncate -s 0 foo bar atf_check chown 0:0 foo atf_check chown 42:42 bar + case "$(get_filesystem .)" in + zfs) + atf_expect_fail "ZFS updates mode for foo unnecessarily" + ;; + esac atf_check -o 'inline:bar\n' chown -v 0:0 foo bar atf_check chown -v 0:0 foo bar for f in foo bar; do From owner-svn-src-head@freebsd.org Mon Aug 21 20:27:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FACBDCFB07; Mon, 21 Aug 2017 20:27:47 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2690838D0; Mon, 21 Aug 2017 20:27:46 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7LKRkg7093696; Mon, 21 Aug 2017 20:27:46 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LKRjHk093691; Mon, 21 Aug 2017 20:27:45 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201708212027.v7LKRjHk093691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 21 Aug 2017 20:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322771 - in head/sys: dev/qlxgbe modules/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: in head/sys: dev/qlxgbe modules/qlxgbe X-SVN-Commit-Revision: 322771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 20:27:47 -0000 Author: davidcs Date: Mon Aug 21 20:27:45 2017 New Revision: 322771 URL: https://svnweb.freebsd.org/changeset/base/322771 Log: Upgrade FW to 5.4.66 sysctls to display stats, stats polled every 2 seconds Modify QLA_LOCK()/QLA_UNLOCK() to not sleep after acquiring mtx_lock Add support to turn OFF/ON error recovery following heartbeat failure for debug purposes. Set default max values to 32 Tx/Rx/SDS rings MFC after:5 days Modified: head/sys/dev/qlxgbe/README.txt head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_inline.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_os.h head/sys/dev/qlxgbe/ql_reset.c head/sys/dev/qlxgbe/ql_ver.h head/sys/modules/qlxgbe/Makefile Modified: head/sys/dev/qlxgbe/README.txt ============================================================================== --- head/sys/dev/qlxgbe/README.txt Mon Aug 21 20:23:05 2017 (r322770) +++ head/sys/dev/qlxgbe/README.txt Mon Aug 21 20:27:45 2017 (r322771) @@ -61,14 +61,17 @@ following OS platforms: - kldunload if_qlxgbe 5. Parameters to set prior to installing the driver + Please run "sysctl kern.ipc" and "sysctl net.inet.tcp" and see if these + values are already greater than shown below. Change only those which + are less than shown below. - Add the following lines to /etc/sysctl.conf and reboot the machine prior to installing the driver - kern.ipc.nmbjumbo9=262144 + kern.ipc.nmbjumbo9=2000000 + kern.ipc.nmbclusters=1000000 net.inet.tcp.recvbuf_max=262144 net.inet.tcp.recvbuf_inc=16384 - kern.ipc.nmbclusters=1000000 kern.ipc.maxsockbuf=2097152 net.inet.tcp.recvspace=131072 net.inet.tcp.sendbuf_max=262144 @@ -78,10 +81,10 @@ following OS platforms: login or su to root - sysctl kern.ipc.nmbjumbo9=262144 + sysctl kern.ipc.nmbjumbo9=2000000 + sysctl kern.ipc.nmbclusters=1000000 sysctl net.inet.tcp.recvbuf_max=262144 sysctl net.inet.tcp.recvbuf_inc=16384 - sysctl kern.ipc.nmbclusters=1000000 sysctl kern.ipc.maxsockbuf=2097152 sysctl net.inet.tcp.recvspace=131072 sysctl net.inet.tcp.sendbuf_max=262144 Modified: head/sys/dev/qlxgbe/ql_boot.c ============================================================================== --- head/sys/dev/qlxgbe/ql_boot.c Mon Aug 21 20:23:05 2017 (r322770) +++ head/sys/dev/qlxgbe/ql_boot.c Mon Aug 21 20:27:45 2017 (r322771) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_bootloader_version_major = 5; unsigned int ql83xx_bootloader_version_minor = 4; -unsigned int ql83xx_bootloader_version_sub = 64; +unsigned int ql83xx_bootloader_version_sub = 66; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -10957,9 +10957,8 @@ unsigned char ql83xx_bootloader[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x95, 0x0e + 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x93, 0x0e }; unsigned int ql83xx_bootloader_len = 131072; - Modified: head/sys/dev/qlxgbe/ql_def.h ============================================================================== --- head/sys/dev/qlxgbe/ql_def.h Mon Aug 21 20:23:05 2017 (r322770) +++ head/sys/dev/qlxgbe/ql_def.h Mon Aug 21 20:27:45 2017 (r322771) @@ -110,6 +110,7 @@ typedef struct qla_ivec qla_ivec_t; typedef struct _qla_tx_ring { qla_tx_buf_t tx_buf[NUM_TX_DESCRIPTORS]; uint64_t count; + uint64_t iscsi_pkt_count; } qla_tx_ring_t; typedef struct _qla_tx_fp { @@ -123,25 +124,26 @@ typedef struct _qla_tx_fp { } qla_tx_fp_t; /* - * Adapter structure contains the hardware independent information of the + * Adapter structure contains the hardware independant information of the * pci function. */ struct qla_host { volatile struct { volatile uint32_t - qla_interface_up :1, qla_callout_init :1, qla_watchdog_active :1, - qla_watchdog_exit :1, - qla_watchdog_pause :1, - stop_rcv :1, parent_tag :1, lock_init :1; } flags; + volatile uint32_t qla_interface_up; + volatile uint32_t stop_rcv; + volatile uint32_t qla_watchdog_exit; volatile uint32_t qla_watchdog_exited; + volatile uint32_t qla_watchdog_pause; volatile uint32_t qla_watchdog_paused; volatile uint32_t qla_initiate_recovery; + volatile uint32_t qla_detach_active; device_t pci_dev; @@ -182,6 +184,7 @@ struct qla_host { struct mtx hw_lock; volatile uint32_t hw_lock_held; + uint64_t hw_lock_failed; /* transmit and receive buffers */ uint32_t txr_idx; /* index of the current tx ring */ @@ -221,6 +224,9 @@ struct qla_host { uint64_t tx_tso_frames; uint64_t hw_vlan_tx_frames; + struct task stats_task; + struct taskqueue *stats_tq; + uint32_t fw_ver_major; uint32_t fw_ver_minor; uint32_t fw_ver_sub; @@ -260,9 +266,7 @@ typedef struct qla_host qla_host_t; #define QL_ALIGN(size, align) (size + (align - 1)) & ~(align - 1); #define QL_MIN(x, y) ((x < y) ? x : y) -#define QL_RUNNING(ifp) \ - ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == \ - IFF_DRV_RUNNING) +#define QL_RUNNING(ifp) (ifp->if_drv_flags & IFF_DRV_RUNNING) /* Return 0, if identical, else 1 */ #define QL_MAC_CMP(mac1, mac2) \ Modified: head/sys/dev/qlxgbe/ql_fw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_fw.c Mon Aug 21 20:23:05 2017 (r322770) +++ head/sys/dev/qlxgbe/ql_fw.c Mon Aug 21 20:27:45 2017 (r322771) @@ -35,32 +35,32 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_firmware_version_major = 5; unsigned int ql83xx_firmware_version_minor = 4; -unsigned int ql83xx_firmware_version_sub = 64; +unsigned int ql83xx_firmware_version_sub = 66; unsigned char ql83xx_firmware[] = { - 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe4, 0x42, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x7e, 0x74, 0x37, 0x27, 0xc9, 0xab, 0x39, + 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe8, 0x46, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x64, 0x27, 0xbc, 0x1f, 0xfc, 0x30, 0xf6, 0x92, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0xef, 0x03, 0x00, + 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0xf2, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x44, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x52, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0xf9, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x9f, 0x90, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x46, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x9f, 0x4e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xfc, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf7, 0x90, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x54, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xa1, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfc, 0x89, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x73, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xab, 0x8d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x74, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -69,118 +69,118 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x6f, 0x94, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1f, 0x98, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xec, 0xa9, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9b, 0xad, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xd0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0xae, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xde, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0xb2, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xdd, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x9a, 0xb9, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1a, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5a, 0xbd, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2a, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9f, 0xd8, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5d, 0xdc, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0xe4, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xbe, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xa0, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0xe8, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xbd, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xb0, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x47, 0xeb, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x73, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0xef, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x71, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xba, 0x0e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x73, 0x12, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x19, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x84, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x1d, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x81, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x50, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x45, 0x36, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x29, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x67, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfc, 0x39, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2a, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6e, 0x3f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x26, 0x43, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x47, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xcc, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x4b, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x51, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xdc, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xd3, 0x4a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x25, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x67, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x8e, 0x4e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x26, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf8, 0x4c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x0a, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xb4, 0x50, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x0a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x57, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xb7, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x5b, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xbb, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x79, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x44, 0xa1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x38, 0x7c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0xa1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xbd, 0x19, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xb4, 0x1d, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x77, 0x1a, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3e, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xd1, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6e, 0x1e, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -189,7 +189,7 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xb5, 0x3f, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xb6, 0x43, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x58, 0xe0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -232,9 +232,9 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x49, 0x1a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xcb, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xe8, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x92, 0x05, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x4d, 0x1a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xcc, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xf8, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x92, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -249,143325 +249,143383 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xda, 0xec, 0x3d, - 0x0b, 0x70, 0x5c, 0xd5, 0x75, 0xf7, 0x7d, 0x76, 0xf7, 0x69, 0x3f, 0xd2, - 0x1a, 0x64, 0x22, 0x84, 0x1c, 0x3f, 0xd9, 0xc6, 0x16, 0xdf, 0xac, 0x8d, - 0x6d, 0x8c, 0x31, 0xf5, 0x93, 0x2c, 0x3b, 0xb6, 0x23, 0x11, 0x01, 0x29, - 0xff, 0x8f, 0x48, 0x5a, 0x2a, 0x13, 0x82, 0xc5, 0x94, 0xa4, 0x32, 0x50, - 0xfc, 0x24, 0x4b, 0xb2, 0x09, 0x72, 0x22, 0x63, 0xc7, 0x38, 0x84, 0x86, - 0x95, 0x8c, 0x29, 0x6d, 0x99, 0x74, 0x99, 0x64, 0x02, 0xd3, 0x76, 0x86, - 0xc5, 0xce, 0x04, 0x93, 0xe2, 0xd4, 0x9d, 0x0e, 0x6d, 0x08, 0x43, 0xb3, - 0x9d, 0x94, 0x19, 0x95, 0x10, 0xb2, 0xed, 0x74, 0x88, 0x9c, 0xd4, 0xd0, - 0x7b, 0xee, 0xe7, 0x7d, 0xee, 0xbe, 0xf7, 0x76, 0xaf, 0x2c, 0x3b, 0xd3, - 0x8e, 0x95, 0x99, 0xa0, 0xe3, 0x7b, 0xef, 0x79, 0xe7, 0x9e, 0x7b, 0xee, - 0xf9, 0xbf, 0x27, 0xa4, 0x20, 0xfa, 0xa3, 0x23, 0x0d, 0xa9, 0xe8, 0x6e, - 0x74, 0x16, 0xfe, 0xbf, 0x09, 0xd3, 0x9f, 0x5e, 0x06, 0x1f, 0x7f, 0xef, - 0x1d, 0xf2, 0xbf, 0x2f, 0x55, 0xc0, 0xfe, 0x9f, 0x82, 0x00, 0xe7, 0x25, - 0x61, 0x5b, 0x45, 0x26, 0xf9, 0x65, 0x6f, 0x82, 0xfc, 0xa7, 0xbf, 0x62, - 0xbe, 0x82, 0x6c, 0x2b, 0xeb, 0x81, 0xd9, 0xef, 0x66, 0x3e, 0x4d, 0xe9, - 0x45, 0x45, 0x8d, 0x93, 0x8e, 0x50, 0x5d, 0x5e, 0xa7, 0x40, 0xcf, 0xad, - 0xf4, 0xe7, 0xde, 0xb0, 0xe7, 0x6d, 0x44, 0x21, 0xcf, 0x93, 0x84, 0x39, - 0xbe, 0x63, 0xb3, 0x8c, 0x6f, 0x91, 0x32, 0xbb, 0xf8, 0x96, 0xcd, 0x32, - 0xbe, 0xad, 0xea, 0xcc, 0xf0, 0xf1, 0xf5, 0xb7, 0xe9, 0x33, 0x5a, 0x1f, - 0x20, 0x6f, 0x39, 0x1b, 0x50, 0x5d, 0xb4, 0xec, 0xce, 0x4d, 0x73, 0xd0, - 0xf0, 0x37, 0x30, 0x4a, 0x80, 0x8f, 0xb7, 0x0d, 0xbf, 0xf9, 0xa3, 0x2e, - 0x25, 0xbb, 0x07, 0x2f, 0x01, 0x38, 0x7f, 0xdf, 0xbc, 0x35, 0xab, 0x11, - 0x19, 0x2f, 0xf3, 0xf1, 0xf7, 0xef, 0x57, 0xf2, 0x78, 0x3c, 0x37, 0x08, - 0xeb, 0xef, 0xbd, 0xe1, 0xb5, 0xcb, 0x17, 0xd2, 0xf5, 0x83, 0x6c, 0xbc, - 0x7e, 0x8f, 0x92, 0x7b, 0x02, 0xaf, 0x1f, 0xe4, 0xf8, 0xff, 0x91, 0xae, - 0x1f, 0xf4, 0xe3, 0xcf, 0x0d, 0x61, 0xb8, 0x67, 0xd3, 0xe5, 0xb1, 0x8b, - 0x2e, 0xa3, 0xeb, 0x87, 0xd8, 0xf8, 0xf5, 0x6f, 0x2a, 0x3d, 0x7b, 0xf1, - 0x7a, 0x80, 0x7b, 0x57, 0xdf, 0xfa, 0xdc, 0x7d, 0x71, 0xba, 0x9e, 0x8f, - 0x3f, 0xf8, 0x6b, 0xa5, 0x77, 0x1c, 0xaf, 0xdf, 0xe1, 0xe0, 0x57, 0xc8, - 0xfa, 0x1d, 0x02, 0xfd, 0x00, 0xe7, 0x5f, 0xf9, 0xcf, 0x45, 0x2b, 0x0d, - 0xba, 0x9e, 0x8f, 0xbf, 0x7c, 0x35, 0xea, 0x81, 0xe7, 0x0f, 0x63, 0xb8, - 0x3f, 0xfb, 0x9a, 0xd5, 0x48, 0xf7, 0xd7, 0x3f, 0xcc, 0xc6, 0x7f, 0x7a, - 0xc7, 0xa3, 0x06, 0xc6, 0x5f, 0x00, 0xb8, 0x37, 0x3d, 0x9a, 0xcb, 0x36, - 0xd3, 0xf5, 0x7c, 0x7c, 0xcd, 0xe7, 0x1f, 0xdd, 0x05, 0xcf, 0x1f, 0x01, - 0xfa, 0x8d, 0xf5, 0x66, 0x9a, 0xed, 0x7f, 0x84, 0x8d, 0x77, 0x0c, 0x3f, - 0x6a, 0xc0, 0xf3, 0x01, 0xb6, 0x74, 0x3d, 0x6b, 0xa4, 0xe9, 0x7a, 0x3e, - 0xfe, 0x07, 0xcf, 0x3d, 0xba, 0x0b, 0x9e, 0x3f, 0xaa, 0xbb, 0xe7, 0x81, - 0xf1, 0xf5, 0x0b, 0x70, 0x41, 0x80, 0xcb, 0x02, 0x9c, 0xdb, 0x29, 0xac, - 0x17, 0xe0, 0x82, 0x00, 0x97, 0x05, 0x38, 0xb7, 0x0b, 0xe8, 0x6b, 0xdc, - 0x70, 0x77, 0x8b, 0x99, 0x5d, 0xf1, 0x14, 0x5e, 0x0f, 0x70, 0x3e, 0xf7, - 0x79, 0xfd, 0x92, 0xad, 0xdb, 0x61, 0x7f, 0x05, 0x80, 0x7b, 0x9a, 0x76, - 0x3e, 0xd0, 0x78, 0x11, 0x19, 0x2f, 0xf3, 0xf1, 0xee, 0x3d, 0xdb, 0x61, - 0x7f, 0xb9, 0xc7, 0x80, 0x3f, 0x2d, 0x87, 0x15, 0x7d, 0x19, 0x5d, 0xff, - 0x18, 0x1b, 0xdf, 0xfa, 0xdd, 0xed, 0xb0, 0xbf, 0x02, 0xc0, 0xfd, 0x2d, - 0x4a, 0xd6, 0xb8, 0x9a, 0xae, 0xe7, 0xe3, 0x7b, 0xde, 0xdc, 0x6e, 0x60, - 0xf9, 0xc8, 0x7d, 0x95, 0xd2, 0xb3, 0xb8, 0xc5, 0xa4, 0xf4, 0x13, 0x38, - 0x95, 0x46, 0x46, 0xf7, 0xdd, 0x84, 0x7e, 0x36, 0xbe, 0x9c, 0x8d, 0x97, - 0x09, 0xfc, 0xb8, 0xc2, 0xc7, 0x73, 0x8f, 0x0b, 0xfb, 0x17, 0xe0, 0x82, - 0x00, 0x97, 0x05, 0x38, 0x37, 0x26, 0xac, 0x17, 0xe0, 0x82, 0x00, 0x97, - 0x05, 0x38, 0xb7, 0x5b, 0x58, 0x2f, 0xc0, 0x05, 0x01, 0x2e, 0x0b, 0x70, - 0xee, 0x6b, 0xc2, 0x7a, 0x01, 0x2e, 0x08, 0x70, 0x59, 0x80, 0x73, 0x5f, - 0x17, 0xd6, 0x0b, 0x70, 0x41, 0x80, 0xcb, 0x02, 0x9c, 0xb3, 0x30, 0x6c, - 0xf7, 0xbd, 0x1f, 0xe7, 0xeb, 0x01, 0x2e, 0x2d, 0xfc, 0xe9, 0x57, 0xf8, - 0x7a, 0x80, 0x8b, 0xbf, 0x39, 0x3a, 0xaa, 0xb1, 0xf5, 0x00, 0xe7, 0x5f, - 0xfc, 0xe8, 0x43, 0x06, 0xe7, 0xda, 0x31, 0x9c, 0xdd, 0xbd, 0xa2, 0xce, - 0x62, 0xeb, 0x01, 0xee, 0xef, 0x5c, 0xb8, 0x8d, 0xc1, 0x05, 0x80, 0x7b, - 0xe6, 0xef, 0xd9, 0xbd, 0x8e, 0xad, 0x07, 0x38, 0xf7, 0xcf, 0x3b, 0x4f, - 0x32, 0x38, 0xd7, 0x21, 0xd0, 0x2f, 0xc0, 0x05, 0x01, 0x2e, 0x0b, 0x70, - 0x6e, 0x9d, 0xb0, 0x5e, 0x80, 0x0b, 0x02, 0x5c, 0x16, 0xe0, 0x5c, 0xa7, - 0xb0, 0x5e, 0x80, 0x0b, 0x02, 0x5c, 0x16, 0xe0, 0xdc, 0x7a, 0x61, 0xbd, - 0x00, 0x17, 0x04, 0xb8, 0x2c, 0xc0, 0xb9, 0x0d, 0xc2, 0x7a, 0x01, 0x2e, - 0x08, 0x70, 0x59, 0x80, 0x73, 0x9f, 0x16, 0xd6, 0x0b, 0x70, 0x41, 0x80, - 0xcb, 0x02, 0x9c, 0xdb, 0x08, 0xe7, 0xf3, 0xfb, 0x6f, 0xf2, 0xf3, 0xec, - 0x07, 0xf8, 0xf8, 0x97, 0xdf, 0xe1, 0x70, 0x81, 0x8c, 0xef, 0x7f, 0x97, - 0xc3, 0x65, 0x32, 0xfe, 0xfd, 0x5f, 0x3a, 0xe7, 0xbf, 0x09, 0xee, 0xff, - 0xd5, 0x7f, 0x75, 0x92, 0xaf, 0x27, 0xf0, 0x6d, 0xdf, 0xe3, 0x70, 0x81, - 0xc0, 0x0f, 0x8f, 0x70, 0xb8, 0x0c, 0x70, 0xf9, 0x99, 0xaf, 0x71, 0x38, - 0xb7, 0x19, 0xe0, 0x57, 0xc6, 0x9d, 0xf5, 0x04, 0xfe, 0xd9, 0x37, 0x9d, - 0xf5, 0x00, 0xa3, 0x39, 0x0b, 0x4e, 0xf0, 0xf5, 0x00, 0x8f, 0xaf, 0xb8, - 0x84, 0xc3, 0xb9, 0xcf, 0x60, 0xd8, 0xec, 0xd0, 0x39, 0xdc, 0x0f, 0x70, - 0xe1, 0x9e, 0x0c, 0x87, 0x0b, 0x00, 0x5b, 0xbb, 0xb2, 0xce, 0x7a, 0x80, - 0x8f, 0xbf, 0x70, 0xbe, 0xb3, 0xbe, 0x0b, 0xf0, 0x17, 0x5f, 0x73, 0xf6, - 0xdf, 0x45, 0xf9, 0x53, 0xe6, 0xeb, 0x05, 0xb8, 0x2c, 0xc0, 0xb9, 0x6e, - 0x3f, 0xdc, 0x2f, 0xc0, 0x05, 0x01, 0x2e, 0x0b, 0x70, 0xee, 0x5a, 0x61, - 0xbd, 0x00, 0x17, 0x04, 0xb8, 0x2c, 0xc0, 0xb9, 0xcf, 0x0a, 0xeb, 0x05, - 0xb8, 0x20, 0xc0, 0x65, 0x01, 0xf6, 0xfb, 0x77, 0x95, 0xfe, 0xc1, 0x1c, - 0x2f, 0x5c, 0xd5, 0xdf, 0x30, 0xf9, 0x6f, 0x0a, 0x73, 0x2a, 0xd9, 0xc3, - 0x1a, 0x14, 0xc7, 0xc9, 0xac, 0xe2, 0xaf, 0xf4, 0x2b, 0x96, 0x47, 0x3e, - 0x29, 0xbe, 0x58, 0x0c, 0xeb, 0x7f, 0xf0, 0xb9, 0xf1, 0xf8, 0xad, 0x31, - 0x36, 0xf6, 0xd1, 0x7c, 0x64, 0xf6, 0x54, 0xc7, 0x27, 0x47, 0x3f, 0xbb, - 0x1b, 0xa5, 0x8f, 0xe9, 0xcf, 0x56, 0x79, 0x7f, 0x6a, 0x56, 0xe1, 0x42, - 0xf5, 0xf3, 0x91, 0x83, 0xd9, 0xfe, 0xca, 0x21, 0xfb, 0xab, 0xfa, 0xbc, - 0x2a, 0xeb, 0xab, 0xc6, 0x2b, 0x92, 0xcf, 0xb3, 0x1d, 0x5d, 0x65, 0x71, - 0xf9, 0xc9, 0xb0, 0x78, 0xa5, 0x0f, 0x8f, 0x2a, 0x4e, 0x3c, 0x83, 0x90, - 0x41, 0xc6, 0x5d, 0xe5, 0x6c, 0xa2, 0x03, 0x47, 0x94, 0x41, 0x94, 0x2d, - 0x22, 0xa3, 0x89, 0xce, 0x37, 0x87, 0xf0, 0x7c, 0x74, 0xa9, 0xca, 0x50, - 0x7f, 0x1c, 0x2c, 0x3f, 0x69, 0x3f, 0x7e, 0xf4, 0x06, 0x1b, 0x9a, 0x62, - 0xf0, 0xef, 0xf6, 0xfc, 0xaa, 0xf1, 0xeb, 0x2c, 0x7c, 0x6a, 0xf7, 0xff, - 0xf4, 0xc3, 0xb3, 0x4b, 0x8f, 0x89, 0x84, 0xfc, 0x03, 0xfe, 0x87, 0xdf, - 0x6b, 0xf6, 0xcc, 0x67, 0xfa, 0xd7, 0x19, 0x47, 0x3f, 0x40, 0x7e, 0xf9, - 0xce, 0xa6, 0xfd, 0x30, 0xdc, 0xa8, 0x38, 0x72, 0xef, 0x15, 0x5e, 0x94, - 0xcc, 0x0d, 0x77, 0xb4, 0xb7, 0x51, 0xfe, 0x62, 0xfc, 0xc9, 0x66, 0x7a, - 0xbf, 0x4c, 0xd5, 0xab, 0x8f, 0xed, 0x93, 0xa7, 0x43, 0x1f, 0x57, 0x87, - 0x1b, 0x3c, 0x60, 0x2d, 0xcf, 0xe7, 0xf3, 0xed, 0x7a, 0xb9, 0xf9, 0x68, - 0x9e, 0x24, 0xfe, 0x4b, 0x24, 0xf1, 0xaf, 0x96, 0xc4, 0xbf, 0x51, 0x12, - 0xff, 0x4d, 0x92, 0xf8, 0xff, 0x50, 0x12, 0xff, 0x83, 0x92, 0xf8, 0x87, - 0x24, 0xf1, 0xef, 0x91, 0xc4, 0xff, 0x8c, 0x24, 0xfe, 0xef, 0x48, 0xe2, - 0xff, 0x3b, 0x49, 0xfc, 0x7f, 0x2f, 0x89, 0xff, 0x2d, 0x49, 0xfc, 0x53, - 0x92, 0xf8, 0x3f, 0x94, 0xc4, 0x1f, 0x53, 0xe4, 0xf0, 0x9f, 0x2b, 0x37, - 0x1f, 0x2d, 0x90, 0xc4, 0x9f, 0x93, 0xc4, 0xbf, 0x56, 0x12, 0x7f, 0xb7, - 0x24, 0xfe, 0xdb, 0x25, 0xf1, 0xdf, 0x2b, 0x89, 0x7f, 0x9b, 0x24, 0xfe, - 0x9d, 0x92, 0xf8, 0xf7, 0x4b, 0xe2, 0x7f, 0x56, 0x12, 0xff, 0x77, 0x25, - 0xf1, 0xbf, 0x2a, 0x89, 0xff, 0xb8, 0x24, 0xfe, 0x7f, 0x95, 0xc4, 0xff, - 0x4b, 0x49, 0xfc, 0xbf, 0x95, 0xc4, 0x9f, 0x54, 0xe5, 0xf0, 0x37, 0xc9, - 0xcd, 0x47, 0x4b, 0x24, 0xf1, 0xaf, 0x90, 0xc4, 0xdf, 0x29, 0x89, 0xff, - 0x7a, 0x49, 0xfc, 0x77, 0x4b, 0xe2, 0xdf, 0x2a, 0x89, 0xff, 0x51, 0x49, - 0xfc, 0x63, 0x92, 0xf8, 0xbf, 0x25, 0x89, 0xff, 0x2f, 0x24, 0xf1, 0xbf, - 0x2c, 0x89, 0xff, 0x87, 0x92, 0xf8, 0xdf, 0x94, 0xc4, 0xff, 0x73, 0x49, - 0xfc, 0xff, 0x25, 0x89, 0x1f, 0x69, 0x72, 0xf8, 0x1b, 0xe4, 0xe6, 0xdb, - 0xf3, 0x24, 0xf1, 0x5f, 0x2a, 0x89, 0x7f, 0xb5, 0x24, 0xfe, 0x4d, 0x92, - 0xf8, 0x6f, 0x92, 0xc4, 0x7f, 0x8f, 0x24, 0xfe, 0x07, 0x25, 0xf1, 0xef, - 0x90, 0xc4, 0xbf, 0x47, 0x12, 0x7f, 0x5e, 0x3b, 0x13, 0xf1, 0x87, 0xdd, - 0x8d, 0x2e, 0xff, 0x24, 0xfc, 0xfa, 0x8b, 0xb5, 0x88, 0xe4, 0x13, 0x8e, - 0xb1, 0x0a, 0x70, 0x5f, 0x8c, 0xc6, 0x4f, 0x19, 0x96, 0x5f, 0x98, 0xd2, - 0x01, 0xe6, 0xf5, 0xba, 0x97, 0xae, 0xe3, 0xcf, 0xdb, 0xcd, 0xf3, 0x0b, - 0x3a, 0x9b, 0xcf, 0xe3, 0x31, 0x05, 0x0d, 0x2a, 0x79, 0x1a, 0x76, 0x3d, - 0x85, 0xa3, 0xb6, 0xc5, 0xa8, 0xa4, 0xbb, 0xf5, 0xda, 0xbc, 0x75, 0x15, - 0x09, 0xc5, 0xf0, 0x3f, 0x35, 0xb6, 0x69, 0xa8, 0x05, 0x48, 0xc9, 0x1f, - 0x51, 0x06, 0x39, 0xfe, 0xb7, 0x27, 0x29, 0x7e, 0x03, 0x29, 0xc8, 0x82, - 0x54, 0xfe, 0xcd, 0x03, 0x88, 0xd2, 0xe7, 0xa7, 0x9f, 0xcf, 0x6f, 0xff, - 0x4a, 0xf0, 0xfe, 0x4d, 0x03, 0x21, 0x2b, 0x69, 0xa6, 0xd0, 0xf4, 0x95, - 0xa8, 0x94, 0x40, 0x07, 0x91, 0xca, 0xf2, 0x3d, 0x57, 0x92, 0x04, 0x4c, - 0xaf, 0x13, 0x60, 0xb7, 0x59, 0x8c, 0x1e, 0x6b, 0x2e, 0xa6, 0xe7, 0xe9, - 0x1f, 0x2e, 0x6a, 0x8a, 0x2f, 0x6d, 0x1c, 0xb5, 0x0d, 0xb4, 0x7b, 0x70, - 0x2f, 0x29, 0x25, 0x4c, 0x69, 0xde, 0xfd, 0x73, 0xfa, 0x90, 0xd2, 0x7d, - 0x84, 0xd6, 0xa3, 0xfb, 0x54, 0xb2, 0x7f, 0x96, 0xec, 0xb3, 0x52, 0x84, - 0x0f, 0xbd, 0x90, 0xc5, 0x21, 0xf4, 0x1b, 0x39, 0x84, 0x9f, 0xcd, 0xf3, - 0x4d, 0xe8, 0x46, 0x56, 0xaf, 0x36, 0x76, 0x4c, 0xa4, 0x40, 0x38, 0x5a, - 0x99, 0x90, 0x54, 0xe2, 0xaf, 0x3b, 0xcc, 0xf0, 0xfb, 0xf2, 0x43, 0xed, - 0x0c, 0x3f, 0x6c, 0xc7, 0x52, 0x2b, 0xf1, 0xdf, 0xc4, 0xf0, 0x27, 0x07, - 0x27, 0x80, 0x04, 0xfb, 0xa2, 0x50, 0xfc, 0x8a, 0x1f, 0xbf, 0x95, 0x39, - 0xdc, 0xda, 0xc2, 0xce, 0x0f, 0xc3, 0x46, 0x05, 0x7f, 0xe8, 0xcf, 0xcd, - 0x0c, 0x7f, 0x05, 0x3e, 0x47, 0x1e, 0xa6, 0xd8, 0xfa, 0xdd, 0x1a, 0xd9, - 0x3f, 0xc3, 0xc7, 0xe7, 0x7f, 0xea, 0x20, 0x9d, 0xaf, 0x0b, 0xf8, 0x11, - 0x1a, 0xe3, 0xee, 0x3f, 0xe1, 0xb7, 0x85, 0xde, 0x50, 0x2c, 0x78, 0x54, - 0xd3, 0x7d, 0x2a, 0xe4, 0xbb, 0x18, 0x3d, 0xf6, 0x2d, 0xbc, 0xde, 0x4f, - 0xce, 0x73, 0xb4, 0x0e, 0xf2, 0xa9, 0x76, 0x0c, 0x0b, 0x51, 0x7b, 0xf7, - 0x61, 0xa5, 0x05, 0x9f, 0xfa, 0xf4, 0x56, 0xad, 0x34, 0xa2, 0x4c, 0xdc, - 0x7e, 0xad, 0xad, 0x97, 0xd0, 0x2a, 0x55, 0x41, 0xcf, 0xc7, 0x7e, 0x84, - 0xd0, 0x4e, 0x7c, 0x5e, 0x87, 0x33, 0x59, 0x97, 0xbe, 0x4a, 0xfa, 0xb9, - 0xbc, 0xf3, 0xfd, 0x1f, 0x53, 0xd6, 0x04, 0xd0, 0xcf, 0xe7, 0x33, 0xfa, - 0xed, 0x3b, 0x38, 0x3d, 0x20, 0x6f, 0xe7, 0x01, 0xbd, 0xf4, 0x3c, 0x80, - 0xde, 0x38, 0xf4, 0x32, 0x1c, 0xa5, 0x30, 0x42, 0xab, 0x12, 0x6c, 0x49, - 0x3c, 0x38, 0x5e, 0x71, 0xee, 0x9f, 0x42, 0xef, 0x53, 0x17, 0xbf, 0x5f, - 0x84, 0x1f, 0x9c, 0x5f, 0x77, 0x85, 0xf0, 0xdf, 0x40, 0xdd, 0x1a, 0xa5, - 0x97, 0xee, 0x8f, 0xd3, 0xb7, 0x3e, 0x74, 0xbe, 0x9f, 0x9f, 0x8e, 0xbc, - 0x0a, 0xf7, 0xeb, 0x9c, 0x98, 0x6f, 0xbf, 0x3d, 0x0a, 0x4d, 0xc4, 0xf4, - 0xba, 0xf9, 0xc5, 0x29, 0x35, 0x28, 0x9f, 0x08, 0xac, 0xb6, 0x00, 0xe9, - 0x81, 0x05, 0x6c, 0xff, 0x5d, 0x9c, 0xa4, 0x58, 0x2d, 0xf1, 0x5a, 0x08, - 0xbf, 0xd1, 0x17, 0x18, 0xbd, 0xa7, 0x7b, 0x7f, 0x06, 0xd6, 0x67, 0x84, - 0x9f, 0xd3, 0xdb, 0xa2, 0xce, 0x1f, 0xdd, 0xe3, 0xf4, 0x9f, 0x04, 0xd3, - 0x7f, 0xb0, 0x9e, 0xce, 0x87, 0x59, 0x6b, 0x74, 0x53, 0x03, 0x79, 0x2d, - 0xc5, 0xd0, 0x04, 0xd5, 0x17, 0x93, 0xf5, 0x8e, 0x7e, 0x44, 0xf5, 0xc8, - 0xb9, 0xaa, 0x12, 0xfc, 0x79, 0x07, 0xb9, 0xf4, 0x40, 0x41, 0x13, 0xb5, - 0x71, 0x79, 0x73, 0xee, 0x93, 0xea, 0xa5, 0x7f, 0x5b, 0xb2, 0x36, 0x7b, - 0xc1, 0xe7, 0xdf, 0x95, 0x92, 0x9b, 0x2f, 0xde, 0x8f, 0xbe, 0x2a, 0xfc, - 0x59, 0x74, 0x8a, 0xf8, 0xb7, 0x38, 0xf8, 0xbb, 0xf8, 0x7e, 0x63, 0xc1, - 0xf9, 0xed, 0x31, 0xc1, 0x5e, 0xd9, 0x3a, 0xf6, 0xa4, 0xa0, 0xa4, 0xa6, - 0xbc, 0x7c, 0x04, 0x0d, 0x56, 0xd8, 0x53, 0x6c, 0x20, 0xea, 0x89, 0x7d, - 0x5c, 0xc8, 0xf8, 0x29, 0xe2, 0xd3, 0x3d, 0xe5, 0xc7, 0x8a, 0xfa, 0x93, - 0xc7, 0xbe, 0x9e, 0x20, 0xf6, 0xd5, 0xc4, 0xa7, 0x6a, 0x9d, 0xb3, 0x2f, - 0x86, 0xcc, 0x1c, 0x2a, 0x26, 0xf0, 0xf9, 0xa3, 0x5b, 0x98, 0x34, 0xda, - 0x8d, 0x70, 0xde, 0x36, 0x3a, 0xd6, 0x6e, 0xd5, 0x7b, 0xee, 0x3f, 0x13, - 0xe0, 0x5f, 0xfd, 0x39, 0xdb, 0x1f, 0x79, 0xda, 0x48, 0x12, 0xe4, 0xc7, - 0xf4, 0xd8, 0x53, 0x74, 0x00, 0xd4, 0x37, 0xa5, 0x0f, 0x0b, 0xad, 0x5e, - 0x7b, 0x3e, 0xf9, 0xdc, 0x48, 0xff, 0xc1, 0xb9, 0x2f, 0x3f, 0x59, 0x1c, - 0xb8, 0x7f, 0x7e, 0x1e, 0xf6, 0x5d, 0x71, 0xdf, 0x7d, 0xb0, 0x91, 0xa5, - 0x79, 0xed, 0x85, 0x6a, 0x6f, 0xd0, 0xbc, 0xf7, 0x93, 0xcf, 0x67, 0xdb, - 0x2b, 0x7c, 0xe9, 0x02, 0x14, 0x28, 0x1f, 0xfc, 0x97, 0xa7, 0xd5, 0xda, - 0xe8, 0x0b, 0xa7, 0xa7, 0x5d, 0x3b, 0xbd, 0xf8, 0x3b, 0x4e, 0x33, 0xfe, - 0x75, 0xa7, 0x19, 0xff, 0x67, 0xd8, 0xf9, 0xa0, 0x62, 0xbb, 0x1a, 0xe5, - 0x3f, 0xbe, 0x21, 0xd8, 0xa7, 0xb0, 0xfb, 0xb2, 0x34, 0xf8, 0xbe, 0xf0, - 0xfb, 0x60, 0xbd, 0x2f, 0xf8, 0x9b, 0x53, 0x09, 0xc0, 0x97, 0xc5, 0xf6, - 0x97, 0xd8, 0x8b, 0xa6, 0xad, 0x89, 0xe2, 0x90, 0xab, 0xaf, 0xfe, 0xed, - 0x73, 0x5c, 0x7f, 0xee, 0xd6, 0xea, 0xe3, 0xc3, 0x58, 0x97, 0x9d, 0x8c, - 0xe7, 0x47, 0xf1, 0x7a, 0x42, 0xeb, 0x64, 0x9d, 0xab, 0x3f, 0xeb, 0x14, - 0xaf, 0x7d, 0x81, 0xd5, 0xcb, 0x92, 0xbe, 0xfb, 0xcf, 0xed, 0x7b, 0x1c, - 0x95, 0xe8, 0xfd, 0x22, 0xf6, 0x7a, 0xfa, 0x0a, 0x4a, 0x2f, 0xd6, 0xc7, - 0x8b, 0xe7, 0xc1, 0x72, 0x46, 0x3f, 0xef, 0x87, 0x1c, 0xd7, 0xa0, 0x06, - 0x8c, 0xef, 0xeb, 0xcd, 0xd1, 0xfa, 0x99, 0xfb, 0x7f, 0xeb, 0xae, 0xf2, - 0xc9, 0xf3, 0xf7, 0x9d, 0xf3, 0x79, 0x8c, 0xfb, 0xd3, 0x19, 0x9f, 0xbf, - 0xc8, 0xe6, 0xb3, 0xfb, 0xd0, 0x9f, 0x98, 0x58, 0xc4, 0xd6, 0xbf, 0x8e, - 0x7c, 0xf3, 0xd1, 0x51, 0xc5, 0x0b, 0x73, 0xfd, 0x67, 0x3f, 0xa0, 0xf9, - 0xec, 0x1f, 0xe7, 0x97, 0x81, 0x5e, 0x57, 0xea, 0xe1, 0xa8, 0xed, 0x13, - 0xd4, 0x7f, 0x26, 0xfa, 0x62, 0x32, 0xed, 0xf2, 0x2b, 0xed, 0xe3, 0x17, - 0x10, 0xb7, 0xca, 0x77, 0xfe, 0x8e, 0xff, 0x41, 0xf9, 0x45, 0xf4, 0x97, - 0xcb, 0x2f, 0x20, 0x7f, 0x41, 0xc6, 0xc3, 0x2f, 0xd8, 0x40, 0xfe, 0xda, - 0x94, 0xbb, 0xfe, 0x02, 0x29, 0x7b, 0xc6, 0x7f, 0x39, 0xea, 0xf0, 0x6b, - 0x13, 0xf7, 0x2f, 0xea, 0xc9, 0xfe, 0x59, 0xdf, 0x62, 0xe2, 0x55, 0xce, - 0x9f, 0x3a, 0xd5, 0x3b, 0x0e, 0x8f, 0xa7, 0xfb, 0x5d, 0xea, 0x93, 0x77, - 0xce, 0x0f, 0xc6, 0x2f, 0x8b, 0xf3, 0x8b, 0x6a, 0xca, 0xc9, 0xa4, 0xcb, - 0x8f, 0x64, 0x85, 0xfc, 0x2c, 0x4f, 0x06, 0xca, 0x3f, 0xe5, 0x07, 0xe6, - 0xa7, 0xd5, 0xe4, 0xf2, 0x03, 0xd8, 0xdb, 0x56, 0xe7, 0xe1, 0x07, 0xdb, - 0xc7, 0x73, 0x3a, 0x5f, 0x7f, 0xcb, 0x8c, 0xf8, 0xf1, 0x96, 0xc3, 0x8f, - 0xd7, 0xf9, 0xf3, 0xeb, 0xa9, 0x7f, 0xcc, 0xf8, 0xf1, 0x22, 0xe7, 0xc7, - 0x63, 0xbe, 0xf1, 0x1a, 0xf9, 0x81, 0x86, 0x39, 0x3f, 0x88, 0x00, 0x4e, - 0xa6, 0x5c, 0x7e, 0xa4, 0x2a, 0xe4, 0x63, 0x65, 0x94, 0x7c, 0xe0, 0xd9, - 0x24, 0x9e, 0xe0, 0xf7, 0x09, 0x9a, 0x59, 0xe6, 0x7a, 0xf8, 0xc1, 0xed, - 0xd5, 0xf3, 0xe0, 0x8e, 0xc0, 0x7d, 0x6a, 0x99, 0x11, 0x3f, 0x7e, 0x51, - 0x21, 0x1f, 0x7d, 0x0d, 0x54, 0x7f, 0x30, 0x7f, 0xb3, 0x09, 0xef, 0x53, - 0xe3, 0xfc, 0x1f, 0xc6, 0x27, 0x92, 0x03, 0xbf, 0x08, 0xaf, 0xdf, 0xa4, - 0x7a, 0xe7, 0xd7, 0x2a, 0x2f, 0xb5, 0xf2, 0x07, 0x56, 0xaf, 0xf4, 0xeb, - 0x1b, 0x9f, 0xbc, 0x38, 0xfa, 0x98, 0xf3, 0x87, 0x8c, 0xee, 0x35, 0x80, - 0x3e, 0x04, 0xfe, 0x20, 0xf6, 0x4a, 0xf6, 0x34, 0x7a, 0xd7, 0xdf, 0x3a, - 0x23, 0xfe, 0xfc, 0x8f, 0xab, 0x6f, 0xf8, 0xf3, 0xb3, 0x9e, 0xf8, 0xd1, - 0xd4, 0x0c, 0x6e, 0x6f, 0xeb, 0x34, 0xef, 0x78, 0x8d, 0xfc, 0xb0, 0x1d, - 0x7e, 0x90, 0xe1, 0xc9, 0x8c, 0xcb, 0x8f, 0x4c, 0x85, 0xbc, 0xac, 0xf6, - 0xcb, 0x4b, 0xa4, 0xfe, 0x05, 0x07, 0x65, 0x71, 0x83, 0xa0, 0x7f, 0xcd, - 0xcf, 0x1a, 0xee, 0xfa, 0xa6, 0x19, 0xf1, 0x83, 0x75, 0x59, 0xf4, 0xbb, - 0xe7, 0x3f, 0xd5, 0xe0, 0x89, 0x6f, 0xb3, 0x2e, 0x3f, 0x1c, 0x7d, 0xdb, - 0x10, 0xe4, 0x3f, 0x72, 0x7e, 0xfc, 0xf8, 0xc6, 0x90, 0x7c, 0x03, 0xf9, - 0xcf, 0x64, 0x8c, 0xf3, 0x83, 0xf1, 0xab, 0x38, 0x18, 0xaa, 0x9f, 0x37, - 0x51, 0xfd, 0x5c, 0xdc, 0xc6, 0xf2, 0x1b, 0x5c, 0x5e, 0xa6, 0xbc, 0xf1, - 0x9e, 0x1d, 0xba, 0x5e, 0x81, 0xf3, 0x1a, 0x35, 0x50, 0x71, 0x29, 0x94, - 0xb9, 0x27, 0x3c, 0xf1, 0x18, 0x59, 0x0f, 0xd3, 0xad, 0x66, 0xbf, 0x7e, - 0xba, 0xb8, 0xce, 0xb5, 0xcf, 0xfb, 0x99, 0xbb, 0x1c, 0x47, 0xab, 0x96, - 0xef, 0xd3, 0xd0, 0xce, 0x7e, 0x4b, 0x73, 0x36, 0x63, 0xa9, 0x0a, 0xf6, - 0x87, 0x51, 0x8b, 0x99, 0xd9, 0x11, 0xe6, 0x4f, 0xe6, 0x87, 0xb0, 0x25, - 0xb1, 0x56, 0x9a, 0x89, 0x6c, 0x06, 0x2a, 0xe8, 0xe8, 0x59, 0xf5, 0xd5, - 0x89, 0xed, 0xf8, 0xdf, 0x1b, 0x5f, 0x7d, 0x80, 0x30, 0x74, 0xa4, 0xd1, - 0x7c, 0x9e, 0x0a, 0x83, 0x71, 0x29, 0x5d, 0x6f, 0x72, 0x7f, 0x15, 0x3f, - 0x9c, 0xf8, 0xab, 0x3c, 0x5f, 0x84, 0x6f, 0x6b, 0xe0, 0x79, 0xb2, 0x71, - 0x6b, 0xc0, 0x17, 0xcf, 0xae, 0x63, 0xf6, 0x92, 0xf3, 0xa3, 0xf1, 0xa0, - 0x3f, 0xde, 0x53, 0x3d, 0xf1, 0x9e, 0x57, 0x9e, 0xb9, 0xfe, 0xe9, 0x5c, - 0x77, 0x95, 0x37, 0x7e, 0xb4, 0x38, 0x7f, 0x91, 0x63, 0xf0, 0x07, 0x90, - 0x37, 0x5e, 0xe2, 0xfc, 0xc6, 0xf7, 0x85, 0x49, 0xcc, 0xc0, 0x1c, 0xd7, - 0x1e, 0x4d, 0x1a, 0xae, 0xfc, 0x1b, 0x15, 0xfa, 0x20, 0x17, 0xa1, 0x0f, - 0x1c, 0x7d, 0xc5, 0xf5, 0x01, 0x91, 0xce, 0x7d, 0x75, 0x5e, 0x7d, 0xb0, - 0x77, 0x16, 0xf4, 0xc1, 0x1a, 0x4d, 0xd4, 0x07, 0x53, 0x94, 0x7e, 0xbe, - 0x9f, 0x03, 0x27, 0xe6, 0x48, 0xdc, 0xff, 0xe2, 0xce, 0xea, 0xfa, 0x30, - 0x5e, 0x93, 0xbd, 0xa8, 0x4a, 0xff, 0x3c, 0xfe, 0xbb, 0x1e, 0xb4, 0x5f, - 0x1b, 0xec, 0x4d, 0xc1, 0x4c, 0x40, 0x3c, 0x45, 0xfd, 0xcd, 0x81, 0xf8, - 0x4c, 0xf8, 0x73, 0xad, 0x56, 0x61, 0x4f, 0x14, 0x1f, 0x7f, 0xb2, 0x03, - 0x0c, 0x36, 0x04, 0xff, 0x57, 0xc0, 0x47, 0xf7, 0x6a, 0x6b, 0x3c, 0x3f, - 0x41, 0xfc, 0x03, 0xec, 0xaf, 0x1a, 0x39, 0x64, 0xc6, 0xc1, 0x1e, 0x66, - 0x6c, 0x03, 0xec, 0xa1, 0xf9, 0x4b, 0x26, 0xcf, 0x96, 0x02, 0xf9, 0xcf, - 0x51, 0x34, 0xbd, 0xf6, 0x62, 0x1c, 0x7f, 0x5a, 0xa8, 0x5b, 0x5d, 0x45, - 0x44, 0xfe, 0x7e, 0xa5, 0x84, 0xf5, 0x01, 0xd6, 0x76, 0x07, 0xba, 0x74, - 0xf4, 0xf4, 0x97, 0xf7, 0xd2, 0xfc, 0x28, 0xac, 0xec, 0x35, 0x0e, 0xc6, - 0x00, 0xf5, 0xcd, 0x01, 0xf9, 0x52, 0xec, 0x4f, 0x73, 0xfd, 0xaa, 0x7a, - 0xef, 0xcb, 0xe3, 0xa1, 0xfa, 0x47, 0xb8, 0x1f, 0xd2, 0xfa, 0x3c, 0x1d, - 0x69, 0xff, 0xe1, 0x57, 0x53, 0xf4, 0x87, 0xec, 0xae, 0x3a, 0x77, 0xfd, - 0xf9, 0x33, 0x92, 0xe7, 0x2d, 0xce, 0x79, 0x39, 0xf6, 0xab, 0xd1, 0x77, - 0x5e, 0x03, 0x03, 0x8d, 0x32, 0xf2, 0xfc, 0x78, 0x55, 0x7f, 0x30, 0x4c, - 0x3f, 0xf9, 0xef, 0x73, 0x18, 0xbd, 0x0f, 0x56, 0xde, 0x3f, 0x3f, 0xbd, - 0x68, 0x5a, 0x86, 0x5e, 0x34, 0x56, 0xf5, 0xfe, 0x85, 0xd1, 0x5b, 0xdb, - 0xfd, 0xdb, 0x5e, 0x79, 0x1f, 0xe6, 0xfa, 0xe9, 0x1d, 0x98, 0x1b, 0x65, - 0x1f, 0xdd, 0xfa, 0x40, 0x88, 0x3e, 0x47, 0x1f, 0x10, 0xf9, 0xa7, 0x06, - 0x65, 0x32, 0xc1, 0xe9, 0xe7, 0xfa, 0x9b, 0xdf, 0x9f, 0x66, 0x2a, 0xff, - 0x2d, 0x0a, 0xd6, 0xc7, 0x24, 0x7f, 0x8b, 0x15, 0x74, 0x6f, 0x7d, 0x02, - 0x5a, 0xfc, 0x63, 0xab, 0xe8, 0x7d, 0x38, 0x4e, 0xfb, 0xbb, 0x0c, 0x13, - 0xc5, 0x4d, 0x14, 0x70, 0x1f, 0x14, 0xef, 0x7d, 0x00, 0xf1, 0xab, 0x87, - 0xff, 0xcb, 0x2f, 0x75, 0xfc, 0x0d, 0x50, 0xc1, 0x9c, 0x9f, 0x59, 0xd4, - 0x8d, 0xd6, 0x18, 0x9e, 0xfc, 0x91, 0x92, 0x51, 0x58, 0x7e, 0x3c, 0x2e, - 0xf4, 0x4f, 0xc6, 0x82, 0xec, 0x03, 0x3d, 0x9f, 0x67, 0x54, 0xf7, 0x3c, - 0x3c, 0xfc, 0xb6, 0xa3, 0xe2, 0x2f, 0x7e, 0x5e, 0xbc, 0x1d, 0x78, 0xfa, - 0x3c, 0xfa, 0x3c, 0xc7, 0x1f, 0xa8, 0x51, 0x5f, 0x8e, 0xf0, 0xf9, 0xe7, - 0xf1, 0xfc, 0x51, 0x12, 0xfc, 0x2b, 0x8b, 0xea, 0xc7, 0x2c, 0x8c, 0x66, - 0x4d, 0x1d, 0x19, 0xcb, 0xa9, 0x3e, 0x42, 0x1b, 0x79, 0x3e, 0xfa, 0xc4, - 0x7c, 0x9a, 0x7f, 0xc2, 0xb4, 0x27, 0x12, 0xa0, 0x47, 0xad, 0x61, 0x90, - 0x47, 0x96, 0xff, 0xb4, 0xee, 0x53, 0xcc, 0x88, 0xf3, 0x6e, 0x14, 0xf2, - 0xf9, 0x47, 0x9c, 0xf8, 0x77, 0x17, 0xaf, 0x07, 0x21, 0xa0, 0x9f, 0xcf, - 0xef, 0xb8, 0xc9, 0x6f, 0xaf, 0xdf, 0x76, 0xe6, 0xf3, 0xfc, 0x5d, 0x9f, - 0x41, 0xf7, 0xef, 0x59, 0x4f, 0xf9, 0xa1, 0x39, 0xfc, 0xa0, 0xf4, 0x24, - 0x68, 0xfe, 0xae, 0x14, 0x9d, 0xbf, 0xb3, 0x16, 0x51, 0xfd, 0xc3, 0xf3, - 0x0f, 0xc5, 0x13, 0x2c, 0xff, 0x90, 0xf1, 0xe9, 0x4b, 0x37, 0xff, 0xe6, - 0xcf, 0x97, 0x7e, 0xe7, 0xba, 0xe0, 0xfa, 0x86, 0x68, 0xff, 0xf9, 0x7e, - 0x92, 0x21, 0xf9, 0x68, 0xce, 0x9f, 0x94, 0x90, 0xbf, 0x4e, 0x57, 0xc9, - 0x5f, 0x67, 0xd8, 0x78, 0x96, 0x27, 0x0b, 0x85, 0xf5, 0x73, 0x3d, 0xfe, - 0x0e, 0xfc, 0x7c, 0x22, 0xb4, 0x3e, 0x93, 0x51, 0xfc, 0xf5, 0x8d, 0xe0, - 0x7c, 0xf8, 0xdb, 0xd7, 0xf9, 0xfd, 0xfd, 0xa4, 0x7a, 0x9e, 0x1e, 0x95, - 0x3f, 0x17, 0xe6, 0x17, 0x25, 0xe7, 0xa3, 0x14, 0x9b, 0xcf, 0x9f, 0x77, - 0x0e, 0x83, 0xc5, 0xf9, 0x6c, 0x7f, 0xa5, 0x87, 0x26, 0x3e, 0x88, 0x45, - 0xe5, 0x93, 0xaf, 0xbc, 0x43, 0x2e, 0x9f, 0xfc, 0xee, 0x1f, 0xd7, 0x5a, - 0x3f, 0x75, 0xfc, 0x3b, 0xa9, 0xfc, 0xfc, 0xd5, 0xad, 0x72, 0xf4, 0x4c, - 0xaa, 0x72, 0xf3, 0x8f, 0x5d, 0x23, 0x4b, 0x7f, 0xb0, 0x3f, 0xe5, 0xd4, - 0x0f, 0x04, 0xfc, 0x47, 0x6f, 0xf7, 0xf1, 0x1f, 0xe5, 0x5b, 0x33, 0x91, - 0xf9, 0xda, 0x77, 0xb5, 0x60, 0x7a, 0x6a, 0xc5, 0x6f, 0x9b, 0x99, 0xc8, - 0x7a, 0xc1, 0xb9, 0x7f, 0x22, 0xbd, 0xdf, 0x84, 0x54, 0xbd, 0xe9, 0x36, - 0xa1, 0x3e, 0x59, 0x85, 0x9e, 0xdf, 0x2a, 0x72, 0xe7, 0x75, 0xf7, 0x53, - 0x7e, 0xfc, 0xd5, 0xf8, 0x99, 0xd4, 0xe5, 0xf0, 0xaf, 0x0d, 0xad, 0xef, - 0xa4, 0x84, 0x7a, 0x05, 0xb7, 0xc7, 0xb4, 0xbe, 0xc5, 0xe3, 0xa3, 0xd2, - 0x47, 0xe7, 0x53, 0xfb, 0xbb, 0xd7, 0x24, 0xd9, 0xdc, 0x4f, 0xb7, 0xf6, - 0x29, 0x41, 0xf1, 0x9f, 0x58, 0xcf, 0x4d, 0xf3, 0xfb, 0x8e, 0x83, 0x3b, - 0x4b, 0x62, 0xff, 0xd5, 0xce, 0xfb, 0xc6, 0xeb, 0xe5, 0xf6, 0xff, 0x0f, - 0x4f, 0x56, 0xc9, 0x87, 0xa3, 0xa5, 0x51, 0xf9, 0x70, 0x1c, 0x56, 0xd0, - 0xfa, 0x45, 0xed, 0xf3, 0xdb, 0xfd, 0xf3, 0xcb, 0xb9, 0xc8, 0xf9, 0x08, - 0xb5, 0x4a, 0xe9, 0x47, 0x85, 0xe9, 0xc3, 0xb0, 0xfd, 0xa6, 0x57, 0xc8, - 0xf1, 0x67, 0x49, 0x83, 0x1f, 0xff, 0x7f, 0xdf, 0xa1, 0x44, 0xf2, 0xff, - 0xaf, 0x97, 0x55, 0xb9, 0xcf, 0x79, 0xff, 0x7e, 0xb7, 0xa7, 0xfc, 0xf7, - 0xf9, 0x5f, 0xfe, 0x14, 0x39, 0xf6, 0x8a, 0xcc, 0xef, 0xf5, 0xcf, 0x1f, - 0x17, 0xe6, 0xff, 0xf8, 0xa8, 0x16, 0x49, 0xcf, 0xbd, 0xcb, 0xe5, 0xf6, - 0x7b, 0x63, 0x9d, 0xdc, 0xfc, 0x0f, 0xcf, 0x95, 0x9b, 0xff, 0x85, 0x6b, - 0xe4, 0xe6, 0xff, 0xad, 0x64, 0xbd, 0xf3, 0x44, 0x46, 0x6e, 0xfe, 0xd0, - 0x06, 0xc9, 0xfa, 0x6e, 0xcf, 0xcc, 0xfa, 0x87, 0xf8, 0xfa, 0x72, 0x97, - 0xa4, 0xfc, 0x1d, 0xd3, 0xa4, 0xe6, 0x37, 0xfc, 0x93, 0xdc, 0xfc, 0x9d, - 0x6f, 0xc8, 0xcd, 0xff, 0xc6, 0x5a, 0x39, 0xfa, 0xb7, 0xe4, 0xe5, 0xf0, - 0x0f, 0x49, 0xea, 0xef, 0xc9, 0x78, 0xf0, 0x7c, 0x15, 0x8d, 0x1d, 0xa1, - 0xf5, 0x39, 0xe6, 0x7f, 0xa2, 0xb4, 0xcf, 0x7f, 0x75, 0xeb, 0x13, 0xbc, - 0x1f, 0x23, 0xc4, 0x1f, 0x2e, 0x2e, 0xf5, 0xfb, 0xc3, 0x16, 0xf7, 0x87, - 0xfd, 0xf5, 0x6c, 0x8f, 0x3f, 0xac, 0x44, 0xc5, 0x7b, 0xbf, 0x32, 0x18, - 0x7e, 0x0b, 0xfc, 0xe3, 0x7d, 0x78, 0xc5, 0x80, 0x52, 0x1c, 0x51, 0x26, - 0x42, 0xcf, 0x53, 0xf2, 0x3e, 0xfe, 0x7b, 0x5c, 0xe8, 0x6f, 0x90, 0x9d, - 0x6f, 0xe4, 0x22, 0xeb, 0xd7, 0xaf, 0xd6, 0xfc, 0xfd, 0x89, 0xfa, 0x19, - 0xf9, 0x7f, 0x7f, 0x19, 0xe2, 0x0f, 0x39, 0x95, 0x7a, 0xe6, 0xaf, 0x43, - 0x3d, 0x27, 0x0d, 0x77, 0x9d, 0xf5, 0x0f, 0x11, 0x7b, 0x6c, 0xc5, 0xd3, - 0x5e, 0xfc, 0x32, 0xf5, 0x7d, 0x15, 0x5d, 0x11, 0x59, 0xdf, 0xaf, 0xac, - 0xf7, 0x8e, 0x09, 0xf9, 0x2f, 0x47, 0x9e, 0x82, 0xf3, 0x5d, 0x82, 0x7c, - 0xe9, 0x4c, 0xbe, 0xb2, 0xed, 0xd5, 0xea, 0xbf, 0x4c, 0xde, 0xb2, 0xbc, - 0x20, 0xc7, 0xed, 0xff, 0x6e, 0xdf, 0xf3, 0xed, 0x8e, 0x63, 0x8a, 0xd5, - 0x72, 0x7e, 0x62, 0x5c, 0xa7, 0xcf, 0xb7, 0x90, 0x45, 0xfb, 0xc1, 0xa6, - 0xb7, 0xa2, 0xd2, 0x41, 0x5a, 0x8f, 0x54, 0xcf, 0x21, 0x0e, 0x1a, 0x7b, - 0x7f, 0x6b, 0x0b, 0x4f, 0x60, 0xd3, 0xf7, 0x21, 0x7b, 0xb0, 0x44, 0x92, - 0x12, 0x93, 0x62, 0xdb, 0x73, 0x4c, 0xb7, 0xde, 0x00, 0xe7, 0xa2, 0xa2, - 0x09, 0x9e, 0x8f, 0xb6, 0x06, 0x79, 0x3f, 0x5d, 0xd6, 0x20, 0xfd, 0x74, - 0x80, 0x7f, 0x47, 0xeb, 0x04, 0xcc, 0x8f, 0x9f, 0xe7, 0xc5, 0x7f, 0x81, - 0x1f, 0x7f, 0x2f, 0xb2, 0xc7, 0x00, 0xbf, 0xa5, 0xd8, 0x79, 0xc0, 0x5f, - 0xad, 0x1f, 0x24, 0x30, 0x5f, 0xd8, 0x45, 0xf2, 0xbd, 0x26, 0xad, 0x5f, - 0xf3, 0xa3, 0x4c, 0x05, 0xc9, 0x17, 0xab, 0xf7, 0x95, 0x3f, 0x56, 0x79, - 0xbd, 0xe2, 0x8b, 0xdc, 0xa5, 0x08, 0xc9, 0xf7, 0x00, 0x87, 0xe1, 0x8b, - 0x06, 0x06, 0x22, 0xcf, 0x12, 0xf6, 0xa3, 0x56, 0xe0, 0xe3, 0xfb, 0xb3, - 0x3f, 0x0a, 0xda, 0x9f, 0x98, 0xaf, 0x86, 0x7e, 0x96, 0x95, 0xd0, 0xcf, - 0x02, 0xf4, 0xc7, 0x48, 0x3f, 0x0b, 0xa7, 0xc7, 0x08, 0xa3, 0x9f, 0x9e, - 0xdf, 0x15, 0x4e, 0x7f, 0x1c, 0x42, 0xfb, 0x35, 0x77, 0x3d, 0x64, 0xe0, - 0x2d, 0x85, 0xd0, 0x6b, 0x54, 0xd2, 0x8b, 0x23, 0x29, 0x91, 0xff, 0xf4, - 0xfd, 0xbd, 0x71, 0xcd, 0x2e, 0x6a, 0x66, 0xa8, 0xbd, 0x7a, 0x51, 0x0f, - 0xf7, 0x5f, 0xe0, 0xe7, 0x67, 0x93, 0xd1, 0xf1, 0xf7, 0xcf, 0x27, 0x67, - 0xd6, 0x3f, 0x56, 0xed, 0x7e, 0xe9, 0xf8, 0x7e, 0xad, 0xd1, 0xbd, 0xf7, - 0x2b, 0x2c, 0x7f, 0x11, 0x7c, 0x9f, 0x9c, 0xf3, 0x30, 0x5a, 0x89, 0x3c, - 0xc3, 0x03, 0xad, 0xa4, 0x59, 0xd7, 0x91, 0x5a, 0x8e, 0x4a, 0x0d, 0xe8, - 0xa0, 0x99, 0x4e, 0x6b, 0x6a, 0x6a, 0xe4, 0x8b, 0xca, 0xc8, 0x80, 0x62, - 0x8e, 0x2a, 0x13, 0xcd, 0x4f, 0x99, 0xa5, 0x1d, 0x7f, 0xb3, 0xc8, 0xee, - 0xc0, 0xd1, 0xd0, 0x81, 0x39, 0x31, 0x3b, 0x09, 0x79, 0x46, 0xd8, 0x87, - 0xd1, 0x96, 0x25, 0x79, 0x88, 0x91, 0x56, 0xa0, 0xcf, 0xfe, 0x1e, 0xd5, - 0x24, 0xb6, 0xfe, 0x4d, 0xb3, 0xa4, 0x41, 0x3c, 0x6e, 0x70, 0xfd, 0x72, - 0x83, 0xef, 0x7d, 0xf6, 0xaa, 0xfd, 0xc7, 0x4e, 0xff, 0xd3, 0x7b, 0xe4, - 0xbe, 0xbb, 0xaf, 0x61, 0xae, 0xa2, 0xf2, 0xc6, 0xf2, 0xe5, 0xb1, 0xfb, - 0x9d, 0x7e, 0x09, 0xad, 0x44, 0xf2, 0x7b, 0x79, 0x54, 0xa4, 0xf9, 0x3d, - 0xb5, 0xd8, 0x90, 0x18, 0xd6, 0xa8, 0x84, 0xef, 0x44, 0x68, 0x13, 0xbf, - 0x1f, 0x59, 0x22, 0x5f, 0x8a, 0x7f, 0x3d, 0x9c, 0x86, 0x95, 0xf4, 0xf7, - 0x27, 0x60, 0xeb, 0x1e, 0x87, 0x7e, 0x29, 0xcc, 0xec, 0x09, 0xa6, 0x39, - 0x4b, 0x4b, 0x62, 0xfc, 0x3c, 0x92, 0x68, 0x26, 0xfa, 0x5c, 0xcc, 0xe7, - 0xc4, 0x0f, 0x09, 0xfd, 0x9f, 0xbc, 0x1f, 0x57, 0x41, 0xc5, 0x56, 0xd8, - 0x74, 0x71, 0x38, 0x69, 0x65, 0x41, 0x3e, 0xdb, 0x12, 0xde, 0x7c, 0x3a, - 0x0e, 0x92, 0x6c, 0xab, 0x45, 0xfa, 0x79, 0x76, 0xf2, 0x90, 0x2f, 0xff, - 0x83, 0xe6, 0x1c, 0x8a, 0x96, 0xdf, 0x73, 0x0f, 0xcd, 0xb0, 0xbf, 0x53, - 0xa8, 0x1f, 0x1a, 0x01, 0xe7, 0x97, 0x04, 0x5f, 0xf9, 0x79, 0xbf, 0x3f, - 0xff, 0x92, 0xce, 0xf1, 0x75, 0xab, 0xd4, 0x5e, 0x73, 0x7b, 0xb2, 0x5b, - 0xb0, 0x2f, 0x4e, 0x7f, 0xb9, 0xaf, 0xbe, 0x37, 0x37, 0x7a, 0x3f, 0xce, - 0xf3, 0x5d, 0x83, 0xb7, 0x9a, 0xdf, 0x37, 0x1f, 0xec, 0x7e, 0xcf, 0x8c, - 0xc1, 0x6e, 0xfd, 0x38, 0xcb, 0xf8, 0xef, 0x1b, 0xaf, 0xd0, 0x6f, 0x64, - 0x8c, 0xea, 0x37, 0x56, 0x8f, 0x83, 0x9f, 0xe3, 0xb3, 0x2d, 0x3f, 0xcd, - 0xe2, 0xf9, 0x70, 0xf9, 0xb1, 0x50, 0xf1, 0xb2, 0x96, 0x1d, 0x2a, 0x7b, - 0x3e, 0xc6, 0x77, 0xb9, 0x5f, 0x7e, 0xc4, 0xef, 0xa1, 0xd5, 0x28, 0x3f, - 0x9f, 0x3c, 0x53, 0xf2, 0x23, 0xf4, 0xc7, 0x18, 0xe2, 0xf9, 0xe0, 0xe5, - 0x06, 0xb4, 0x08, 0xd9, 0xa1, 0xf2, 0xa3, 0x51, 0xff, 0x6d, 0x40, 0x11, - 0xf2, 0xb5, 0x82, 0x3c, 0xf9, 0xe4, 0x07, 0x5d, 0x58, 0x55, 0x7e, 0x56, - 0x0b, 0xf9, 0x66, 0x56, 0x2f, 0xaf, 0xac, 0xef, 0x68, 0x7e, 0xff, 0x1a, - 0x9f, 0x33, 0xc9, 0x37, 0x17, 0x51, 0x74, 0xbf, 0xe8, 0x82, 0x68, 0xff, - 0xc7, 0x7e, 0x2f, 0xcc, 0xdf, 0x56, 0x88, 0xbf, 0x3d, 0xfd, 0xb0, 0x0e, - 0xe3, 0xc9, 0x27, 0x5b, 0x41, 0x9b, 0xd8, 0x2f, 0x3c, 0x51, 0x44, 0x65, - 0xa2, 0x0f, 0x9d, 0xfe, 0x36, 0x85, 0xf4, 0x8b, 0xb6, 0x67, 0x86, 0xac, - 0xfa, 0x7d, 0xab, 0xb2, 0x89, 0x69, 0x0d, 0xfc, 0x6d, 0x7a, 0x1f, 0x40, - 0xbb, 0x2f, 0x47, 0x56, 0xcc, 0x5b, 0x6f, 0x19, 0xf0, 0xf5, 0x2f, 0xef, - 0x5a, 0xe8, 0xc9, 0xd7, 0x40, 0x3f, 0xf2, 0xf4, 0x12, 0x28, 0xa3, 0xb8, - 0xf3, 0x8d, 0x1a, 0xe7, 0xeb, 0x30, 0xdf, 0xc4, 0x97, 0xe0, 0x11, 0x05, - 0x0d, 0x07, 0xcf, 0xd7, 0xb1, 0x6c, 0x8c, 0x6f, 0x63, 0xfe, 0xac, 0x91, - 0x61, 0xfa, 0x91, 0x9e, 0x67, 0xd0, 0xfc, 0xb8, 0x77, 0x7e, 0x98, 0xbf, - 0x1e, 0x92, 0x9f, 0xae, 0xe8, 0x9f, 0xcf, 0x82, 0x7c, 0x80, 0xf1, 0xfe, - 0x40, 0x29, 0x0d, 0xbb, 0xf2, 0x71, 0x71, 0xa8, 0x7c, 0x64, 0xb4, 0x5c, - 0xdc, 0x1b, 0x3f, 0x75, 0x45, 0xf6, 0xb7, 0x07, 0xd4, 0xb7, 0xb8, 0xc6, - 0xc9, 0x04, 0xd6, 0xab, 0x69, 0x74, 0x9a, 0x80, 0xfb, 0x6c, 0xbb, 0xfd, - 0x21, 0x0e, 0xfd, 0xf4, 0x2a, 0x3b, 0x9f, 0x34, 0xca, 0x07, 0xf7, 0xcb, - 0x3e, 0xab, 0x79, 0xea, 0x4b, 0x8a, 0x1c, 0x7d, 0x77, 0x72, 0xfa, 0x62, - 0x61, 0xfd, 0x8b, 0xf5, 0xc4, 0xdf, 0xe3, 0xf2, 0xbb, 0x4b, 0xf1, 0xd6, - 0x5f, 0xc4, 0xfc, 0x7e, 0x70, 0x7e, 0xfe, 0x39, 0x0f, 0x7d, 0xc1, 0xf4, - 0x74, 0xc7, 0xc2, 0xf3, 0x73, 0x5d, 0x44, 0xc3, 0xe1, 0xf5, 0x6a, 0xf5, - 0xfa, 0x82, 0x2c, 0xfe, 0xd0, 0x78, 0x11, 0xd5, 0x9c, 0x4f, 0x8e, 0xd4, - 0xf7, 0xa2, 0xfe, 0x0e, 0xc9, 0xff, 0x15, 0x35, 0x4f, 0x7f, 0xb4, 0x3f, - 0x3e, 0x6d, 0x9b, 0x25, 0xfc, 0xed, 0xbc, 0x9f, 0x97, 0xbe, 0x1f, 0x94, - 0xe5, 0xf8, 0x9b, 0x66, 0x09, 0x3f, 0xed, 0x77, 0x06, 0x79, 0x26, 0xfa, - 0xaa, 0xc9, 0xe9, 0xbf, 0x98, 0x25, 0xfc, 0xb4, 0xdf, 0xd9, 0xb1, 0xc7, - 0x4e, 0x7f, 0xc7, 0xc6, 0x59, 0xc2, 0x4f, 0xfb, 0x9d, 0xb9, 0xfd, 0x2f, - 0x3a, 0xf5, 0xc7, 0x8d, 0xdc, 0xbe, 0xe8, 0x11, 0xf7, 0xc9, 0x5e, 0xb7, - 0xd8, 0x98, 0xee, 0xe9, 0x85, 0x68, 0xf7, 0x21, 0xfe, 0xbd, 0x10, 0x9d, - 0xfb, 0xa3, 0xb5, 0xd8, 0x63, 0xe3, 0x25, 0x4f, 0x7e, 0x22, 0xe6, 0xca, - 0x3b, 0x21, 0x27, 0xed, 0x91, 0x07, 0x72, 0xfb, 0xbe, 0xed, 0xe9, 0x2f, - 0x1a, 0xe0, 0xdf, 0xfb, 0xa9, 0xe9, 0xfb, 0x24, 0xd5, 0xe5, 0xdb, 0xb1, - 0x7f, 0x7a, 0x15, 0xfb, 0xc7, 0xec, 0x23, 0xf6, 0xc2, 0x89, 0xfd, 0x43, - 0xd1, 0xf5, 0x56, 0x9b, 0xea, 0x8f, 0x2c, 0xb1, 0x77, 0x38, 0xb2, 0x2d, - 0x9e, 0x5c, 0x8b, 0xe3, 0x8f, 0xbc, 0xe3, 0x9f, 0x1b, 0x34, 0x9e, 0xb3, - 0x74, 0xb0, 0xe7, 0xc3, 0x5f, 0x6d, 0x5f, 0xf7, 0x88, 0x6a, 0x8f, 0x29, - 0x13, 0x28, 0x89, 0xf5, 0xb5, 0xd5, 0xf1, 0xf8, 0xe1, 0x4b, 0xa7, 0x15, - 0xac, 0x7a, 0xf2, 0x97, 0x6f, 0x18, 0x54, 0x21, 0x1e, 0xf8, 0x41, 0xfb, - 0x46, 0xf4, 0x13, 0x1a, 0x0f, 0x04, 0xee, 0xef, 0x99, 0x84, 0xcb, 0xcf, - 0x9c, 0x37, 0x3f, 0x44, 0xce, 0x62, 0x73, 0xda, 0xfd, 0xde, 0x96, 0x53, - 0x6f, 0x0f, 0xf9, 0xde, 0x16, 0xaf, 0xef, 0xfb, 0xdf, 0xf7, 0x3a, 0xe4, - 0xe2, 0x2f, 0xb6, 0xd7, 0x90, 0x7f, 0xe2, 0xf3, 0x69, 0x3d, 0x24, 0xa1, - 0x42, 0xbd, 0x9d, 0xda, 0x57, 0xa7, 0xbe, 0x5d, 0xc5, 0xdf, 0x70, 0xf2, - 0x2d, 0xcc, 0xdf, 0xc8, 0x47, 0xfb, 0x1b, 0x2c, 0x9f, 0x47, 0x9f, 0xbe, - 0x23, 0xc6, 0xed, 0x8b, 0x45, 0xf9, 0x1f, 0x07, 0xfe, 0x5b, 0xa3, 0x9e, - 0xfe, 0x7a, 0xa3, 0x8f, 0xbc, 0x4f, 0x67, 0xab, 0x60, 0x2f, 0x87, 0x13, - 0x47, 0x3a, 0x4f, 0xaa, 0xd6, 0x18, 0x86, 0x75, 0xcc, 0x7f, 0xb3, 0xe3, - 0x37, 0x93, 0x1a, 0xaf, 0x6f, 0xef, 0x86, 0x7e, 0x00, 0x03, 0xfc, 0x07, - 0x73, 0x38, 0x3c, 0xff, 0x17, 0xca, 0x7f, 0xa2, 0x2e, 0x37, 0xa7, 0x5c, - 0xfe, 0xa7, 0xfe, 0x5f, 0xf3, 0x5f, 0xec, 0x2f, 0xd0, 0x1d, 0x65, 0xb5, - 0x5e, 0xf3, 0xfb, 0x27, 0xdc, 0x5e, 0xfb, 0xfb, 0x0f, 0x2a, 0xed, 0x3d, - 0x7b, 0x7f, 0x32, 0x3b, 0x4d, 0xfc, 0x25, 0x47, 0xbf, 0x65, 0xa3, 0xf5, - 0x1b, 0x7f, 0x9e, 0xee, 0x34, 0x97, 0xac, 0x8f, 0x7a, 0xff, 0xc6, 0x24, - 0xf1, 0x85, 0x57, 0xdf, 0x72, 0xfd, 0xe3, 0xf0, 0x9a, 0x7e, 0x8f, 0xcc, - 0xc4, 0x0a, 0xca, 0x6a, 0x19, 0x8e, 0x81, 0xbe, 0xb7, 0x13, 0xbe, 0x7e, - 0xc4, 0x39, 0x44, 0xff, 0xa9, 0xfe, 0xf9, 0x8e, 0xb9, 0xe4, 0x30, 0xff, - 0xd2, 0x6f, 0x58, 0x3d, 0x96, 0xc7, 0x0b, 0xfc, 0xf9, 0xa6, 0x7f, 0x3d, - 0x21, 0x0d, 0xce, 0xb6, 0xc0, 0xed, 0xc1, 0x35, 0xfc, 0xf9, 0x19, 0x1e, - 0xcf, 0x91, 0x78, 0xda, 0xf3, 0x3e, 0xac, 0xd7, 0xbe, 0x52, 0xf2, 0x86, - 0x14, 0x90, 0xc7, 0xde, 0x98, 0xaf, 0xff, 0x2c, 0xe5, 0x5b, 0x9f, 0xcd, - 0x85, 0xbc, 0xef, 0x45, 0x7f, 0xde, 0x0a, 0xf1, 0x2f, 0x1c, 0x7b, 0xe8, - 0xd3, 0xdf, 0x2e, 0xfd, 0xd4, 0x34, 0xc0, 0x27, 0x6b, 0xd9, 0xfb, 0xaa, - 0xae, 0x3d, 0x4b, 0xf8, 0x9e, 0xcf, 0xed, 0x9d, 0xb0, 0x1f, 0x27, 0x3f, - 0x7c, 0x9c, 0xd3, 0xb7, 0x05, 0x09, 0xf9, 0x04, 0x3a, 0xbf, 0x4d, 0x58, - 0x5f, 0x25, 0xfe, 0xbc, 0x4c, 0x88, 0x07, 0x3f, 0x55, 0x25, 0x1e, 0x5c, - 0x3a, 0xd3, 0x78, 0x90, 0xfd, 0xc3, 0x3d, 0x0f, 0x2b, 0xbe, 0xfe, 0x95, - 0x2a, 0xf2, 0x49, 0xde, 0xbf, 0xe9, 0xf5, 0xe4, 0xeb, 0x1a, 0xa2, 0xe7, - 0xe7, 0xd1, 0x2e, 0xc3, 0x4f, 0x5f, 0x71, 0x09, 0xcb, 0x77, 0x06, 0xdf, - 0x17, 0x9d, 0xdf, 0x4f, 0xbe, 0xc1, 0x87, 0x33, 0x3e, 0xfa, 0x12, 0x6c, - 0x1c, 0x86, 0x37, 0x80, 0xfc, 0xb5, 0xf9, 0xfd, 0x53, 0x8e, 0x0f, 0x9f, - 0x77, 0xd1, 0x6b, 0xff, 0x61, 0x7e, 0x2e, 0x80, 0x3f, 0xe2, 0xf3, 0x39, - 0x7e, 0xc7, 0x3e, 0xb6, 0x2d, 0x80, 0xcd, 0x55, 0xcc, 0xa7, 0xfa, 0x6c, - 0x84, 0xe4, 0x03, 0x20, 0xbe, 0x0b, 0xe3, 0xbf, 0x80, 0x1f, 0x4b, 0xc1, - 0x7a, 0x2d, 0xea, 0xbc, 0x2a, 0xeb, 0xd9, 0xc1, 0xf3, 0xc3, 0xf4, 0xad, - 0xb8, 0x1f, 0xbe, 0x5e, 0xf4, 0x87, 0x08, 0x3e, 0x8f, 0x7f, 0xef, 0xd6, - 0xc3, 0x83, 0xcf, 0x13, 0x53, 0x5e, 0xf4, 0xca, 0x2f, 0xac, 0x5f, 0x53, - 0x9d, 0x7e, 0xa4, 0x8a, 0xf4, 0x47, 0xfb, 0x83, 0x96, 0xab, 0x9f, 0x83, - 0xf7, 0xb7, 0x3f, 0x6c, 0xbe, 0x89, 0x6c, 0xab, 0x39, 0x30, 0xfe, 0x0b, - 0xb4, 0x6f, 0x8e, 0x3f, 0x8e, 0xe3, 0xe7, 0x5e, 0xae, 0x1f, 0xb2, 0x5e, - 0xff, 0xbf, 0x89, 0xe7, 0xb7, 0x7f, 0x3d, 0x3f, 0xa4, 0x3f, 0x87, 0xfa, - 0xaf, 0xd1, 0xf7, 0xa5, 0xf4, 0xca, 0xbd, 0xfe, 0xfd, 0xdb, 0xb5, 0xc9, - 0xbf, 0xa3, 0xbf, 0x58, 0xbe, 0x86, 0xef, 0x37, 0x5e, 0x85, 0x3f, 0xfe, - 0xe7, 0x3f, 0x49, 0xf2, 0xf9, 0x48, 0x47, 0x13, 0x35, 0xf2, 0x13, 0xbb, - 0xbc, 0xeb, 0x35, 0x57, 0x3f, 0xc2, 0x27, 0x91, 0x69, 0xbe, 0x4b, 0x1c, - 0xaf, 0x21, 0x1e, 0xfe, 0x1d, 0xd9, 0xf7, 0xce, 0x59, 0xb1, 0xef, 0xae, - 0xbd, 0xee, 0x3c, 0x6b, 0xaf, 0x67, 0xd1, 0x5e, 0x7f, 0x2e, 0xa4, 0x9e, - 0xee, 0xe8, 0xa7, 0x10, 0xfe, 0xd9, 0xd4, 0xd8, 0x78, 0xbe, 0xdf, 0xf0, - 0x90, 0x94, 0xbd, 0x06, 0xd4, 0xe9, 0x3a, 0xaf, 0xbd, 0xde, 0x34, 0x1b, - 0xf6, 0xda, 0x5e, 0x26, 0x69, 0xaf, 0x97, 0xcf, 0xd0, 0x5e, 0x3b, 0xf5, - 0xba, 0x5d, 0xbe, 0xef, 0x8b, 0xd8, 0x5c, 0x3e, 0x29, 0x9b, 0x46, 0x53, - 0xfc, 0xbe, 0x86, 0xda, 0xef, 0x03, 0xd4, 0x7e, 0x3b, 0xcf, 0xb7, 0x16, - 0x56, 0xd1, 0x47, 0x9d, 0x32, 0xf6, 0x0a, 0xdb, 0xcf, 0x4e, 0xbf, 0xfd, - 0xdc, 0x15, 0xfc, 0xbe, 0xb3, 0xd7, 0x7e, 0xf6, 0x4a, 0xd9, 0xcf, 0x4e, - 0x49, 0xfb, 0x29, 0x47, 0x3f, 0x9f, 0x5f, 0xbb, 0xbd, 0xec, 0x9c, 0x65, - 0x7b, 0xd9, 0x29, 0x69, 0x2f, 0x3b, 0x25, 0xed, 0x65, 0xe7, 0x29, 0xdb, - 0x4b, 0xf3, 0x94, 0xec, 0x65, 0x67, 0xb4, 0xbd, 0x7c, 0x46, 0xb0, 0x97, - 0xa8, 0x36, 0xf9, 0x14, 0xdf, 0x77, 0x71, 0xed, 0x65, 0xf8, 0xf3, 0x4c, - 0x72, 0x9e, 0xbc, 0x9e, 0x7b, 0x86, 0xec, 0x15, 0xfb, 0xfe, 0x84, 0xf8, - 0x7d, 0x89, 0xb0, 0xf3, 0x42, 0x4e, 0x7e, 0xf7, 0xd4, 0xbe, 0x07, 0x40, - 0xfb, 0x41, 0x36, 0x63, 0x0c, 0x2b, 0xe0, 0xfb, 0x4b, 0x9e, 0xfa, 0x47, - 0x70, 0xbf, 0x91, 0x03, 0xb8, 0xf9, 0x5d, 0x05, 0xea, 0xbf, 0x29, 0xc3, - 0xc6, 0xfb, 0x75, 0xdf, 0x77, 0xe2, 0xf4, 0xa2, 0xf6, 0x8c, 0x6a, 0xb5, - 0xec, 0xc3, 0x6c, 0x9d, 0x0e, 0xec, 0x37, 0xc2, 0x8a, 0x55, 0xf1, 0xe9, - 0xeb, 0x1a, 0xf3, 0x65, 0x61, 0xfc, 0x30, 0xe3, 0x58, 0x7e, 0xcf, 0xd9, - 0x9c, 0x1c, 0xbf, 0x78, 0x39, 0x2a, 0x65, 0x50, 0xde, 0xc4, 0x67, 0xbf, - 0xaf, 0x29, 0x16, 0x83, 0xfc, 0x02, 0xf9, 0xbe, 0x14, 0x22, 0x1f, 0xc9, - 0xb6, 0x15, 0xda, 0xb1, 0x60, 0xa2, 0x36, 0x64, 0xb5, 0x63, 0x79, 0x1f, - 0x8f, 0xb9, 0xf9, 0x10, 0x56, 0x5a, 0x47, 0xbd, 0x83, 0x25, 0xa5, 0x42, - 0xfe, 0x3b, 0x11, 0x6a, 0x84, 0xf7, 0xc3, 0x0e, 0x0c, 0x22, 0xe8, 0x67, - 0x00, 0x79, 0x59, 0x56, 0x83, 0xbe, 0xe1, 0xfd, 0xa4, 0x6e, 0x7f, 0x58, - 0x9f, 0xd0, 0x1f, 0x36, 0x25, 0xf4, 0x1b, 0xf4, 0x45, 0xf7, 0x87, 0xd9, - 0x4b, 0x23, 0xed, 0x69, 0x65, 0x7d, 0x9f, 0x7d, 0xdf, 0x84, 0x1e, 0x5e, - 0x0c, 0xea, 0x5f, 0xf0, 0x71, 0xaf, 0xac, 0x7e, 0x4c, 0xb1, 0x8c, 0xe6, - 0x24, 0x79, 0x7f, 0x8e, 0x9c, 0xf7, 0x66, 0xcd, 0x51, 0x39, 0x50, 0xbf, - 0x4a, 0x8e, 0x61, 0x79, 0x1c, 0xb9, 0x7a, 0x5c, 0x1f, 0xd0, 0xac, 0x11, - 0xde, 0x0f, 0xa4, 0xa6, 0x51, 0xe9, 0x42, 0xb2, 0x1e, 0xf8, 0x65, 0x7c, - 0x02, 0x39, 0xfd, 0xa5, 0x95, 0xf4, 0xf8, 0xeb, 0x61, 0xc0, 0x9e, 0x51, - 0xd0, 0x2f, 0xa6, 0xfb, 0x3e, 0x1b, 0x81, 0x43, 0xbe, 0x47, 0x11, 0x64, - 0x1f, 0x56, 0xeb, 0x6e, 0xfd, 0x62, 0xb6, 0xbf, 0x87, 0x51, 0xc1, 0x9f, - 0x21, 0x92, 0x9f, 0x5b, 0x34, 0xae, 0x9f, 0x20, 0xf9, 0x51, 0xf7, 0x7d, - 0x2b, 0xca, 0x9f, 0xa2, 0x0e, 0xf7, 0x75, 0x64, 0x65, 0x36, 0x36, 0xa0, - 0x10, 0xfe, 0x10, 0x85, 0xa5, 0xa6, 0x38, 0x7f, 0xc0, 0x3e, 0xc7, 0x33, - 0x51, 0xfc, 0x49, 0xfa, 0xf9, 0x43, 0xf8, 0xbb, 0x21, 0x0d, 0xf6, 0xaf, - 0x08, 0xfe, 0xb9, 0x07, 0xb6, 0x6b, 0xf4, 0xd7, 0x57, 0xe9, 0x51, 0xfd, - 0x63, 0xa7, 0xc6, 0x9f, 0x4a, 0xfd, 0xe0, 0xef, 0x0f, 0xf0, 0xe8, 0x2f, - 0x9f, 0x3f, 0xed, 0xe4, 0x1f, 0xdb, 0xb1, 0x3f, 0xdd, 0x62, 0xaa, 0x17, - 0xa6, 0x1f, 0x51, 0x8a, 0x5f, 0xf7, 0xf4, 0x9b, 0x60, 0x77, 0xcb, 0x76, - 0xde, 0xcf, 0x7e, 0x3a, 0xe6, 0x9e, 0x6f, 0x40, 0xbe, 0x50, 0x47, 0x3d, - 0x13, 0xff, 0xc1, 0xed, 0x5f, 0xf4, 0x7d, 0xf2, 0xec, 0xaf, 0xb6, 0xfb, - 0x74, 0x46, 0xf6, 0x87, 0xac, 0x17, 0x54, 0x6f, 0xbf, 0xd8, 0x9f, 0xc5, - 0xab, 0xec, 0xb7, 0xf7, 0xd0, 0xe9, 0xde, 0x2f, 0xeb, 0xf7, 0x1b, 0x27, - 0xfb, 0x6b, 0xd6, 0xc5, 0xef, 0xaf, 0x39, 0xfb, 0xb3, 0xf0, 0xfe, 0xf4, - 0xae, 0x7a, 0x34, 0xf5, 0x88, 0x82, 0xbc, 0xf5, 0x02, 0xd3, 0xcd, 0x7f, - 0xa1, 0xe2, 0x48, 0xdc, 0xdf, 0x3f, 0xf7, 0xed, 0xba, 0xc8, 0xfd, 0x2d, - 0xea, 0xd0, 0xd0, 0x94, 0x13, 0x4f, 0x48, 0xf6, 0x3b, 0x56, 0xe9, 0xc7, - 0x22, 0xf7, 0xb7, 0xb9, 0x8e, 0xeb, 0x3f, 0x4f, 0xff, 0x1e, 0xb9, 0x6f, - 0x79, 0xb2, 0x5f, 0x33, 0xc6, 0xfa, 0x61, 0xdd, 0xfd, 0x94, 0xa3, 0xeb, - 0xdb, 0x9e, 0x7c, 0xba, 0xd5, 0x7e, 0x3a, 0xef, 0x1b, 0x1a, 0x4e, 0xf8, - 0xfb, 0x15, 0x47, 0x13, 0x32, 0xfd, 0x8b, 0x71, 0x33, 0xff, 0x9a, 0xb9, - 0xa5, 0x15, 0xad, 0x6f, 0x33, 0xa6, 0xa9, 0x1d, 0x5a, 0x9d, 0x88, 0xce, - 0xef, 0x47, 0xf7, 0x8f, 0x86, 0xf7, 0x4b, 0x9c, 0x10, 0xbf, 0x4f, 0x49, - 0xe5, 0x4f, 0xcd, 0x0c, 0x91, 0xef, 0xd1, 0x38, 0xe7, 0x55, 0xc7, 0x9f, - 0xaf, 0xd3, 0xfe, 0x08, 0xb8, 0x2f, 0xcd, 0x4d, 0xe3, 0x5a, 0x5f, 0x64, - 0xff, 0xf2, 0x05, 0x21, 0x7f, 0x6f, 0x10, 0xe2, 0xe7, 0x74, 0x0b, 0x3e, - 0x3f, 0xc7, 0xdf, 0xbc, 0x33, 0x1e, 0xed, 0xaf, 0x9e, 0xa6, 0xfb, 0x13, - 0xf2, 0xbe, 0x62, 0x65, 0xbe, 0xc1, 0xdf, 0x0f, 0x53, 0xf1, 0xfe, 0xa2, - 0xb2, 0x9b, 0xc5, 0x17, 0x8c, 0x3e, 0x15, 0xfc, 0x99, 0x20, 0x7b, 0x0a, - 0x85, 0x68, 0xfa, 0xfd, 0x02, 0x2b, 0x59, 0xbd, 0x3e, 0x23, 0xc6, 0xa7, - 0x2b, 0x0e, 0x45, 0x7f, 0xef, 0x6d, 0x7f, 0x88, 0xff, 0xe2, 0xc4, 0x9b, - 0xbe, 0x78, 0x7c, 0x34, 0x09, 0xf6, 0xa9, 0x14, 0x63, 0xf5, 0x24, 0x6b, - 0xb3, 0xe7, 0xfb, 0x42, 0x29, 0x7f, 0x3c, 0x3d, 0xc3, 0xfe, 0xab, 0x95, - 0x92, 0xf1, 0xf4, 0xaa, 0x43, 0xa7, 0xfa, 0xbd, 0x44, 0xc6, 0x7f, 0xaa, - 0xa0, 0xad, 0xf9, 0xec, 0x7d, 0x17, 0xdd, 0x11, 0xde, 0x38, 0xe1, 0x47, - 0x73, 0x57, 0x9e, 0xbc, 0x77, 0xd5, 0xd9, 0x4a, 0x26, 0xd8, 0x47, 0x49, - 0x59, 0x1f, 0xaf, 0xfc, 0x23, 0x7a, 0xdf, 0xaa, 0xc5, 0x7f, 0x6e, 0xbd, - 0xd5, 0xff, 0x7d, 0x50, 0x8e, 0x9f, 0xee, 0x67, 0x84, 0xe4, 0xeb, 0x8a, - 0xc1, 0xf1, 0x7b, 0x71, 0x2c, 0x1e, 0x10, 0x8f, 0x31, 0x7c, 0xd4, 0x97, - 0x1d, 0xa4, 0xfd, 0x2c, 0xb1, 0x9a, 0xfd, 0x69, 0xe7, 0xf9, 0x74, 0xfb, - 0x93, 0x8e, 0x7d, 0x62, 0xf9, 0x97, 0x7e, 0x4f, 0x7f, 0x1d, 0x97, 0xc7, - 0x94, 0xcc, 0xf9, 0x5e, 0xe8, 0xa9, 0x47, 0x92, 0x7c, 0x52, 0x4f, 0xce, - 0xf1, 0xbf, 0x08, 0x3f, 0xf2, 0x21, 0xf1, 0x24, 0x86, 0x73, 0x73, 0xdc, - 0x78, 0x1b, 0xa1, 0x9b, 0x79, 0x3f, 0xf4, 0x89, 0xf9, 0x33, 0x97, 0x2f, - 0xfb, 0xaa, 0x33, 0x26, 0x5f, 0xc1, 0xf4, 0xf5, 0x86, 0xfd, 0x3d, 0x55, - 0x51, 0x1e, 0xc3, 0xea, 0x59, 0xa1, 0xf9, 0xb5, 0x47, 0xfc, 0xfd, 0x44, - 0xbc, 0x5f, 0x54, 0xcc, 0xaf, 0x49, 0xc6, 0x5b, 0x8e, 0x7c, 0x82, 0x80, - 0xb4, 0x98, 0x1a, 0xc4, 0x57, 0xbd, 0x71, 0x8a, 0xaf, 0xcb, 0x77, 0x3e, - 0xce, 0xf7, 0x54, 0x69, 0x3f, 0x04, 0x41, 0xe7, 0x7e, 0xbf, 0xc2, 0x91, - 0xd7, 0x55, 0x1e, 0xff, 0x01, 0x0d, 0xc6, 0xb9, 0xbc, 0xe3, 0xe9, 0xf6, - 0xb7, 0x92, 0x41, 0xfd, 0x10, 0xb3, 0x13, 0x8f, 0xd3, 0xf8, 0x77, 0x9e, - 0xea, 0xc4, 0xe3, 0x95, 0xf1, 0x4b, 0x95, 0xf7, 0x05, 0x04, 0x7c, 0x90, - 0x1d, 0x87, 0xb3, 0x2f, 0x2d, 0x99, 0x35, 0x7c, 0x4f, 0x44, 0xbc, 0x1f, - 0x53, 0x0d, 0x06, 0xfe, 0xf9, 0xed, 0x83, 0x38, 0xbf, 0x43, 0xae, 0x5f, - 0x5c, 0x1a, 0xff, 0x0d, 0xa7, 0x84, 0x1f, 0x5e, 0x36, 0x88, 0x96, 0xcf, - 0x65, 0x91, 0xf8, 0x40, 0xb4, 0x72, 0x6a, 0xed, 0xfc, 0x9a, 0xe1, 0xdf, - 0x6f, 0x73, 0xfe, 0x7e, 0xb1, 0x21, 0xc0, 0x59, 0x01, 0x36, 0x05, 0xd8, - 0x12, 0x60, 0x96, 0xef, 0x77, 0x61, 0x5d, 0x80, 0x0d, 0x01, 0xce, 0x0a, - 0xb0, 0x29, 0xc0, 0x67, 0xf6, 0xef, 0x51, 0xd9, 0x02, 0x5c, 0xf5, 0xef, - 0xad, 0xcd, 0x32, 0x7d, 0x67, 0x7f, 0xce, 0xfe, 0x9c, 0xfd, 0x89, 0xf8, - 0xf9, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xec, 0x5d, 0x7b, 0x90, 0x1c, - 0x47, 0x79, 0xef, 0xee, 0x79, 0xec, 0xec, 0xde, 0xde, 0x6a, 0x75, 0x3e, - 0x89, 0xf5, 0x59, 0xb2, 0xe6, 0x24, 0x59, 0x3a, 0x52, 0x46, 0x75, 0x16, - 0xb2, 0x39, 0x9b, 0x8b, 0x99, 0x93, 0x4e, 0x46, 0x32, 0x12, 0x11, 0x06, - 0x82, 0x4c, 0x01, 0xd9, 0xc3, 0x45, 0x95, 0x6c, 0x1c, 0xd9, 0x24, 0x0e, - 0x39, 0x63, 0xa7, 0xdc, 0x7b, 0xb7, 0xf7, 0x30, 0xe8, 0x5c, 0x67, 0x61, - 0x8c, 0x30, 0xc6, 0xec, 0x49, 0x32, 0x56, 0x61, 0x2a, 0x50, 0xe5, 0xa4, - 0xca, 0xf0, 0x47, 0xb2, 0xd6, 0x83, 0x08, 0x4a, 0xaa, 0x3a, 0x70, 0xe2, - 0x22, 0x29, 0x2a, 0x59, 0x3b, 0x29, 0x47, 0x3c, 0xa2, 0x28, 0x01, 0x93, - 0x33, 0x18, 0x94, 0x7e, 0xcf, 0x74, 0xef, 0xcc, 0xec, 0x9e, 0x24, 0x53, - 0x24, 0x70, 0x7f, 0xd8, 0x1e, 0xcf, 0x6c, 0x4f, 0x4f, 0xf7, 0xd7, 0xdf, - 0xfb, 0xfb, 0x7d, 0xfd, 0x4c, 0xbf, 0xe2, 0xf8, 0x32, 0x34, 0xdf, 0xca, - 0x43, 0x79, 0x8b, 0xd8, 0x17, 0xf3, 0x0f, 0xc2, 0x3d, 0xb0, 0x3e, 0x0e, - 0x0f, 0xbd, 0x07, 0x9c, 0xc2, 0xfb, 0xed, 0xea, 0x26, 0x68, 0x71, 0x7f, - 0x6d, 0x0e, 0x3c, 0x42, 0xcf, 0xec, 0x0a, 0xb7, 0xd7, 0x83, 0x5f, 0x1b, - 0x70, 0x30, 0xe7, 0x57, 0x37, 0xb9, 0xcc, 0x7b, 0x4a, 0xe4, 0x77, 0xb9, - 0x08, 0x82, 0x07, 0x73, 0xe3, 0x57, 0x77, 0x58, 0xdc, 0x3f, 0x95, 0x7f, - 0x74, 0xce, 0x2e, 0x23, 0x04, 0x96, 0x2e, 0x05, 0x6e, 0xb9, 0x34, 0xa9, - 0xf4, 0xdf, 0xa2, 0xa8, 0x3f, 0x1d, 0xa6, 0xf6, 0x72, 0x75, 0xb3, 0xf2, - 0x0f, 0xac, 0x23, 0xfa, 0x6b, 0x80, 0x96, 0x6d, 0x5d, 0x03, 0x65, 0xfe, - 0xd9, 0x2d, 0xa9, 0xfd, 0x38, 0x73, 0x98, 0xa9, 0x13, 0xb5, 0xcd, 0xef, - 0xed, 0xa3, 0xb7, 0x70, 0x0e, 0x67, 0xf9, 0xb5, 0xe8, 0x17, 0x27, 0xef, - 0x7b, 0x75, 0xc6, 0x48, 0xa7, 0x0f, 0xfb, 0x3a, 0xbf, 0xf1, 0xfb, 0xa8, - 0xbc, 0xf2, 0x3b, 0x66, 0x0b, 0x9b, 0x68, 0xd0, 0x9a, 0xfa, 0xf3, 0x62, - 0xde, 0xf7, 0x5e, 0x47, 0x7e, 0x1f, 0x00, 0xef, 0x30, 0xe4, 0x97, 0xc2, - 0xdb, 0x62, 0xf6, 0xa5, 0xef, 0x8b, 0xe7, 0x77, 0x23, 0x5c, 0x73, 0xfc, - 0x8b, 0x95, 0x27, 0xaf, 0xfb, 0x5f, 0x51, 0xbf, 0x1c, 0x91, 0xff, 0xb1, - 0x56, 0xec, 0x8f, 0xcf, 0x9a, 0x73, 0xfb, 0x8e, 0xa4, 0x0f, 0x9a, 0x2b, - 0x18, 0x78, 0xbe, 0x53, 0x74, 0xf8, 0xfa, 0x47, 0xe9, 0xa5, 0x41, 0xe8, - 0x65, 0x98, 0xda, 0x9b, 0xfe, 0xcd, 0x1b, 0xa1, 0xc8, 0x47, 0x94, 0xf2, - 0x0d, 0x89, 0x7a, 0x45, 0x2a, 0xbb, 0xbd, 0xeb, 0xdf, 0xe9, 0x4a, 0x7c, - 0x23, 0x93, 0x5e, 0xec, 0x2e, 0x80, 0xa7, 0xed, 0xc9, 0xfc, 0x6c, 0x9e, - 0x5c, 0xe7, 0xa9, 0x7f, 0x73, 0xbb, 0xb1, 0xde, 0xca, 0x7f, 0xcc, 0xea, - 0x09, 0x99, 0x38, 0xc4, 0x9b, 0xa5, 0x44, 0xaf, 0x31, 0x54, 0x55, 0xb0, - 0x6c, 0x6b, 0x6f, 0x9b, 0xf4, 0x13, 0xa9, 0x07, 0x12, 0xf8, 0x2a, 0xac, - 0xff, 0x6b, 0x31, 0x7c, 0x1f, 0x53, 0xb9, 0xfc, 0x48, 0xbc, 0x23, 0x48, - 0xcb, 0x67, 0xf4, 0x11, 0xa3, 0xa7, 0x6c, 0x38, 0x7e, 0xfa, 0xfc, 0x2f, - 0xb1, 0xfe, 0x71, 0x11, 0xe7, 0xbf, 0xff, 0xd7, 0x7a, 0xfe, 0xff, 0xe0, - 0x12, 0x9d, 0xff, 0xe6, 0xfd, 0x4a, 0x5f, 0xaf, 0xff, 0x6b, 0xfb, 0xf3, - 0xff, 0x95, 0xff, 0xef, 0xf5, 0x22, 0xf6, 0x70, 0xe4, 0xfc, 0xca, 0xfd, - 0xef, 0x5d, 0x24, 0xff, 0x97, 0xfc, 0xbd, 0x49, 0x9f, 0x94, 0xf8, 0xd7, - 0xca, 0x5e, 0xfa, 0xed, 0xde, 0xef, 0xe6, 0xbf, 0x53, 0x46, 0x7d, 0x5e, - 0x5e, 0xb3, 0x97, 0x4d, 0x7b, 0x2e, 0x87, 0xdf, 0xc4, 0xfe, 0xdd, 0x23, - 0xea, 0x8b, 0x65, 0x3d, 0xf2, 0x58, 0xa0, 0xcb, 0xdb, 0xa3, 0xfa, 0xb5, - 0xe4, 0x9f, 0x78, 0x35, 0xf7, 0xff, 0xf9, 0x49, 0xfa, 0x7f, 0x18, 0x6f, - 0x93, 0xf5, 0xf5, 0x71, 0xf2, 0xd8, 0x52, 0xf7, 0x73, 0xb8, 0x2f, 0x6e, - 0x3c, 0xfc, 0x9e, 0xf9, 0x70, 0xff, 0xf7, 0x6b, 0xfb, 0xaf, 0xfc, 0xa5, - 0xbf, 0xfc, 0xed, 0xdc, 0x6f, 0xfd, 0xaf, 0xd9, 0x5e, 0x7f, 0x77, 0xcc, - 0x7a, 0x23, 0xf3, 0xbc, 0x5d, 0xb2, 0xfd, 0x6c, 0xb9, 0xfe, 0xc9, 0xfb, - 0xf7, 0xab, 0xdf, 0xed, 0xdf, 0xaf, 0xe5, 0xfc, 0x0b, 0xef, 0xa5, 0xdc, - 0x7f, 0x7e, 0xfe, 0x8f, 0x0e, 0xf7, 0x69, 0xe7, 0xbf, 0x4b, 0xf1, 0x83, - 0x8c, 0xc1, 0x1f, 0x16, 0x4d, 0x2f, 0x06, 0x3d, 0x36, 0x9d, 0xff, 0xba, - 0xce, 0x8f, 0x7e, 0x77, 0xfe, 0x2f, 0xf2, 0xfc, 0x6b, 0xfb, 0x1b, 0x73, - 0xfe, 0x0d, 0xfe, 0xbf, 0xb8, 0xfd, 0xfc, 0xcd, 0x3b, 0xef, 0x06, 0xde, - 0x8b, 0x8a, 0xd7, 0xfd, 0xd0, 0xec, 0x6f, 0x62, 0x8b, 0x78, 0x25, 0xe2, - 0xf8, 0xde, 0xa3, 0x36, 0xcf, 0x57, 0xca, 0x1a, 0xf1, 0x8d, 0x19, 0x0d, - 0xbf, 0x5d, 0x7d, 0xab, 0xc0, 0x07, 0x0a, 0x17, 0x44, 0x8f, 0x1f, 0x3c, - 0xad, 0xe3, 0xef, 0xdd, 0xdd, 0xf1, 0x46, 0x89, 0x1f, 0x34, 0x03, 0x78, - 0xfd, 0xf3, 0x5e, 0x8b, 0xd6, 0x3f, 0x03, 0xd8, 0x69, 0x05, 0x91, 0xfe, - 0x67, 0x32, 0xff, 0xcd, 0x92, 0xf9, 0x56, 0xf4, 0x85, 0x14, 0x72, 0xdb, - 0x57, 0xf9, 0xab, 0xf5, 0xbc, 0xd7, 0x46, 0xbc, 0xe3, 0x5d, 0xe1, 0xfb, - 0x01, 0x38, 0x3c, 0xf6, 0x3c, 0x5c, 0x07, 0x1a, 0x79, 0x85, 0x87, 0x1d, - 0xc8, 0xf1, 0x7d, 0x19, 0x3f, 0x9c, 0x7e, 0x0e, 0xd6, 0xa2, 0xf1, 0x43, - 0xad, 0xbe, 0xf7, 0x49, 0x85, 0x9f, 0xbb, 0x99, 0xf6, 0xaf, 0x42, 0xbe, - 0x0b, 0xbc, 0x51, 0x8b, 0xd6, 0xaf, 0xf1, 0x7a, 0x9a, 0xcf, 0x45, 0xea, - 0x21, 0xf7, 0xc8, 0x7c, 0x99, 0x9f, 0x73, 0xfc, 0x5a, 0x3e, 0xaf, 0x71, - 0xab, 0xc9, 0x9f, 0xdf, 0xa2, 0x1f, 0x94, 0xaa, 0xff, 0x17, 0xfd, 0xa0, - 0xfc, 0xf4, 0xfa, 0xc6, 0xfa, 0xea, 0x84, 0x7c, 0x0e, 0x23, 0x3e, 0x0d, - 0x32, 0x46, 0x7e, 0x5b, 0x1d, 0x63, 0x07, 0xae, 0x20, 0x1f, 0xb8, 0xe1, - 0x1f, 0x00, 0x98, 0xca, 0x7d, 0xb6, 0x97, 0xfd, 0x7a, 0xcb, 0x08, 0x53, - 0x35, 0xf1, 0x30, 0xdb, 0xff, 0x89, 0x2f, 0x59, 0xf0, 0x7e, 0x88, 0x23, - 0xf5, 0xf4, 0xb2, 0xde, 0x1d, 0x04, 0x2c, 0xfe, 0x1b, 0x58, 0x99, 0x28, - 0xfe, 0x2c, 0xa8, 0xab, 0xfd, 0x63, 0x5f, 0x93, 0xf1, 0xbe, 0x63, 0x93, - 0xf5, 0xf1, 0xe2, 0xea, 0xe5, 0xb7, 0x23, 0x5e, 0x9f, 0x27, 0xf0, 0x74, - 0x4d, 0xfc, 0x68, 0x5b, 0xdf, 0xaf, 0xe6, 0xdf, 0x7f, 0x0b, 0x81, 0x20, - 0x83, 0xc2, 0xfa, 0x7a, 0x7e, 0x2e, 0xd5, 0xfb, 0xfd, 0x93, 0x22, 0xfe, - 0xb2, 0x17, 0x30, 0x7a, 0x0b, 0xfb, 0xb7, 0x68, 0x78, 0xfa, 0x21, 0xbd, - 0x7c, 0x8b, 0xa6, 0xe6, 0x8d, 0x7d, 0x07, 0x9e, 0x85, 0x8d, 0x69, 0x9e, - 0xff, 0xde, 0x6f, 0x27, 0xd3, 0x97, 0xc4, 0x7f, 0x7d, 0xfa, 0x47, 0x5f, - 0xcd, 0x03, 0x1d, 0xbf, 0x01, 0xb5, 0xa8, 0x5f, 0x15, 0xf2, 0x08, 0x43, - 0xbe, 0xbf, 0x38, 0x3d, 0x7f, 0x52, 0xe5, 0xbf, 0x25, 0x9c, 0x6f, 0x81, - 0x67, 0x23, 0xcf, 0x67, 0xe3, 0x16, 0x5e, 0x2f, 0x54, 0x78, 0x64, 0xe4, - 0x89, 0x17, 0x0b, 0x99, 0xea, 0xd1, 0x11, 0x96, 0x77, 0x88, 0xbf, 0xef, - 0x20, 0x8a, 0x5f, 0x63, 0xd3, 0xa9, 0x96, 0xd9, 0xfb, 0x54, 0xbe, 0x0f, - 0xd2, 0xfb, 0x65, 0x8e, 0xaa, 0xf8, 0x5b, 0xe0, 0x55, 0xd9, 0xf3, 0x45, - 0xf2, 0xbc, 0xfc, 0xfe, 0x40, 0xd8, 0x37, 0x1e, 0xec, 0xc4, 0x41, 0xd1, - 0xb7, 0xc0, 0xc0, 0x6b, 0x0c, 0x6f, 0x21, 0xe9, 0x3c, 0x5e, 0x1b, 0xb5, - 0x87, 0x22, 0xfe, 0x12, 0x00, 0x4e, 0x82, 0xe8, 0x7e, 0x84, 0xf5, 0xce, - 0x82, 0x9e, 0xec, 0x69, 0x10, 0xd0, 0x7e, 0x03, 0x0b, 0xf7, 0xb1, 0x7e, - 0x14, 0x3d, 0xfb, 0x59, 0x8a, 0x11, 0xde, 0xca, 0xeb, 0xd2, 0x31, 0x2a, - 0x02, 0xbc, 0xee, 0xd9, 0x77, 0xc0, 0x70, 0x7d, 0x57, 0x48, 0xbc, 0x7d, - 0x11, 0x7f, 0xff, 0x96, 0x36, 0x9e, 0x84, 0xf7, 0x0a, 0xcf, 0xbf, 0x1e, - 0x8f, 0xe6, 0xeb, 0x37, 0xe1, 0x8a, 0x7e, 0x78, 0x35, 0x8c, 0x1e, 0x24, - 0xd7, 0x53, 0xff, 0x3e, 0x67, 0x2f, 0xc0, 0xa0, 0x1a, 0x47, 0x2f, 0xdb, - 0xd1, 0xe6, 0x0c, 0xa1, 0x77, 0x78, 0x16, 0x34, 0xc6, 0x92, 0xf1, 0x0e, - 0xde, 0x91, 0x80, 0x2f, 0xc7, 0xf9, 0x03, 0xc7, 0x5f, 0xe0, 0xfd, 0x60, - 0xe4, 0x7a, 0x10, 0x3e, 0xd2, 0x50, 0xf1, 0x78, 0x6c, 0x25, 0xe0, 0x1b, - 0xb0, 0xf5, 0xac, 0x67, 0x50, 0xf8, 0xbe, 0x0b, 0xc3, 0x0f, 0x81, 0xee, - 0xa5, 0xc2, 0x0f, 0x99, 0xd1, 0xea, 0xb3, 0xc3, 0xfa, 0xde, 0x05, 0x8b, - 0xdd, 0x1f, 0xa2, 0xf8, 0x69, 0x55, 0x5a, 0xbf, 0x6b, 0xfb, 0x13, 0x12, - 0x6f, 0x9d, 0xfe, 0x09, 0xfc, 0x1e, 0x49, 0x7f, 0xe5, 0x05, 0x13, 0x9f, - 0x87, 0xcf, 0xd7, 0xa7, 0xfc, 0x2c, 0xd3, 0x29, 0xe9, 0x35, 0x07, 0x82, - 0x2c, 0xed, 0x57, 0x40, 0x03, 0xf6, 0x97, 0x41, 0x56, 0xc8, 0xc8, 0xfe, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 21 21:48:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B418DD592E; Mon, 21 Aug 2017 21:48:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67E633898; Mon, 21 Aug 2017 21:48:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7LLmOoF027895; Mon, 21 Aug 2017 21:48:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LLmOTh027894; Mon, 21 Aug 2017 21:48:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708212148.v7LLmOTh027894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Aug 2017 21:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322772 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 322772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 21:48:25 -0000 Author: jhb Date: Mon Aug 21 21:48:24 2017 New Revision: 322772 URL: https://svnweb.freebsd.org/changeset/base/322772 Log: Enable hardfloat CPU instructions in the FP exception handler. This permits compiling with clang's integrated assembler. Sponsored by: DARPA / AFRL Modified: head/sys/mips/mips/exception.S Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Mon Aug 21 20:27:45 2017 (r322771) +++ head/sys/mips/mips/exception.S Mon Aug 21 21:48:24 2017 (r322772) @@ -1102,6 +1102,8 @@ END(MipsTLBMissException) *---------------------------------------------------------------------------- */ NESTED(MipsFPTrap, CALLFRAME_SIZ, ra) + .set push + .set hardfloat PTR_SUBU sp, sp, CALLFRAME_SIZ mfc0 t0, MIPS_COP_0_STATUS HAZARD_DELAY @@ -1201,6 +1203,7 @@ FPReturn: ITLBNOPFIX j ra PTR_ADDU sp, sp, CALLFRAME_SIZ + .set pop END(MipsFPTrap) #ifndef INTRNG From owner-svn-src-head@freebsd.org Mon Aug 21 21:56:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23CFEDD611C; Mon, 21 Aug 2017 21:56:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id E63CA3D7E; Mon, 21 Aug 2017 21:56:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7LLu21p031940; Mon, 21 Aug 2017 21:56:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LLu2kZ031939; Mon, 21 Aug 2017 21:56:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708212156.v7LLu2kZ031939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Aug 2017 21:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322773 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 322773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 21:56:04 -0000 Author: markj Date: Mon Aug 21 21:56:02 2017 New Revision: 322773 URL: https://svnweb.freebsd.org/changeset/base/322773 Log: Fix an off-by-two in the llquantize() action parameter validation. The aggregation created by llquantize() partitions values into buckets; the lower bound of the bucket containing the largest values is b^{m+1}, where b and m are the second and fourth parameters to the action, respectively. Bucket bounds are stored in a 64-bit integer, and so the llquantize() validation checks need to verify that b^{m+1} fits in 64 bits. However, it was only verifying that b^{m-1} fits in 64 bits, so certain parameter combinations could trigger assertion failures in libdtrace. PR: 219451 MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Mon Aug 21 21:48:24 2017 (r322772) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Mon Aug 21 21:56:02 2017 (r322773) @@ -1503,7 +1503,7 @@ dt_compile_agg(dtrace_hdl_t *dtp, dt_node_t *dnp, dtra "divide a power of the factor\n"); } - for (i = 0, order = 1; i < args[2].value; i++) { + for (i = 0, order = 1; i <= args[2].value + 1; i++) { if (order * args[0].value > order) { order *= args[0].value; continue; @@ -1511,7 +1511,7 @@ dt_compile_agg(dtrace_hdl_t *dtp, dt_node_t *dnp, dtra dnerror(dnp, D_LLQUANT_MAGTOOBIG, "llquantize( ) " "factor (%d) raised to power of high magnitude " - "(%d) overflows 64-bits\n", args[0].value, + "(%d) plus 1 overflows 64-bits\n", args[0].value, args[2].value); } From owner-svn-src-head@freebsd.org Mon Aug 21 21:58:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9FA9DD63DE; Mon, 21 Aug 2017 21:58:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5FCE3FB3; Mon, 21 Aug 2017 21:58:43 +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 v7LLwgMx032086; Mon, 21 Aug 2017 21:58:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LLwgXC032084; Mon, 21 Aug 2017 21:58:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708212158.v7LLwgXC032084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Aug 2017 21:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322774 - in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize usr.sbin/dtrace/tests/common/llquantize X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize usr.sbin/dtrace/tests/common/llquantize X-SVN-Commit-Revision: 322774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 21:58:44 -0000 Author: markj Date: Mon Aug 21 21:58:42 2017 New Revision: 322774 URL: https://svnweb.freebsd.org/changeset/base/322774 Log: Add a regression test for r322773. MFC after: 1 week Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d (contents, props changed) Modified: head/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d Mon Aug 21 21:58:42 2017 (r322774) @@ -0,0 +1,35 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2017 Mark Johnston + */ + +/* + * A regression test for FreeBSD r322773. 100^9 fits in 64 bits, but + * llquantize() will create buckets up to 100^{10}, which does not fit. + */ + +BEGIN +{ + @ = llquantize(0, 100, 0, 9, 100); + exit(0); +} Modified: head/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile Mon Aug 21 21:56:02 2017 (r322773) +++ head/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile Mon Aug 21 21:58:42 2017 (r322774) @@ -22,6 +22,7 @@ ${PACKAGE}FILES= \ err.D_LLQUANT_LOWVAL.d \ err.D_LLQUANT_MAGRANGE.d \ err.D_LLQUANT_MAGTOOBIG.d \ + err.D_LLQUANT_MAGTOOBIG.offbyone.d \ err.D_LLQUANT_NSTEPMATCH.d \ err.D_LLQUANT_NSTEPTYPE.d \ err.D_LLQUANT_NSTEPVAL.d \ From owner-svn-src-head@freebsd.org Mon Aug 21 22:26:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80405DD7EB4; Mon, 21 Aug 2017 22:26:50 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4E5C063F3F; Mon, 21 Aug 2017 22:26:50 +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 v7LMQnd0044183; Mon, 21 Aug 2017 22:26:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7LMQn5N044182; Mon, 21 Aug 2017 22:26:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708212226.v7LMQn5N044182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Aug 2017 22:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322775 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize X-SVN-Commit-Revision: 322775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Aug 2017 22:26:50 -0000 Author: markj Date: Mon Aug 21 22:26:49 2017 New Revision: 322775 URL: https://svnweb.freebsd.org/changeset/base/322775 Log: Use an updated copy of the CDDL header boilerplate from illumos. Reported by: Yuri Pankov X-MFC with: r322774 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d Mon Aug 21 21:58:42 2017 (r322774) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d Mon Aug 21 22:26:49 2017 (r322775) @@ -1,26 +1,16 @@ /* - * CDDL HEADER START + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms version + * 1.0 of the CDDL. * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. */ /* - * Copyright (c) 2017 Mark Johnston + * Copyright 2017 Mark Johnston */ /* From owner-svn-src-head@freebsd.org Tue Aug 22 00:10:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A5F9DDDF3A; Tue, 22 Aug 2017 00:10:17 +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 mx1.freebsd.org (Postfix) with ESMTPS id 037F366F26; Tue, 22 Aug 2017 00:10:16 +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 v7M0AGOn084600; Tue, 22 Aug 2017 00:10:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7M0AFV4084597; Tue, 22 Aug 2017 00:10:15 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201708220010.v7M0AFV4084597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 22 Aug 2017 00:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322776 - in head/sys: kern sys x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: kern sys x86/x86 X-SVN-Commit-Revision: 322776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 00:10:17 -0000 Author: cem Date: Tue Aug 22 00:10:15 2017 New Revision: 322776 URL: https://svnweb.freebsd.org/changeset/base/322776 Log: subr_smp: Clean up topology analysis, add additional layers Rather than repeatedly nesting loops, separate concerns with a single loop per call stack level. Use a table to drive the recursive routine. Handle missing topology layers more gracefully (infer a single unit). Analyze some additional optional layers which may be present on e.g. AMD Zen systems (groups, aka dies, per package; and cachegroups, aka CCXes, per group). Display that additional information in the boot-time topology information, when it is relevent (non-one). Reviewed by: markj@, mjoras@ (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12019 Modified: head/sys/kern/subr_smp.c head/sys/sys/smp.h head/sys/x86/x86/mp_x86.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Mon Aug 21 22:26:49 2017 (r322775) +++ head/sys/kern/subr_smp.c Tue Aug 22 00:10:15 2017 (r322776) @@ -993,7 +993,7 @@ topo_next_node(struct topo_node *top, struct topo_node if ((next = TAILQ_NEXT(node, siblings)) != NULL) return (next); - while ((node = node->parent) != top) + while (node != top && (node = node->parent) != top) if ((next = TAILQ_NEXT(node, siblings)) != NULL) return (next); @@ -1012,7 +1012,7 @@ topo_next_nonchild_node(struct topo_node *top, struct if ((next = TAILQ_NEXT(node, siblings)) != NULL) return (next); - while ((node = node->parent) != top) + while (node != top && (node = node->parent) != top) if ((next = TAILQ_NEXT(node, siblings)) != NULL) return (next); @@ -1044,105 +1044,99 @@ topo_set_pu_id(struct topo_node *node, cpuid_t id) } } -/* - * Check if the topology is uniform, that is, each package has the same number - * of cores in it and each core has the same number of threads (logical - * processors) in it. If so, calculate the number of package, the number of - * cores per package and the number of logical processors per core. - * 'all' parameter tells whether to include administratively disabled logical - * processors into the analysis. - */ -int -topo_analyze(struct topo_node *topo_root, int all, - int *pkg_count, int *cores_per_pkg, int *thrs_per_core) +static struct topology_spec { + topo_node_type type; + bool match_subtype; + uintptr_t subtype; +} topology_level_table[TOPO_LEVEL_COUNT] = { + [TOPO_LEVEL_PKG] = { .type = TOPO_TYPE_PKG, }, + [TOPO_LEVEL_GROUP] = { .type = TOPO_TYPE_GROUP, }, + [TOPO_LEVEL_CACHEGROUP] = { + .type = TOPO_TYPE_CACHE, + .match_subtype = true, + .subtype = CG_SHARE_L3, + }, + [TOPO_LEVEL_CORE] = { .type = TOPO_TYPE_CORE, }, + [TOPO_LEVEL_THREAD] = { .type = TOPO_TYPE_PU, }, +}; + +static bool +topo_analyze_table(struct topo_node *root, int all, enum topo_level level, + struct topo_analysis *results) { - struct topo_node *pkg_node; - struct topo_node *core_node; - struct topo_node *pu_node; - int thrs_per_pkg; - int cpp_counter; - int tpc_counter; - int tpp_counter; + struct topology_spec *spec; + struct topo_node *node; + int count; - *pkg_count = 0; - *cores_per_pkg = -1; - *thrs_per_core = -1; - thrs_per_pkg = -1; - pkg_node = topo_root; - while (pkg_node != NULL) { - if (pkg_node->type != TOPO_TYPE_PKG) { - pkg_node = topo_next_node(topo_root, pkg_node); + if (level >= TOPO_LEVEL_COUNT) + return (true); + + spec = &topology_level_table[level]; + count = 0; + node = topo_next_node(root, root); + + while (node != NULL) { + if (node->type != spec->type || + (spec->match_subtype && node->subtype != spec->subtype)) { + node = topo_next_node(root, node); continue; } - if (!all && CPU_EMPTY(&pkg_node->cpuset)) { - pkg_node = topo_next_nonchild_node(topo_root, pkg_node); + if (!all && CPU_EMPTY(&node->cpuset)) { + node = topo_next_nonchild_node(root, node); continue; } - (*pkg_count)++; + count++; - cpp_counter = 0; - tpp_counter = 0; - core_node = pkg_node; - while (core_node != NULL) { - if (core_node->type == TOPO_TYPE_CORE) { - if (!all && CPU_EMPTY(&core_node->cpuset)) { - core_node = - topo_next_nonchild_node(pkg_node, - core_node); - continue; - } + if (!topo_analyze_table(node, all, level + 1, results)) + return (false); - cpp_counter++; + node = topo_next_nonchild_node(root, node); + } - tpc_counter = 0; - pu_node = core_node; - while (pu_node != NULL) { - if (pu_node->type == TOPO_TYPE_PU && - (all || !CPU_EMPTY(&pu_node->cpuset))) - tpc_counter++; - pu_node = topo_next_node(core_node, - pu_node); - } + /* No explicit subgroups is essentially one subgroup. */ + if (count == 0) { + count = 1; - if (*thrs_per_core == -1) - *thrs_per_core = tpc_counter; - else if (*thrs_per_core != tpc_counter) - return (0); + if (!topo_analyze_table(root, all, level + 1, results)) + return (false); + } - core_node = topo_next_nonchild_node(pkg_node, - core_node); - } else { - /* PU node directly under PKG. */ - if (core_node->type == TOPO_TYPE_PU && - (all || !CPU_EMPTY(&core_node->cpuset))) - tpp_counter++; - core_node = topo_next_node(pkg_node, - core_node); - } - } + if (results->entities[level] == -1) + results->entities[level] = count; + else if (results->entities[level] != count) + return (false); - if (*cores_per_pkg == -1) - *cores_per_pkg = cpp_counter; - else if (*cores_per_pkg != cpp_counter) - return (0); - if (thrs_per_pkg == -1) - thrs_per_pkg = tpp_counter; - else if (thrs_per_pkg != tpp_counter) - return (0); + return (true); +} - pkg_node = topo_next_nonchild_node(topo_root, pkg_node); - } +/* + * Check if the topology is uniform, that is, each package has the same number + * of cores in it and each core has the same number of threads (logical + * processors) in it. If so, calculate the number of packages, the number of + * groups per package, the number of cachegroups per group, and the number of + * logical processors per cachegroup. 'all' parameter tells whether to include + * administratively disabled logical processors into the analysis. + */ +int +topo_analyze(struct topo_node *topo_root, int all, + struct topo_analysis *results) +{ - KASSERT(*pkg_count > 0, + results->entities[TOPO_LEVEL_PKG] = -1; + results->entities[TOPO_LEVEL_CORE] = -1; + results->entities[TOPO_LEVEL_THREAD] = -1; + results->entities[TOPO_LEVEL_GROUP] = -1; + results->entities[TOPO_LEVEL_CACHEGROUP] = -1; + + if (!topo_analyze_table(topo_root, all, TOPO_LEVEL_PKG, results)) + return (0); + + KASSERT(results->entities[TOPO_LEVEL_PKG] > 0, ("bug in topology or analysis")); - if (*cores_per_pkg == 0) { - KASSERT(*thrs_per_core == -1 && thrs_per_pkg > 0, - ("bug in topology or analysis")); - *thrs_per_core = thrs_per_pkg; - } return (1); } + #endif /* SMP */ Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Mon Aug 21 22:26:49 2017 (r322775) +++ head/sys/sys/smp.h Tue Aug 22 00:10:15 2017 (r322776) @@ -120,8 +120,25 @@ struct topo_node * topo_next_node(struct topo_node *to struct topo_node * topo_next_nonchild_node(struct topo_node *top, struct topo_node *node); void topo_set_pu_id(struct topo_node *node, cpuid_t id); -int topo_analyze(struct topo_node *topo_root, int all, int *pkg_count, - int *cores_per_pkg, int *thrs_per_core); + +enum topo_level { + TOPO_LEVEL_PKG = 0, + /* + * Some systems have useful sub-package core organizations. On these, + * a package has one or more subgroups. Each subgroup contains one or + * more cache groups (cores that share a last level cache). + */ + TOPO_LEVEL_GROUP, + TOPO_LEVEL_CACHEGROUP, + TOPO_LEVEL_CORE, + TOPO_LEVEL_THREAD, + TOPO_LEVEL_COUNT /* Must be last */ +}; +struct topo_analysis { + int entities[TOPO_LEVEL_COUNT]; +}; +int topo_analyze(struct topo_node *topo_root, int all, + struct topo_analysis *results); #define TOPO_FOREACH(i, root) \ for (i = root; i != NULL; i = topo_next_node(root, i)) Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Mon Aug 21 22:26:49 2017 (r322775) +++ head/sys/x86/x86/mp_x86.c Tue Aug 22 00:10:15 2017 (r322776) @@ -662,18 +662,23 @@ cpu_mp_announce(void) { struct topo_node *node; const char *hyperthread; - int pkg_count; - int cores_per_pkg; - int thrs_per_core; + struct topo_analysis topology; printf("FreeBSD/SMP: "); - if (topo_analyze(&topo_root, 1, &pkg_count, - &cores_per_pkg, &thrs_per_core)) { - printf("%d package(s)", pkg_count); - if (cores_per_pkg > 0) - printf(" x %d core(s)", cores_per_pkg); - if (thrs_per_core > 1) - printf(" x %d hardware threads", thrs_per_core); + if (topo_analyze(&topo_root, 1, &topology)) { + printf("%d package(s)", topology.entities[TOPO_LEVEL_PKG]); + if (topology.entities[TOPO_LEVEL_GROUP] > 1) + printf(" x %d groups", + topology.entities[TOPO_LEVEL_GROUP]); + if (topology.entities[TOPO_LEVEL_CACHEGROUP] > 1) + printf(" x %d cache groups", + topology.entities[TOPO_LEVEL_CACHEGROUP]); + if (topology.entities[TOPO_LEVEL_CORE] > 0) + printf(" x %d core(s)", + topology.entities[TOPO_LEVEL_CORE]); + if (topology.entities[TOPO_LEVEL_THREAD] > 1) + printf(" x %d hardware threads", + topology.entities[TOPO_LEVEL_THREAD]); } else { printf("Non-uniform topology"); } @@ -681,13 +686,21 @@ cpu_mp_announce(void) if (disabled_cpus) { printf("FreeBSD/SMP Online: "); - if (topo_analyze(&topo_root, 0, &pkg_count, - &cores_per_pkg, &thrs_per_core)) { - printf("%d package(s)", pkg_count); - if (cores_per_pkg > 0) - printf(" x %d core(s)", cores_per_pkg); - if (thrs_per_core > 1) - printf(" x %d hardware threads", thrs_per_core); + if (topo_analyze(&topo_root, 0, &topology)) { + printf("%d package(s)", + topology.entities[TOPO_LEVEL_PKG]); + if (topology.entities[TOPO_LEVEL_GROUP] > 1) + printf(" x %d groups", + topology.entities[TOPO_LEVEL_GROUP]); + if (topology.entities[TOPO_LEVEL_CACHEGROUP] > 1) + printf(" x %d cache groups", + topology.entities[TOPO_LEVEL_CACHEGROUP]); + if (topology.entities[TOPO_LEVEL_CORE] > 0) + printf(" x %d core(s)", + topology.entities[TOPO_LEVEL_CORE]); + if (topology.entities[TOPO_LEVEL_THREAD] > 1) + printf(" x %d hardware threads", + topology.entities[TOPO_LEVEL_THREAD]); } else { printf("Non-uniform topology"); } From owner-svn-src-head@freebsd.org Tue Aug 22 03:59:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9846DDEDC0C; Tue, 22 Aug 2017 03:59:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 680006FD1A; Tue, 22 Aug 2017 03:59:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22c.google.com with SMTP id c28so19770631pfe.3; Mon, 21 Aug 2017 20:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=j8SERZSE/hSx8wO4K/+lYH5YEEnmZZ2dEKl3LRvYEZ0=; b=lc5++42WlmrHetiYSkpahjZP718FkEuTvA/vACIKACe78jhIpzeEpY6tHc6PnTPvtH /S7on4s0yY0nqLa5Qhwg7zcgLo1Yzdi9tDQNrD6kPiaxFVfCxdHLDmSD7fp+3TL88yGr rbTpGa/v52PEaFGjWgRMVmOMjqQcVHS4axGQp0a5QOogy2klW1wz9hAG4chYyYjRPmKy kzX0ZSnFzsJY7tCIx0fTDPi5+LwEe0eGarwXLu1ugWpHS0T7GiaodF5m+l9H7NNLyEdU d7zp4zZCugPXGab2HA09jIxvOouidvrQoX0cKkwC3mRweb4wUGkxq6Js9Y1wnOhAbT2b /yvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=j8SERZSE/hSx8wO4K/+lYH5YEEnmZZ2dEKl3LRvYEZ0=; b=TLC2CIpf7/B7HRVeQuVVSI7Ls2XFYzgoSFxBw7S2w2cwXeEk2HQi8n2ZPzSs/5Jd6m 4Vb8RCThWWqPiRObcrL5hD7WoAW7M6AUBUhOD0LKU6lm+wjKkepg97EPTyKhTeIXJWEB jGMvm+ntsxI4S8swbXI0nv/oQXatDjyn+auV66sc43YB8o+h3eP3Baz90wF4cYxy5lJ3 kytfa7cu99y2zgFsf0hjx4Ng8zEB/Rs+Lnw/5gWGSU+bJzvMOA3ScvBGMnyiCH+9fM5t wK1NYTU7czGBIDUE/qzbsPjKY3f4wEvjAMgHgju0+ZnEvE1bHxgQ4URTto33cUiglOq4 ajqw== X-Gm-Message-State: AHYfb5hnlxwJdJR/LzG0oRIipu2WhdpXy6XPv+kWbYdZ8FSaVhJx1ZoF NQio2L5Nv0qrRstj0AM= X-Received: by 10.84.217.86 with SMTP id e22mr2856944plj.22.1503374354508; Mon, 21 Aug 2017 20:59:14 -0700 (PDT) Received: from [10.0.1.119] ([12.37.166.67]) by smtp.gmail.com with ESMTPSA id z8sm20457541pgc.93.2017.08.21.20.59.13 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 20:59:13 -0700 (PDT) Subject: Re: svn commit: r322770 - head/usr.sbin/chown/tests Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_0FF3CA10-F1A0-4E96-8F62-C0CD695C5D94"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201708212023.v7LKN654093357@repo.freebsd.org> Date: Mon, 21 Aug 2017 20:59:10 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201708212023.v7LKN654093357@repo.freebsd.org> To: Glen Barber X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 03:59:15 -0000 --Apple-Mail=_0FF3CA10-F1A0-4E96-8F62-C0CD695C5D94 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Aug 21, 2017, at 13:23, Glen Barber wrote: > > Author: gjb > Date: Mon Aug 21 20:23:05 2017 > New Revision: 322770 > URL: https://svnweb.freebsd.org/changeset/base/322770 > > Log: > Apply changes from bin/chmod/tests/chmod_test.sh (r321949, r321950, > and r322101), adding atf_expect_fail() before chflags(8) is invoked > if the filesystem is ZFS, which does not support UF_IMMUTABLE. > > MFC after: 3 days > Sponsored by: The FreeBSD Foundation Ah, thanks :)! -Ngie --Apple-Mail=_0FF3CA10-F1A0-4E96-8F62-C0CD695C5D94 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZm6wOAAoJEPWDqSZpMIYVKHUQAJdWqf9oq1PyQoR9KbtLaGuL aCNLwGvl99ZFsd5g0IAZ5HLBj/Ag7c8dgFBNj/ChPpDUyTKQVPp+ybH6oiP70/Oh +3w22pVOaiLqCOG1U/9VGei2McIRPNNnY6duDhq6IN/Y68VUxmcGt5ALsFf3rGXz +8CqMQ2m9s8xrxXBnZ4Cr6ImSVVGLuq2HO6BGQkcVPS9whddyscA0afpOYUs8vr5 EfaNYUBPEUtOFdd0lziYdJ8OYwHhzpAMp+iZZkVZyPBNvQ18DmmNTzOyTqpBoVkj WaVErgAVl7JOUYXvYxB5BT++c2/B2rSxTN+6EYFLrUoAmsgApLkTOJEx8xIc97Nb zuuVxzbdddOnvxmXIBSxRJaT962V5hRl2gQifYCg4IOlEVSqJeJm1Sml0TdetMtx nj8gQwIsAasQ3HIx7FwEdJVcl8w2m0EZbsvndougitrCAjS+9M3REGrhdwhRwrHW siNIX1zbqvLGPUKpj7dJ3/KeKjscZvvPGseFZR7KKqHT8rMHi/RR2sd7vDSZWsUV 7nP3LykG4ZpVfWluzGt8buos4V/sST9zx5MILSkrvj4589/GagfCLCoeWL9nSxdA 3wbOO6qtgA2B7uUQNeo6PTHRhdWL5P4ITomxWzkk1r83pzJuvOisQs5xfB96GGvV ndDb4+10doAMRrhVyk80 =C/Ee -----END PGP SIGNATURE----- --Apple-Mail=_0FF3CA10-F1A0-4E96-8F62-C0CD695C5D94-- From owner-svn-src-head@freebsd.org Tue Aug 22 11:11:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 585B6DE27EE; Tue, 22 Aug 2017 11:11:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3A388130C; Tue, 22 Aug 2017 11:11:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7MBBpRa055392; Tue, 22 Aug 2017 11:11:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MBBoTZ055381; Tue, 22 Aug 2017 11:11:50 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201708221111.v7MBBoTZ055381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 22 Aug 2017 11:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322784 - in head/contrib/zstd: . doc doc/educational_decoder lib lib/common lib/compress lib/decompress lib/deprecated lib/dictBuilder lib/legacy programs tests tests/files tests/fuzz ... X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/contrib/zstd: . doc doc/educational_decoder lib lib/common lib/compress lib/decompress lib/deprecated lib/dictBuilder lib/legacy programs tests tests/files tests/fuzz zlibWrapper zlibWrapper/e... X-SVN-Commit-Revision: 322784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 11:11:52 -0000 Author: bapt Date: Tue Aug 22 11:11:49 2017 New Revision: 322784 URL: https://svnweb.freebsd.org/changeset/base/322784 Log: Import zstandard 1.3.1 Added: head/contrib/zstd/lib/common/compiler.h - copied unchanged from r322782, vendor/zstd/dist/lib/common/compiler.h head/contrib/zstd/tests/files/ - copied from r322780, vendor/zstd/dist/tests/files/ head/contrib/zstd/tests/fuzz/ - copied from r322780, vendor/zstd/dist/tests/fuzz/ head/contrib/zstd/tests/poolTests.c - copied unchanged from r322780, vendor/zstd/dist/tests/poolTests.c Deleted: head/contrib/zstd/PATENTS head/contrib/zstd/tests/pool.c Modified: head/contrib/zstd/CONTRIBUTING.md head/contrib/zstd/Makefile head/contrib/zstd/NEWS head/contrib/zstd/README.md head/contrib/zstd/circle.yml head/contrib/zstd/doc/educational_decoder/harness.c head/contrib/zstd/doc/educational_decoder/zstd_decompress.c head/contrib/zstd/doc/educational_decoder/zstd_decompress.h head/contrib/zstd/doc/zstd_compression_format.md head/contrib/zstd/doc/zstd_manual.html head/contrib/zstd/lib/common/bitstream.h head/contrib/zstd/lib/common/error_private.c head/contrib/zstd/lib/common/error_private.h head/contrib/zstd/lib/common/fse.h head/contrib/zstd/lib/common/fse_decompress.c head/contrib/zstd/lib/common/huf.h head/contrib/zstd/lib/common/mem.h head/contrib/zstd/lib/common/pool.c head/contrib/zstd/lib/common/pool.h head/contrib/zstd/lib/common/threading.h head/contrib/zstd/lib/common/xxhash.c head/contrib/zstd/lib/common/zstd_common.c head/contrib/zstd/lib/common/zstd_errors.h head/contrib/zstd/lib/common/zstd_internal.h head/contrib/zstd/lib/compress/fse_compress.c head/contrib/zstd/lib/compress/huf_compress.c head/contrib/zstd/lib/compress/zstd_compress.c head/contrib/zstd/lib/compress/zstd_opt.h head/contrib/zstd/lib/compress/zstdmt_compress.c head/contrib/zstd/lib/compress/zstdmt_compress.h head/contrib/zstd/lib/decompress/huf_decompress.c head/contrib/zstd/lib/decompress/zstd_decompress.c head/contrib/zstd/lib/deprecated/zbuff.h head/contrib/zstd/lib/deprecated/zbuff_common.c head/contrib/zstd/lib/deprecated/zbuff_compress.c head/contrib/zstd/lib/deprecated/zbuff_decompress.c head/contrib/zstd/lib/dictBuilder/cover.c head/contrib/zstd/lib/dictBuilder/zdict.c head/contrib/zstd/lib/dictBuilder/zdict.h head/contrib/zstd/lib/legacy/zstd_legacy.h head/contrib/zstd/lib/legacy/zstd_v01.c head/contrib/zstd/lib/legacy/zstd_v01.h head/contrib/zstd/lib/legacy/zstd_v02.c head/contrib/zstd/lib/legacy/zstd_v02.h head/contrib/zstd/lib/legacy/zstd_v03.c head/contrib/zstd/lib/legacy/zstd_v03.h head/contrib/zstd/lib/legacy/zstd_v04.c head/contrib/zstd/lib/legacy/zstd_v04.h head/contrib/zstd/lib/legacy/zstd_v05.c head/contrib/zstd/lib/legacy/zstd_v05.h head/contrib/zstd/lib/legacy/zstd_v06.c head/contrib/zstd/lib/legacy/zstd_v06.h head/contrib/zstd/lib/legacy/zstd_v07.c head/contrib/zstd/lib/legacy/zstd_v07.h head/contrib/zstd/lib/zstd.h head/contrib/zstd/programs/.gitignore head/contrib/zstd/programs/Makefile head/contrib/zstd/programs/README.md head/contrib/zstd/programs/bench.c head/contrib/zstd/programs/bench.h head/contrib/zstd/programs/datagen.c head/contrib/zstd/programs/datagen.h head/contrib/zstd/programs/dibio.c head/contrib/zstd/programs/dibio.h head/contrib/zstd/programs/fileio.c head/contrib/zstd/programs/fileio.h head/contrib/zstd/programs/platform.h head/contrib/zstd/programs/util.h head/contrib/zstd/programs/zstd.1 head/contrib/zstd/programs/zstd.1.md head/contrib/zstd/programs/zstdcli.c head/contrib/zstd/tests/Makefile head/contrib/zstd/tests/datagencli.c head/contrib/zstd/tests/decodecorpus.c head/contrib/zstd/tests/fullbench.c head/contrib/zstd/tests/fuzzer.c head/contrib/zstd/tests/invalidDictionaries.c head/contrib/zstd/tests/legacy.c head/contrib/zstd/tests/longmatch.c head/contrib/zstd/tests/namespaceTest.c head/contrib/zstd/tests/paramgrill.c head/contrib/zstd/tests/playTests.sh head/contrib/zstd/tests/roundTripCrash.c head/contrib/zstd/tests/symbols.c head/contrib/zstd/tests/zbufftest.c head/contrib/zstd/tests/zstreamtest.c head/contrib/zstd/zlibWrapper/examples/zwrapbench.c head/contrib/zstd/zlibWrapper/gzcompatibility.h head/contrib/zstd/zlibWrapper/gzlib.c head/contrib/zstd/zlibWrapper/gzread.c head/contrib/zstd/zlibWrapper/gzwrite.c head/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c head/contrib/zstd/zlibWrapper/zstd_zlibwrapper.h Directory Properties: head/contrib/zstd/ (props changed) Modified: head/contrib/zstd/CONTRIBUTING.md ============================================================================== --- head/contrib/zstd/CONTRIBUTING.md Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/CONTRIBUTING.md Tue Aug 22 11:11:49 2017 (r322784) @@ -39,4 +39,4 @@ outlined on that page and do not file a public issue. ## License By contributing to Zstandard, you agree that your contributions will be licensed -under the [LICENSE](LICENSE) file in the root directory of this source tree. +under both the [LICENSE](LICENSE) file and the [COPYING](COPYING) file in the root directory of this source tree. Modified: head/contrib/zstd/Makefile ============================================================================== --- head/contrib/zstd/Makefile Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/Makefile Tue Aug 22 11:11:49 2017 (r322784) @@ -74,14 +74,11 @@ zstdmt: zlibwrapper: $(MAKE) -C $(ZWRAPDIR) test -.PHONY: shortest -shortest: +.PHONY: test shortest +test shortest: + $(MAKE) -C $(PRGDIR) allVariants $(MAKE) -C $(TESTDIR) $@ -.PHONY: test -test: - $(MAKE) -C $(TESTDIR) $@ - .PHONY: examples examples: CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all @@ -146,6 +143,11 @@ gcc6build: clean gcc-6 -v CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror" +.PHONY: gcc7build +gcc7build: clean + gcc-7 -v + CC=gcc-7 $(MAKE) all MOREFLAGS="-Werror" + .PHONY: clangbuild clangbuild: clean clang -v @@ -180,7 +182,7 @@ ppc64fuzz: clean CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest gpptest: clean - CC=g++ $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" + CC=$(CXX) $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" gcc5test: clean gcc-5 -v Modified: head/contrib/zstd/NEWS ============================================================================== --- head/contrib/zstd/NEWS Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/NEWS Tue Aug 22 11:11:49 2017 (r322784) @@ -1,3 +1,18 @@ +v1.3.1 +New license : BSD + GPLv2 +perf: substantially decreased memory usage in Multi-threading mode, thanks to reports by Tino Reichardt (@mcmilk) +perf: Multi-threading supports up to 256 threads. Cap at 256 when more are requested (#760) +cli : improved and fixed --list command, by @ib (#772) +cli : command -vV to list supported formats, by @ib (#771) +build : fixed binary variants, reported by @svenha (#788) +build : fix Visual compilation for non x86/x64 targets, reported by Greg Slazinski (@GregSlazinski) (#718) +API exp : breaking change : ZSTD_getframeHeader() provides more information +API exp : breaking change : pinned down values of error codes +doc : fixed huffman example, by Ulrich Kunitz (@ulikunitz) +new : contrib/adaptive-compression, I/O driven compression strength, by Paul Cruz (@paulcruz74) +new : contrib/long_distance_matching, statistics by Stella Lau (@stellamplau) +updated : contrib/linux-kernel, by Nick Terrell (@terrelln) + v1.3.0 cli : new : `--list` command, by Paul Cruz cli : changed : xz/lzma support enabled by default Modified: head/contrib/zstd/README.md ============================================================================== --- head/contrib/zstd/README.md Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/README.md Tue Aug 22 11:11:49 2017 (r322784) @@ -134,12 +134,12 @@ Going into `build` directory, you will find additional ### Status -Zstandard is currently deployed within Facebook. It is used daily to compress and decompress very large amounts of data in multiple formats and use cases. +Zstandard is currently deployed within Facebook. It is used continuously to compress large amounts of data in multiple formats and use cases. Zstandard is considered safe for production environments. ### License -Zstandard is [BSD-licensed](LICENSE). We also provide an [additional patent grant](PATENTS). +Zstandard is dual-licensed under [BSD](LICENSE) and [GPLv2](COPYING). ### Contributing Modified: head/contrib/zstd/circle.yml ============================================================================== --- head/contrib/zstd/circle.yml Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/circle.yml Tue Aug 22 11:11:49 2017 (r322784) @@ -3,7 +3,7 @@ dependencies: - sudo dpkg --add-architecture i386 - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; sudo apt-get -y -qq update - sudo apt-get -y install gcc-powerpc-linux-gnu gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross - - sudo apt-get -y install libstdc++-6-dev clang gcc g++ gcc-5 gcc-6 zlib1g-dev liblzma-dev + - sudo apt-get -y install libstdc++-7-dev clang gcc g++ gcc-5 gcc-6 gcc-7 zlib1g-dev liblzma-dev - sudo apt-get -y install linux-libc-dev:i386 libc6-dev-i386 test: @@ -45,7 +45,7 @@ test: parallel: true - ? | if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make ppc64build && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then true && make clean; fi #could add another test here + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc7build && make clean; fi #could add another test here : parallel: true - ? | @@ -64,7 +64,7 @@ test: #- gcc -v; make -C tests test32 MOREFLAGS="-I/usr/include/x86_64-linux-gnu" && make clean #- make uasan && make clean #- make asan32 && make clean - #- make -C tests test32 CC=clang MOREFLAGS="-g -fsanitize=address -I/usr/include/x86_64-linux-gnu" + #- make -C tests test32 CC=clang MOREFLAGS="-g -fsanitize=address -I/usr/include/x86_64-linux-gnu" # Valgrind tests #- CFLAGS="-O1 -g" make -C zlibWrapper valgrindTest && make clean #- make -C tests valgrindTest && make clean Modified: head/contrib/zstd/doc/educational_decoder/harness.c ============================================================================== --- head/contrib/zstd/doc/educational_decoder/harness.c Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/doc/educational_decoder/harness.c Tue Aug 22 11:11:49 2017 (r322784) @@ -87,7 +87,7 @@ int main(int argc, char **argv) { } size_t decompressed_size = ZSTD_get_decompressed_size(input, input_size); - if (decompressed_size == -1) { + if (decompressed_size == (size_t)-1) { decompressed_size = MAX_COMPRESSION_RATIO * input_size; fprintf(stderr, "WARNING: Compressed data does not contain " "decompressed size, going to assume the compression " @@ -106,10 +106,16 @@ int main(int argc, char **argv) { return 1; } + dictionary_t* const parsed_dict = create_dictionary(); + if (dict) { + parse_dictionary(parsed_dict, dict, dict_size); + } size_t decompressed = ZSTD_decompress_with_dict(output, decompressed_size, - input, input_size, dict, dict_size); + input, input_size, parsed_dict); + free_dictionary(parsed_dict); + write_file(argv[2], output, decompressed); free(input); @@ -117,4 +123,3 @@ int main(int argc, char **argv) { free(dict); input = output = dict = NULL; } - Modified: head/contrib/zstd/doc/educational_decoder/zstd_decompress.c ============================================================================== --- head/contrib/zstd/doc/educational_decoder/zstd_decompress.c Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/doc/educational_decoder/zstd_decompress.c Tue Aug 22 11:11:49 2017 (r322784) @@ -14,22 +14,8 @@ #include #include #include +#include "zstd_decompress.h" -/// Zstandard decompression functions. -/// `dst` must point to a space at least as large as the reconstructed output. -size_t ZSTD_decompress(void *const dst, const size_t dst_len, - const void *const src, const size_t src_len); -/// If `dict != NULL` and `dict_len >= 8`, does the same thing as -/// `ZSTD_decompress` but uses the provided dict -size_t ZSTD_decompress_with_dict(void *const dst, const size_t dst_len, - const void *const src, const size_t src_len, - const void *const dict, const size_t dict_len); - -/// Get the decompressed size of an input stream so memory can be allocated in -/// advance -/// Returns -1 if the size can't be determined -size_t ZSTD_get_decompressed_size(const void *const src, const size_t src_len); - /******* UTILITY MACROS AND TYPES *********************************************/ // Max block size decompressed size is 128 KB and literal blocks can't be // larger than their block @@ -108,10 +94,10 @@ static inline size_t IO_istream_len(const istream_t *c /// Advances the stream by `len` bytes, and returns a pointer to the chunk that /// was skipped. The stream must be byte aligned. -static inline const u8 *IO_read_bytes(istream_t *const in, size_t len); +static inline const u8 *IO_get_read_ptr(istream_t *const in, size_t len); /// Advances the stream by `len` bytes, and returns a pointer to the chunk that /// was skipped so it can be written to. -static inline u8 *IO_write_bytes(ostream_t *const out, size_t len); +static inline u8 *IO_get_write_ptr(ostream_t *const out, size_t len); /// Advance the inner state by `len` bytes. The stream must be byte aligned. static inline void IO_advance_input(istream_t *const in, size_t len); @@ -307,7 +293,7 @@ typedef struct { /// The decoded contents of a dictionary so that it doesn't have to be repeated /// for each frame that uses it -typedef struct { +struct dictionary_s { // Entropy tables HUF_dtable literals_dtable; FSE_dtable ll_dtable; @@ -322,7 +308,7 @@ typedef struct { u64 previous_offsets[3]; u32 dictionary_id; -} dictionary_t; +}; /// A tuple containing the parts necessary to decode and execute a ZSTD sequence /// command @@ -367,27 +353,36 @@ static void execute_sequences(frame_context_t *const c const sequence_command_t *const sequences, const size_t num_sequences); -// Parse a provided dictionary blob for use in decompression -static void parse_dictionary(dictionary_t *const dict, const u8 *src, - size_t src_len); -static void free_dictionary(dictionary_t *const dict); +// Copies literals and returns the total literal length that was copied +static u32 copy_literals(const size_t seq, istream_t *litstream, + ostream_t *const out); + +// Given an offset code from a sequence command (either an actual offset value +// or an index for previous offset), computes the correct offset and udpates +// the offset history +static size_t compute_offset(sequence_command_t seq, u64 *const offset_hist); + +// Given an offset, match length, and total output, as well as the frame +// context for the dictionary, determines if the dictionary is used and +// executes the copy operation +static void execute_match_copy(frame_context_t *const ctx, size_t offset, + size_t match_length, size_t total_output, + ostream_t *const out); + /******* END ZSTD HELPER STRUCTS AND PROTOTYPES *******************************/ size_t ZSTD_decompress(void *const dst, const size_t dst_len, const void *const src, const size_t src_len) { - return ZSTD_decompress_with_dict(dst, dst_len, src, src_len, NULL, 0); + dictionary_t* uninit_dict = create_dictionary(); + size_t const decomp_size = ZSTD_decompress_with_dict(dst, dst_len, src, + src_len, uninit_dict); + free_dictionary(uninit_dict); + return decomp_size; } size_t ZSTD_decompress_with_dict(void *const dst, const size_t dst_len, const void *const src, const size_t src_len, - const void *const dict, - const size_t dict_len) { - dictionary_t parsed_dict; - memset(&parsed_dict, 0, sizeof(dictionary_t)); - // dict_len < 8 is not a valid dictionary - if (dict && dict_len > 8) { - parse_dictionary(&parsed_dict, (const u8 *)dict, dict_len); - } + dictionary_t* parsed_dict) { istream_t in = IO_make_istream(src, src_len); ostream_t out = IO_make_ostream(dst, dst_len); @@ -396,11 +391,9 @@ size_t ZSTD_decompress_with_dict(void *const dst, cons // Multiple frames can be appended into a single file or stream. A frame is // totally independent, has a defined beginning and end, and a set of // parameters which tells the decoder how to decompress it." - while (IO_istream_len(&in) > 0) { - decode_frame(&out, &in, &parsed_dict); - } - free_dictionary(&parsed_dict); + /* this decoder assumes decompression of a single frame */ + decode_frame(&out, &in, parsed_dict); return out.ptr - (u8 *)dst; } @@ -424,30 +417,6 @@ static void decompress_data(frame_context_t *const ctx static void decode_frame(ostream_t *const out, istream_t *const in, const dictionary_t *const dict) { const u32 magic_number = IO_read_bits(in, 32); - - // Skippable frame - // - // "Magic_Number - // - // 4 Bytes, little-endian format. Value : 0x184D2A5?, which means any value - // from 0x184D2A50 to 0x184D2A5F. All 16 values are valid to identify a - // skippable frame." - if ((magic_number & ~0xFU) == 0x184D2A50U) { - // "Skippable frames allow the insertion of user-defined data into a - // flow of concatenated frames. Its design is pretty straightforward, - // with the sole objective to allow the decoder to quickly skip over - // user-defined data and continue decoding. - // - // Skippable frames defined in this specification are compatible with - // LZ4 ones." - const size_t frame_size = IO_read_bits(in, 32); - - // skip over frame - IO_advance_input(in, frame_size); - - return; - } - // Zstandard frame // // "Magic_Number @@ -460,8 +429,8 @@ static void decode_frame(ostream_t *const out, istream return; } - // not a real frame - ERROR("Invalid magic number"); + // not a real frame or a skippable frame + ERROR("Tried to decode non-ZSTD frame"); } /// Decode a frame that contains compressed data. Not all frames do as there @@ -672,8 +641,8 @@ static void decompress_data(frame_context_t *const ctx case 0: { // "Raw_Block - this is an uncompressed block. Block_Size is the // number of bytes to read and copy." - const u8 *const read_ptr = IO_read_bytes(in, block_len); - u8 *const write_ptr = IO_write_bytes(out, block_len); + const u8 *const read_ptr = IO_get_read_ptr(in, block_len); + u8 *const write_ptr = IO_get_write_ptr(out, block_len); // Copy the raw data into the output memcpy(write_ptr, read_ptr, block_len); @@ -685,8 +654,8 @@ static void decompress_data(frame_context_t *const ctx // "RLE_Block - this is a single byte, repeated N times. In which // case, Block_Size is the size to regenerate, while the // "compressed" block is just 1 byte (the byte to repeat)." - const u8 *const read_ptr = IO_read_bytes(in, 1); - u8 *const write_ptr = IO_write_bytes(out, block_len); + const u8 *const read_ptr = IO_get_read_ptr(in, 1); + u8 *const write_ptr = IO_get_write_ptr(out, block_len); // Copy `block_len` copies of `read_ptr[0]` to the output memset(write_ptr, read_ptr[0], block_len); @@ -832,13 +801,13 @@ static size_t decode_literals_simple(istream_t *const switch (block_type) { case 0: { // "Raw_Literals_Block - Literals are stored uncompressed." - const u8 *const read_ptr = IO_read_bytes(in, size); + const u8 *const read_ptr = IO_get_read_ptr(in, size); memcpy(*literals, read_ptr, size); break; } case 1: { // "RLE_Literals_Block - Literals consist of a single byte value repeated N times." - const u8 *const read_ptr = IO_read_bytes(in, 1); + const u8 *const read_ptr = IO_get_read_ptr(in, 1); memset(*literals, read_ptr[0], size); break; } @@ -949,7 +918,7 @@ static void decode_huf_table(HUF_dtable *const dtable, num_symbs = header - 127; const size_t bytes = (num_symbs + 1) / 2; - const u8 *const weight_src = IO_read_bytes(in, bytes); + const u8 *const weight_src = IO_get_read_ptr(in, bytes); for (int i = 0; i < num_symbs; i++) { // "They are encoded forward, 2 @@ -1157,7 +1126,7 @@ static void decompress_sequences(frame_context_t *cons } const size_t len = IO_istream_len(in); - const u8 *const src = IO_read_bytes(in, len); + const u8 *const src = IO_get_read_ptr(in, len); // "After writing the last bit containing information, the compressor writes // a single 1-bit and then fills the byte with 0-7 0 bits of padding." @@ -1262,7 +1231,7 @@ static void decode_seq_table(FSE_dtable *const table, } case seq_rle: { // "RLE_Mode : it's a single code, repeated Number_of_Sequences times." - const u8 symb = IO_read_bytes(in, 1)[0]; + const u8 symb = IO_get_read_ptr(in, 1)[0]; FSE_init_dtable_rle(table, symb); break; } @@ -1303,145 +1272,146 @@ static void execute_sequences(frame_context_t *const c for (size_t i = 0; i < num_sequences; i++) { const sequence_command_t seq = sequences[i]; - { - // If the sequence asks for more literals than are left, the - // sequence must be corrupted - if (seq.literal_length > IO_istream_len(&litstream)) { - CORRUPTION(); - } + const u32 literals_size = copy_literals(seq.literal_length, &litstream, out); + total_output += literals_size; + } - u8 *const write_ptr = IO_write_bytes(out, seq.literal_length); - const u8 *const read_ptr = - IO_read_bytes(&litstream, seq.literal_length); - // Copy literals to output - memcpy(write_ptr, read_ptr, seq.literal_length); + size_t const offset = compute_offset(seq, offset_hist); - total_output += seq.literal_length; - } + size_t const match_length = seq.match_length; - size_t offset; + execute_match_copy(ctx, offset, match_length, total_output, out); - // Offsets are special, we need to handle the repeat offsets - if (seq.offset <= 3) { - // "The first 3 values define a repeated offset and we will call - // them Repeated_Offset1, Repeated_Offset2, and Repeated_Offset3. - // They are sorted in recency order, with Repeated_Offset1 meaning - // 'most recent one'". + total_output += match_length; + } - // Use 0 indexing for the array - u32 idx = seq.offset - 1; - if (seq.literal_length == 0) { - // "There is an exception though, when current sequence's - // literals length is 0. In this case, repeated offsets are - // shifted by one, so Repeated_Offset1 becomes Repeated_Offset2, - // Repeated_Offset2 becomes Repeated_Offset3, and - // Repeated_Offset3 becomes Repeated_Offset1 - 1_byte." - idx++; - } + // Copy any leftover literals + { + size_t len = IO_istream_len(&litstream); + copy_literals(len, &litstream, out); + total_output += len; + } - if (idx == 0) { - offset = offset_hist[0]; - } else { - // If idx == 3 then literal length was 0 and the offset was 3, - // as per the exception listed above - offset = idx < 3 ? offset_hist[idx] : offset_hist[0] - 1; + ctx->current_total_output = total_output; +} - // If idx == 1 we don't need to modify offset_hist[2], since - // we're using the second-most recent code - if (idx > 1) { - offset_hist[2] = offset_hist[1]; - } - offset_hist[1] = offset_hist[0]; - offset_hist[0] = offset; - } +static u32 copy_literals(const size_t literal_length, istream_t *litstream, + ostream_t *const out) { + // If the sequence asks for more literals than are left, the + // sequence must be corrupted + if (literal_length > IO_istream_len(litstream)) { + CORRUPTION(); + } + + u8 *const write_ptr = IO_get_write_ptr(out, literal_length); + const u8 *const read_ptr = + IO_get_read_ptr(litstream, literal_length); + // Copy literals to output + memcpy(write_ptr, read_ptr, literal_length); + + return literal_length; +} + +static size_t compute_offset(sequence_command_t seq, u64 *const offset_hist) { + size_t offset; + // Offsets are special, we need to handle the repeat offsets + if (seq.offset <= 3) { + // "The first 3 values define a repeated offset and we will call + // them Repeated_Offset1, Repeated_Offset2, and Repeated_Offset3. + // They are sorted in recency order, with Repeated_Offset1 meaning + // 'most recent one'". + + // Use 0 indexing for the array + u32 idx = seq.offset - 1; + if (seq.literal_length == 0) { + // "There is an exception though, when current sequence's + // literals length is 0. In this case, repeated offsets are + // shifted by one, so Repeated_Offset1 becomes Repeated_Offset2, + // Repeated_Offset2 becomes Repeated_Offset3, and + // Repeated_Offset3 becomes Repeated_Offset1 - 1_byte." + idx++; + } + + if (idx == 0) { + offset = offset_hist[0]; } else { - // When it's not a repeat offset: - // "if (Offset_Value > 3) offset = Offset_Value - 3;" - offset = seq.offset - 3; + // If idx == 3 then literal length was 0 and the offset was 3, + // as per the exception listed above + offset = idx < 3 ? offset_hist[idx] : offset_hist[0] - 1; - // Shift back history - offset_hist[2] = offset_hist[1]; + // If idx == 1 we don't need to modify offset_hist[2], since + // we're using the second-most recent code + if (idx > 1) { + offset_hist[2] = offset_hist[1]; + } offset_hist[1] = offset_hist[0]; offset_hist[0] = offset; } + } else { + // When it's not a repeat offset: + // "if (Offset_Value > 3) offset = Offset_Value - 3;" + offset = seq.offset - 3; - size_t match_length = seq.match_length; + // Shift back history + offset_hist[2] = offset_hist[1]; + offset_hist[1] = offset_hist[0]; + offset_hist[0] = offset; + } + return offset; +} - u8 *write_ptr = IO_write_bytes(out, match_length); - if (total_output <= ctx->header.window_size) { - // In this case offset might go back into the dictionary - if (offset > total_output + ctx->dict_content_len) { - // The offset goes beyond even the dictionary - CORRUPTION(); - } - - if (offset > total_output) { - // "The rest of the dictionary is its content. The content act - // as a "past" in front of data to compress or decompress, so it - // can be referenced in sequence commands." - const size_t dict_copy = - MIN(offset - total_output, match_length); - const size_t dict_offset = - ctx->dict_content_len - (offset - total_output); - - memcpy(write_ptr, ctx->dict_content + dict_offset, dict_copy); - write_ptr += dict_copy; - match_length -= dict_copy; - } - } else if (offset > ctx->header.window_size) { +static void execute_match_copy(frame_context_t *const ctx, size_t offset, + size_t match_length, size_t total_output, + ostream_t *const out) { + u8 *write_ptr = IO_get_write_ptr(out, match_length); + if (total_output <= ctx->header.window_size) { + // In this case offset might go back into the dictionary + if (offset > total_output + ctx->dict_content_len) { + // The offset goes beyond even the dictionary CORRUPTION(); } - // We must copy byte by byte because the match length might be larger - // than the offset - // ex: if the output so far was "abc", a command with offset=3 and - // match_length=6 would produce "abcabcabc" as the new output - for (size_t i = 0; i < match_length; i++) { - *write_ptr = *(write_ptr - offset); - write_ptr++; - } + if (offset > total_output) { + // "The rest of the dictionary is its content. The content act + // as a "past" in front of data to compress or decompress, so it + // can be referenced in sequence commands." + const size_t dict_copy = + MIN(offset - total_output, match_length); + const size_t dict_offset = + ctx->dict_content_len - (offset - total_output); - total_output += seq.match_length; + memcpy(write_ptr, ctx->dict_content + dict_offset, dict_copy); + write_ptr += dict_copy; + match_length -= dict_copy; + } + } else if (offset > ctx->header.window_size) { + CORRUPTION(); } - // Copy any leftover literals - { - size_t len = IO_istream_len(&litstream); - u8 *const write_ptr = IO_write_bytes(out, len); - const u8 *const read_ptr = IO_read_bytes(&litstream, len); - memcpy(write_ptr, read_ptr, len); - - total_output += len; + // We must copy byte by byte because the match length might be larger + // than the offset + // ex: if the output so far was "abc", a command with offset=3 and + // match_length=6 would produce "abcabcabc" as the new output + for (size_t j = 0; j < match_length; j++) { + *write_ptr = *(write_ptr - offset); + write_ptr++; } - - ctx->current_total_output = total_output; } /******* END SEQUENCE EXECUTION ***********************************************/ /******* OUTPUT SIZE COUNTING *************************************************/ -static void traverse_frame(const frame_header_t *const header, istream_t *const in); - /// Get the decompressed size of an input stream so memory can be allocated in /// advance. -/// This is more complex than the implementation in the reference -/// implementation, as this API allows for the decompression of multiple -/// concatenated frames. +/// This implementation assumes `src` points to a single ZSTD-compressed frame size_t ZSTD_get_decompressed_size(const void *src, const size_t src_len) { istream_t in = IO_make_istream(src, src_len); - size_t dst_size = 0; - // Each frame header only gives us the size of its frame, so iterate over - // all - // frames - while (IO_istream_len(&in) > 0) { + // get decompressed size from ZSTD frame header + { const u32 magic_number = IO_read_bits(&in, 32); - if ((magic_number & ~0xFU) == 0x184D2A50U) { - // skippable frame, this has no impact on output size - const size_t frame_size = IO_read_bits(&in, 32); - IO_advance_input(&in, frame_size); - } else if (magic_number == 0xFD2FB528U) { + if (magic_number == 0xFD2FB528U) { // ZSTD frame frame_header_t header; parse_frame_header(&header, &in); @@ -1451,68 +1421,42 @@ size_t ZSTD_get_decompressed_size(const void *src, con return -1; } - dst_size += header.frame_content_size; - - // Consume the input from the frame to reach the start of the next - traverse_frame(&header, &in); + return header.frame_content_size; } else { - // not a real frame - ERROR("Invalid magic number"); + // not a real frame or skippable frame + ERROR("ZSTD frame magic number did not match"); } } - - return dst_size; } +/******* END OUTPUT SIZE COUNTING *********************************************/ -/// Iterate over each block in a frame to find the end of it, to get to the -/// start of the next frame -static void traverse_frame(const frame_header_t *const header, istream_t *const in) { - int last_block = 0; +/******* DICTIONARY PARSING ***************************************************/ +#define DICT_SIZE_ERROR() ERROR("Dictionary size cannot be less than 8 bytes") +#define NULL_SRC() ERROR("Tried to create dictionary with pointer to null src"); - do { - // Parse the block header - last_block = IO_read_bits(in, 1); - const int block_type = IO_read_bits(in, 2); - const size_t block_len = IO_read_bits(in, 21); - - switch (block_type) { - case 0: // Raw block, block_len bytes - IO_advance_input(in, block_len); - break; - case 1: // RLE block, 1 byte - IO_advance_input(in, 1); - break; - case 2: // Compressed block, compressed size is block_len - IO_advance_input(in, block_len); - break; - case 3: - // Reserved block type - CORRUPTION(); - break; - default: - IMPOSSIBLE(); - } - } while (!last_block); - - if (header->content_checksum_flag) { - IO_advance_input(in, 4); +dictionary_t* create_dictionary() { + dictionary_t* dict = calloc(1, sizeof(dictionary_t)); + if (!dict) { + BAD_ALLOC(); } + return dict; } -/******* END OUTPUT SIZE COUNTING *********************************************/ - -/******* DICTIONARY PARSING ***************************************************/ static void init_dictionary_content(dictionary_t *const dict, istream_t *const in); -static void parse_dictionary(dictionary_t *const dict, const u8 *src, +void parse_dictionary(dictionary_t *const dict, const void *src, size_t src_len) { + const u8 *byte_src = (const u8 *)src; memset(dict, 0, sizeof(dictionary_t)); + if (src == NULL) { /* cannot initialize dictionary with null src */ + NULL_SRC(); + } if (src_len < 8) { - INP_SIZE(); + DICT_SIZE_ERROR(); } - istream_t in = IO_make_istream(src, src_len); + istream_t in = IO_make_istream(byte_src, src_len); const u32 magic_number = IO_read_bits(&in, 32); if (magic_number != 0xEC30A437) { @@ -1564,13 +1508,13 @@ static void init_dictionary_content(dictionary_t *cons BAD_ALLOC(); } - const u8 *const content = IO_read_bytes(in, dict->content_size); + const u8 *const content = IO_get_read_ptr(in, dict->content_size); memcpy(dict->content, content, dict->content_size); } /// Free an allocated dictionary -static void free_dictionary(dictionary_t *const dict) { +void free_dictionary(dictionary_t *const dict) { HUF_free_dtable(&dict->literals_dtable); FSE_free_dtable(&dict->ll_dtable); FSE_free_dtable(&dict->of_dtable); @@ -1579,6 +1523,8 @@ static void free_dictionary(dictionary_t *const dict) free(dict->content); memset(dict, 0, sizeof(dictionary_t)); + + free(dict); } /******* END DICTIONARY PARSING ***********************************************/ @@ -1657,7 +1603,7 @@ static inline size_t IO_istream_len(const istream_t *c /// Returns a pointer where `len` bytes can be read, and advances the internal /// state. The stream must be byte aligned. -static inline const u8 *IO_read_bytes(istream_t *const in, size_t len) { +static inline const u8 *IO_get_read_ptr(istream_t *const in, size_t len) { if (len > in->len) { INP_SIZE(); } @@ -1671,7 +1617,7 @@ static inline const u8 *IO_read_bytes(istream_t *const return ptr; } /// Returns a pointer to write `len` bytes to, and advances the internal state -static inline u8 *IO_write_bytes(ostream_t *const out, size_t len) { +static inline u8 *IO_get_write_ptr(ostream_t *const out, size_t len) { if (len > out->len) { OUT_SIZE(); } @@ -1710,7 +1656,7 @@ static inline istream_t IO_make_istream(const u8 *in, /// `in` must be byte aligned static inline istream_t IO_make_sub_istream(istream_t *const in, size_t len) { // Consume `len` bytes of the parent stream - const u8 *const ptr = IO_read_bytes(in, len); + const u8 *const ptr = IO_get_read_ptr(in, len); // Make a substream using the pointer to those `len` bytes return IO_make_istream(ptr, len); @@ -1814,7 +1760,7 @@ static size_t HUF_decompress_1stream(const HUF_dtable if (len == 0) { INP_SIZE(); } - const u8 *const src = IO_read_bytes(in, len); + const u8 *const src = IO_get_read_ptr(in, len); // "Each bitstream must be read backward, that is starting from the end down // to the beginning. Therefore it's necessary to know the size of each @@ -2065,7 +2011,7 @@ static size_t FSE_decompress_interleaved2(const FSE_dt if (len == 0) { INP_SIZE(); } - const u8 *const src = IO_read_bytes(in, len); + const u8 *const src = IO_get_read_ptr(in, len); // "Each bitstream must be read backward, that is starting from the end down // to the beginning. Therefore it's necessary to know the size of each @@ -2192,7 +2138,7 @@ static void FSE_init_dtable(FSE_dtable *const dtable, } // Now we can fill baseline and num bits - for (int i = 0; i < size; i++) { + for (size_t i = 0; i < size; i++) { u8 symbol = dtable->symbols[i]; u16 next_state_desc = state_desc[symbol]++; // Fills in the table appropriately, next_state_desc increases by symbol @@ -2355,4 +2301,3 @@ static void FSE_copy_dtable(FSE_dtable *const dst, con memcpy(dst->new_state_base, src->new_state_base, size * sizeof(u16)); } /******* END FSE PRIMITIVES ***************************************************/ - Modified: head/contrib/zstd/doc/educational_decoder/zstd_decompress.h ============================================================================== --- head/contrib/zstd/doc/educational_decoder/zstd_decompress.h Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/doc/educational_decoder/zstd_decompress.h Tue Aug 22 11:11:49 2017 (r322784) @@ -7,10 +7,52 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +/******* EXPOSED TYPES ********************************************************/ +/* +* Contains the parsed contents of a dictionary +* This includes Huffman and FSE tables used for decoding and data on offsets +*/ +typedef struct dictionary_s dictionary_t; +/******* END EXPOSED TYPES ****************************************************/ + +/******* DECOMPRESSION FUNCTIONS **********************************************/ +/// Zstandard decompression functions. +/// `dst` must point to a space at least as large as the reconstructed output. size_t ZSTD_decompress(void *const dst, const size_t dst_len, - const void *const src, const size_t src_len); + const void *const src, const size_t src_len); + +/// If `dict != NULL` and `dict_len >= 8`, does the same thing as +/// `ZSTD_decompress` but uses the provided dict size_t ZSTD_decompress_with_dict(void *const dst, const size_t dst_len, - const void *const src, const size_t src_len, - const void *const dict, const size_t dict_len); + const void *const src, const size_t src_len, + dictionary_t* parsed_dict); + +/// Get the decompressed size of an input stream so memory can be allocated in +/// advance +/// Returns -1 if the size can't be determined +/// Assumes decompression of a single frame size_t ZSTD_get_decompressed_size(const void *const src, const size_t src_len); +/******* END DECOMPRESSION FUNCTIONS ******************************************/ +/******* DICTIONARY MANAGEMENT ***********************************************/ +/* + * Return a valid dictionary_t pointer for use with dictionary initialization + * or decompression + */ +dictionary_t* create_dictionary(); + +/* + * Parse a provided dictionary blob for use in decompression + * `src` -- must point to memory space representing the dictionary + * `src_len` -- must provide the dictionary size + * `dict` -- will contain the parsed contents of the dictionary and + * can be used for decompression + */ +void parse_dictionary(dictionary_t *const dict, const void *src, + size_t src_len); + +/* + * Free internal Huffman tables, FSE tables, and dictionary content + */ +void free_dictionary(dictionary_t *const dict); +/******* END DICTIONARY MANAGEMENT *******************************************/ Modified: head/contrib/zstd/doc/zstd_compression_format.md ============================================================================== --- head/contrib/zstd/doc/zstd_compression_format.md Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/doc/zstd_compression_format.md Tue Aug 22 11:11:49 2017 (r322784) @@ -16,7 +16,7 @@ Distribution of this document is unlimited. ### Version -0.2.5 (31/03/17) +0.2.6 (19/08/17) Introduction @@ -106,7 +106,7 @@ The structure of a single Zstandard frame is following | `Magic_Number` | `Frame_Header` |`Data_Block`| [More data blocks] | [`Content_Checksum`] | |:--------------:|:--------------:|:----------:| ------------------ |:--------------------:| -| 4 bytes | 2-14 bytes | n bytes | | 0-4 bytes | +| 4 bytes | 2-14 bytes | n bytes | | 0-4 bytes | __`Magic_Number`__ @@ -1249,23 +1249,30 @@ Consequently, a last byte of `0` is not possible. And the final-bit-flag itself is not part of the useful bitstream. Hence, the last byte contains between 0 and 7 useful bits. -For example, if the literal sequence "0145" was encoded using the prefix codes above, -it would be encoded as: -``` -00000001 01110000 -``` +Starting from the end, +it's possible to read the bitstream in a __little-endian__ fashion, +keeping track of already used bits. Since the bitstream is encoded in reverse +order, starting from the end read symbols in forward order. +For example, if the literal sequence "0145" was encoded using above prefix code, +it would be encoded (in reverse order) as: + |Symbol | 5 | 4 | 1 | 0 | Padding | |--------|------|------|----|---|---------| -|Encoding|`0000`|`0001`|`01`|`1`| `10000` | +|Encoding|`0000`|`0001`|`01`|`1`| `00001` | -Starting from the end, -it's possible to read the bitstream in a __little-endian__ fashion, -keeping track of already used bits. Since the bitstream is encoded in reverse -order, by starting at the end the symbols can be read in forward order. +Resulting in following 2-bytes bitstream : +``` +00010000 00001101 +``` -Reading the last `Max_Number_of_Bits` bits, -it's then possible to compare extracted value to decoding table, +Here is an alternative representation with the symbol codes separated by underscore: +``` +0001_0000 00001_1_01 +``` + +Reading highest `Max_Number_of_Bits` bits, +it's possible to compare extracted value to decoding table, determining the symbol to decode and number of bits to discard. The process continues up to reading the required number of symbols per stream. @@ -1516,12 +1523,13 @@ to crosscheck that an implementation build its decodin Version changes --------------- +- 0.2.6 : fixed an error in huffman example, by Ulrich Kunitz - 0.2.5 : minor typos and clarifications - 0.2.4 : section restructuring, by Sean Purcell - 0.2.3 : clarified several details, by Sean Purcell - 0.2.2 : added predefined codes, by Johannes Rudolph - 0.2.1 : clarify field names, by Przemyslaw Skibinski -- 0.2.0 : numerous format adjustments for zstd v0.8 +- 0.2.0 : numerous format adjustments for zstd v0.8+ - 0.1.2 : limit Huffman tree depth to 11 bits - 0.1.1 : reserved dictID ranges - 0.1.0 : initial release Modified: head/contrib/zstd/doc/zstd_manual.html ============================================================================== --- head/contrib/zstd/doc/zstd_manual.html Tue Aug 22 11:11:10 2017 (r322783) +++ head/contrib/zstd/doc/zstd_manual.html Tue Aug 22 11:11:49 2017 (r322784) @@ -1,10 +1,10 @@ -zstd 1.3.0 Manual +zstd 1.3.1 Manual -

zstd 1.3.0 Manual

+

zstd 1.3.1 Manual


Contents

    @@ -73,29 +73,43 @@ or an errorCode if it fails (which can be tested using ZSTD_isError()).


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

    NOTE: This function is planned to be obsolete, in favor of ZSTD_getFrameContentSize(). - ZSTD_getFrameContentSize() works the same way, - returning the decompressed size of a single frame, - but distinguishes empty frames from frames with an unknown size, or errors. - - 'src' is the start of a zstd compressed frame. - @return : content size to be decompressed, as a 64-bits value _if known_, 0 otherwise. - note 1 : decompressed size is an optional field, it may not be present, typically in streaming mode. - When `return==0`, data to decompress could be any size. +

    #define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
    +#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
    +unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);
    +

    `src` should point to the start of a ZSTD encoded frame. + `srcSize` must be at least as large as the frame header. + hint : any size >= `ZSTD_frameHeaderSize_max` is large enough. + @return : - decompressed size of the frame in `src`, if known + - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined + - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) + note 1 : a 0 return value means the frame is valid but "empty". + note 2 : decompressed size is an optional field, it may not be present, typically in streaming mode. + When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size. In which case, it's necessary to use streaming mode to decompress data. - Optionally, application can use ZSTD_decompress() while relying on implied limits. - (For example, data may be necessarily cut into blocks <= 16 KB). - note 2 : decompressed size is always present when compression is done with ZSTD_compress() - note 3 : decompressed size can be very large (64-bits value), + Optionally, application can rely on some implicit limit, + as ZSTD_decompress() only needs an upper bound of decompressed size. + (For example, data could be necessarily cut into blocks <= 16 KB). + note 3 : decompressed size is always present when compression is done with ZSTD_compress() + note 4 : decompressed size can be very large (64-bits value), potentially larger than what local system can handle as a single memory segment. In which case, it's necessary to use streaming mode to decompress data. - note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified. - Always ensure result fits within application's authorized limits. + note 5 : If source is untrusted, decompressed size could be wrong or intentionally modified. + Always ensure return value fits within application's authorized limits. Each application can set its own limits. - note 5 : when `return==0`, if precise failure cause is needed, use ZSTD_getFrameHeader() to know more. + note 6 : This function replaces ZSTD_getDecompressedSize()


    *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 22 13:08:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC2A8DEA1F0; Tue, 22 Aug 2017 13:08:23 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BC7F1055; Tue, 22 Aug 2017 13:08:23 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7MD8MVS001891; Tue, 22 Aug 2017 13:08:22 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MD8MXs001890; Tue, 22 Aug 2017 13:08:22 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201708221308.v7MD8MXs001890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 22 Aug 2017 13:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322785 - head/usr.sbin/camdd X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: head/usr.sbin/camdd X-SVN-Commit-Revision: 322785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 13:08:23 -0000 Author: ken Date: Tue Aug 22 13:08:22 2017 New Revision: 322785 URL: https://svnweb.freebsd.org/changeset/base/322785 Log: Restructure camdd(8) slightly to make it easier to add support for additional protocols. Submitted by: Chuck Tuffli MFC after: 1 week Differential Revision: D11230 Modified: head/usr.sbin/camdd/camdd.c Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Tue Aug 22 11:11:49 2017 (r322784) +++ head/usr.sbin/camdd/camdd.c Tue Aug 22 13:08:22 2017 (r322785) @@ -260,6 +260,7 @@ struct camdd_buf { struct camdd_dev_pass { int scsi_dev_type; + int protocol; struct cam_device *dev; uint64_t max_sector; uint32_t block_len; @@ -477,6 +478,9 @@ uint32_t camdd_buf_get_len(struct camdd_buf *buf); void camdd_buf_add_child(struct camdd_buf *buf, struct camdd_buf *child_buf); int camdd_probe_tape(int fd, char *filename, uint64_t *max_iosize, uint64_t *max_blk, uint64_t *min_blk, uint64_t *blk_gran); +int camdd_probe_pass_scsi(struct cam_device *cam_dev, union ccb *ccb, + camdd_argmask arglist, int probe_retry_count, + int probe_timeout, uint64_t *maxsector, uint32_t *block_len); struct camdd_dev *camdd_probe_file(int fd, struct camdd_io_opts *io_opts, int retry_count, int timeout); struct camdd_dev *camdd_probe_pass(struct cam_device *cam_dev, @@ -485,7 +489,8 @@ struct camdd_dev *camdd_probe_pass(struct cam_device * int probe_timeout, int io_retry_count, int io_timeout); void *camdd_file_worker(void *arg); -camdd_buf_status camdd_ccb_status(union ccb *ccb); +camdd_buf_status camdd_ccb_status(union ccb *ccb, int protocol); +int camdd_get_cgd(struct cam_device *device, struct ccb_getdev *cgd); int camdd_queue_peer_buf(struct camdd_dev *dev, struct camdd_buf *buf); int camdd_complete_peer_buf(struct camdd_dev *dev, struct camdd_buf *peer_buf); void camdd_peer_done(struct camdd_buf *buf); @@ -1248,56 +1253,59 @@ bailout_error: } /* - * Need to implement this. Do a basic probe: - * - Check the inquiry data, make sure we're talking to a device that we - * can reasonably expect to talk to -- direct, RBC, CD, WORM. - * - Send a test unit ready, make sure the device is available. - * - Get the capacity and block size. + * Get a get device CCB for the specified device. */ -struct camdd_dev * -camdd_probe_pass(struct cam_device *cam_dev, struct camdd_io_opts *io_opts, - camdd_argmask arglist, int probe_retry_count, - int probe_timeout, int io_retry_count, int io_timeout) +int +camdd_get_cgd(struct cam_device *device, struct ccb_getdev *cgd) { - union ccb *ccb; - uint64_t maxsector; - uint32_t cpi_maxio, max_iosize, pass_numblocks; - uint32_t block_len; - struct scsi_read_capacity_data rcap; - struct scsi_read_capacity_data_long rcaplong; - struct camdd_dev *dev; - struct camdd_dev_pass *pass_dev; - struct kevent ke; - int scsi_dev_type; + union ccb *ccb; + int retval = 0; - dev = NULL; + ccb = cam_getccb(device); + + if (ccb == NULL) { + warnx("%s: couldn't allocate CCB", __func__); + return -1; + } - scsi_dev_type = SID_TYPE(&cam_dev->inq_data); - maxsector = 0; - block_len = 0; + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgd); - /* - * For devices that support READ CAPACITY, we'll attempt to get the - * capacity. Otherwise, we really don't support tape or other - * devices via SCSI passthrough, so just return an error in that case. - */ - switch (scsi_dev_type) { - case T_DIRECT: - case T_WORM: - case T_CDROM: - case T_OPTICAL: - case T_RBC: - case T_ZBC_HM: - break; - default: - errx(1, "Unsupported SCSI device type %d", scsi_dev_type); - break; /*NOTREACHED*/ + ccb->ccb_h.func_code = XPT_GDEV_TYPE; + + if (cam_send_ccb(device, ccb) < 0) { + warn("%s: error sending Get Device Information CCB", __func__); + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + retval = -1; + goto bailout; } - ccb = cam_getccb(cam_dev); + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + retval = -1; + goto bailout; + } + bcopy(&ccb->cgd, cgd, sizeof(struct ccb_getdev)); + +bailout: + cam_freeccb(ccb); + + return retval; +} + +int +camdd_probe_pass_scsi(struct cam_device *cam_dev, union ccb *ccb, + camdd_argmask arglist, int probe_retry_count, + int probe_timeout, uint64_t *maxsector, uint32_t *block_len) +{ + struct scsi_read_capacity_data rcap; + struct scsi_read_capacity_data_long rcaplong; + int retval = -1; + if (ccb == NULL) { - warnx("%s: error allocating ccb", __func__); + warnx("%s: error passed ccb is NULL", __func__); goto bailout; } @@ -1331,16 +1339,18 @@ camdd_probe_pass(struct cam_device *cam_dev, struct ca goto bailout; } - maxsector = scsi_4btoul(rcap.addr); - block_len = scsi_4btoul(rcap.length); + *maxsector = scsi_4btoul(rcap.addr); + *block_len = scsi_4btoul(rcap.length); /* * A last block of 2^32-1 means that the true capacity is over 2TB, * and we need to issue the long READ CAPACITY to get the real * capacity. Otherwise, we're all set. */ - if (maxsector != 0xffffffff) - goto rcap_done; + if (*maxsector != 0xffffffff) { + retval = 0; + goto bailout; + } scsi_read_capacity_16(&ccb->csio, /*retries*/ probe_retry_count, @@ -1372,10 +1382,83 @@ camdd_probe_pass(struct cam_device *cam_dev, struct ca goto bailout; } - maxsector = scsi_8btou64(rcaplong.addr); - block_len = scsi_4btoul(rcaplong.length); + *maxsector = scsi_8btou64(rcaplong.addr); + *block_len = scsi_4btoul(rcaplong.length); -rcap_done: + retval = 0; + +bailout: + return retval; +} + +/* + * Need to implement this. Do a basic probe: + * - Check the inquiry data, make sure we're talking to a device that we + * can reasonably expect to talk to -- direct, RBC, CD, WORM. + * - Send a test unit ready, make sure the device is available. + * - Get the capacity and block size. + */ +struct camdd_dev * +camdd_probe_pass(struct cam_device *cam_dev, struct camdd_io_opts *io_opts, + camdd_argmask arglist, int probe_retry_count, + int probe_timeout, int io_retry_count, int io_timeout) +{ + union ccb *ccb; + uint64_t maxsector = 0; + uint32_t cpi_maxio, max_iosize, pass_numblocks; + uint32_t block_len = 0; + struct camdd_dev *dev = NULL; + struct camdd_dev_pass *pass_dev; + struct kevent ke; + struct ccb_getdev cgd; + int retval; + int scsi_dev_type; + + if ((retval = camdd_get_cgd(cam_dev, &cgd)) != 0) { + warnx("%s: error retrieving CGD", __func__); + return NULL; + } + + ccb = cam_getccb(cam_dev); + + if (ccb == NULL) { + warnx("%s: error allocating ccb", __func__); + goto bailout; + } + + switch (cgd.protocol) { + case PROTO_SCSI: + scsi_dev_type = SID_TYPE(&cam_dev->inq_data); + + /* + * For devices that support READ CAPACITY, we'll attempt to get the + * capacity. Otherwise, we really don't support tape or other + * devices via SCSI passthrough, so just return an error in that case. + */ + switch (scsi_dev_type) { + case T_DIRECT: + case T_WORM: + case T_CDROM: + case T_OPTICAL: + case T_RBC: + case T_ZBC_HM: + break; + default: + errx(1, "Unsupported SCSI device type %d", scsi_dev_type); + break; /*NOTREACHED*/ + } + + if ((retval = camdd_probe_pass_scsi(cam_dev, ccb, probe_retry_count, + arglist, probe_timeout, &maxsector, + &block_len))) { + goto bailout; + } + break; + default: + errx(1, "Unsupported PROTO type %d", cgd.protocol); + break; /*NOTREACHED*/ + } + if (block_len == 0) { warnx("Sector size for %s%u is 0, cannot continue", cam_dev->device_name, cam_dev->dev_unit_num); @@ -1405,6 +1488,7 @@ rcap_done: pass_dev = &dev->dev_spec.pass; pass_dev->scsi_dev_type = scsi_dev_type; + pass_dev->protocol = cgd.protocol; pass_dev->dev = cam_dev; pass_dev->max_sector = maxsector; pass_dev->block_len = block_len; @@ -1715,43 +1799,50 @@ bailout: * Simplistic translation of CCB status to our local status. */ camdd_buf_status -camdd_ccb_status(union ccb *ccb) +camdd_ccb_status(union ccb *ccb, int protocol) { camdd_buf_status status = CAMDD_STATUS_NONE; cam_status ccb_status; ccb_status = ccb->ccb_h.status & CAM_STATUS_MASK; - switch (ccb_status) { - case CAM_REQ_CMP: { - if (ccb->csio.resid == 0) { - status = CAMDD_STATUS_OK; - } else if (ccb->csio.dxfer_len > ccb->csio.resid) { - status = CAMDD_STATUS_SHORT_IO; - } else { - status = CAMDD_STATUS_EOF; + switch (protocol) { + case PROTO_SCSI: + switch (ccb_status) { + case CAM_REQ_CMP: { + if (ccb->csio.resid == 0) { + status = CAMDD_STATUS_OK; + } else if (ccb->csio.dxfer_len > ccb->csio.resid) { + status = CAMDD_STATUS_SHORT_IO; + } else { + status = CAMDD_STATUS_EOF; + } + break; } - break; - } - case CAM_SCSI_STATUS_ERROR: { - switch (ccb->csio.scsi_status) { - case SCSI_STATUS_OK: - case SCSI_STATUS_COND_MET: - case SCSI_STATUS_INTERMED: - case SCSI_STATUS_INTERMED_COND_MET: - status = CAMDD_STATUS_OK; + case CAM_SCSI_STATUS_ERROR: { + switch (ccb->csio.scsi_status) { + case SCSI_STATUS_OK: + case SCSI_STATUS_COND_MET: + case SCSI_STATUS_INTERMED: + case SCSI_STATUS_INTERMED_COND_MET: + status = CAMDD_STATUS_OK; + break; + case SCSI_STATUS_CMD_TERMINATED: + case SCSI_STATUS_CHECK_COND: + case SCSI_STATUS_QUEUE_FULL: + case SCSI_STATUS_BUSY: + case SCSI_STATUS_RESERV_CONFLICT: + default: + status = CAMDD_STATUS_ERROR; + break; + } break; - case SCSI_STATUS_CMD_TERMINATED: - case SCSI_STATUS_CHECK_COND: - case SCSI_STATUS_QUEUE_FULL: - case SCSI_STATUS_BUSY: - case SCSI_STATUS_RESERV_CONFLICT: + } default: status = CAMDD_STATUS_ERROR; break; } break; - } default: status = CAMDD_STATUS_ERROR; break; @@ -2149,11 +2240,18 @@ camdd_pass_fetch(struct camdd_dev *dev) CAM_EPF_ALL, stderr); } - data->resid = ccb.csio.resid; - dev->bytes_transferred += (ccb.csio.dxfer_len - ccb.csio.resid); + switch (pass_dev->protocol) { + case PROTO_SCSI: + data->resid = ccb.csio.resid; + dev->bytes_transferred += (ccb.csio.dxfer_len - ccb.csio.resid); + break; + default: + return -1; + break; + } if (buf->status == CAMDD_STATUS_NONE) - buf->status = camdd_ccb_status(&ccb); + buf->status = camdd_ccb_status(&ccb, pass_dev->protocol); if (buf->status == CAMDD_STATUS_ERROR) error_count++; else if (buf->status == CAMDD_STATUS_EOF) { @@ -2433,9 +2531,6 @@ camdd_pass_run(struct camdd_dev *dev) data = &buf->buf_type_spec.data; - ccb = &data->ccb; - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - /* * In almost every case the number of blocks should be the device * block size. The exception may be at the end of an I/O stream @@ -2446,22 +2541,37 @@ camdd_pass_run(struct camdd_dev *dev) else num_blocks = data->fill_len / pass_dev->block_len; - scsi_read_write(&ccb->csio, - /*retries*/ dev->retry_count, - /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, - /*readop*/ (dev->write_dev == 0) ? SCSI_RW_READ : - SCSI_RW_WRITE, - /*byte2*/ 0, - /*minimum_cmd_size*/ dev->min_cmd_size, - /*lba*/ buf->lba, - /*block_count*/ num_blocks, - /*data_ptr*/ (data->sg_count != 0) ? - (uint8_t *)data->segs : data->buf, - /*dxfer_len*/ (num_blocks * pass_dev->block_len), - /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ dev->io_timeout); + ccb = &data->ccb; + switch (pass_dev->protocol) { + case PROTO_SCSI: + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); + + scsi_read_write(&ccb->csio, + /*retries*/ dev->retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*readop*/ (dev->write_dev == 0) ? SCSI_RW_READ : + SCSI_RW_WRITE, + /*byte2*/ 0, + /*minimum_cmd_size*/ dev->min_cmd_size, + /*lba*/ buf->lba, + /*block_count*/ num_blocks, + /*data_ptr*/ (data->sg_count != 0) ? + (uint8_t *)data->segs : data->buf, + /*dxfer_len*/ (num_blocks * pass_dev->block_len), + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ dev->io_timeout); + + if (data->sg_count != 0) { + ccb->csio.sglist_cnt = data->sg_count; + } + break; + default: + retval = -1; + goto bailout; + } + /* Disable freezing the device queue */ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; @@ -2469,7 +2579,6 @@ camdd_pass_run(struct camdd_dev *dev) ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; if (data->sg_count != 0) { - ccb->csio.sglist_cnt = data->sg_count; ccb->ccb_h.flags |= CAM_DATA_SG; } From owner-svn-src-head@freebsd.org Tue Aug 22 13:16:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8AC4DEA854; Tue, 22 Aug 2017 13:16:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id C20531620; Tue, 22 Aug 2017 13:16:15 +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 v7MDGECA005963; Tue, 22 Aug 2017 13:16:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MDGEP0005957; Tue, 22 Aug 2017 13:16:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708221316.v7MDGEP0005957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 22 Aug 2017 13:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322786 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 322786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 13:16:16 -0000 Author: andrew Date: Tue Aug 22 13:16:14 2017 New Revision: 322786 URL: https://svnweb.freebsd.org/changeset/base/322786 Log: Move the l0 pagetable address to struct mdproc. It is a property of the whole process so should live there. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/genassym.c head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/swtch.S head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/include/pcb.h head/sys/arm64/include/proc.h Modified: head/sys/arm64/arm64/genassym.c ============================================================================== --- head/sys/arm64/arm64/genassym.c Tue Aug 22 13:08:22 2017 (r322785) +++ head/sys/arm64/arm64/genassym.c Tue Aug 22 13:16:14 2017 (r322786) @@ -50,12 +50,15 @@ ASSYM(PCB_SINGLE_STEP_SHIFT, PCB_SINGLE_STEP_SHIFT); ASSYM(PCB_REGS, offsetof(struct pcb, pcb_x)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); ASSYM(PCB_TPIDRRO, offsetof(struct pcb, pcb_tpidrro_el0)); -ASSYM(PCB_L0ADDR, offsetof(struct pcb, pcb_l0addr)); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); +ASSYM(P_MD, offsetof(struct proc, p_md)); +ASSYM(MD_L0ADDR, offsetof(struct mdproc, md_l0addr)); + ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); +ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 22 13:08:22 2017 (r322785) +++ head/sys/arm64/arm64/pmap.c Tue Aug 22 13:16:14 2017 (r322786) @@ -4662,8 +4662,9 @@ pmap_activate(struct thread *td) critical_enter(); pmap = vmspace_pmap(td->td_proc->p_vmspace); - td->td_pcb->pcb_l0addr = vtophys(pmap->pm_l0); - __asm __volatile("msr ttbr0_el1, %0" : : "r"(td->td_pcb->pcb_l0addr)); + td->td_proc->p_md.md_l0addr = vtophys(pmap->pm_l0); + __asm __volatile("msr ttbr0_el1, %0" : : + "r"(td->td_proc->p_md.md_l0addr)); pmap_invalidate_all(pmap); critical_exit(); } Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Tue Aug 22 13:08:22 2017 (r322785) +++ head/sys/arm64/arm64/swtch.S Tue Aug 22 13:16:14 2017 (r322786) @@ -86,7 +86,8 @@ ENTRY(cpu_throw) */ /* Switch to the new pmap */ - ldr x5, [x4, #PCB_L0ADDR] + ldr x28, [x1, #TD_PROC] + ldr x5, [x28, #(P_MD + MD_L0ADDR)] msr ttbr0_el1, x5 isb @@ -186,8 +187,15 @@ ENTRY(cpu_switch) * to a user process. */ + /* + * Load the proc pointers. If these are the same then we are in the + * same process so don't need to switch page tables or issue a + * TLB invalidate. + */ + ldr x28, [x1, #TD_PROC] + /* Switch to the new pmap */ - ldr x5, [x4, #PCB_L0ADDR] + ldr x5, [x28, #(P_MD + MD_L0ADDR)] msr ttbr0_el1, x5 isb Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Tue Aug 22 13:08:22 2017 (r322785) +++ head/sys/arm64/arm64/vm_machdep.c Tue Aug 22 13:16:14 2017 (r322786) @@ -91,7 +91,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t td2->td_pcb = pcb2; bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); - td2->td_pcb->pcb_l0addr = + td2->td_proc->p_md.md_l0addr = vtophys(vmspace_pmap(td2->td_proc->p_vmspace)->pm_l0); tf = (struct trapframe *)STACKALIGN((struct trapframe *)pcb2 - 1); Modified: head/sys/arm64/include/pcb.h ============================================================================== --- head/sys/arm64/include/pcb.h Tue Aug 22 13:08:22 2017 (r322785) +++ head/sys/arm64/include/pcb.h Tue Aug 22 13:16:14 2017 (r322786) @@ -43,7 +43,6 @@ struct pcb { uint64_t pcb_sp; uint64_t pcb_tpidr_el0; uint64_t pcb_tpidrro_el0; - vm_offset_t pcb_l0addr; /* Fault handler, the error value is passed in x0 */ vm_offset_t pcb_onfault; Modified: head/sys/arm64/include/proc.h ============================================================================== --- head/sys/arm64/include/proc.h Tue Aug 22 13:08:22 2017 (r322785) +++ head/sys/arm64/include/proc.h Tue Aug 22 13:16:14 2017 (r322786) @@ -40,7 +40,7 @@ struct mdthread { }; struct mdproc { - int dummy; + vm_offset_t md_l0addr; }; #define KINFO_PROC_SIZE 1088 From owner-svn-src-head@freebsd.org Tue Aug 22 13:53:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F343EDECAD3; Tue, 22 Aug 2017 13:53:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id C2B313030; Tue, 22 Aug 2017 13:53:54 +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 v7MDrsb4022435; Tue, 22 Aug 2017 13:53:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MDrscO022434; Tue, 22 Aug 2017 13:53:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708221353.v7MDrscO022434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 22 Aug 2017 13:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322787 - 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: 322787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 13:53:55 -0000 Author: andrew Date: Tue Aug 22 13:53:53 2017 New Revision: 322787 URL: https://svnweb.freebsd.org/changeset/base/322787 Log: Fix a comment on uncommitted work. Modified: head/sys/arm64/arm64/swtch.S Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Tue Aug 22 13:16:14 2017 (r322786) +++ head/sys/arm64/arm64/swtch.S Tue Aug 22 13:53:53 2017 (r322787) @@ -187,11 +187,7 @@ ENTRY(cpu_switch) * to a user process. */ - /* - * Load the proc pointers. If these are the same then we are in the - * same process so don't need to switch page tables or issue a - * TLB invalidate. - */ + /* Load the new proc address */ ldr x28, [x1, #TD_PROC] /* Switch to the new pmap */ From owner-svn-src-head@freebsd.org Tue Aug 22 15:34:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BA01DCC22B; Tue, 22 Aug 2017 15:34:28 +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 mx1.freebsd.org (Postfix) with ESMTPS id EFAB366A69; Tue, 22 Aug 2017 15:34:27 +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 v7MFYRbx064702; Tue, 22 Aug 2017 15:34:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MFYR9E064701; Tue, 22 Aug 2017 15:34:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201708221534.v7MFYR9E064701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 22 Aug 2017 15:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322794 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 322794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 15:34:28 -0000 Author: gjb Date: Tue Aug 22 15:34:27 2017 New Revision: 322794 URL: https://svnweb.freebsd.org/changeset/base/322794 Log: Use py-google-compute-engine instead for releasing Google Compute Engine (GCE) images with an updated version of Google's tools. PR: 221714 Submitted by: helen _dot_ koike _@_ collabora_dot_com (original) MFC after: 5 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Tue Aug 22 15:26:47 2017 (r322793) +++ head/release/tools/gce.conf Tue Aug 22 15:34:27 2017 (r322794) @@ -5,12 +5,15 @@ # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ - google-cloud-sdk google-daemon panicmail sudo firstboot-growfs \ - google-startup-scripts" + google-cloud-sdk panicmail sudo firstboot-growfs \ + sysutils/py-google-compute-engine" # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="google_accounts_manager ntpd sshd firstboot_growfs \ - firstboot_pkgs firstboot_freebsd_update google_startup" + firstboot_pkgs firstboot_freebsd_update google_startup \ + google_accounts_daemon google_clock_skew_daemon + google_instance_setup google_ip_forwarding_daemon + google_network_setup" vm_extra_install_base() { echo 'search google.internal' > ${DESTDIR}/etc/resolv.conf From owner-svn-src-head@freebsd.org Tue Aug 22 17:13:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82CA4DD56AF; Tue, 22 Aug 2017 17:13:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5BDE46C0EC; Tue, 22 Aug 2017 17:13:30 +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 v7MHDT2a008409; Tue, 22 Aug 2017 17:13:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MHDTUl008404; Tue, 22 Aug 2017 17:13:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708221713.v7MHDTUl008404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 22 Aug 2017 17:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322795 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 322795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 17:13:30 -0000 Author: markj Date: Tue Aug 22 17:13:28 2017 New Revision: 322795 URL: https://svnweb.freebsd.org/changeset/base/322795 Log: Add some miscellaneous definitions to support the DRM drivers. MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/include/linux/kobject.h head/sys/compat/linuxkpi/common/include/linux/lockdep.h head/sys/compat/linuxkpi/common/include/linux/module.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Tue Aug 22 15:34:27 2017 (r322794) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Tue Aug 22 17:13:28 2017 (r322795) @@ -50,12 +50,14 @@ enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED, IRQ_WAKE_T typedef enum irqreturn irqreturn_t; struct device; +struct fwnode_handle; struct class { const char *name; struct module *owner; struct kobject kobj; devclass_t bsdclass; + const struct dev_pm_ops *pm; void (*class_release)(struct class *class); void (*dev_release)(struct device *dev); char * (*devnode)(struct device *dev, umode_t *mode); @@ -113,6 +115,7 @@ struct device { unsigned int msix; unsigned int msix_max; const struct attribute_group **groups; + struct fwnode_handle *fwnode; spinlock_t devres_lock; struct list_head devres_head; @@ -179,6 +182,7 @@ show_class_attr_string(struct class *class, #define dev_warn(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) #define dev_info(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) #define dev_notice(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_dbg(dev, fmt, ...) do { } while (0) #define dev_printk(lvl, dev, fmt, ...) \ device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Tue Aug 22 15:34:27 2017 (r322794) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Tue Aug 22 17:13:28 2017 (r322795) @@ -53,9 +53,11 @@ struct pipe_inode_info; struct vm_area_struct; struct poll_table_struct; struct files_struct; +struct pfs_node; #define inode vnode #define i_cdev v_rdev +#define i_private v_data #define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) #define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) @@ -65,6 +67,7 @@ typedef struct files_struct *fl_owner_t; struct dentry { struct inode *d_inode; + struct pfs_node *d_pfs_node; }; struct file_operations; Modified: head/sys/compat/linuxkpi/common/include/linux/kobject.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kobject.h Tue Aug 22 15:34:27 2017 (r322794) +++ head/sys/compat/linuxkpi/common/include/linux/kobject.h Tue Aug 22 17:13:28 2017 (r322795) @@ -135,6 +135,11 @@ kobject_create_and_add(const char *name, struct kobjec return (NULL); } +static inline void +kobject_del(struct kobject *kobj __unused) +{ +} + static inline char * kobject_name(const struct kobject *kobj) { Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/lockdep.h Tue Aug 22 15:34:27 2017 (r322794) +++ head/sys/compat/linuxkpi/common/include/linux/lockdep.h Tue Aug 22 17:13:28 2017 (r322795) @@ -47,4 +47,6 @@ struct lock_class_key { #define lockdep_is_held(m) (sx_xholder(&(m)->sx) == curthread) +#define might_lock(m) do { } while (0) + #endif /* _LINUX_LOCKDEP_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/module.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/module.h Tue Aug 22 15:34:27 2017 (r322794) +++ head/sys/compat/linuxkpi/common/include/linux/module.h Tue Aug 22 17:13:28 2017 (r322795) @@ -102,4 +102,6 @@ _module_run(void *arg) #define module_put(module) #define try_module_get(module) 1 +#define postcore_initcall(fn) module_init(fn) + #endif /* _LINUX_MODULE_H_ */ From owner-svn-src-head@freebsd.org Tue Aug 22 17:23:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41078DD6136; Tue, 22 Aug 2017 17:23:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA556C850; Tue, 22 Aug 2017 17:23:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7MHNTtu012519; Tue, 22 Aug 2017 17:23:29 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MHNTv4012518; Tue, 22 Aug 2017 17:23:29 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201708221723.v7MHNTv4012518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 22 Aug 2017 17:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322796 - head/usr.sbin/chown/tests X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/usr.sbin/chown/tests X-SVN-Commit-Revision: 322796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 17:23:30 -0000 Author: gjb Date: Tue Aug 22 17:23:29 2017 New Revision: 322796 URL: https://svnweb.freebsd.org/changeset/base/322796 Log: Revert part of r322770 in usr.sbin/chown/tests/chown_test.sh, which incorrectly adds atf_expect_fail() where there is no failure case. MFC after: 3 days MFC with: r322770 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/chown/tests/chown_test.sh Modified: head/usr.sbin/chown/tests/chown_test.sh ============================================================================== --- head/usr.sbin/chown/tests/chown_test.sh Tue Aug 22 17:13:28 2017 (r322795) +++ head/usr.sbin/chown/tests/chown_test.sh Tue Aug 22 17:23:29 2017 (r322796) @@ -156,11 +156,6 @@ v_flag_body() atf_check truncate -s 0 foo bar atf_check chown 0:0 foo atf_check chown 42:42 bar - case "$(get_filesystem .)" in - zfs) - atf_expect_fail "ZFS updates mode for foo unnecessarily" - ;; - esac atf_check -o 'inline:bar\n' chown -v 0:0 foo bar atf_check chown -v 0:0 foo bar for f in foo bar; do From owner-svn-src-head@freebsd.org Tue Aug 22 17:38:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53935DD716F; Tue, 22 Aug 2017 17:38:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2129C6D3C7; Tue, 22 Aug 2017 17:38:07 +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 v7MHc6Ro017333; Tue, 22 Aug 2017 17:38:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MHc6UH017332; Tue, 22 Aug 2017 17:38:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708221738.v7MHc6UH017332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 22 Aug 2017 17:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322797 - 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: 322797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 17:38:07 -0000 Author: andrew Date: Tue Aug 22 17:38:06 2017 New Revision: 322797 URL: https://svnweb.freebsd.org/changeset/base/322797 Log: Fix a bug in pmap_protect where we invalidate the wrong page. With this we can now remove an unneeded call to invalidate all entries. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 22 17:23:29 2017 (r322796) +++ head/sys/arm64/arm64/pmap.c Tue Aug 22 17:38:06 2017 (r322797) @@ -2620,13 +2620,10 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t pmap_set(l3p, nbits); /* XXX: Use pmap_invalidate_range */ - pmap_invalidate_page(pmap, va); + pmap_invalidate_page(pmap, sva); } } PMAP_UNLOCK(pmap); - - /* TODO: Only invalidate entries we are touching */ - pmap_invalidate_all(pmap); } /* From owner-svn-src-head@freebsd.org Tue Aug 22 17:57:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D089DD86B4; Tue, 22 Aug 2017 17:57:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id 174DB6E0E6; Tue, 22 Aug 2017 17:57:36 +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 v7MHvZcr025594; Tue, 22 Aug 2017 17:57:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MHvZ5c025593; Tue, 22 Aug 2017 17:57:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201708221757.v7MHvZ5c025593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 22 Aug 2017 17:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322798 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 322798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 17:57:36 -0000 Author: emaste Date: Tue Aug 22 17:57:34 2017 New Revision: 322798 URL: https://svnweb.freebsd.org/changeset/base/322798 Log: newvers.sh: accommodate `git worktree` newvers.sh looks for a .vcs subdirectory (e.g. .git, .svn) to determine which vcs info tool to run (e.g., git rev-parse, svn info). (As of r308789 if a .vcs subdirectory is not found at ${TOPDIR} then newvers.sh walks up successive parent directories, testing for the .vcs subdirectory at each step. This is done in case the FreeBSD source is built in a subdirectory as part of some larger project, but either way newvers.sh still tests for the .vcs subdirectory.) However, when using git worktree there is no .git subdirectory but rather a plain text .git file which contains a reference to the main working tree. Change findvcs() to test that the .vcs entry exists, regardless of type. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Tue Aug 22 17:38:06 2017 (r322797) +++ head/sys/conf/newvers.sh Tue Aug 22 17:57:34 2017 (r322798) @@ -62,7 +62,7 @@ findvcs() savedir=$(pwd) cd ${SYSDIR}/.. while [ $(pwd) != "/" ]; do - if [ -d "./$1" ]; then + if [ -e "./$1" ]; then VCSDIR=$(pwd)"/$1" cd ${savedir} return 0 From owner-svn-src-head@freebsd.org Tue Aug 22 18:15:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99464DD9D4A; Tue, 22 Aug 2017 18:15:48 +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 mx1.freebsd.org (Postfix) with ESMTPS id 66E706F14C; Tue, 22 Aug 2017 18:15:48 +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 v7MIFl1Y033720; Tue, 22 Aug 2017 18:15:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MIFlI2033719; Tue, 22 Aug 2017 18:15:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708221815.v7MIFlI2033719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 Aug 2017 18:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322799 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 322799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 18:15:48 -0000 Author: kib Date: Tue Aug 22 18:15:47 2017 New Revision: 322799 URL: https://svnweb.freebsd.org/changeset/base/322799 Log: Ensure that fs/gs bases are stored in pcb before copying the pcb for new process or thread. Reported and tested by: ae, dhw Sponsored by: The FreeBSD Foundation MFC after: 20 days Modified: head/sys/amd64/amd64/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Tue Aug 22 17:57:34 2017 (r322798) +++ head/sys/amd64/amd64/vm_machdep.c Tue Aug 22 18:15:47 2017 (r322799) @@ -172,6 +172,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t /* Ensure that td1's pcb is up to date. */ fpuexit(td1); + update_pcb_bases(td1->td_pcb); /* Point the pcb to the top of the stack */ pcb2 = get_pcb_td(td2); @@ -433,6 +434,7 @@ cpu_copy_thread(struct thread *td, struct thread *td0) * Those not loaded individually below get their default * values here. */ + update_pcb_bases(td0->td_pcb); bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE | PCB_KERNFPU); From owner-svn-src-head@freebsd.org Tue Aug 22 18:20:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 707E7DDA194; Tue, 22 Aug 2017 18:20:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D4466F360; Tue, 22 Aug 2017 18:20:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7MIKPpd034044; Tue, 22 Aug 2017 18:20:25 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MIKPt1034043; Tue, 22 Aug 2017 18:20:25 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708221820.v7MIKPt1034043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 22 Aug 2017 18:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322800 - 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: 322800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 18:20:26 -0000 Author: andrew Date: Tue Aug 22 18:20:25 2017 New Revision: 322800 URL: https://svnweb.freebsd.org/changeset/base/322800 Log: Remove an unneeded call to pmap_invalidate_all. This was never called as the anyvalid variable is never set. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 22 18:15:47 2017 (r322799) +++ head/sys/arm64/arm64/pmap.c Tue Aug 22 18:20:25 2017 (r322800) @@ -2331,7 +2331,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t pd_entry_t *l0, *l1, *l2; pt_entry_t l3_paddr, *l3; struct spglist free; - int anyvalid; /* * Perform an unsynchronized read. This is, however, safe. @@ -2339,7 +2338,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t if (pmap->pm_stats.resident_count == 0) return; - anyvalid = 0; SLIST_INIT(&free); PMAP_LOCK(pmap); @@ -2429,8 +2427,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t } if (lock != NULL) rw_wunlock(lock); - if (anyvalid) - pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); } From owner-svn-src-head@freebsd.org Tue Aug 22 19:56:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2779DDE03D8; Tue, 22 Aug 2017 19:56:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB69172C5A; Tue, 22 Aug 2017 19:56:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7MJuVDs075291; Tue, 22 Aug 2017 19:56:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MJuVXi075290; Tue, 22 Aug 2017 19:56:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708221956.v7MJuVXi075290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Aug 2017 19:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322802 - head/sys/x86/acpica X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/x86/acpica X-SVN-Commit-Revision: 322802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 19:56:32 -0000 Author: mav Date: Tue Aug 22 19:56:30 2017 New Revision: 322802 URL: https://svnweb.freebsd.org/changeset/base/322802 Log: Fix off-by-one error when parsing SRAT table. Reviewed by: jhb MFC after: 1 week Modified: head/sys/x86/acpica/srat.c Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Tue Aug 22 19:48:33 2017 (r322801) +++ head/sys/x86/acpica/srat.c Tue Aug 22 19:56:30 2017 (r322802) @@ -172,7 +172,7 @@ overlaps_phys_avail(vm_paddr_t start, vm_paddr_t end) int i; for (i = 0; phys_avail[i] != 0 && phys_avail[i + 1] != 0; i += 2) { - if (phys_avail[i + 1] < start) + if (phys_avail[i + 1] <= start) continue; if (phys_avail[i] < end) return (1); From owner-svn-src-head@freebsd.org Tue Aug 22 20:46:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94E64DE30B9; Tue, 22 Aug 2017 20:46:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 640CD74971; Tue, 22 Aug 2017 20:46:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7MKkTcW095628; Tue, 22 Aug 2017 20:46:29 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MKkTAQ095627; Tue, 22 Aug 2017 20:46:29 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201708222046.v7MKkTAQ095627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 22 Aug 2017 20:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322803 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 322803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 20:46:30 -0000 Author: jkim Date: Tue Aug 22 20:46:29 2017 New Revision: 322803 URL: https://svnweb.freebsd.org/changeset/base/322803 Log: Fix size to copyout(9) for cpuset_getid(2). MFC after: 3 days Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Tue Aug 22 19:56:30 2017 (r322802) +++ head/sys/kern/kern_cpuset.c Tue Aug 22 20:46:29 2017 (r322803) @@ -1062,7 +1062,7 @@ kern_cpuset_getid(struct thread *td, cpulevel_t level, tmpid = set->cs_id; cpuset_rel(set); if (error == 0) - error = copyout(&tmpid, setid, sizeof(id)); + error = copyout(&tmpid, setid, sizeof(tmpid)); return (error); } From owner-svn-src-head@freebsd.org Tue Aug 22 23:55:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DA0FDED34A; Tue, 22 Aug 2017 23:55:10 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8F77E8C7; Tue, 22 Aug 2017 23:55:10 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7MNt9Nh073071; Tue, 22 Aug 2017 23:55:09 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7MNt9e8073070; Tue, 22 Aug 2017 23:55:09 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201708222355.v7MNt9e8073070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 22 Aug 2017 23:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322804 - head/usr.sbin/ctladm X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/usr.sbin/ctladm X-SVN-Commit-Revision: 322804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Aug 2017 23:55:10 -0000 Author: benno Date: Tue Aug 22 23:55:09 2017 New Revision: 322804 URL: https://svnweb.freebsd.org/changeset/base/322804 Log: Correct typo in usage string. Submitted by: peterpakos (GitHub username) MFC after: 1 day Modified: head/usr.sbin/ctladm/ctladm.c Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Tue Aug 22 20:46:29 2017 (r322803) +++ head/usr.sbin/ctladm/ctladm.c Tue Aug 22 23:55:09 2017 (r322804) @@ -3963,7 +3963,7 @@ usage(int error) "-q : omit header in list output\n" "-x : output port list in XML format\n" "portlist options:\n" -"-f fronetnd : specify frontend type\n" +"-f frontend : specify frontend type\n" "-i : report target and initiators addresses\n" "-l : report LUN mapping\n" "-p targ_port : specify target port number\n" From owner-svn-src-head@freebsd.org Wed Aug 23 12:09:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA04FDE58A5; Wed, 23 Aug 2017 12:09:38 +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 mx1.freebsd.org (Postfix) with ESMTPS id 93DC36D5A9; Wed, 23 Aug 2017 12:09:38 +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 v7NC9bA6070341; Wed, 23 Aug 2017 12:09:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NC9bBJ070335; Wed, 23 Aug 2017 12:09:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708231209.v7NC9bBJ070335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 23 Aug 2017 12:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322810 - in head: share/man/man4 sys/conf sys/dev/mlx5/mlx5_ib sys/modules sys/modules/mlx5ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/mlx5/mlx5_ib sys/modules sys/modules/mlx5ib X-SVN-Commit-Revision: 322810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 12:09:39 -0000 Author: hselasky Date: Wed Aug 23 12:09:37 2017 New Revision: 322810 URL: https://svnweb.freebsd.org/changeset/base/322810 Log: Add new mlx5ib(4) driver to the kernel source tree which supports Remote DMA over Converged Ethernet, RoCE, for the ConnectX-4 series of PCI express network cards. There is currently no user-space support and this driver only supports kernel side non-routable RoCE V1. The krping kernel module can be used to test this driver. Full user-space support including RoCE V2 will be added as part of the ongoing upgrade to ibcore from Linux 4.9. Otherwise this driver is feature equivalent to mlx4ib(4). The mlx5ib(4) kernel module will only be built when WITH_OFED=YES is specified. MFC after: 2 weeks Sponsored by: Mellanox Technologies Added: head/share/man/man4/mlx5ib.4 (contents, props changed) head/sys/dev/mlx5/mlx5_ib/ head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_ah.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mad.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mr.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_roce.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_srq.c (contents, props changed) head/sys/dev/mlx5/mlx5_ib/user.h (contents, props changed) head/sys/modules/mlx5ib/ head/sys/modules/mlx5ib/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Aug 23 11:52:02 2017 (r322809) +++ head/share/man/man4/Makefile Wed Aug 23 12:09:37 2017 (r322810) @@ -888,6 +888,7 @@ MAN+= iser.4 .if ${MK_OFED} != "no" MAN+= mlx4ib.4 +MAN+= mlx5ib.4 .endif .if ${MK_TESTS} != "no" Added: head/share/man/man4/mlx5ib.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mlx5ib.4 Wed Aug 23 12:09:37 2017 (r322810) @@ -0,0 +1,124 @@ +.\" Copyright (c) 2017 Mellanox Technologies +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY 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 AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 23, 2017 +.Dt MLX5IB 4 +.Os +.Sh NAME +.Nm mlx5ib +.Nd "Mellanox ConnectX-4 and ConnectX-4 LX based 100Gb, 50Gb, 40Gb, 25Gb and 10Gb network adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place these lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options COMPAT_LINUXKPI" +.Cd "device mlx5" +.Cd "device mlx5ib" +.Ed +.Pp +To load the driver as a module at run-time, +run this command as root: +.Bd -literal -offset indent +kldload mlx5ib +.Ed +.Pp +To load the driver as a +module at boot time, place this line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mlx5ib_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for infiniband and Remote DMA over Converged Ethernet, +RoCE, for PCI Express network adapters based on ConnectX-4 and ConnectX-4 LX. +.br +For further hardware information and questions related to hardware +requirements, see +.Pa http://www.mellanox.com/ . +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports 100Gb, 50Gb, 40Gb, 25Gb and 10Gb network adapters. +ConnectX-4 supports: 10/20/25/40/50/56/100Gb/s speeds. +ConnectX-4 LX supports: 10/25/40/50Gb/s speeds (and reduced power consumption): +.Pp +.Bl -bullet -compact +.It +Mellanox MCX455A-ECAT +.It +Mellanox MCX456A-ECAT +.It +Mellanox MCX415A-CCAT +.It +Mellanox MCX416A-CCAT +.It +Mellanox MCX455A-FCAT +.It +Mellanox MCX456A-FCAT +.It +Mellanox MCX415A-BCAT +.It +Mellanox MCX416A-BCAT +.It +Mellanox MCX4131A-GCAT +.It +Mellanox MCX4131A-BCAT +.It +Mellanox MCX4121A-ACAT +.It +Mellanox MCX4111A-ACAT +.It +Mellanox MCX4121A-XCAT +.It +Mellanox MCX4111A-XCAT +.El +.Sh SUPPORT +For general information and support, +go to the Mellanox support website at: +.Pa http://www.mellanox.com/ . +.Pp +If an issue is identified with this driver with a supported adapter, +email all the specific information related to the issue to +.Aq Mt freebsd-drivers@mellanox.com . +.Sh SEE ALSO +.Xr mlx5en 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.x . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Mellanox Technologies . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 23 11:52:02 2017 (r322809) +++ head/sys/conf/files Wed Aug 23 12:09:37 2017 (r322810) @@ -4508,6 +4508,27 @@ dev/mlx4/mlx4_en/mlx4_en_rx.c optional mlx4en pci in dev/mlx4/mlx4_en/mlx4_en_tx.c optional mlx4en pci inet inet6 \ compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_ah.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_cq.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_mad.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_main.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_mem.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_mr.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_qp.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_roce.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_srq.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" + dev/mlx5/mlx5_core/mlx5_alloc.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci \ Added: head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Wed Aug 23 12:09:37 2017 (r322810) @@ -0,0 +1,790 @@ +/*- + * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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 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 MLX5_IB_H +#define MLX5_IB_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define mlx5_ib_dbg(dev, format, arg...) \ +pr_debug("mlx5_dbg:%s:%s:%d:(pid %d): " format, (dev)->ib_dev.name, __func__, \ + __LINE__, curthread->td_proc->p_pid, ##arg) + +#define mlx5_ib_err(dev, format, arg...) \ +printf("mlx5_ib: ERR: ""mlx5_err:%s:%s:%d:(pid %d): " format, (dev)->ib_dev.name, __func__, \ + __LINE__, curthread->td_proc->p_pid, ##arg) + +#define mlx5_ib_warn(dev, format, arg...) \ +printf("mlx5_ib: WARN: ""mlx5_warn:%s:%s:%d:(pid %d): " format, (dev)->ib_dev.name, __func__, \ + __LINE__, curthread->td_proc->p_pid, ##arg) +#define BF_ENABLE 0 + +extern struct workqueue_struct *mlx5_ib_wq; + +enum { + MLX5_IB_MMAP_CMD_SHIFT = 8, + MLX5_IB_MMAP_CMD_MASK = 0xff, +}; + +enum mlx5_ib_mmap_cmd { + MLX5_IB_MMAP_REGULAR_PAGE = 0, + MLX5_IB_MMAP_GET_CONTIGUOUS_PAGES = 1, + MLX5_IB_MMAP_WC_PAGE = 2, + MLX5_IB_MMAP_NC_PAGE = 3, + MLX5_IB_MMAP_MAP_DC_INFO_PAGE = 4, + + /* Use EXP mmap commands until it is pushed to upstream */ + MLX5_IB_EXP_MMAP_CORE_CLOCK = 0xFB, + MLX5_IB_EXP_MMAP_GET_CONTIGUOUS_PAGES_CPU_NUMA = 0xFC, + MLX5_IB_EXP_MMAP_GET_CONTIGUOUS_PAGES_DEV_NUMA = 0xFD, + MLX5_IB_EXP_ALLOC_N_MMAP_WC = 0xFE, +}; + +enum { + MLX5_RES_SCAT_DATA32_CQE = 0x1, + MLX5_RES_SCAT_DATA64_CQE = 0x2, + MLX5_REQ_SCAT_DATA32_CQE = 0x11, + MLX5_REQ_SCAT_DATA64_CQE = 0x22, +}; + +enum { + MLX5_DCT_CS_RES_64 = 2, + MLX5_CNAK_RX_POLL_CQ_QUOTA = 256, +}; + +enum mlx5_ib_latency_class { + MLX5_IB_LATENCY_CLASS_LOW, + MLX5_IB_LATENCY_CLASS_MEDIUM, + MLX5_IB_LATENCY_CLASS_HIGH, + MLX5_IB_LATENCY_CLASS_FAST_PATH +}; + +enum mlx5_ib_mad_ifc_flags { + MLX5_MAD_IFC_IGNORE_MKEY = 1, + MLX5_MAD_IFC_IGNORE_BKEY = 2, + MLX5_MAD_IFC_NET_VIEW = 4, +}; + +enum { + MLX5_CROSS_CHANNEL_UUAR = 0, +}; + +enum { + MLX5_IB_MAX_CTX_DYNAMIC_UARS = 256, + MLX5_IB_INVALID_UAR_INDEX = -1U +}; + +enum { + MLX5_MAX_SINGLE_STRIDE_LOG_NUM_BYTES = 13, + MLX5_MIN_SINGLE_STRIDE_LOG_NUM_BYTES = 6, + MLX5_MAX_SINGLE_WQE_LOG_NUM_STRIDES = 16, + MLX5_MIN_SINGLE_WQE_LOG_NUM_STRIDES = 9, +}; + +struct mlx5_ib_ucontext { + struct ib_ucontext ibucontext; + struct list_head db_page_list; + + /* protect doorbell record alloc/free + */ + struct mutex db_page_mutex; + struct mlx5_uuar_info uuari; + u32 dynamic_wc_uar_index[MLX5_IB_MAX_CTX_DYNAMIC_UARS]; + /* Transport Domain number */ + u32 tdn; +}; + +static inline struct mlx5_ib_ucontext *to_mucontext(struct ib_ucontext *ibucontext) +{ + return container_of(ibucontext, struct mlx5_ib_ucontext, ibucontext); +} + +struct mlx5_ib_pd { + struct ib_pd ibpd; + u32 pdn; + u32 pa_lkey; +}; + +struct wr_list { + u16 opcode; + u16 next; +}; + +struct mlx5_swr_ctx { + u64 wrid; + u32 wr_data; + struct wr_list w_list; + u32 wqe_head; + u8 sig_piped; + u8 rsvd[11]; +}; + +struct mlx5_rwr_ctx { + u64 wrid; +}; + +struct mlx5_ib_wq { + union { + struct mlx5_swr_ctx *swr_ctx; + struct mlx5_rwr_ctx *rwr_ctx; + }; + u16 unsig_count; + + /* serialize post to the work queue + */ + spinlock_t lock; + int wqe_cnt; + int max_post; + int max_gs; + int offset; + int wqe_shift; + unsigned head; + unsigned tail; + u16 cur_post; + u16 last_poll; + void *qend; +}; + +enum { + MLX5_QP_USER, + MLX5_QP_KERNEL, + MLX5_QP_EMPTY +}; + +enum { + MLX5_WQ_USER, + MLX5_WQ_KERNEL +}; + +struct mlx5_ib_sqd { + struct mlx5_ib_qp *qp; + struct work_struct work; +}; + +struct mlx5_ib_mc_flows_list { + struct list_head flows_list; + /*Protect the flows_list*/ + struct mutex lock; +}; + +struct mlx5_ib_qp { + struct ib_qp ibqp; + struct mlx5_core_qp mqp; + struct mlx5_core_qp mrq; + struct mlx5_core_qp msq; + u32 tisn; + u32 tirn; + struct mlx5_buf buf; + + struct mlx5_db db; + struct mlx5_ib_wq rq; + + u32 doorbell_qpn; + u8 sq_signal_bits; + u8 fm_cache; + int sq_max_wqes_per_wr; + int sq_spare_wqes; + struct mlx5_ib_wq sq; + + struct ib_umem *umem; + int buf_size; + /* Raw Ethernet QP's SQ is allocated seperately + * from the RQ's buffer in user-space. + */ + struct ib_umem *sq_umem; + int sq_buf_size; + u64 sq_buf_addr; + int allow_mp_wqe; + + /* serialize qp state modifications + */ + struct mutex mutex; + u16 xrcdn; + u32 flags; + u8 port; + u8 alt_port; + u8 atomic_rd_en; + u8 resp_depth; + u8 state; + /* Raw Ethernet QP's SQ and RQ states */ + u8 rq_state; + u8 sq_state; + int mlx_type; + int wq_sig; + int scat_cqe; + int max_inline_data; + struct mlx5_bf *bf; + int has_rq; + + /* only for user space QPs. For kernel + * we have it from the bf object + */ + int uuarn; + + int create_type; + u32 pa_lkey; + + /* Store signature errors */ + bool signature_en; + + struct list_head qps_list; + struct list_head cq_recv_list; + struct list_head cq_send_list; + + struct mlx5_ib_mc_flows_list mc_flows_list; +}; + +struct mlx5_ib_cq_buf { + struct mlx5_buf buf; + struct ib_umem *umem; + int cqe_size; + int nent; +}; + +enum mlx5_ib_qp_flags { + MLX5_IB_QP_BLOCK_MULTICAST_LOOPBACK = 1 << 0, + MLX5_IB_QP_SIGNATURE_HANDLING = 1 << 1, + MLX5_IB_QP_CAP_RX_END_PADDING = 1 << 5, +}; + +struct mlx5_umr_wr { + union { + u64 virt_addr; + u64 offset; + } target; + struct ib_pd *pd; + unsigned int page_shift; + unsigned int npages; + u64 length; + int access_flags; + u32 mkey; +}; + +struct mlx5_shared_mr_info { + int mr_id; + struct ib_umem *umem; +}; + +struct mlx5_ib_cq { + struct ib_cq ibcq; + struct mlx5_core_cq mcq; + struct mlx5_ib_cq_buf buf; + struct mlx5_db db; + + /* serialize access to the CQ + */ + spinlock_t lock; + + /* protect resize cq + */ + struct mutex resize_mutex; + struct mlx5_ib_cq_buf *resize_buf; + struct ib_umem *resize_umem; + int cqe_size; + struct list_head list_send_qp; + struct list_head list_recv_qp; +}; + +struct mlx5_ib_srq { + struct ib_srq ibsrq; + struct mlx5_core_srq msrq; + struct mlx5_buf buf; + struct mlx5_db db; + u64 *wrid; + /* protect SRQ hanlding + */ + spinlock_t lock; + int head; + int tail; + u16 wqe_ctr; + struct ib_umem *umem; + /* serialize arming a SRQ + */ + struct mutex mutex; + int wq_sig; +}; + +struct mlx5_ib_xrcd { + struct ib_xrcd ibxrcd; + u32 xrcdn; +}; + +enum mlx5_ib_mtt_access_flags { + MLX5_IB_MTT_READ = (1 << 0), + MLX5_IB_MTT_WRITE = (1 << 1), +}; + +#define MLX5_IB_MTT_PRESENT (MLX5_IB_MTT_READ | MLX5_IB_MTT_WRITE) + +struct mlx5_ib_mr { + struct ib_mr ibmr; + struct mlx5_core_mr mmr; + struct ib_umem *umem; + struct mlx5_shared_mr_info *smr_info; + struct list_head list; + int order; + int umred; + dma_addr_t dma; + int npages; + struct mlx5_ib_dev *dev; + struct mlx5_create_mkey_mbox_out out; + struct mlx5_core_sig_ctx *sig; + u32 max_reg_descriptors; + u64 size; + u64 page_count; + struct mlx5_ib_mr **children; + int nchild; +}; + +struct mlx5_ib_fast_reg_page_list { + struct ib_fast_reg_page_list ibfrpl; + __be64 *mapped_page_list; + dma_addr_t map; +}; + +struct mlx5_ib_umr_context { + enum ib_wc_status status; + struct completion done; +}; + +static inline void mlx5_ib_init_umr_context(struct mlx5_ib_umr_context *context) +{ + context->status = -1; + init_completion(&context->done); +} + +struct umr_common { + struct ib_pd *pd; + struct ib_mr *mr; +}; + +enum { + MLX5_FMR_INVALID, + MLX5_FMR_VALID, + MLX5_FMR_BUSY, +}; + +struct mlx5_ib_fmr { + struct ib_fmr ibfmr; + struct mlx5_core_mr mr; + int access_flags; + int state; + /* protect fmr state + */ + spinlock_t lock; + u64 wrid; + struct ib_send_wr wr[2]; + u8 page_shift; + struct ib_fast_reg_page_list page_list; +}; + +struct cache_order { + struct kobject kobj; + int order; + int index; + struct mlx5_ib_dev *dev; +}; + +struct mlx5_cache_ent { + struct list_head head; + /* sync access to the cahce entry + */ + spinlock_t lock; + + + u32 order; + u32 size; + u32 cur; + u32 miss; + u32 limit; + + struct mlx5_ib_dev *dev; + struct work_struct work; + struct delayed_work dwork; + int pending; + struct cache_order co; +}; + +struct mlx5_mr_cache { + struct workqueue_struct *wq; + struct mlx5_cache_ent ent[MAX_MR_CACHE_ENTRIES]; + int stopped; + struct dentry *root; + int last_add; + int rel_timeout; + int rel_imm; +}; + +struct mlx5_ib_resources { + struct ib_cq *c0; + struct ib_xrcd *x0; + struct ib_xrcd *x1; + struct ib_pd *p0; + struct ib_srq *s0; + struct ib_srq *s1; +}; + +struct mlx5_dc_tracer { + struct page *pg; + dma_addr_t dma; + int size; + int order; +}; + +struct mlx5_dc_desc { + dma_addr_t dma; + void *buf; +}; + +enum mlx5_op { + MLX5_WR_OP_MLX = 1, +}; + +struct mlx5_mlx_wr { + u8 sl; + u16 dlid; + int icrc; +}; + +struct mlx5_send_wr { + struct ib_send_wr wr; + union { + struct mlx5_mlx_wr mlx; + } sel; +}; + +struct mlx5_dc_data { + struct ib_mr *mr; + struct ib_qp *dcqp; + struct ib_cq *rcq; + struct ib_cq *scq; + unsigned int rx_npages; + unsigned int tx_npages; + struct mlx5_dc_desc *rxdesc; + struct mlx5_dc_desc *txdesc; + unsigned int max_wqes; + unsigned int cur_send; + unsigned int last_send_completed; + int tx_pending; + struct mlx5_ib_dev *dev; + int port; + int initialized; + struct kobject kobj; + unsigned long connects; + unsigned long cnaks; + unsigned long discards; + struct ib_wc wc_tbl[MLX5_CNAK_RX_POLL_CQ_QUOTA]; +}; + +struct mlx5_ib_port_sysfs_group { + struct kobject kobj; + bool enabled; + struct attribute_group counters; +}; + +#define MLX5_IB_GID_MAX 16 + +struct mlx5_ib_port { + struct mlx5_ib_dev *dev; + u8 port_num; /* 0 based */ + u8 port_gone; /* set when gone */ + u16 q_cnt_id; + struct mlx5_ib_port_sysfs_group group; + union ib_gid gid_table[MLX5_IB_GID_MAX]; +}; + +struct mlx5_ib_dev { + struct ib_device ib_dev; + struct mlx5_core_dev *mdev; + MLX5_DECLARE_DOORBELL_LOCK(uar_lock); + int num_ports; + /* serialize update of capability mask + */ + struct mutex cap_mask_mutex; + bool ib_active; + struct umr_common umrc; + /* sync used page count stats + */ + struct mlx5_ib_resources devr; + struct mutex slow_path_mutex; + int enable_atomic_resp; + enum ib_atomic_cap atomic_cap; + struct mlx5_mr_cache cache; + struct kobject mr_cache; + /* protect resources needed as part of reset flow */ + spinlock_t reset_flow_resource_lock; + struct list_head qp_list; + struct timer_list delay_timer; + int fill_delay; + struct mlx5_dc_tracer dctr; + struct mlx5_dc_data dcd[MLX5_MAX_PORTS]; + struct kobject *dc_kobj; + /* Array with num_ports elements */ + struct mlx5_ib_port *port; + struct kobject *ports_parent; +}; + +static inline struct mlx5_ib_cq *to_mibcq(struct mlx5_core_cq *mcq) +{ + return container_of(mcq, struct mlx5_ib_cq, mcq); +} + +static inline struct mlx5_ib_xrcd *to_mxrcd(struct ib_xrcd *ibxrcd) +{ + return container_of(ibxrcd, struct mlx5_ib_xrcd, ibxrcd); +} + +static inline struct mlx5_ib_dev *to_mdev(struct ib_device *ibdev) +{ + return container_of(ibdev, struct mlx5_ib_dev, ib_dev); +} + +static inline struct mlx5_ib_fmr *to_mfmr(struct ib_fmr *ibfmr) +{ + return container_of(ibfmr, struct mlx5_ib_fmr, ibfmr); +} + +static inline struct mlx5_ib_cq *to_mcq(struct ib_cq *ibcq) +{ + return container_of(ibcq, struct mlx5_ib_cq, ibcq); +} + +static inline struct mlx5_ib_qp *to_mibqp(struct mlx5_core_qp *mqp) +{ + return container_of(mqp, struct mlx5_ib_qp, mqp); +} + +static inline struct mlx5_ib_qp *sq_to_mibqp(struct mlx5_core_qp *msq) +{ + return container_of(msq, struct mlx5_ib_qp, msq); +} + +static inline struct mlx5_ib_qp *rq_to_mibqp(struct mlx5_core_qp *mrq) +{ + return container_of(mrq, struct mlx5_ib_qp, mrq); +} + +static inline struct mlx5_ib_mr *to_mibmr(struct mlx5_core_mr *mmr) +{ + return container_of(mmr, struct mlx5_ib_mr, mmr); +} + +static inline struct mlx5_ib_pd *to_mpd(struct ib_pd *ibpd) +{ + return container_of(ibpd, struct mlx5_ib_pd, ibpd); +} + +static inline struct mlx5_ib_srq *to_msrq(struct ib_srq *ibsrq) +{ + return container_of(ibsrq, struct mlx5_ib_srq, ibsrq); +} + +static inline struct mlx5_ib_qp *to_mqp(struct ib_qp *ibqp) +{ + return container_of(ibqp, struct mlx5_ib_qp, ibqp); +} + +static inline struct mlx5_ib_srq *to_mibsrq(struct mlx5_core_srq *msrq) +{ + return container_of(msrq, struct mlx5_ib_srq, msrq); +} + +static inline struct mlx5_ib_mr *to_mmr(struct ib_mr *ibmr) +{ + return container_of(ibmr, struct mlx5_ib_mr, ibmr); +} + +static inline struct mlx5_ib_fast_reg_page_list *to_mfrpl(struct ib_fast_reg_page_list *ibfrpl) +{ + return container_of(ibfrpl, struct mlx5_ib_fast_reg_page_list, ibfrpl); +} + +struct mlx5_ib_ah { + struct ib_ah ibah; + struct mlx5_av av; +}; + +static inline struct mlx5_ib_ah *to_mah(struct ib_ah *ibah) +{ + return container_of(ibah, struct mlx5_ib_ah, ibah); +} + +int mlx5_ib_db_map_user(struct mlx5_ib_ucontext *context, uintptr_t virt, + struct mlx5_db *db); +void mlx5_ib_db_unmap_user(struct mlx5_ib_ucontext *context, struct mlx5_db *db); +void __mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 qpn, struct mlx5_ib_srq *srq); +void mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 qpn, struct mlx5_ib_srq *srq); +void mlx5_ib_free_srq_wqe(struct mlx5_ib_srq *srq, int wqe_index); +int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey, + u8 port, struct ib_wc *in_wc, struct ib_grh *in_grh, + void *in_mad, void *response_mad); +struct ib_ah *create_ib_ah(struct mlx5_ib_dev *dev, struct ib_ah_attr *ah_attr, + struct mlx5_ib_ah *ah, enum rdma_link_layer ll); +struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr); +int mlx5_ib_query_ah(struct ib_ah *ibah, struct ib_ah_attr *ah_attr); +int mlx5_ib_destroy_ah(struct ib_ah *ah); +struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, + struct ib_srq_init_attr *init_attr, + struct ib_udata *udata); +int mlx5_ib_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr, + enum ib_srq_attr_mask attr_mask, struct ib_udata *udata); +int mlx5_ib_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr); +int mlx5_ib_destroy_srq(struct ib_srq *srq); +int mlx5_ib_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, + struct ib_recv_wr **bad_wr); +struct ib_qp *mlx5_ib_create_qp(struct ib_pd *pd, + struct ib_qp_init_attr *init_attr, + struct ib_udata *udata); +int mlx5_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, + int attr_mask, struct ib_udata *udata); +int mlx5_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr_mask, + struct ib_qp_init_attr *qp_init_attr); +int mlx5_ib_destroy_qp(struct ib_qp *qp); +int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, + struct ib_send_wr **bad_wr); +int mlx5_ib_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, + struct ib_recv_wr **bad_wr); +void *mlx5_get_send_wqe(struct mlx5_ib_qp *qp, int n); +struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev, + struct ib_cq_init_attr *attr, + struct ib_ucontext *context, + struct ib_udata *udata); +int mlx5_ib_destroy_cq(struct ib_cq *cq); +int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc); +int mlx5_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags); +int mlx5_ib_modify_cq(struct ib_cq *cq, struct ib_cq_attr *attr, int cq_attr_mask); +int mlx5_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata); +struct ib_mr *mlx5_ib_get_dma_mr(struct ib_pd *pd, int acc); +struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, + u64 virt_addr, int access_flags, + struct ib_udata *udata, int mr_id); +struct ib_mr *mlx5_ib_reg_phys_mr(struct ib_pd *pd, + struct ib_phys_buf *buffer_list, + int num_phys_buf, + int access_flags, + u64 *virt_addr); +int mlx5_ib_dereg_mr(struct ib_mr *ibmr); +int mlx5_ib_destroy_mr(struct ib_mr *ibmr); +struct ib_mr *mlx5_ib_alloc_fast_reg_mr(struct ib_pd *pd, + int max_page_list_len); +struct ib_fast_reg_page_list *mlx5_ib_alloc_fast_reg_page_list(struct ib_device *ibdev, + int page_list_len); +void mlx5_ib_free_fast_reg_page_list(struct ib_fast_reg_page_list *page_list); + +struct ib_fmr *mlx5_ib_fmr_alloc(struct ib_pd *pd, int acc, + struct ib_fmr_attr *fmr_attr); +int mlx5_ib_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list, + int npages, u64 iova); +int mlx5_ib_unmap_fmr(struct list_head *fmr_list); +int mlx5_ib_fmr_dealloc(struct ib_fmr *ibfmr); +int mlx5_ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num, + struct ib_wc *in_wc, struct ib_grh *in_grh, + struct ib_mad *in_mad, struct ib_mad *out_mad); +struct ib_xrcd *mlx5_ib_alloc_xrcd(struct ib_device *ibdev, + struct ib_ucontext *context, + struct ib_udata *udata); +int mlx5_ib_dealloc_xrcd(struct ib_xrcd *xrcd); +int mlx5_ib_get_buf_offset(u64 addr, int page_shift, u32 *offset); +int mlx5_query_ext_port_caps(struct mlx5_ib_dev *dev, u8 port); +int mlx5_query_smp_attr_node_info_mad_ifc(struct ib_device *ibdev, + struct ib_smp *out_mad); +int mlx5_query_system_image_guid_mad_ifc(struct ib_device *ibdev, + __be64 *sys_image_guid); +int mlx5_query_max_pkeys_mad_ifc(struct ib_device *ibdev, + u16 *max_pkeys); +int mlx5_query_vendor_id_mad_ifc(struct ib_device *ibdev, + u32 *vendor_id); +int mlx5_query_pkey_mad_ifc(struct ib_device *ibdev, u8 port, u16 index, + u16 *pkey); +int mlx5_query_node_desc_mad_ifc(struct mlx5_ib_dev *dev, char *node_desc); +int mlx5_query_node_guid_mad_ifc(struct mlx5_ib_dev *dev, u64 *node_guid); +int mlx5_query_gids_mad_ifc(struct ib_device *ibdev, u8 port, int index, + union ib_gid *gid); +int mlx5_query_port_mad_ifc(struct ib_device *ibdev, u8 port, + struct ib_port_attr *props); +int mlx5_ib_query_port(struct ib_device *ibdev, u8 port, + struct ib_port_attr *props); +int mlx5_ib_init_fmr(struct mlx5_ib_dev *dev); +void mlx5_ib_cleanup_fmr(struct mlx5_ib_dev *dev); +void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, int *count, int *shift, + int *ncont, int *order); +void mlx5_ib_populate_pas(struct mlx5_ib_dev *dev, struct ib_umem *umem, + int page_shift, __be64 *pas, int umr); +void mlx5_ib_copy_pas(u64 *old, u64 *new, int step, int num); +int mlx5_ib_get_cqe_size(struct mlx5_ib_dev *dev, struct ib_cq *ibcq); +int mlx5_mr_cache_init(struct mlx5_ib_dev *dev); +int mlx5_mr_cache_cleanup(struct mlx5_ib_dev *dev); +int mlx5_mr_ib_cont_pages(struct ib_umem *umem, u64 addr, int *count, int *shift); +void mlx5_umr_cq_handler(struct ib_cq *cq, void *cq_context); +int mlx5_query_port_roce(struct ib_device *ibdev, u8 port, + struct ib_port_attr *props); +__be16 mlx5_get_roce_udp_sport(struct mlx5_ib_dev *dev, u8 port, int index, + __be16 ah_udp_s_port); +int mlx5_get_roce_gid_type(struct mlx5_ib_dev *dev, u8 port, + int index, int *gid_type); +struct net_device *mlx5_ib_get_netdev(struct ib_device *ib_dev, u8 port); +int modify_gid_roce(struct ib_device *ib_dev, u8 port, unsigned int index, + const union ib_gid *gid, struct net_device *ndev); +int query_gid_roce(struct ib_device *ib_dev, u8 port, int index, + union ib_gid *gid); +int mlx5_process_mad_mad_ifc(struct ib_device *ibdev, int mad_flags, + u8 port_num, struct ib_wc *in_wc, + struct ib_grh *in_grh, struct ib_mad *in_mad, + struct ib_mad *out_mad); + +static inline void init_query_mad(struct ib_smp *mad) +{ + mad->base_version = 1; + mad->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED; + mad->class_version = 1; + mad->method = IB_MGMT_METHOD_GET; +} + +static inline u8 convert_access(int acc) +{ + return (acc & IB_ACCESS_REMOTE_ATOMIC ? MLX5_PERM_ATOMIC : 0) | + (acc & IB_ACCESS_REMOTE_WRITE ? MLX5_PERM_REMOTE_WRITE : 0) | + (acc & IB_ACCESS_REMOTE_READ ? MLX5_PERM_REMOTE_READ : 0) | + (acc & IB_ACCESS_LOCAL_WRITE ? MLX5_PERM_LOCAL_WRITE : 0) | + MLX5_PERM_LOCAL_READ; +} + +#define MLX5_MAX_UMR_SHIFT 16 +#define MLX5_MAX_UMR_PAGES (1 << MLX5_MAX_UMR_SHIFT) + +#endif /* MLX5_IB_H */ Added: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_ah.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_ah.c Wed Aug 23 12:09:37 2017 (r322810) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "mlx5_ib.h" + +#define IPV6_DEFAULT_HOPLIMIT 64 + +struct ib_ah *create_ib_ah(struct mlx5_ib_dev *dev, + struct ib_ah_attr *ah_attr, + struct mlx5_ib_ah *ah, enum rdma_link_layer ll) +{ + int err; + int gid_type; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 23 12:47:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E95F5DE67F1; Wed, 23 Aug 2017 12:47:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id B74206EACF; Wed, 23 Aug 2017 12:47:11 +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 v7NClAEO086623; Wed, 23 Aug 2017 12:47:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NClAJI086622; Wed, 23 Aug 2017 12:47:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201708231247.v7NClAJI086622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 23 Aug 2017 12:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322811 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 322811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 12:47:12 -0000 Author: emaste Date: Wed Aug 23 12:47:10 2017 New Revision: 322811 URL: https://svnweb.freebsd.org/changeset/base/322811 Log: Set MK_LLD_IS_LD to MK_LLD_BOOTSTRAP for cross-tools LLD_BOOTSTRAP is intended to control the linker used to link world and kernel, while LLD_IS_LD is intended to control the linker installed in that world. Force LLD_IS_LD equal to LLD_BOOTSTRAP for the cross-tools build and install phase, so that lld will be installed as the ld to run on the host, when LLD_BOOTSTRAP is set. PR: 221543 Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12072 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Aug 23 12:09:37 2017 (r322810) +++ head/Makefile.inc1 Wed Aug 23 12:47:10 2017 (r322811) @@ -557,7 +557,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - MK_GDB=no MK_TESTS=no + MK_GDB=no MK_LLD_IS_LD=${MK_LLD_BOOTSTRAP} MK_TESTS=no # kernel-tools stage KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ From owner-svn-src-head@freebsd.org Wed Aug 23 14:50:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D4AEDE8E90; Wed, 23 Aug 2017 14:50:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1A179732CC; Wed, 23 Aug 2017 14:50:09 +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 v7NEo8Oa038159; Wed, 23 Aug 2017 14:50:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NEo8iH038158; Wed, 23 Aug 2017 14:50:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201708231450.v7NEo8iH038158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 23 Aug 2017 14:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322812 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 322812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 14:50:09 -0000 Author: tuexen Date: Wed Aug 23 14:50:08 2017 New Revision: 322812 URL: https://svnweb.freebsd.org/changeset/base/322812 Log: Avoid TCP log messages which are false positives. The check for timestamps are too early to handle SYN-ACK correctly. So move it down after the corresponing processing has been done. PR: 216832 Obtained from: antonfb@hesiod.org MFC after: 1 week Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Aug 23 12:47:10 2017 (r322811) +++ head/sys/netinet/tcp_input.c Wed Aug 23 14:50:08 2017 (r322812) @@ -1694,25 +1694,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru to.to_tsecr = 0; } /* - * If timestamps were negotiated during SYN/ACK they should - * appear on every segment during this session and vice versa. - */ - if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp missing, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } - if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp not expected, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } - - /* * Process options only when we get SYN/ACK back. The SYN case * for incoming connections is handled in tcp_syncache. * According to RFC1323 the window field in a SYN (i.e., a @@ -1740,6 +1721,25 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru if ((tp->t_flags & TF_SACK_PERMIT) && (to.to_flags & TOF_SACKPERM) == 0) tp->t_flags &= ~TF_SACK_PERMIT; + } + + /* + * If timestamps were negotiated during SYN/ACK they should + * appear on every segment during this session and vice versa. + */ + if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp missing, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } + } + if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp not expected, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } } /* From owner-svn-src-head@freebsd.org Wed Aug 23 15:08:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A0A4DE94A6; Wed, 23 Aug 2017 15:08:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id E855173F23; Wed, 23 Aug 2017 15:08:52 +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 v7NF8q42046464; Wed, 23 Aug 2017 15:08:52 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NF8qdK046463; Wed, 23 Aug 2017 15:08:52 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201708231508.v7NF8qdK046463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 23 Aug 2017 15:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322813 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 322813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 15:08:53 -0000 Author: tuexen Date: Wed Aug 23 15:08:51 2017 New Revision: 322813 URL: https://svnweb.freebsd.org/changeset/base/322813 Log: Avoid TCP log messages which are false positives. This is https://svnweb.freebsd.org/changeset/base/322812, just for alternate TCP stacks. XMFC with: 322812 Modified: head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Wed Aug 23 14:50:08 2017 (r322812) +++ head/sys/netinet/tcp_stacks/fastpath.c Wed Aug 23 15:08:51 2017 (r322813) @@ -1831,24 +1831,6 @@ tcp_do_segment_fastslow(struct mbuf *m, struct tcphdr if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) to.to_tsecr = 0; } - /* - * If timestamps were negotiated during SYN/ACK they should - * appear on every segment during this session and vice versa. - */ - if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp missing, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } - if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp not expected, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } /* * Process options only when we get SYN/ACK back. The SYN case @@ -1879,6 +1861,26 @@ tcp_do_segment_fastslow(struct mbuf *m, struct tcphdr (to.to_flags & TOF_SACKPERM) == 0) tp->t_flags &= ~TF_SACK_PERMIT; } + + /* + * If timestamps were negotiated during SYN/ACK they should + * appear on every segment during this session and vice versa. + */ + if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp missing, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } + } + if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp not expected, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } + } + can_enter = 0; if (__predict_true((tlen == 0))) { /* @@ -2306,24 +2308,6 @@ tcp_do_segment_fastack(struct mbuf *m, struct tcphdr * if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) to.to_tsecr = 0; } - /* - * If timestamps were negotiated during SYN/ACK they should - * appear on every segment during this session and vice versa. - */ - if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp missing, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } - if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp not expected, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } /* * Process options only when we get SYN/ACK back. The SYN case @@ -2354,6 +2338,26 @@ tcp_do_segment_fastack(struct mbuf *m, struct tcphdr * (to.to_flags & TOF_SACKPERM) == 0) tp->t_flags &= ~TF_SACK_PERMIT; } + + /* + * If timestamps were negotiated during SYN/ACK they should + * appear on every segment during this session and vice versa. + */ + if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp missing, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } + } + if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp not expected, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } + } + /* * Header prediction: check for the two common cases * of a uni-directional data xfer. If the packet has From owner-svn-src-head@freebsd.org Wed Aug 23 16:50:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2E8ADEB0B0; Wed, 23 Aug 2017 16:50:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B058276F7C; Wed, 23 Aug 2017 16:50:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7NGoAsf087598; Wed, 23 Aug 2017 16:50:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NGoApe087597; Wed, 23 Aug 2017 16:50:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708231650.v7NGoApe087597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Aug 2017 16:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322816 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 322816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 16:50:12 -0000 Author: markj Date: Wed Aug 23 16:50:10 2017 New Revision: 322816 URL: https://svnweb.freebsd.org/changeset/base/322816 Log: Set the bus number field when attaching a PCI device. MFC after: 1 week 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 Wed Aug 23 15:47:42 2017 (r322815) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Aug 23 16:50:10 2017 (r322816) @@ -167,6 +167,7 @@ linux_pci_attach(device_t dev) if (pdev->bus == NULL) { pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK | M_ZERO); pbus->self = pdev; + pbus->number = pci_get_bus(dev); pdev->bus = pbus; } From owner-svn-src-head@freebsd.org Wed Aug 23 17:52:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20754DEC226; Wed, 23 Aug 2017 17:52:51 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E16997CFF1; Wed, 23 Aug 2017 17:52:50 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7NHqoer016078; Wed, 23 Aug 2017 17:52:50 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NHqoRk016077; Wed, 23 Aug 2017 17:52:50 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201708231752.v7NHqoRk016077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 23 Aug 2017 17:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322819 - head/usr.sbin/camdd X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: head/usr.sbin/camdd X-SVN-Commit-Revision: 322819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 17:52:51 -0000 Author: ken Date: Wed Aug 23 17:52:49 2017 New Revision: 322819 URL: https://svnweb.freebsd.org/changeset/base/322819 Log: Fix a resource leak in an error case in camdd_buf_sg_create(). Submitted by: Coverity CID: 1341622 MFC after: 3 days Sponsored by: Spectra Logic Modified: head/usr.sbin/camdd/camdd.c Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Wed Aug 23 17:47:57 2017 (r322818) +++ head/usr.sbin/camdd/camdd.c Wed Aug 23 17:52:49 2017 (r322819) @@ -824,6 +824,7 @@ camdd_buf_sg_create(struct camdd_buf *buf, int iovec, struct camdd_buf_data *data; uint8_t *extra_buf = NULL; size_t extra_buf_len = 0; + int extra_buf_attached = 0; int i, retval = 0; data = &buf->buf_type_spec.data; @@ -913,6 +914,7 @@ camdd_buf_sg_create(struct camdd_buf *buf, int iovec, data->iovec[i].iov_base = extra_buf; data->iovec[i].iov_len = extra_buf_len; } + extra_buf_attached = 1; i++; } if ((tmp_buf != NULL) || (i != data->sg_count)) { @@ -926,6 +928,14 @@ bailout: if (retval == 0) { *num_sectors_used = (data->fill_len + extra_buf_len) / sector_size; + } else if (extra_buf_attached == 0) { + /* + * If extra_buf isn't attached yet, we need to free it + * to avoid leaking. + */ + free(extra_buf); + data->extra_buf = 0; + data->sg_count--; } return (retval); } From owner-svn-src-head@freebsd.org Wed Aug 23 17:56:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D0E1DEC3F5; Wed, 23 Aug 2017 17:56:56 +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 mx1.freebsd.org (Postfix) with ESMTPS id 59E5A7D1EB; Wed, 23 Aug 2017 17:56:56 +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 v7NHutiU016264; Wed, 23 Aug 2017 17:56:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NHutQM016263; Wed, 23 Aug 2017 17:56:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201708231756.v7NHutQM016263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 23 Aug 2017 17:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322820 - head/contrib/top X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/top X-SVN-Commit-Revision: 322820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 17:56:56 -0000 Author: emaste Date: Wed Aug 23 17:56:55 2017 New Revision: 322820 URL: https://svnweb.freebsd.org/changeset/base/322820 Log: top: use __mips__ and __NetBSD__ for consistency r322767 fixed the mips64 build failure with Clang with a minimal change to use __FreeBSD__ instead of FreeBSD in a #if test. For consistency and to facilitate possible upstreaming change the other macros in the test to their canonical form. Discussed with: jhb Modified: head/contrib/top/loadavg.h Modified: head/contrib/top/loadavg.h ============================================================================== --- head/contrib/top/loadavg.h Wed Aug 23 17:52:49 2017 (r322819) +++ head/contrib/top/loadavg.h Wed Aug 23 17:56:55 2017 (r322820) @@ -19,7 +19,7 @@ * * Defined types: load_avg for load averages, pctcpu for cpu percentages. */ -#if defined(mips) && !(defined(NetBSD) || defined(__FreeBSD__)) +#if defined(__mips__) && !(defined(__NetBSD__) || defined(__FreeBSD__)) # include # if defined(FBITS) && !defined(FSCALE) # define FSCALE (1 << FBITS) /* RISC/os on mips */ From owner-svn-src-head@freebsd.org Wed Aug 23 19:00:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8947BDED22F; Wed, 23 Aug 2017 19:00:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 58BE17EA0D; Wed, 23 Aug 2017 19:00:07 +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 v7NJ06b7040951; Wed, 23 Aug 2017 19:00:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NJ06K5040950; Wed, 23 Aug 2017 19:00:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708231900.v7NJ06K5040950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 23 Aug 2017 19:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322821 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 322821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 19:00:07 -0000 Author: mav Date: Wed Aug 23 19:00:06 2017 New Revision: 322821 URL: https://svnweb.freebsd.org/changeset/base/322821 Log: Add missing restart_queue initialization. MFC after: 1 week Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Wed Aug 23 17:56:55 2017 (r322820) +++ head/sys/dev/isp/isp_freebsd.c Wed Aug 23 19:00:06 2017 (r322821) @@ -971,6 +971,7 @@ create_lun_state(ispsoftc_t *isp, int bus, struct cam_ tptr->ts_lun = lun; SLIST_INIT(&tptr->atios); SLIST_INIT(&tptr->inots); + STAILQ_INIT(&tptr->restart_queue); ISP_GET_PC_ADDR(isp, bus, lun_hash[LUN_HASH_FUNC(lun)], lhp); SLIST_INSERT_HEAD(lhp, tptr, next); *rslt = tptr; From owner-svn-src-head@freebsd.org Wed Aug 23 21:49:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DD71DEF926; Wed, 23 Aug 2017 21:49:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 550AB82CE6; Wed, 23 Aug 2017 21:49:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7NLnuh2011777; Wed, 23 Aug 2017 21:49:56 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NLnudw011776; Wed, 23 Aug 2017 21:49:56 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201708232149.v7NLnudw011776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 23 Aug 2017 21:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322823 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 322823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 21:49:57 -0000 Author: sbruno Date: Wed Aug 23 21:49:56 2017 New Revision: 322823 URL: https://svnweb.freebsd.org/changeset/base/322823 Log: iflib: call device's if_init function during vlan initialization. Submitted by: bhargava.marreddy@broadcom.com Reviewed by: shurd Sponsored by: Broadcom Differential Revision: https://reviews.freebsd.org/D12098 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Aug 23 20:28:25 2017 (r322822) +++ head/sys/net/iflib.c Wed Aug 23 21:49:56 2017 (r322823) @@ -3927,7 +3927,7 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag IFDI_VLAN_REGISTER(ctx, vtag); /* Re-init to load the changes */ if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) - iflib_init_locked(ctx); + iflib_if_init_locked(ctx); CTX_UNLOCK(ctx); } @@ -3946,7 +3946,7 @@ iflib_vlan_unregister(void *arg, if_t ifp, uint16_t vt IFDI_VLAN_UNREGISTER(ctx, vtag); /* Re-init to load the changes */ if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) - iflib_init_locked(ctx); + iflib_if_init_locked(ctx); CTX_UNLOCK(ctx); } From owner-svn-src-head@freebsd.org Wed Aug 23 23:30:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD43DF0C8D; Wed, 23 Aug 2017 23:30:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B580135B; Wed, 23 Aug 2017 23:30:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7NNUQnN052281; Wed, 23 Aug 2017 23:30:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NNUPpV052276; Wed, 23 Aug 2017 23:30:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708232330.v7NNUPpV052276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 23 Aug 2017 23:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322824 - in head: lib/clang share/mk usr.bin/clang X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/clang share/mk usr.bin/clang X-SVN-Commit-Revision: 322824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 23 Aug 2017 23:30:27 -0000 Author: jhb Date: Wed Aug 23 23:30:25 2017 New Revision: 322824 URL: https://svnweb.freebsd.org/changeset/base/322824 Log: Improve the coverage of debug symbols for MK_DEBUG_FILES. - Include debug symbols in static libraries. This permits binaries to include debug symbols for functions obtained from static libraries. - Permit the C/C++ compiler flags added for MK_DEBUG_FILES to be overridden by setting DEBUG_FILES_CFLAGS. Use this to limit the debug information for llvm libraries and binaries. Reviewed by: emaste Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D12025 Added: head/lib/clang/Makefile.inc (contents, props changed) Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/share/mk/bsd.sys.mk head/usr.bin/clang/Makefile.inc Added: head/lib/clang/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/Makefile.inc Wed Aug 23 23:30:25 2017 (r322824) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +.if ${COMPILER_TYPE} == "clang" +DEBUG_FILES_CFLAGS= -gline-tables-only +.else +DEBUG_FILES_CFLAGS= -g1 +.endif Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Aug 23 21:49:56 2017 (r322823) +++ head/share/mk/bsd.lib.mk Wed Aug 23 23:30:25 2017 (r322824) @@ -69,8 +69,8 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) -SHARED_CFLAGS+= -g -SHARED_CXXFLAGS+= -g +CFLAGS+= ${DEBUG_FILES_CFLAGS} +CXXFLAGS+= ${DEBUG_FILES_CFLAGS} CTFFLAGS+= -g .endif Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Aug 23 21:49:56 2017 (r322823) +++ head/share/mk/bsd.prog.mk Wed Aug 23 23:30:25 2017 (r322824) @@ -39,7 +39,7 @@ CFLAGS+=${CRUNCH_CFLAGS} .else .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf-*) -CFLAGS+= -g +CFLAGS+= ${DEBUG_FILES_CFLAGS} CTFFLAGS+= -g .endif .endif Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Wed Aug 23 21:49:56 2017 (r322823) +++ head/share/mk/bsd.sys.mk Wed Aug 23 23:30:25 2017 (r322824) @@ -212,6 +212,10 @@ SSP_CFLAGS?= -fstack-protector CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !ARM && !MIPS +# Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is +# enabled. +DEBUG_FILES_CFLAGS?= -g + # Allow user-specified additional warning flags, plus compiler and file # specific flag overrides, unless we've overriden this... .if ${MK_WARNS} != "no" Modified: head/usr.bin/clang/Makefile.inc ============================================================================== --- head/usr.bin/clang/Makefile.inc Wed Aug 23 21:49:56 2017 (r322823) +++ head/usr.bin/clang/Makefile.inc Wed Aug 23 23:30:25 2017 (r322824) @@ -2,4 +2,12 @@ WARNS?= 0 +.include + +.if ${COMPILER_TYPE} == "clang" +DEBUG_FILES_CFLAGS= -gline-tables-only +.else +DEBUG_FILES_CFLAGS= -g1 +.endif + .include "../Makefile.inc" From owner-svn-src-head@freebsd.org Thu Aug 24 00:04:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C025DF172C; Thu, 24 Aug 2017 00:04:55 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 046F422C1; Thu, 24 Aug 2017 00:04:55 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x22b.google.com with SMTP id f135so5608455ita.0; Wed, 23 Aug 2017 17:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=52z7XYk1x9iTadOpV2tT+1dCM1KagU7GE0Z3RFF0T+A=; b=a7XiYuHCttCxlzBSIOiXJ7Vo9odNWX7CItGi1bnwHCc2IB1Cax6c7DKyGCOkVSqYLo v64lEKuEqwHTI+Y17qYZw3T9NKPnW8NNnRUOHKutl8BTzqA7I0TECl/2ZbtIMZp2YlQR FfcJC/pc0gumQIsYFixPXLIvvnuOMWCMmvkcgDV06YC4XWE+46l7Fjc2Z/kWOylyVN6s D5XYHwJaU+8qKRFqzor9NeA92MbXOAcnoGW2K7RPXmfskIq5AyaymciTCEi89hWwusSB xQODjLA3qfNFHu1roI2ZD97OVekDahKerOedlTTTl0C24M2jy6YL2uZONvUOIUnMRs3c PmWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=52z7XYk1x9iTadOpV2tT+1dCM1KagU7GE0Z3RFF0T+A=; b=lI9cu+AngboysHhsesz90hTbSoEvWnxPHCz37/53+VD+T9FfWG7Bv0EAMgWEgJc5kA Y0Fl8J5Ipu6zrxu8a4skp2GxDZWiuMAGcRUCTwlD0RD2ei2yO8qqoMwG8eCsR88D5lux LEUspUs5yyyyUMf0Qi+vP6vQF+Zn1jry7oGoa/jVLv/pOM3x4gTB5JbzPbngXF3rLLDU OhthQn6jXC3ZsmjdMOU9by+uQV6FxU5UTXvIV9i2Cww2fEAZvx7bB0pSv5uqUJ2p8tiQ txeMAGIYog6w3L1Ic9AmaOOZeN3kQrsQgYSSMSFJvODwz7pC0yGVroJ4uci/QbUXxgQG R8Pw== X-Gm-Message-State: AHYfb5iq0V5jcDjS2ArMsUsmKoR8HwJbhIxzDRF1JE4uyweZOSZEkV+g 85bRzkBqxPSszSVJgdRB7i+WYSFiE4WiiCs= X-Received: by 10.36.37.143 with SMTP id g137mr4608260itg.35.1503533094186; Wed, 23 Aug 2017 17:04:54 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.24.66 with HTTP; Wed, 23 Aug 2017 17:04:33 -0700 (PDT) In-Reply-To: <201708231209.v7NC9bBJ070335@repo.freebsd.org> References: <201708231209.v7NC9bBJ070335@repo.freebsd.org> From: Ed Maste Date: Wed, 23 Aug 2017 20:04:33 -0400 X-Google-Sender-Auth: 1rbfkwdaUaHiQZbvPWv5AKFkqM0 Message-ID: Subject: Re: svn commit: r322810 - in head: share/man/man4 sys/conf sys/dev/mlx5/mlx5_ib sys/modules sys/modules/mlx5ib To: Hans Petter Selasky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 00:04:55 -0000 On 23 August 2017 at 08:09, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Aug 23 12:09:37 2017 > New Revision: 322810 > URL: https://svnweb.freebsd.org/changeset/base/322810 > > Log: > Add new mlx5ib(4) driver to the kernel source tree which supports > Remote DMA over Converged Ethernet, RoCE, for the ConnectX-4 series of > PCI express network cards. i386 lint kernel is now failing with: /scratch/tmp/emaste/freebsd/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c:58:21: error: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned int *') to parameter of type 'const unsigned long *' [-Werror,-Wincompatible-pointer-types] m = find_first_bit(&tmp, 8 * sizeof(tmp)); ^~~~ /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/bitops.h:111:37: note: passing argument to parameter 'addr' here find_first_bit(const unsigned long *addr, unsigned long size) ^ /scratch/tmp/emaste/freebsd/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c:70:23: error: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned int *') to parameter of type 'const unsigned long *' [-Werror,-Wincompatible-pointer-types] find_first_bit(&tmp, 8 * sizeof(tmp))); ^~~~ /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/kernel.h:366:17: note: expanded from macro 'min_t' type __min2 = (y); \ ^ /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/bitops.h:111:37: note: passing argument to parameter 'addr' here find_first_bit(const unsigned long *addr, unsigned long size) ^ /scratch/tmp/emaste/freebsd/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c:78:25: error: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned int *') to parameter of type 'const unsigned long *' [-Werror,-Wincompatible-pointer-types] m = find_first_bit(&tmp, 8 * sizeof(tmp)); ^~~~ /scratch/tmp/emaste/freebsd/sys/compat/linuxkpi/common/include/linux/bitops.h:111:37: note: passing argument to parameter 'addr' here find_first_bit(const unsigned long *addr, unsigned long size) ^ 3 errors generated. From owner-svn-src-head@freebsd.org Thu Aug 24 01:20:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D8E0DF2DF4; Thu, 24 Aug 2017 01:20:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D083A63663; Thu, 24 Aug 2017 01:20:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7O1KqYx096744; Thu, 24 Aug 2017 01:20:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7O1Kq2Z096743; Thu, 24 Aug 2017 01:20:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201708240120.v7O1Kq2Z096743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Aug 2017 01:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322825 - head/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/usr.bin/grep X-SVN-Commit-Revision: 322825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 01:20:54 -0000 Author: kevans Date: Thu Aug 24 01:20:52 2017 New Revision: 322825 URL: https://svnweb.freebsd.org/changeset/base/322825 Log: bsdgrep: add some additional tests for fgrep Previously added tests only check that fgrep is somewhat sane and works. Add some more tests that check that the implementation is basically functional and not producing incorrect results with various flags. Reviewed by: cem, emaste, ngie Approved by: emaste (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12056 Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Wed Aug 23 23:30:25 2017 (r322824) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Aug 24 01:20:52 2017 (r322825) @@ -687,6 +687,59 @@ matchall_body() atf_check -s exit:1 grep "" test1 } + +atf_test_case fgrep_multipattern +fgrep_multipattern_head() +{ + atf_set "descr" "Check proper behavior with multiple patterns supplied to fgrep" +} +fgrep_multipattern_body() +{ + printf "Foo\nBar\nBaz" > test1 + + atf_check -o inline:"Foo\nBaz\n" grep -F -e "Foo" -e "Baz" test1 + atf_check -o inline:"Foo\nBaz\n" grep -F -e "Baz" -e "Foo" test1 + atf_check -o inline:"Bar\nBaz\n" grep -F -e "Bar" -e "Baz" test1 +} + +atf_test_case fgrep_icase +fgrep_icase_head() +{ + atf_set "descr" "Check proper handling of -i supplied to fgrep" +} +fgrep_icase_body() +{ + printf "Foo\nBar\nBaz" > test1 + + atf_check -o inline:"Foo\nBaz\n" grep -Fi -e "foo" -e "baz" test1 + atf_check -o inline:"Foo\nBaz\n" grep -Fi -e "baz" -e "foo" test1 + atf_check -o inline:"Bar\nBaz\n" grep -Fi -e "bar" -e "baz" test1 + atf_check -o inline:"Bar\nBaz\n" grep -Fi -e "BAR" -e "bAz" test1 +} + +atf_test_case fgrep_oflag +fgrep_oflag_head() +{ + atf_set "descr" "Check proper handling of -o supplied to fgrep" +} +fgrep_oflag_body() +{ + printf "abcdefghi\n" > test1 + + atf_check -o inline:"a\n" grep -Fo "a" test1 + atf_check -o inline:"i\n" grep -Fo "i" test1 + atf_check -o inline:"abc\n" grep -Fo "abc" test1 + atf_check -o inline:"fgh\n" grep -Fo "fgh" test1 + atf_check -o inline:"cde\n" grep -Fo "cde" test1 + atf_check -o inline:"bcd\n" grep -Fo -e "bcd" -e "cde" test1 + atf_check -o inline:"bcd\nefg\n" grep -Fo -e "bcd" -e "efg" test1 + + atf_check -s exit:1 grep -Fo "xabc" test1 + atf_check -s exit:1 grep -Fo "abcx" test1 + atf_check -s exit:1 grep -Fo "xghi" test1 + atf_check -s exit:1 grep -Fo "ghix" test1 + atf_check -s exit:1 grep -Fo "abcdefghiklmnopqrstuvwxyz" test1 +} # End FreeBSD atf_init_test_cases() @@ -728,5 +781,8 @@ atf_init_test_cases() atf_add_test_case mmap atf_add_test_case mmap_eof_not_eol atf_add_test_case matchall + atf_add_test_case fgrep_multipattern + atf_add_test_case fgrep_icase + atf_add_test_case fgrep_oflag # End FreeBSD } From owner-svn-src-head@freebsd.org Thu Aug 24 01:23:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6902DCB09B; Thu, 24 Aug 2017 01:23:34 +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 mx1.freebsd.org (Postfix) with ESMTPS id B0DB063A07; Thu, 24 Aug 2017 01:23:34 +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 v7O1NXCM000505; Thu, 24 Aug 2017 01:23:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7O1NXTx000502; Thu, 24 Aug 2017 01:23:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201708240123.v7O1NXTx000502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Aug 2017 01:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322826 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 322826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 01:23:35 -0000 Author: kevans Date: Thu Aug 24 01:23:33 2017 New Revision: 322826 URL: https://svnweb.freebsd.org/changeset/base/322826 Log: bsdgrep: add a primitive literal matcher fgrep/grep -F will error out at runtime if compiled with a regex(3) that does not define REG_NOSPEC or REG_LITERAL. glibc is one such regex(3) implementation, and as it turns out they don't support literal matching at all. Provide a primitive literal matcher for use with glibc and other implementations that don't support literal matching so that we don't completely lose fgrep/grep -F if compiled against libgnuregex on stable/10, stable/11, or other systems that we don't necessarily support. This is a wholly unoptimized implementation with no plans to optimize it as of now. This is due to both its use-case being primarily on unsupported systems in the near-distant future and that it's reinventing the wheel that we already have available as a feature of regex(3). Reviewed by: cem, emaste, ngie Approved by: emaste (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12056 Modified: head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/util.c Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Thu Aug 24 01:20:52 2017 (r322825) +++ head/usr.bin/grep/grep.c Thu Aug 24 01:23:33 2017 (r322826) @@ -720,12 +720,19 @@ main(int argc, char *argv[]) case GREP_BASIC: break; case GREP_FIXED: + /* + * regex(3) implementations that support fixed-string searches generally + * define either REG_NOSPEC or REG_LITERAL. Set the appropriate flag + * here. If neither are defined, GREP_FIXED later implies that the + * internal literal matcher should be used. Other cflags that have + * the same interpretation as REG_NOSPEC and REG_LITERAL should be + * similarly added here, and grep.h should be amended to take this into + * consideration when defining WITH_INTERNAL_NOSPEC. + */ #if defined(REG_NOSPEC) cflags |= REG_NOSPEC; #elif defined(REG_LITERAL) cflags |= REG_LITERAL; -#else - errx(2, "literal expressions not supported at compile time"); #endif break; case GREP_EXTENDED: @@ -742,7 +749,11 @@ main(int argc, char *argv[]) r_pattern = grep_calloc(patterns, sizeof(*r_pattern)); /* Don't process any patterns if we have a blank one */ +#ifdef WITH_INTERNAL_NOSPEC + if (!matchall && grepbehave != GREP_FIXED) { +#else if (!matchall) { +#endif /* Check if cheating is allowed (always is for fgrep). */ for (i = 0; i < patterns; ++i) { #ifndef WITHOUT_FASTMATCH Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Thu Aug 24 01:20:52 2017 (r322825) +++ head/usr.bin/grep/grep.h Thu Aug 24 01:23:33 2017 (r322826) @@ -57,6 +57,10 @@ extern const char *errstr[]; #define GREP_BASIC 1 #define GREP_EXTENDED 2 +#if !defined(REG_NOSPEC) && !defined(REG_LITERAL) +#define WITH_INTERNAL_NOSPEC +#endif + #define BINFILE_BIN 0 #define BINFILE_SKIP 1 #define BINFILE_TEXT 2 Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Thu Aug 24 01:20:52 2017 (r322825) +++ head/usr.bin/grep/util.c Thu Aug 24 01:23:33 2017 (r322826) @@ -70,7 +70,10 @@ struct parsec { bool binary; /* Binary file? */ }; - +#ifdef WITH_INTERNAL_NOSPEC +static int litexec(const struct pat *pat, const char *string, + size_t nmatch, regmatch_t pmatch[]); +#endif static int procline(struct parsec *pc); static void printline(struct parsec *pc, int sep); static void printline_metadata(struct str *line, int sep); @@ -350,6 +353,67 @@ procfile(const char *fn) return (c); } +#ifdef WITH_INTERNAL_NOSPEC +/* + * Internal implementation of literal string search within a string, modeled + * after regexec(3), for use when the regex(3) implementation doesn't offer + * either REG_NOSPEC or REG_LITERAL. This does not apply in the default FreeBSD + * config, but in other scenarios such as building against libgnuregex or on + * some non-FreeBSD OSes. + */ +static int +litexec(const struct pat *pat, const char *string, size_t nmatch, + regmatch_t pmatch[]) +{ + char *(*strstr_fn)(const char *, const char *); + char *sub, *subject; + const char *search; + size_t idx, n, ofs, stringlen; + + if (cflags & REG_ICASE) + strstr_fn = strcasestr; + else + strstr_fn = strstr; + idx = 0; + ofs = pmatch[0].rm_so; + stringlen = pmatch[0].rm_eo; + if (ofs >= stringlen) + return (REG_NOMATCH); + subject = strndup(string, stringlen); + if (subject == NULL) + return (REG_ESPACE); + for (n = 0; ofs < stringlen;) { + search = (subject + ofs); + if ((unsigned long)pat->len > strlen(search)) + break; + sub = strstr_fn(search, pat->pat); + /* + * Ignoring the empty string possibility due to context: grep optimizes + * for empty patterns and will never reach this point. + */ + if (sub == NULL) + break; + ++n; + /* Fill in pmatch if necessary */ + if (nmatch > 0) { + pmatch[idx].rm_so = ofs + (sub - search); + pmatch[idx].rm_eo = pmatch[idx].rm_so + pat->len; + if (++idx == nmatch) + break; + ofs = pmatch[idx].rm_so + 1; + } else + /* We only needed to know if we match or not */ + break; + } + free(subject); + if (n > 0 && nmatch > 0) + for (n = idx; n < nmatch; ++n) + pmatch[n].rm_so = pmatch[n].rm_eo = -1; + + return (n > 0 ? 0 : REG_NOMATCH); +} +#endif /* WITH_INTERNAL_NOSPEC */ + #define iswword(x) (iswalnum((x)) || (x) == L'_') /* @@ -400,6 +464,11 @@ procline(struct parsec *pc) for (i = 0; i < patterns; i++) { pmatch.rm_so = st; pmatch.rm_eo = pc->ln.len; +#ifdef WITH_INTERNAL_NOSPEC + if (grepbehave == GREP_FIXED) + r = litexec(&pattern[i], pc->ln.dat, 1, &pmatch); + else +#endif #ifndef WITHOUT_FASTMATCH if (fg_pattern[i].pattern) r = fastexec(&fg_pattern[i], From owner-svn-src-head@freebsd.org Thu Aug 24 01:45:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB164DCC9CB for ; Thu, 24 Aug 2017 01:45:56 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 385B8649A8 for ; Thu, 24 Aug 2017 01:45:56 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x234.google.com with SMTP id b189so10473068wmd.0 for ; Wed, 23 Aug 2017 18:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=C3ylXMMp73LoOi1oZX2U5T28YsmZTR50Y42ubNMoV/s=; b=WryNm53mPkQPnlLOXJke9qR3r4xylYjZMQ5m34XuaoQtsVJ6bUFu8MtneDA+D50dX7 2DDTP1siEodB7mMt135du/2TM9PT33w9mAavbgGINHO9OUYdHsO7udFIq4tnOu5sLEkC GtElL+CnawWiQPLe8Lch17uyCQSiiqW318tFAIiRR3WyyrUo2gewZNDixSTCx1GzMjpE Qm9tR5A1EGxESNYdUQIxQSb2a2eGvw8EaekYU1KUykphDZphwNnWmAuXXa3gni5N3CAx w8cpf1eU7Zrqy4rPhnAfGfw4WWiwo1U6hV3L6hXrfYHu3QO04ied3lcDTDLwqQacYm3X X+EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=C3ylXMMp73LoOi1oZX2U5T28YsmZTR50Y42ubNMoV/s=; b=P36BwsiO0XSG8n/ja+oTHgzCjIE5tP+Dv7hJJ6P/ygQ0MMyhwMYudhDVykRwFwxyEu dD/xkMe0DGEOT+3wYBz6gTiPO4a7FiGkN3WXmLJBR+tlTsK30kTEANS2/XjHBaRwQcb4 ayHLATSURap8WCOGsnEDlqXWT/VSIB1NkjUoXZhxkJCmRvlwNuQ5FWG11PFe+H0fn3/f zBPtg9fKKjpc7vHwpZja6tPub1sjAPjjX/jxtLffgG2irJjec9okKLogJWlrCuz6UAYU N6qb2y8AaR3GbaYo2FNO6UtxKv/IG6KwLPTa+Y3oL+JS8M3FF/A0zcOC7lvkDPUwpHnz Nevw== X-Gm-Message-State: AHYfb5jEoaC5VHRJdjJRlIhTbj5/fi5renXA2ew6bdJITJHO1Kb0NlNW 0M1T9PNutabal52D X-Received: by 10.28.178.130 with SMTP id b124mr2745430wmf.164.1503539153903; Wed, 23 Aug 2017 18:45:53 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-230-154.bltmmd.fios.verizon.net. [100.16.230.154]) by smtp.gmail.com with ESMTPSA id 3sm2177888wmi.46.2017.08.23.18.45.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2017 18:45:53 -0700 (PDT) Date: Wed, 23 Aug 2017 21:45:50 -0400 From: Shawn Webb To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322763 - head/lib/libc/amd64/sys Message-ID: <20170824014550.z7su35lezsmfyzw7@mutt-hbsd> References: <201708211739.v7LHdD6k023805@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pf7xt3lyykoqli3k" Content-Disposition: inline In-Reply-To: <201708211739.v7LHdD6k023805@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20170714 (1.8.3) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 01:45:56 -0000 --pf7xt3lyykoqli3k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 21, 2017 at 05:39:13PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Aug 21 17:39:12 2017 > New Revision: 322763 > URL: https://svnweb.freebsd.org/changeset/base/322763 >=20 > Log: > Optimize libc to get and set TLS using the RDFSBASE and RDGSBASE > instructions, if supported both by CPU and kernel. > =20 > Reviewed by: jhb (previous version) > Tested by: pho (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 3 weeks > Differential revision: https://reviews.freebsd.org/D12023 >=20 > Added: > head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c (contents, props ch= anged) > head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h (contents, props ch= anged) > Modified: > head/lib/libc/amd64/sys/Makefile.inc > head/lib/libc/amd64/sys/amd64_get_fsbase.c > head/lib/libc/amd64/sys/amd64_get_gsbase.c > head/lib/libc/amd64/sys/amd64_set_fsbase.c > head/lib/libc/amd64/sys/amd64_set_gsbase.c Hey kib, This commit breaks booting in UEFI mode under bhyve. The VM gets stuck when the kernel launches /sbin/init. Here's a screenshot of a verbose boot at a recent HEAD: https://imgur.com/PiJhfll Note, the screenshot depicts HardenedBSD, not FreeBSD. Another user attempting to boot a recent vanilla FreeBSD 12-CURRENT/amd64 snapshot reported to me the same behavior, though, so the issue is certainly not specific to HardenedBSD. Reverting just this commit enabled booting in a bhyve VM again. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --pf7xt3lyykoqli3k Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlmeL8wACgkQaoRlj1JF bu5N/g//bOpZRqzHMIZp5ljqG5McGvfhjHwpUmdxqCLjT2nVEs6+qKjQQP1QnpQV caHrBmwoxhDiXQg7tdFykxBu3gMKMqAYuoM36RUYjcfpSRHQhScUXU67/IhpRaTQ Y2RYsPW7IZ3T4CIeqU3ICgwV1P6hE+Oc3a2oBFYb49ASRiNCXwPYAFY+JzrLKdAl nn0edjdT/ELnA2QfBya7t0PzKtitix8Eelw+fSAwxj3+sDa4kd3BC9zZwlrCHxu+ Y0Sm8Y2N0aSZjEdgJFIoVf4vRJX+OaMpx0tEuGcF6jxysS+nBZYZclyMGS0obdzw iutBaFpa8B8VZa1H6y3GGw1q+IeHfX7VjLHsjnLgr0HM/EyJuVvIczbTzMGcMLE0 c8AxGEr7cNqHyY/Qiex0Dne3cWbsAP00lThTZHJjSV2QMJY+EfaFc5bECvCoqejG EfMQI+L02lduMj6jSLwQRmc7VqyXyeJtS64ZtVTwNUwTf3DNeDcZNnkQn7OTijvb 01accHIHLGMFFAArAE8LJZbAsIk76lDo0pHhcmbY7xH8hZa3TIInHd4DsfI136rZ U08HLWL5RqWS10eRzAR5eoSDHZVH6S42leh08b/j31Sre9X3suPaiCzMzlNlJi5q wqFjRKKmcFfcV540tuWhBP86WpotjJdmZeAj5amIEYL/1VmvXmk= =3J8K -----END PGP SIGNATURE----- --pf7xt3lyykoqli3k-- From owner-svn-src-head@freebsd.org Thu Aug 24 02:08:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2106ADD0185; Thu, 24 Aug 2017 02:08:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E33B165731; Thu, 24 Aug 2017 02:08:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7O28qZx017153; Thu, 24 Aug 2017 02:08:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7O28qeY017151; Thu, 24 Aug 2017 02:08:52 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201708240208.v7O28qeY017151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 24 Aug 2017 02:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322827 - head/sys/boot/fdt/dts/arm X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/boot/fdt/dts/arm X-SVN-Commit-Revision: 322827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 02:08:54 -0000 Author: gonzo Date: Thu Aug 24 02:08:52 2017 New Revision: 322827 URL: https://svnweb.freebsd.org/changeset/base/322827 Log: Add "xlnx,zynq-7000" to zedboard and zybo compatible property This property is required to boot CURRENT on zedboard and zybo PR: 221208 Submitted by: Thomas Skibo Modified: head/sys/boot/fdt/dts/arm/zedboard.dts head/sys/boot/fdt/dts/arm/zybo.dts Modified: head/sys/boot/fdt/dts/arm/zedboard.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/zedboard.dts Thu Aug 24 01:23:33 2017 (r322826) +++ head/sys/boot/fdt/dts/arm/zedboard.dts Thu Aug 24 02:08:52 2017 (r322827) @@ -30,7 +30,7 @@ / { model = "zedboard"; - compatible = "digilent,zedboard"; + compatible = "digilent,zedboard", "xlnx,zynq-7000"; memory { // First megabyte isn't accessible by all interconnect masters. Modified: head/sys/boot/fdt/dts/arm/zybo.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/zybo.dts Thu Aug 24 01:23:33 2017 (r322826) +++ head/sys/boot/fdt/dts/arm/zybo.dts Thu Aug 24 02:08:52 2017 (r322827) @@ -30,7 +30,7 @@ / { model = "zybo"; - compatible = "digilent,zybo"; + compatible = "digilent,zybo", "xlnx,zynq-7000"; memory { // First megabyte isn't accessible by all interconnect masters. From owner-svn-src-head@freebsd.org Thu Aug 24 07:36:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 250ABDD8544; Thu, 24 Aug 2017 07:36:31 +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 CFDB26DB1C; Thu, 24 Aug 2017 07:36:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (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 82569260117; Thu, 24 Aug 2017 09:36:28 +0200 (CEST) Subject: Re: svn commit: r322810 - in head: share/man/man4 sys/conf sys/dev/mlx5/mlx5_ib sys/modules sys/modules/mlx5ib To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201708231209.v7NC9bBJ070335@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <2bf96e9d-8c7a-cc98-a51e-c38465181ab5@selasky.org> Date: Thu, 24 Aug 2017 09:34:10 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 07:36:31 -0000 On 08/24/17 02:04, Ed Maste wrote: > On 23 August 2017 at 08:09, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Wed Aug 23 12:09:37 2017 >> New Revision: 322810 >> URL: https://svnweb.freebsd.org/changeset/base/322810 >> >> Log: >> Add new mlx5ib(4) driver to the kernel source tree which supports >> Remote DMA over Converged Ethernet, RoCE, for the ConnectX-4 series of >> PCI express network cards. > > i386 lint kernel is now failing with: > I'll fix shortly. --HPS From owner-svn-src-head@freebsd.org Thu Aug 24 08:09:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A6ADD9142; Thu, 24 Aug 2017 08:09:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3A2FA6E93A; Thu, 24 Aug 2017 08:09:44 +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 v7O89hVo062240; Thu, 24 Aug 2017 08:09:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7O89hxF062238; Thu, 24 Aug 2017 08:09:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708240809.v7O89hxF062238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Aug 2017 08:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322830 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 322830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 08:09:44 -0000 Author: hselasky Date: Thu Aug 24 08:09:42 2017 New Revision: 322830 URL: https://svnweb.freebsd.org/changeset/base/322830 Log: Compile fixes for LINT on 32-bit platforms. MFC after: 2 weeks Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Aug 24 08:02:26 2017 (r322829) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Aug 24 08:09:42 2017 (r322830) @@ -856,7 +856,7 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(stru else if (reqlen == sizeof(struct mlx5_ib_alloc_ucontext_req_v2)) ver = 2; else { - mlx5_ib_err(dev, "request malformed, reqlen: %ld\n", reqlen); + mlx5_ib_err(dev, "request malformed, reqlen: %ld\n", (long)reqlen); return ERR_PTR(-EINVAL); } Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c Thu Aug 24 08:02:26 2017 (r322829) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c Thu Aug 24 08:09:42 2017 (r322830) @@ -29,6 +29,8 @@ #include #include "mlx5_ib.h" +CTASSERT(sizeof(uintptr_t) == sizeof(unsigned long)); + /* @umem: umem object to scan * @addr: ib virtual address requested by the user * @count: number of PAGE_SIZE pages covered by umem @@ -40,7 +42,7 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, int *count, int *shift, int *ncont, int *order) { - uintptr_t tmp; + unsigned long tmp; unsigned long m; int i, k; u64 base = 0; From owner-svn-src-head@freebsd.org Thu Aug 24 08:20:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84AD2DD949A; Thu, 24 Aug 2017 08:20:24 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 5229F6EE7A; Thu, 24 Aug 2017 08:20:24 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7O8KNsi066183; Thu, 24 Aug 2017 08:20:23 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7O8KNh3066182; Thu, 24 Aug 2017 08:20:23 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201708240820.v7O8KNh3066182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Thu, 24 Aug 2017 08:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322831 - head/bin/pkill X-SVN-Group: head X-SVN-Commit-Author: lstewart X-SVN-Commit-Paths: head/bin/pkill X-SVN-Commit-Revision: 322831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 08:20:24 -0000 Author: lstewart Date: Thu Aug 24 08:20:23 2017 New Revision: 322831 URL: https://svnweb.freebsd.org/changeset/base/322831 Log: Only emit the trailing new line added in r322613 when not operating in quiet mode. Reported by: pho MFC after: 1 week X-MFC-with: r322210 Modified: head/bin/pkill/pkill.c Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Thu Aug 24 08:09:42 2017 (r322830) +++ head/bin/pkill/pkill.c Thu Aug 24 08:20:23 2017 (r322831) @@ -568,7 +568,7 @@ main(int argc, char **argv) continue; rv |= (*action)(kp); } - if (rv && pgrep) + if (rv && pgrep && !quiet) putchar('\n'); if (!did_action && !pgrep && longfmt) fprintf(stderr, From owner-svn-src-head@freebsd.org Thu Aug 24 10:49:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0ABBDDC883; Thu, 24 Aug 2017 10:49:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8387173809; Thu, 24 Aug 2017 10:49:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7OAnr7l028558; Thu, 24 Aug 2017 10:49:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OAnrrl028557; Thu, 24 Aug 2017 10:49:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708241049.v7OAnrrl028557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 24 Aug 2017 10:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322832 - head/sys/amd64/vmm/intel X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/vmm/intel X-SVN-Commit-Revision: 322832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 10:49:54 -0000 Author: kib Date: Thu Aug 24 10:49:53 2017 New Revision: 322832 URL: https://svnweb.freebsd.org/changeset/base/322832 Log: Save KGSBASE in pcb before overriding it with the guest value. Reported by: lwhsu, mjoras Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 18 days Modified: head/sys/amd64/vmm/intel/vmx_msr.c Modified: head/sys/amd64/vmm/intel/vmx_msr.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_msr.c Thu Aug 24 08:20:23 2017 (r322831) +++ head/sys/amd64/vmm/intel/vmx_msr.c Thu Aug 24 10:49:53 2017 (r322832) @@ -31,10 +31,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include @@ -356,7 +358,8 @@ vmx_msr_guest_enter(struct vmx *vmx, int vcpuid) { uint64_t *guest_msrs = vmx->guest_msrs[vcpuid]; - /* Save host MSRs (if any) and restore guest MSRs */ + /* Save host MSRs (in particular, KGSBASE) and restore guest MSRs */ + update_pcb_bases(curpcb); wrmsr(MSR_LSTAR, guest_msrs[IDX_MSR_LSTAR]); wrmsr(MSR_CSTAR, guest_msrs[IDX_MSR_CSTAR]); wrmsr(MSR_STAR, guest_msrs[IDX_MSR_STAR]); From owner-svn-src-head@freebsd.org Thu Aug 24 10:57:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADD5ADDCAD9; Thu, 24 Aug 2017 10:57:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AAF773C22; Thu, 24 Aug 2017 10:57:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7OAvYr2032492; Thu, 24 Aug 2017 10:57:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OAvYgU032491; Thu, 24 Aug 2017 10:57:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708241057.v7OAvYgU032491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 24 Aug 2017 10:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322833 - 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: 322833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 10:57:35 -0000 Author: kib Date: Thu Aug 24 10:57:34 2017 New Revision: 322833 URL: https://svnweb.freebsd.org/changeset/base/322833 Log: Stop masking FSGSBASE and SMEP features under monitors. Not enabling FSGSBASE in %cr4 does not prevent reporting of the feature by the CPUID instruction (blame Int*l). As result, kernels which were run under monitors pretended that usermode cannot modify TLS base without the syscall, while libc noted right combination of capable CPU and the new kernel version, trying to use the WRFSBASE instruction. Really old hypervisors that cannot handle enablement of these features in %cr4 would require the manual configuration, by setting the loader tunable hw.cpu_stdext_disable=0x81 Reported by: lwhsu, mjoras Sponsored by: The FreeBSD Foundation MFC after: 18 days Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Thu Aug 24 10:49:53 2017 (r322832) +++ head/sys/x86/x86/identcpu.c Thu Aug 24 10:57:34 2017 (r322833) @@ -1423,18 +1423,15 @@ finishidentcpu(void) cpu_stdext_feature = regs[1]; /* - * Some hypervisors fail to filter out unsupported - * extended features. For now, disable the + * Some hypervisors failed to filter out unsupported + * extended features. Allow to disable the * extensions, activation of which requires setting a * bit in CR4, and which VM monitors do not support. */ - if (cpu_feature2 & CPUID2_HV) { - cpu_stdext_disable = CPUID_STDEXT_FSGSBASE | - CPUID_STDEXT_SMEP; - } else - cpu_stdext_disable = 0; + cpu_stdext_disable = 0; TUNABLE_INT_FETCH("hw.cpu_stdext_disable", &cpu_stdext_disable); cpu_stdext_feature &= ~cpu_stdext_disable; + cpu_stdext_feature2 = regs[2]; } From owner-svn-src-head@freebsd.org Thu Aug 24 11:33:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07291DDD2F6; Thu, 24 Aug 2017 11:33:55 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF3FE748E3; Thu, 24 Aug 2017 11:33:54 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x233.google.com with SMTP id c73so4313269itb.1; Thu, 24 Aug 2017 04:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Fk+7mUQEa9/0v1KAMct2dFKW3RgoImlQ8yl8o3DYSwo=; b=CwIx3EztKd8NSJ6TuaEmfejtxZkOyjl+jVSP8GV1Aq3JUL5DXZtgp8go5bSrkg0WU9 5EDY8ZIXZNBot9Z/L5Ox/gjiWxLB2Cv9jpkIPVF/pz0PC3n84aevo68TrYJpkYG7HHKK S8yTYOJmmjbw2QZPgMuaPf4/VP63tHvboDtPWHSCNYdTe7b10d3Bt9rgoKcqxredVD5F nE9fKQl7EZYJwc0tR9FIvLCkvTs+d4orRDGrLLi1um8g50gnBQ6NjlXIghG0DAzJSFn7 rj6PAijUvXFTNV7SAXEWGDde2NvMJxb65ohCNQcZ4YqipDoRVYSXKfOzWDaIjN+BFVP/ vaKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Fk+7mUQEa9/0v1KAMct2dFKW3RgoImlQ8yl8o3DYSwo=; b=RN/flK141NjMPmCz6aFRfbSfZmKXRY+pSQVGEihgs0CcgctU17SEc6glpC6MRJbOx5 mhR2iUoWFIm+M8Je1hI9TZChq0PdEnH1C9K4U8yW3cTNIH27R+9wIcoHYdA9ePEXSBcT g1AJPWc2HmEGh3aTa6TBtbZBZW31EifW0Mw3o90cjIJgx91s+AJRMRZipkMZz0UluFX+ 4U+urxrDvwT6z+om/9r3JiWyseDuTsqVT8g+GbG+XAZg9aek1JE5i2TAcIcjIEfukpi+ vBFr7JdkF9r2B++AtZoMDCp+Uwp3DSlVnEKQMuKcj7PJHudr+uCYttvsZqcIPjij1Ypo 6QuQ== X-Gm-Message-State: AHYfb5hIQbAh+5fS0HX6ipHl3gFILzX6d8ijAIg8+nW1Rlb8sTaksFF2 jdD/c3rKTEiCzifyb/CB5A3SjRkhFkRg X-Received: by 10.36.11.196 with SMTP id 187mr5658954itd.7.1503574434083; Thu, 24 Aug 2017 04:33:54 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.24.66 with HTTP; Thu, 24 Aug 2017 04:33:33 -0700 (PDT) In-Reply-To: <20170824014550.z7su35lezsmfyzw7@mutt-hbsd> References: <201708211739.v7LHdD6k023805@repo.freebsd.org> <20170824014550.z7su35lezsmfyzw7@mutt-hbsd> From: Ed Maste Date: Thu, 24 Aug 2017 07:33:33 -0400 X-Google-Sender-Auth: X8OYslHUlEf5O6O5iwpLSKMwWBU Message-ID: Subject: Re: svn commit: r322763 - head/lib/libc/amd64/sys To: Shawn Webb Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 11:33:55 -0000 On 23 August 2017 at 21:45, Shawn Webb wrote: > On Mon, Aug 21, 2017 at 05:39:13PM +0000, Konstantin Belousov wrote: >> Author: kib >> Date: Mon Aug 21 17:39:12 2017 >> New Revision: 322763 >> URL: https://svnweb.freebsd.org/changeset/base/322763 >> ... > > Hey kib, > > This commit breaks booting in UEFI mode under bhyve. The VM gets stuck > when the kernel launches /sbin/init. What svn rev did you try? (There was a followup fix to this.) From owner-svn-src-head@freebsd.org Thu Aug 24 15:12:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59444DE1935; Thu, 24 Aug 2017 15:12:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2E4E680218; Thu, 24 Aug 2017 15:12:18 +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 v7OFCHOP040483; Thu, 24 Aug 2017 15:12:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OFCHiA040482; Thu, 24 Aug 2017 15:12:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201708241512.v7OFCHiA040482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 24 Aug 2017 15:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322836 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 322836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 15:12:18 -0000 Author: cem Date: Thu Aug 24 15:12:16 2017 New Revision: 322836 URL: https://svnweb.freebsd.org/changeset/base/322836 Log: Merge print_lockchain and print_sleepchain When debugging a deadlock, it is useful to follow the full chain of locks as far as possible. Reviewed by: jhb Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12115 Modified: head/sys/kern/subr_turnstile.c Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Thu Aug 24 13:39:24 2017 (r322835) +++ head/sys/kern/subr_turnstile.c Thu Aug 24 15:12:16 2017 (r322836) @@ -1096,7 +1096,7 @@ found: /* * Show all the threads a particular thread is waiting on based on - * non-sleepable and non-spin locks. + * non-spin locks. */ static void print_lockchain(struct thread *td, const char *prefix) @@ -1104,10 +1104,11 @@ print_lockchain(struct thread *td, const char *prefix) struct lock_object *lock; struct lock_class *class; struct turnstile *ts; + struct thread *owner; /* * Follow the chain. We keep walking as long as the thread is - * blocked on a turnstile that has an owner. + * blocked on a lock that has an owner. */ while (!db_pager_quit) { db_printf("%sthread %d (pid %d, %s) ", prefix, td->td_tid, @@ -1136,6 +1137,17 @@ print_lockchain(struct thread *td, const char *prefix) return; td = ts->ts_owner; break; + } else if (TD_ON_SLEEPQ(td)) { + if (!lockmgr_chain(td, &owner) && + !sx_chain(td, &owner)) { + db_printf("sleeping on %p \"%s\"\n", + td->td_wchan, td->td_wmesg); + return; + } + if (owner == NULL) + return; + td = owner; + break; } db_printf("inhibited\n"); return; @@ -1158,6 +1170,7 @@ DB_SHOW_COMMAND(lockchain, db_show_lockchain) print_lockchain(td, ""); } +DB_SHOW_ALIAS(sleepchain, db_show_lockchain); DB_SHOW_ALL_COMMAND(chains, db_show_allchains) { @@ -1168,84 +1181,17 @@ DB_SHOW_ALL_COMMAND(chains, db_show_allchains) i = 1; FOREACH_PROC_IN_SYSTEM(p) { FOREACH_THREAD_IN_PROC(p, td) { - if (TD_ON_LOCK(td) && LIST_EMPTY(&td->td_contested)) { + if ((TD_ON_LOCK(td) && LIST_EMPTY(&td->td_contested)) + || (TD_IS_INHIBITED(td) && TD_ON_SLEEPQ(td))) { db_printf("chain %d:\n", i++); print_lockchain(td, " "); } - if (TD_IS_INHIBITED(td) && TD_ON_SLEEPQ(td)) { - db_printf("chain %d:\n", i++); - print_sleepchain(td, " "); - } if (db_pager_quit) return; } } } DB_SHOW_ALIAS(allchains, db_show_allchains) - -/* - * Show all the threads a particular thread is waiting on based on - * sleepable locks. - */ -static void -print_sleepchain(struct thread *td, const char *prefix) -{ - struct thread *owner; - - /* - * Follow the chain. We keep walking as long as the thread is - * blocked on a sleep lock that has an owner. - */ - while (!db_pager_quit) { - db_printf("%sthread %d (pid %d, %s) ", prefix, td->td_tid, - td->td_proc->p_pid, td->td_name); - switch (td->td_state) { - case TDS_INACTIVE: - db_printf("is inactive\n"); - return; - case TDS_CAN_RUN: - db_printf("can run\n"); - return; - case TDS_RUNQ: - db_printf("is on a run queue\n"); - return; - case TDS_RUNNING: - db_printf("running on CPU %d\n", td->td_oncpu); - return; - case TDS_INHIBITED: - if (TD_ON_SLEEPQ(td)) { - if (lockmgr_chain(td, &owner) || - sx_chain(td, &owner)) { - if (owner == NULL) - return; - td = owner; - break; - } - db_printf("sleeping on %p \"%s\"\n", - td->td_wchan, td->td_wmesg); - return; - } - db_printf("inhibited\n"); - return; - default: - db_printf("??? (%#x)\n", td->td_state); - return; - } - } -} - -DB_SHOW_COMMAND(sleepchain, db_show_sleepchain) -{ - struct thread *td; - - /* Figure out which thread to start with. */ - if (have_addr) - td = db_lookup_thread(addr, true); - else - td = kdb_thread; - - print_sleepchain(td, ""); -} static void print_waiters(struct turnstile *ts, int indent); From owner-svn-src-head@freebsd.org Thu Aug 24 19:09:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A33F3DE6366; Thu, 24 Aug 2017 19:09:43 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71EF8355E; Thu, 24 Aug 2017 19:09:43 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7OJ9giY037062; Thu, 24 Aug 2017 19:09:42 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OJ9gHD037061; Thu, 24 Aug 2017 19:09:42 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201708241909.v7OJ9gHD037061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 24 Aug 2017 19:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322852 - head/sys/dev/qlnx/qlnxe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlnx/qlnxe X-SVN-Commit-Revision: 322852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 19:09:43 -0000 Author: davidcs Date: Thu Aug 24 19:09:42 2017 New Revision: 322852 URL: https://svnweb.freebsd.org/changeset/base/322852 Log: Fix qlnx_tso_check() so that every window of (ETH_TX_LSO_WINDOW_BDS_NUM - nbds_in_hdr) has atleast ETH_TX_LSO_WINDOW_MIN_LEN bytes MFC after:5 days Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Thu Aug 24 18:51:55 2017 (r322851) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Thu Aug 24 19:09:42 2017 (r322852) @@ -2921,25 +2921,35 @@ qlnx_tso_check(struct qlnx_fastpath *fp, bus_dma_segme { int i; uint32_t sum, nbds_in_hdr = 1; - bus_dma_segment_t *t_segs = segs; + uint32_t window; + bus_dma_segment_t *s_seg; - /* count the number of segments spanned by TCP header */ + /* If the header spans mulitple segments, skip those segments */ + if (nsegs < ETH_TX_LSO_WINDOW_BDS_NUM) + return (0); + i = 0; - while ((i < nsegs) && (offset > t_segs->ds_len)) { - nbds_in_hdr++; - offset = offset - t_segs->ds_len; - t_segs++; + + while ((i < nsegs) && (offset >= segs->ds_len)) { + offset = offset - segs->ds_len; + segs++; i++; + nbds_in_hdr++; } - while (nsegs >= QLNX_MAX_SEGMENTS_NON_TSO) { + window = ETH_TX_LSO_WINDOW_BDS_NUM - nbds_in_hdr; + nsegs = nsegs - i; + + while (nsegs >= window) { + sum = 0; + s_seg = segs; - for (i = 0; i < (ETH_TX_LSO_WINDOW_BDS_NUM - nbds_in_hdr); i++){ - sum += segs->ds_len; - segs++; + for (i = 0; i < window; i++){ + sum += s_seg->ds_len; + s_seg++; } if (sum < ETH_TX_LSO_WINDOW_MIN_LEN) { @@ -2947,7 +2957,8 @@ qlnx_tso_check(struct qlnx_fastpath *fp, bus_dma_segme return (-1); } - nsegs -= QLNX_MAX_SEGMENTS_NON_TSO; + nsegs = nsegs - 1; + segs++; } return (0); From owner-svn-src-head@freebsd.org Thu Aug 24 19:16:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE5E5DE65BF; Thu, 24 Aug 2017 19:16:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD033A0F; Thu, 24 Aug 2017 19:16:26 +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 v7OJGPxf040966; Thu, 24 Aug 2017 19:16:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OJGPfw040964; Thu, 24 Aug 2017 19:16:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201708241916.v7OJGPfw040964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 24 Aug 2017 19:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322853 - in head: share/man/man4 sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/kern X-SVN-Commit-Revision: 322853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 19:16:26 -0000 Author: cem Date: Thu Aug 24 19:16:25 2017 New Revision: 322853 URL: https://svnweb.freebsd.org/changeset/base/322853 Log: Remove unused declaration and update ddb.4 A follow-up to r322836. Warnings for the unused declaration were breaking some second tier architectures, but did not show up in Clang on x86. Reported by: markj (ddb.4), emaste (declaration) Sponsored by: Dell EMC Isilon Modified: head/share/man/man4/ddb.4 head/sys/kern/subr_turnstile.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Thu Aug 24 19:09:42 2017 (r322852) +++ head/share/man/man4/ddb.4 Thu Aug 24 19:16:25 2017 (r322853) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2017 +.Dd August 24, 2017 .Dt DDB 4 .Os .Sh NAME @@ -782,7 +782,7 @@ Lock owner. .It Ic show Cm lockchain Ar addr Show all threads a particular thread at address .Ar addr -is waiting on based on non-sleepable and non-spin locks. +is waiting on based on non-spin locks. .\" .Pp .It Ic show Cm lockedbufs @@ -960,8 +960,9 @@ Useful for long debugging sessions. .\" .Pp .It Ic show Cm sleepchain -Show all the threads a particular thread is waiting on based on -sleepable locks. +Deprecated. +Now an alias for +.Ic show Cm lockchain . .\" .Pp .It Ic show Cm sleepq Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Thu Aug 24 19:09:42 2017 (r322852) +++ head/sys/kern/subr_turnstile.c Thu Aug 24 19:16:25 2017 (r322853) @@ -157,9 +157,6 @@ static void init_turnstile0(void *dummy); #ifdef TURNSTILE_PROFILING static void init_turnstile_profiling(void *arg); #endif -#ifdef DDB -static void print_sleepchain(struct thread *td, const char *prefix); -#endif static void propagate_priority(struct thread *td); static int turnstile_adjust_thread(struct turnstile *ts, struct thread *td); From owner-svn-src-head@freebsd.org Thu Aug 24 19:43:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91282DE6DD1; Thu, 24 Aug 2017 19:43:50 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2795963B12; Thu, 24 Aug 2017 19:43:50 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id b189so3149022wmd.0; Thu, 24 Aug 2017 12:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=y/0fwu3Xl4bqXMxVANB+aKACcKCWJD6hBBkf5WnueSE=; b=vaVlETX9ke4S5s8RBgwrKx8AS2H1K18wziDozIGszTGIQoGNvECKz3yxYLXdlSmNZv Zp8MYBJ4ZVWuK5Kp+h25raz4ZLx5nG627YQ8fSSCgzRXZAveGStDBxAUKAEW1simKcd5 BPfuwXgmO74hAgoXu1rZpMcnsYW2SDdPZK01fz1mwxWm3lemfXa1Toc4IDYs/oD9xIk4 Oa2PIcKYm7XHM1RAxLz4cUlsir+wyi0exHQA0c0d5x6UybPkb3Q3wCqXAvrmg+sa8Ezk xt5CYsRTCCRLEV9cVxQDjKNKihURXCt1Li209j6k8kNVnEX73X8hX8EDnwsjUPthB2oT IJrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=y/0fwu3Xl4bqXMxVANB+aKACcKCWJD6hBBkf5WnueSE=; b=b9qGNf1GQG82aSuvxHewvbpqpGEY1vjKPfrfQyoyAj/exFmVab8ZsDcjx+8p1ybFnz aEJXVN6muh49SqbOPo5kcWfoAzv0dwPio1nHZrvBfi8rxL5UlJ+iJZjb2KGzrLq8xZzP yKxTbxzsAKrFQCibIRAYekdClfDsr2CJf2WRJL1xUbdgik/h0GEyifSZQgOCCCj7KlLA SjnNUuI+Ryru5t10eJUkMa1W1YgDDnpwJoicYPp4s+fb6FI3N5bIpi1YjqNlPeD9+KRM SzAtOyCkhIPy98dSLwnrbdDILyWZL03L0CAKC1/KaPgdqeBmD3sSWlucwLe3bI6swnEB C0Jg== X-Gm-Message-State: AHYfb5hibtHz0I92mbTAVBWofUJFLcJ7RBrHJdJI6OkQWL0HhE6H+Xli lNK7B4raXWtYh4UQLBuZAp2PVEygiF9+ X-Received: by 10.28.98.66 with SMTP id w63mr4343968wmb.34.1503603828264; Thu, 24 Aug 2017 12:43:48 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.28.56.194 with HTTP; Thu, 24 Aug 2017 12:43:47 -0700 (PDT) In-Reply-To: <20170809141608.I1096@besplex.bde.org> References: <201708081614.v78GEVGY066448@repo.freebsd.org> <20170809141608.I1096@besplex.bde.org> From: Alan Somers Date: Thu, 24 Aug 2017 13:43:47 -0600 X-Google-Sender-Auth: g3YuGXWyus_al5iZstj16XhjgrA Message-ID: Subject: Re: svn commit: r322258 - head/sys/kern To: Bruce Evans Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 19:43:50 -0000 On Wed, Aug 9, 2017 at 1:05 AM, Bruce Evans wrote: > On Tue, 8 Aug 2017, Alan Somers wrote: > >> Log: >> Make p1003_1b.aio_listio_max a tunable >> >> p1003_1b.aio_listio_max is now a tunable. Its value is reflected in the >> sysctl of the same name, and the sysconf(3) variable _SC_AIO_LISTIO_MAX. >> Its value will be bounded from below by the compile-time constant >> AIO_LISTIO_MAX and from above by the compile-time constant >> MAX_AIO_QUEUE_PER_PROC and the tunable vfs.aio.max_aio_queue. > > > I don't like tunables or sysctls being limited or silently limiting them. > This is not done for more important sysctls like kern.maxfilesperproc. > Lots of silent runtime limiting is done for a few more important limits > like kern.maxfilesperproc. > > The limiting is also buggy: > - vfs.aio.max_aio_queue isn't a tunable as stated. It is a r/w sysctl > - if vfs.aio.max_aio_queue were a r/o tunable, then there would be a > solvable ordering problem initializing it before using it > - since vfs.aio.max_aio_queue is only a sysctl, it is unusable at boot > time (and module load time), but it is used there. > > Other bugs in vfs.aio.max_aio_queue: > - its name is too long, yet not very descriptive > - its name repeats "aio" > - its name but doesn't say "len", so it looks like it limits a number of > queues and not the length of a single queue. This is backwards relative > to the corresponding variable name. That is missing "aio" when it > is needed, but only spells "length" badly as "count". It is > max_queue_count, but should be something like aio_max_qlen. All > sysctl variables should have an aio_ prefix which is removed in the > leaf name in the sysctl tree. > Other names have similar or worse bugs. Bugs start with parameter names > MAX_AIO_* instead of AIO_*_MAX, and variable names track this. There is > some ambiguity from global vs per-process limits and counts, and the > noise word "num" is sprinkled to get names which differ without describing > any difference. > >> Modified: head/sys/kern/vfs_aio.c >> >> ============================================================================== >> --- head/sys/kern/vfs_aio.c Tue Aug 8 16:06:16 2017 (r322257) >> +++ head/sys/kern/vfs_aio.c Tue Aug 8 16:14:31 2017 (r322258) >> @@ -102,6 +102,7 @@ static uint64_t jobseqno; >> #endif >> >> FEATURE(aio, "Asynchronous I/O"); >> +SYSCTL_DECL(_p1003_1b); >> >> static MALLOC_DEFINE(M_LIO, "lio", "listio aio control block list"); >> >> @@ -168,6 +169,11 @@ static int max_buf_aio = MAX_BUF_AIO; >> SYSCTL_INT(_vfs_aio, OID_AUTO, max_buf_aio, CTLFLAG_RW, &max_buf_aio, 0, >> "Maximum buf aio requests per process (stored in the process)"); >> >> +static int aio_listio_max = AIO_LISTIO_MAX; >> +SYSCTL_INT(_p1003_1b, CTL_P1003_1B_AIO_LISTIO_MAX, aio_listio_max, >> + CTLFLAG_RDTUN | CTLFLAG_CAPRD, &aio_listio_max, 0, >> + "Maximum aio requests for a single lio_listio call"); >> + > > > The POSIX namespace is missing all of the bugs described above. It has > aio first (except, for historical reasons it unfortunately has p10031b > instead of vfs.aio for the sysctl prefix), and max last. > >> #ifdef COMPAT_FREEBSD6 >> typedef struct oaiocb { >> int aio_fildes; /* File descriptor */ >> @@ -388,6 +394,11 @@ static int >> aio_onceonly(void) >> { >> >> + if (aio_listio_max < AIO_LISTIO_MAX) >> + aio_listio_max = AIO_LISTIO_MAX; >> + if (aio_listio_max > MIN(MAX_AIO_QUEUE_PER_PROC, max_queue_count)) >> + aio_listio_max = MIN(MAX_AIO_QUEUE_PER_PROC, >> max_queue_count); >> + > > > max_queue_count is not initialized here, except to a default at compile > time. Except for module (re)load, it always has the default value > MAX_AIO_QUEUE = 1024 > (this 1024 is bogusly ifdefed. MAX_AIO_QUEUE is not defined in any > header file and is not a supported option, and the tunable makes the > option less needed than before). > MAX_AIO_QUEUE_PER_PROC = 256, modulo a similar unsupported option. > Thus MIN(MAX_AIO_QUEUE_PER_PROC, max_queue_count) is an obfuscated spelling > of 256. > > MAX_AIO_QUEUE_PER_PROC is also just the default for a variable > (max_aio_queue_per_proc), so using it here has the same bugs except for > the obfuscation. > > Using MIN() instead of imin() is a style bug. > > OTOH, AIO_LISTIO_MAX is defined (as 16) in a header file, and is not > bogusly ifdefed. It is 1 of 3 aio limits specified by POSIX. > > The checking would be buggy if it were done later, since max_queue_count > is not checked and limiting to it can corrupt aio_listio_max (when it is > negative or just too small). > > The compile-time definition of AIO_LISTIO_MAX seems to be broken. I think > POSIX species that AIO_LISTIO_MAX shall not be defined if the value of > {AIO_LISTIO_MAX} varies at runtime, but it is still defined. FreeBSD > has this bug for many other sysconf() variables, e.g., {OPEN_MAX}. > Perhaps AIO_LISTIO_MAX is easier to fix since it is not hard-coded as > often as OPEN_MAX. What you describe is Linux's behavior, but the POSIX requirement is a bit more general. All POSIX says is that "The value returned [by sysconf(3)] shall not be more restrictive than the corresponding value described to the application when it was compiled with the implementation's or ". > > AIO_LISTIO_MAX is now just the FreeBSD default, but the first check in > the above restricts {AIO_LISTIO_MAX} to this default (16) instead of to > the POSIX limit of _POSIX_IO_LISTIO_MAX (2). Relaxing this check would > cause more problems with hard-coded AIO_LISTIO_MAX. > > If the second check in the above were done at runtime so that it worked > for changed max_queue_count, then it would reduce aio_listio_max below > the POSIX limit of 2 slightly before it reduces to garbage zero and negative > values. The first check should be large, or if you want to give a > preference > for >= the old limit of 16 and a hard limit of the POSIX limit of 2, check > keep checking the old limit first and the POSIX limit last. > >> exit_tag = EVENTHANDLER_REGISTER(process_exit, aio_proc_rundown, >> NULL, >> EVENTHANDLER_PRI_ANY); >> exec_tag = EVENTHANDLER_REGISTER(process_exec, >> aio_proc_rundown_exec, >> @@ -405,14 +416,13 @@ aio_onceonly(void) >> NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); >> aiocb_zone = uma_zcreate("AIOCB", sizeof(struct kaiocb), NULL, >> NULL, >> NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); >> - aiol_zone = uma_zcreate("AIOL", AIO_LISTIO_MAX*sizeof(intptr_t) , >> NULL, >> - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); >> + aiol_zone = uma_zcreate("AIOL", aio_listio_max * sizeof(intptr_t) >> , >> + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); > > > Allocations like this are hard to adjust later (I forget if the size limit > is hard or soft, but it should be hard). The user must be allowed to set > aio_listio_max to value larger than the default, so as to prepare for > expansion of the other limits later. However, this doesn't work, since > it leaves the other limits inconsistent until they are expanded. > > It seems best to adjust all the other limits based on the aio_listio_max > tunable. Usually this is not set. Use the old parameters then, but remove > all the macros and compile-time initializers for them. Do onceonly > initialization like > > if (aio_listio_max == 16) { > max_queue_count = 1024; /* historical MAX_AIO_QUEUE */ > ... > } > > When aio_listio_max != 16, calculate the parameters somehow. I don't know > how to do this. At least make them consistent. > > After initialization, the other parameters are still restricted by the > choice for aio_listio_max. Leave it to the user to not choose bad > combinations. > > The aio sysctls seem to already break many of the POSIX sysctls. E.g., > MAX_AIO_QUEUE is used as the default for the r/w sysctl > vfs.aio.max_aio_queue and as the value for the sysctl r/o sysctl > p1003_1b.aio_max. Any change to the first sysctl breaks the second > sysctl. > > The 3 POSIX (2001) aio sysctls thus have quite different invariance > bugs: > - {AIO_MAX}: AIO_MAX is correctly not defined. {AIO_MAX} is variable > by a low-level sysctl but the p1003 sysctl used to report {AIO_MAX} > doesn't see the change. > - {AIO_PRIO_DELTA_MAX}: no low-level sysctl or variable to break it > (value is always 0) > - {AIO_LISTIO_MAX}: was constant until this commit. There is not > low-level sysctl for it, and the low-level variable for it is > correctly exported, but AIO_LISTIO_MAX was incorrectly defined > so it is hard to change now. {AIO_LISTIO_MAX} is inconsistent > with the macro whenever the tunable is used to change its default. > > Bruce I dug deeper and found that there wasn't any good reason for the aio_listio_max limit to exist in the first place. This DR eliminates it, which I think will satisfy most of your concerns. https://reviews.freebsd.org/D12120 -Alan From owner-svn-src-head@freebsd.org Thu Aug 24 19:48:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A158CDE6E60; Thu, 24 Aug 2017 19:48:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6DDED63CC0; Thu, 24 Aug 2017 19:48:43 +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 v7OJmghX053469; Thu, 24 Aug 2017 19:48:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OJmgNR053466; Thu, 24 Aug 2017 19:48:42 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201708241948.v7OJmgNR053466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 24 Aug 2017 19:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322854 - in head/cddl: contrib/opensolaris/lib/libzfs/common usr.sbin/zfsd X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/cddl: contrib/opensolaris/lib/libzfs/common usr.sbin/zfsd X-SVN-Commit-Revision: 322854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 19:48:43 -0000 Author: asomers Date: Thu Aug 24 19:48:41 2017 New Revision: 322854 URL: https://svnweb.freebsd.org/changeset/base/322854 Log: zfsd(8): Close a race condition when onlining a disk paritition When inserting a partitioned disk, devfs and geom will announce the whole disk before they announce the partition. If the partition containing ZFS extends to one of the disk's extents, then zfsd will see a ZFS label on the whole disk and attempt to online it. ZFS is smart enough to activate the partition instead of the whole disk, but only if GEOM has already created the partition's provider. cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Add a zpool_read_all_labels method. It's similar to zpool_read_label, but it will return the number of labels found. cddl/usr.sbin/zfsd/zfsd_event.cc When processing a DevFS CREATE event, only online a VDEV if we can read all four ZFS labels. Reviewed by: mav MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11920 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c head/cddl/usr.sbin/zfsd/zfsd_event.cc Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Aug 24 19:16:25 2017 (r322853) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Aug 24 19:48:41 2017 (r322854) @@ -772,6 +772,7 @@ extern int zpool_in_use(libzfs_handle_t *, int, pool_s * Label manipulation. */ extern int zpool_read_label(int, nvlist_t **); +extern int zpool_read_all_labels(int, nvlist_t **); extern int zpool_clear_label(int); /* is this zvol valid for use as a dump device? */ Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Aug 24 19:16:25 2017 (r322853) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Aug 24 19:48:41 2017 (r322854) @@ -914,6 +914,65 @@ zpool_read_label(int fd, nvlist_t **config) return (0); } +/* + * Given a file descriptor, read the label information and return an nvlist + * describing the configuration, if there is one. + * returns the number of valid labels found + */ +int +zpool_read_all_labels(int fd, nvlist_t **config) +{ + struct stat64 statbuf; + int l; + vdev_label_t *label; + uint64_t state, txg, size; + int nlabels = 0; + + *config = NULL; + + if (fstat64(fd, &statbuf) == -1) + return (0); + size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t); + + if ((label = malloc(sizeof (vdev_label_t))) == NULL) + return (0); + + for (l = 0; l < VDEV_LABELS; l++) { + nvlist_t *temp = NULL; + + /* TODO: use aio_read so we can read al 4 labels in parallel */ + if (pread64(fd, label, sizeof (vdev_label_t), + label_offset(size, l)) != sizeof (vdev_label_t)) + continue; + + if (nvlist_unpack(label->vl_vdev_phys.vp_nvlist, + sizeof (label->vl_vdev_phys.vp_nvlist), &temp, 0) != 0) + continue; + + if (nvlist_lookup_uint64(temp, ZPOOL_CONFIG_POOL_STATE, + &state) != 0 || state > POOL_STATE_L2CACHE) { + nvlist_free(temp); + temp = NULL; + continue; + } + + if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE && + (nvlist_lookup_uint64(temp, ZPOOL_CONFIG_POOL_TXG, + &txg) != 0 || txg == 0)) { + nvlist_free(temp); + temp = NULL; + continue; + } + if (temp) + *config = temp; + + nlabels++; + } + + free(label); + return (nlabels); +} + typedef struct rdsk_node { char *rn_name; int rn_dfd; Modified: head/cddl/usr.sbin/zfsd/zfsd_event.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/zfsd_event.cc Thu Aug 24 19:16:25 2017 (r322853) +++ head/cddl/usr.sbin/zfsd/zfsd_event.cc Thu Aug 24 19:48:41 2017 (r322854) @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -93,6 +94,7 @@ DevfsEvent::ReadLabel(int devFd, bool &inUse, bool &de pool_state_t poolState; char *poolName; boolean_t b_inuse; + int nlabels; inUse = false; degraded = false; @@ -105,8 +107,16 @@ DevfsEvent::ReadLabel(int devFd, bool &inUse, bool &de if (poolName != NULL) free(poolName); - if (zpool_read_label(devFd, &devLabel) != 0 - || devLabel == NULL) + nlabels = zpool_read_all_labels(devFd, &devLabel); + /* + * If we find a disk with fewer than the maximum number of + * labels, it might be the whole disk of a partitioned disk + * where ZFS resides on a partition. In that case, we should do + * nothing and wait for the partition to appear. Or, the disk + * might be damaged. In that case, zfsd should do nothing and + * wait for the sysadmin to decide. + */ + if (nlabels != VDEV_LABELS || devLabel == NULL) return (NULL); try { From owner-svn-src-head@freebsd.org Thu Aug 24 20:19:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9AECDE776D; Thu, 24 Aug 2017 20:19:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 791DD64BCC; Thu, 24 Aug 2017 20:19:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7OKJT1Z065717; Thu, 24 Aug 2017 20:19:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OKJSZc065702; Thu, 24 Aug 2017 20:19:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201708242019.v7OKJSZc065702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 24 Aug 2017 20:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322855 - in head: contrib/compiler-rt/lib/builtins/arm contrib/compiler-rt/lib/esan contrib/compiler-rt/lib/profile contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen/Selection... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/compiler-rt/lib/builtins/arm contrib/compiler-rt/lib/esan contrib/compiler-rt/lib/profile contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/lib/IR c... X-SVN-Commit-Revision: 322855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 20:19:31 -0000 Author: dim Date: Thu Aug 24 20:19:27 2017 New Revision: 322855 URL: https://svnweb.freebsd.org/changeset/base/322855 Log: Upgrade our copies of clang, llvm, lldb and compiler-rt to r311606 from the upstream release_50 branch. As of this version, lib/msun's trig test should also work correctly again (see bug 220989 for more information). PR: 220989 MFC after: 2 months X-MFC-with: r321369 Modified: head/contrib/compiler-rt/lib/builtins/arm/aeabi_dcmp.S head/contrib/compiler-rt/lib/builtins/arm/aeabi_fcmp.S head/contrib/compiler-rt/lib/esan/esan_sideline_linux.cpp head/contrib/compiler-rt/lib/profile/InstrProfilingNameVar.c head/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/IR/AutoUpgrade.cpp head/contrib/llvm/lib/Object/COFFModuleDefinition.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td head/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td head/contrib/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp head/contrib/llvm/lib/ToolDrivers/llvm-dlltool/Options.td head/contrib/llvm/lib/Transforms/Scalar/LowerAtomic.cpp head/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp head/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp head/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Darwin.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/MSVC.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/MSVC.h head/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.cpp head/contrib/llvm/tools/clang/lib/Headers/unwind.h head/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp head/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/lld/Config/Version.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/contrib/compiler-rt/lib/builtins/arm/aeabi_dcmp.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/aeabi_dcmp.S Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/compiler-rt/lib/builtins/arm/aeabi_dcmp.S Thu Aug 24 20:19:27 2017 (r322855) @@ -18,11 +18,20 @@ // } // } +#if defined(COMPILER_RT_ARMHF_TARGET) +# define CONVERT_DCMP_ARGS_TO_DF2_ARGS \ + vmov d0, r0, r1 SEPARATOR \ + vmov d1, r2, r3 +#else +# define CONVERT_DCMP_ARGS_TO_DF2_ARGS +#endif + #define DEFINE_AEABI_DCMP(cond) \ .syntax unified SEPARATOR \ .p2align 2 SEPARATOR \ DEFINE_COMPILERRT_FUNCTION(__aeabi_dcmp ## cond) \ push { r4, lr } SEPARATOR \ + CONVERT_DCMP_ARGS_TO_DF2_ARGS SEPARATOR \ bl SYMBOL_NAME(__ ## cond ## df2) SEPARATOR \ cmp r0, #0 SEPARATOR \ b ## cond 1f SEPARATOR \ Modified: head/contrib/compiler-rt/lib/builtins/arm/aeabi_fcmp.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/aeabi_fcmp.S Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/compiler-rt/lib/builtins/arm/aeabi_fcmp.S Thu Aug 24 20:19:27 2017 (r322855) @@ -18,11 +18,20 @@ // } // } +#if defined(COMPILER_RT_ARMHF_TARGET) +# define CONVERT_FCMP_ARGS_TO_SF2_ARGS \ + vmov s0, r0 SEPARATOR \ + vmov s1, r1 +#else +# define CONVERT_FCMP_ARGS_TO_SF2_ARGS +#endif + #define DEFINE_AEABI_FCMP(cond) \ .syntax unified SEPARATOR \ .p2align 2 SEPARATOR \ DEFINE_COMPILERRT_FUNCTION(__aeabi_fcmp ## cond) \ push { r4, lr } SEPARATOR \ + CONVERT_FCMP_ARGS_TO_SF2_ARGS SEPARATOR \ bl SYMBOL_NAME(__ ## cond ## sf2) SEPARATOR \ cmp r0, #0 SEPARATOR \ b ## cond 1f SEPARATOR \ Modified: head/contrib/compiler-rt/lib/esan/esan_sideline_linux.cpp ============================================================================== --- head/contrib/compiler-rt/lib/esan/esan_sideline_linux.cpp Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/compiler-rt/lib/esan/esan_sideline_linux.cpp Thu Aug 24 20:19:27 2017 (r322855) @@ -70,7 +70,7 @@ int SidelineThread::runSideline(void *Arg) { // Set up a signal handler on an alternate stack for safety. InternalScopedBuffer StackMap(SigAltStackSize); - struct sigaltstack SigAltStack; + stack_t SigAltStack; SigAltStack.ss_sp = StackMap.data(); SigAltStack.ss_size = SigAltStackSize; SigAltStack.ss_flags = 0; Modified: head/contrib/compiler-rt/lib/profile/InstrProfilingNameVar.c ============================================================================== --- head/contrib/compiler-rt/lib/profile/InstrProfilingNameVar.c Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/compiler-rt/lib/profile/InstrProfilingNameVar.c Thu Aug 24 20:19:27 2017 (r322855) @@ -1,11 +1,11 @@ -//===- InstrProfilingNameVar.c - profile name variable setup --------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// +/*===- InstrProfilingNameVar.c - profile name variable setup -------------===*\ +|* +|* The LLVM Compiler Infrastructure +|* +|* This file is distributed under the University of Illinois Open Source +|* License. See LICENSE.TXT for details. +|* +\*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" Modified: head/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h Thu Aug 24 20:19:27 2017 (r322855) @@ -85,7 +85,10 @@ namespace ISD { /// If N is a BUILD_VECTOR node whose elements are all the same constant or /// undefined, return true and return the constant value in \p SplatValue. - bool isConstantSplatVector(const SDNode *N, APInt &SplatValue); + /// This sets \p SplatValue to the smallest possible splat unless AllowShrink + /// is set to false. + bool isConstantSplatVector(const SDNode *N, APInt &SplatValue, + bool AllowShrink = true); /// Return true if the specified node is a BUILD_VECTOR where all of the /// elements are ~0 or undef. Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h Thu Aug 24 20:19:27 2017 (r322855) @@ -627,6 +627,7 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer { (priv SDValue ScalarizeVecOp_CONCAT_VECTORS(SDNode *N); SDValue ScalarizeVecOp_EXTRACT_VECTOR_ELT(SDNode *N); SDValue ScalarizeVecOp_VSELECT(SDNode *N); + SDValue ScalarizeVecOp_VSETCC(SDNode *N); SDValue ScalarizeVecOp_STORE(StoreSDNode *N, unsigned OpNo); SDValue ScalarizeVecOp_FP_ROUND(SDNode *N, unsigned OpNo); Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Thu Aug 24 20:19:27 2017 (r322855) @@ -484,6 +484,9 @@ bool DAGTypeLegalizer::ScalarizeVectorOperand(SDNode * case ISD::VSELECT: Res = ScalarizeVecOp_VSELECT(N); break; + case ISD::SETCC: + Res = ScalarizeVecOp_VSETCC(N); + break; case ISD::STORE: Res = ScalarizeVecOp_STORE(cast(N), OpNo); break; @@ -558,6 +561,36 @@ SDValue DAGTypeLegalizer::ScalarizeVecOp_VSELECT(SDNod return DAG.getNode(ISD::SELECT, SDLoc(N), VT, ScalarCond, N->getOperand(1), N->getOperand(2)); +} + +/// If the operand is a vector that needs to be scalarized then the +/// result must be v1i1, so just convert to a scalar SETCC and wrap +/// with a scalar_to_vector since the res type is legal if we got here +SDValue DAGTypeLegalizer::ScalarizeVecOp_VSETCC(SDNode *N) { + assert(N->getValueType(0).isVector() && + N->getOperand(0).getValueType().isVector() && + "Operand types must be vectors"); + assert(N->getValueType(0) == MVT::v1i1 && "Expected v1i1 type"); + + EVT VT = N->getValueType(0); + SDValue LHS = GetScalarizedVector(N->getOperand(0)); + SDValue RHS = GetScalarizedVector(N->getOperand(1)); + + EVT OpVT = N->getOperand(0).getValueType(); + EVT NVT = VT.getVectorElementType(); + SDLoc DL(N); + // Turn it into a scalar SETCC. + SDValue Res = DAG.getNode(ISD::SETCC, DL, MVT::i1, LHS, RHS, + N->getOperand(2)); + + // Vectors may have a different boolean contents to scalars. Promote the + // value appropriately. + ISD::NodeType ExtendCode = + TargetLowering::getExtendForContent(TLI.getBooleanContents(OpVT)); + + Res = DAG.getNode(ExtendCode, DL, NVT, Res); + + return DAG.getNode(ISD::SCALAR_TO_VECTOR, DL, VT, Res); } /// If the value to store is a vector that needs to be scalarized, it must be Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Aug 24 20:19:27 2017 (r322855) @@ -116,7 +116,8 @@ bool ConstantFPSDNode::isValueValidForType(EVT VT, // ISD Namespace //===----------------------------------------------------------------------===// -bool ISD::isConstantSplatVector(const SDNode *N, APInt &SplatVal) { +bool ISD::isConstantSplatVector(const SDNode *N, APInt &SplatVal, + bool AllowShrink) { auto *BV = dyn_cast(N); if (!BV) return false; @@ -124,9 +125,11 @@ bool ISD::isConstantSplatVector(const SDNode *N, APInt APInt SplatUndef; unsigned SplatBitSize; bool HasUndefs; - EVT EltVT = N->getValueType(0).getVectorElementType(); - return BV->isConstantSplat(SplatVal, SplatUndef, SplatBitSize, HasUndefs) && - EltVT.getSizeInBits() >= SplatBitSize; + unsigned EltSize = N->getValueType(0).getVectorElementType().getSizeInBits(); + unsigned MinSplatBits = AllowShrink ? 0 : EltSize; + return BV->isConstantSplat(SplatVal, SplatUndef, SplatBitSize, HasUndefs, + MinSplatBits) && + EltSize >= SplatBitSize; } // FIXME: AllOnes and AllZeros duplicate a lot of code. Could these be Modified: head/contrib/llvm/lib/IR/AutoUpgrade.cpp ============================================================================== --- head/contrib/llvm/lib/IR/AutoUpgrade.cpp Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/lib/IR/AutoUpgrade.cpp Thu Aug 24 20:19:27 2017 (r322855) @@ -2239,14 +2239,14 @@ bool llvm::UpgradeDebugInfo(Module &M) { } bool llvm::UpgradeModuleFlags(Module &M) { - const NamedMDNode *ModFlags = M.getModuleFlagsMetadata(); + NamedMDNode *ModFlags = M.getModuleFlagsMetadata(); if (!ModFlags) return false; - bool HasObjCFlag = false, HasClassProperties = false; + bool HasObjCFlag = false, HasClassProperties = false, Changed = false; for (unsigned I = 0, E = ModFlags->getNumOperands(); I != E; ++I) { MDNode *Op = ModFlags->getOperand(I); - if (Op->getNumOperands() < 2) + if (Op->getNumOperands() != 3) continue; MDString *ID = dyn_cast_or_null(Op->getOperand(1)); if (!ID) @@ -2255,7 +2255,24 @@ bool llvm::UpgradeModuleFlags(Module &M) { HasObjCFlag = true; if (ID->getString() == "Objective-C Class Properties") HasClassProperties = true; + // Upgrade PIC/PIE Module Flags. The module flag behavior for these two + // field was Error and now they are Max. + if (ID->getString() == "PIC Level" || ID->getString() == "PIE Level") { + if (auto *Behavior = + mdconst::dyn_extract_or_null(Op->getOperand(0))) { + if (Behavior->getLimitedValue() == Module::Error) { + Type *Int32Ty = Type::getInt32Ty(M.getContext()); + Metadata *Ops[3] = { + ConstantAsMetadata::get(ConstantInt::get(Int32Ty, Module::Max)), + MDString::get(M.getContext(), ID->getString()), + Op->getOperand(2)}; + ModFlags->setOperand(I, MDNode::get(M.getContext(), Ops)); + Changed = true; + } + } + } } + // "Objective-C Class Properties" is recently added for Objective-C. We // upgrade ObjC bitcodes to contain a "Objective-C Class Properties" module // flag of value 0, so we can correclty downgrade this flag when trying to @@ -2264,9 +2281,10 @@ bool llvm::UpgradeModuleFlags(Module &M) { if (HasObjCFlag && !HasClassProperties) { M.addModuleFlag(llvm::Module::Override, "Objective-C Class Properties", (uint32_t)0); - return true; + Changed = true; } - return false; + + return Changed; } static bool isOldLoopArgument(Metadata *MD) { Modified: head/contrib/llvm/lib/Object/COFFModuleDefinition.cpp ============================================================================== --- head/contrib/llvm/lib/Object/COFFModuleDefinition.cpp Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/lib/Object/COFFModuleDefinition.cpp Thu Aug 24 20:19:27 2017 (r322855) @@ -232,7 +232,13 @@ class Parser { (private) for (;;) { read(); if (Tok.K == Identifier && Tok.Value[0] == '@') { - Tok.Value.drop_front().getAsInteger(10, E.Ordinal); + if (Tok.Value.drop_front().getAsInteger(10, E.Ordinal)) { + // Not an ordinal modifier at all, but the next export (fastcall + // decorated) - complete the current one. + unget(); + Info.Exports.push_back(E); + return Error::success(); + } read(); if (Tok.K == KwNoname) { E.Noname = true; Modified: head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Thu Aug 24 20:19:27 2017 (r322855) @@ -5901,7 +5901,10 @@ static bool isVUZPMask(ArrayRef M, EVT VT, unsign return false; for (unsigned i = 0; i < M.size(); i += NumElts) { - WhichResult = M[i] == 0 ? 0 : 1; + if (M.size() == NumElts * 2) + WhichResult = i / NumElts; + else + WhichResult = M[i] == 0 ? 0 : 1; for (unsigned j = 0; j < NumElts; ++j) { if (M[i+j] >= 0 && (unsigned) M[i+j] != 2 * j + WhichResult) return false; @@ -5932,7 +5935,10 @@ static bool isVUZP_v_undef_Mask(ArrayRef M, EVT V unsigned Half = NumElts / 2; for (unsigned i = 0; i < M.size(); i += NumElts) { - WhichResult = M[i] == 0 ? 0 : 1; + if (M.size() == NumElts * 2) + WhichResult = i / NumElts; + else + WhichResult = M[i] == 0 ? 0 : 1; for (unsigned j = 0; j < NumElts; j += Half) { unsigned Idx = WhichResult; for (unsigned k = 0; k < Half; ++k) { @@ -5972,7 +5978,10 @@ static bool isVZIPMask(ArrayRef M, EVT VT, unsign return false; for (unsigned i = 0; i < M.size(); i += NumElts) { - WhichResult = M[i] == 0 ? 0 : 1; + if (M.size() == NumElts * 2) + WhichResult = i / NumElts; + else + WhichResult = M[i] == 0 ? 0 : 1; unsigned Idx = WhichResult * NumElts / 2; for (unsigned j = 0; j < NumElts; j += 2) { if ((M[i+j] >= 0 && (unsigned) M[i+j] != Idx) || @@ -6005,7 +6014,10 @@ static bool isVZIP_v_undef_Mask(ArrayRef M, EVT V return false; for (unsigned i = 0; i < M.size(); i += NumElts) { - WhichResult = M[i] == 0 ? 0 : 1; + if (M.size() == NumElts * 2) + WhichResult = i / NumElts; + else + WhichResult = M[i] == 0 ? 0 : 1; unsigned Idx = WhichResult * NumElts / 2; for (unsigned j = 0; j < NumElts; j += 2) { if ((M[i+j] >= 0 && (unsigned) M[i+j] != Idx) || @@ -8793,6 +8805,8 @@ ARMTargetLowering::EmitLowered__chkstk(MachineInstr &M .addReg(ARM::R4, RegState::Implicit | RegState::Kill) .addReg(ARM::R4, RegState::Implicit | RegState::Define) .addReg(ARM::R12, + RegState::Implicit | RegState::Define | RegState::Dead) + .addReg(ARM::CPSR, RegState::Implicit | RegState::Define | RegState::Dead); break; case CodeModel::Large: @@ -8808,6 +8822,8 @@ ARMTargetLowering::EmitLowered__chkstk(MachineInstr &M .addReg(ARM::R4, RegState::Implicit | RegState::Kill) .addReg(ARM::R4, RegState::Implicit | RegState::Define) .addReg(ARM::R12, + RegState::Implicit | RegState::Define | RegState::Dead) + .addReg(ARM::CPSR, RegState::Implicit | RegState::Define | RegState::Dead); break; } Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Aug 24 20:19:27 2017 (r322855) @@ -29540,8 +29540,9 @@ static bool detectZextAbsDiff(const SDValue &Select, S // In SetLT case, The second operand of the comparison can be either 1 or 0. APInt SplatVal; if ((CC == ISD::SETLT) && - !((ISD::isConstantSplatVector(SetCC.getOperand(1).getNode(), SplatVal) && - SplatVal == 1) || + !((ISD::isConstantSplatVector(SetCC.getOperand(1).getNode(), SplatVal, + /*AllowShrink*/false) && + SplatVal.isOneValue()) || (ISD::isBuildVectorAllZeros(SetCC.getOperand(1).getNode())))) return false; @@ -30628,6 +30629,9 @@ static SDValue combineSelect(SDNode *N, SelectionDAG & // Byte blends are only available in AVX2 if (VT == MVT::v32i8 && !Subtarget.hasAVX2()) return SDValue(); + // There are no 512-bit blend instructions that use sign bits. + if (VT.is512BitVector()) + return SDValue(); assert(BitWidth >= 8 && BitWidth <= 64 && "Invalid mask size"); APInt DemandedMask(APInt::getSignMask(BitWidth)); @@ -32058,7 +32062,8 @@ static SDValue combineAndMaskToShift(SDNode *N, Select return SDValue(); APInt SplatVal; - if (!ISD::isConstantSplatVector(Op1.getNode(), SplatVal) || + if (!ISD::isConstantSplatVector(Op1.getNode(), SplatVal, + /*AllowShrink*/false) || !SplatVal.isMask()) return SDValue(); @@ -32642,7 +32647,8 @@ static SDValue detectUSatPattern(SDValue In, EVT VT) { "Unexpected types for truncate operation"); APInt C; - if (ISD::isConstantSplatVector(In.getOperand(1).getNode(), C)) { + if (ISD::isConstantSplatVector(In.getOperand(1).getNode(), C, + /*AllowShrink*/false)) { // C should be equal to UINT32_MAX / UINT16_MAX / UINT8_MAX according // the element size of the destination type. return C.isMask(VT.getScalarSizeInBits()) ? In.getOperand(0) : @@ -35346,7 +35352,8 @@ static SDValue combineIncDecVector(SDNode *N, Selectio SDNode *N1 = N->getOperand(1).getNode(); APInt SplatVal; - if (!ISD::isConstantSplatVector(N1, SplatVal) || !SplatVal.isOneValue()) + if (!ISD::isConstantSplatVector(N1, SplatVal, /*AllowShrink*/false) || + !SplatVal.isOneValue()) return SDValue(); SDValue AllOnesVec = getOnesVector(VT, DAG, SDLoc(N)); Modified: head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td Thu Aug 24 20:19:27 2017 (r322855) @@ -3619,8 +3619,8 @@ let Predicates = [HasVLX] in { def : Pat<(alignedstore256 (v4f64 (extract_subvector (v8f64 VR512:$src), (iPTR 0))), addr:$dst), (VMOVAPDZ256mr addr:$dst, (v4f64 (EXTRACT_SUBREG VR512:$src,sub_ymm)))>; - def : Pat<(alignedstore (v8f32 (extract_subvector - (v16f32 VR512:$src), (iPTR 0))), addr:$dst), + def : Pat<(alignedstore256 (v8f32 (extract_subvector + (v16f32 VR512:$src), (iPTR 0))), addr:$dst), (VMOVAPSZ256mr addr:$dst, (v8f32 (EXTRACT_SUBREG VR512:$src,sub_ymm)))>; def : Pat<(alignedstore256 (v4i64 (extract_subvector (v8i64 VR512:$src), (iPTR 0))), addr:$dst), Modified: head/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td Thu Aug 24 19:48:41 2017 (r322854) +++ head/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td Thu Aug 24 20:19:27 2017 (r322855) @@ -24,8 +24,8 @@ def SandyBridgeModel : SchedMachineModel { // Based on the LSD (loop-stream detector) queue size. let LoopMicroOpBufferSize = 28; - // This flag is set to allow the scheduler to assign - // a default model to unrecognized opcodes. + // FIXME: SSE4 and AVX are unimplemented. This flag is set to allow + // the scheduler to assign a default model to unrecognized opcodes. let CompleteModel = 0; } @@ -48,7 +48,6 @@ def SBPort23 : ProcResource<2>; def SBPort4 : ProcResource<1>; // Many micro-ops are capable of issuing on multiple ports. -def SBPort01 : ProcResGroup<[SBPort0, SBPort1]>; def SBPort05 : ProcResGroup<[SBPort0, SBPort5]>; def SBPort15 : ProcResGroup<[SBPort1, SBPort5]>; def SBPort015 : ProcResGroup<[SBPort0, SBPort1, SBPort5]>; @@ -116,10 +115,10 @@ def : WriteRes; defm : SBWriteResPair; -defm : SBWriteResPair; +defm : SBWriteResPair; // 10-14 cycles. defm : SBWriteResPair; defm : SBWriteResPair; -defm : SBWriteResPair; +defm : SBWriteResPair; defm : SBWriteResPair; defm : SBWriteResPair; defm : SBWriteResPair; @@ -135,11 +134,11 @@ def : WriteRes; -defm : SBWriteResPair; -defm : SBWriteResPair; +defm : SBWriteResPair; +defm : SBWriteResPair; +defm : SBWriteResPair; defm : SBWriteResPair; -defm : SBWriteResPair; +defm : SBWriteResPair; defm : SBWriteResPair; def : WriteRes { let Latency = 2; @@ -149,15 +148,13 @@ def : WriteRes { - let Latency = 5; - let NumMicroOps = 3; - let ResourceCycles = [1,2]; +def : WriteRes { + let Latency = 6; + let ResourceCycles = [1, 1, 1]; } -def : WriteRes { - let Latency = 11; - let NumMicroOps = 4; - let ResourceCycles = [1,1,2]; +def : WriteRes { + let Latency = 6; + let ResourceCycles = [1, 1, 1, 1]; } //////////////////////////////////////////////////////////////////////////////// @@ -207,15 +204,13 @@ def : WriteRes { - let Latency = 11; - let NumMicroOps = 3; +def : WriteRes { + let Latency = 3; let ResourceCycles = [3]; } -def : WriteRes { - let Latency = 17; - let NumMicroOps = 4; - let ResourceCycles = [3,1]; +def : WriteRes { + let Latency = 3; + let ResourceCycles = [3, 1]; } // Packed Compare Explicit Length Strings, Return Index @@ -229,26 +224,22 @@ def : WriteRes { - let Latency = 7; - let NumMicroOps = 2; - let ResourceCycles = [1,1]; +def : WriteRes { + let Latency = 8; + let ResourceCycles = [2]; } -def : WriteRes { - let Latency = 13; - let NumMicroOps = 3; - let ResourceCycles = [1,1,1]; +def : WriteRes { + let Latency = 8; + let ResourceCycles = [2, 1]; } -def : WriteRes { - let Latency = 12; - let NumMicroOps = 2; +def : WriteRes { + let Latency = 8; let ResourceCycles = [2]; } -def : WriteRes { - let Latency = 18; - let NumMicroOps = 3; - let ResourceCycles = [2,1]; +def : WriteRes { + let Latency = 8; + let ResourceCycles = [2, 1]; } def : WriteRes { @@ -281,2407 +272,4 @@ def : WriteRes; defm : SBWriteResPair; defm : SBWriteResPair; defm : SBWriteResPair; - -// Remaining SNB instrs. - -def SBWriteResGroup0 : SchedWriteRes<[SBPort0]> { - let Latency = 1; - let NumMicroOps = 1; - let ResourceCycles = [1]; -} -def: InstRW<[SBWriteResGroup0], (instregex "CVTSS2SDrr")>; -def: InstRW<[SBWriteResGroup0], (instregex "PSLLDri")>; -def: InstRW<[SBWriteResGroup0], (instregex "PSLLQri")>; -def: InstRW<[SBWriteResGroup0], (instregex "PSLLWri")>; -def: InstRW<[SBWriteResGroup0], (instregex "PSRADri")>; -def: InstRW<[SBWriteResGroup0], (instregex "PSRAWri")>; -def: InstRW<[SBWriteResGroup0], (instregex "PSRLDri")>; -def: InstRW<[SBWriteResGroup0], (instregex "PSRLQri")>; -def: InstRW<[SBWriteResGroup0], (instregex "PSRLWri")>; -def: InstRW<[SBWriteResGroup0], (instregex "VCVTSS2SDrr")>; -def: InstRW<[SBWriteResGroup0], (instregex "VPMOVMSKBrr")>; -def: InstRW<[SBWriteResGroup0], (instregex "VPSLLDri")>; -def: InstRW<[SBWriteResGroup0], (instregex "VPSLLQri")>; -def: InstRW<[SBWriteResGroup0], (instregex "VPSLLWri")>; -def: InstRW<[SBWriteResGroup0], (instregex "VPSRADri")>; -def: InstRW<[SBWriteResGroup0], (instregex "VPSRAWri")>; -def: InstRW<[SBWriteResGroup0], (instregex "VPSRLDri")>; -def: InstRW<[SBWriteResGroup0], (instregex "VPSRLQri")>; -def: InstRW<[SBWriteResGroup0], (instregex "VPSRLWri")>; -def: InstRW<[SBWriteResGroup0], (instregex "VTESTPDYrr")>; -def: InstRW<[SBWriteResGroup0], (instregex "VTESTPDrr")>; -def: InstRW<[SBWriteResGroup0], (instregex "VTESTPSYrr")>; -def: InstRW<[SBWriteResGroup0], (instregex "VTESTPSrr")>; - -def SBWriteResGroup1 : SchedWriteRes<[SBPort1]> { - let Latency = 1; - let NumMicroOps = 1; - let ResourceCycles = [1]; -} -def: InstRW<[SBWriteResGroup1], (instregex "COMP_FST0r")>; -def: InstRW<[SBWriteResGroup1], (instregex "COM_FST0r")>; -def: InstRW<[SBWriteResGroup1], (instregex "UCOM_FPr")>; -def: InstRW<[SBWriteResGroup1], (instregex "UCOM_Fr")>; - -def SBWriteResGroup2 : SchedWriteRes<[SBPort5]> { - let Latency = 1; - let NumMicroOps = 1; - let ResourceCycles = [1]; -} -def: InstRW<[SBWriteResGroup2], (instregex "ANDNPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "ANDNPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "ANDPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "ANDPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "FDECSTP")>; -def: InstRW<[SBWriteResGroup2], (instregex "FFREE")>; -def: InstRW<[SBWriteResGroup2], (instregex "FINCSTP")>; -def: InstRW<[SBWriteResGroup2], (instregex "FNOP")>; -def: InstRW<[SBWriteResGroup2], (instregex "INSERTPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "JMP64r")>; -def: InstRW<[SBWriteResGroup2], (instregex "LD_Frr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOV64toPQIrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVAPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVAPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVDDUPrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVDI2PDIrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVHLPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVLHPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVSDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVSHDUPrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVSLDUPrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVSSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVUPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "MOVUPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "ORPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "ORPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "RETQ")>; -def: InstRW<[SBWriteResGroup2], (instregex "SHUFPDrri")>; -def: InstRW<[SBWriteResGroup2], (instregex "SHUFPSrri")>; -def: InstRW<[SBWriteResGroup2], (instregex "ST_FPrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "ST_Frr")>; -def: InstRW<[SBWriteResGroup2], (instregex "UNPCKHPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "UNPCKHPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "UNPCKLPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "UNPCKLPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VANDNPDYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VANDNPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VANDNPSYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VANDNPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VANDPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VANDPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VANDPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VEXTRACTF128rr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VINSERTF128rr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VINSERTPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOV64toPQIrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOV64toPQIrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVAPDYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVAPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVAPSYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVAPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVDDUPYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVDDUPrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVHLPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVHLPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVSDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVSHDUPYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVSHDUPrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVSLDUPYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVSLDUPrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVSSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVUPDYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVUPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVUPSYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VMOVUPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VORPDYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VORPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VORPSYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VORPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VPERMILPDri")>; -def: InstRW<[SBWriteResGroup2], (instregex "VPERMILPDrm")>; -def: InstRW<[SBWriteResGroup2], (instregex "VPERMILPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VPERMILPSri")>; -def: InstRW<[SBWriteResGroup2], (instregex "VPERMILPSrm")>; -def: InstRW<[SBWriteResGroup2], (instregex "VPERMILPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VPERMILPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VSHUFPDYrri")>; -def: InstRW<[SBWriteResGroup2], (instregex "VSHUFPDrri")>; -def: InstRW<[SBWriteResGroup2], (instregex "VSHUFPSYrri")>; -def: InstRW<[SBWriteResGroup2], (instregex "VSHUFPSrri")>; -def: InstRW<[SBWriteResGroup2], (instregex "VUNPCKHPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VUNPCKHPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VUNPCKLPDYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VUNPCKLPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VUNPCKLPSYrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VUNPCKLPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VXORPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "VXORPSrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "XORPDrr")>; -def: InstRW<[SBWriteResGroup2], (instregex "XORPSrr")>; - -def SBWriteResGroup3 : SchedWriteRes<[SBPort01]> { - let Latency = 1; - let NumMicroOps = 1; - let ResourceCycles = [1]; -} -def: InstRW<[SBWriteResGroup3], (instregex "LEA64_32r")>; - -def SBWriteResGroup4 : SchedWriteRes<[SBPort0]> { - let Latency = 1; - let NumMicroOps = 1; - let ResourceCycles = [1]; -} -def: InstRW<[SBWriteResGroup4], (instregex "BLENDPDrri")>; -def: InstRW<[SBWriteResGroup4], (instregex "BLENDPSrri")>; -def: InstRW<[SBWriteResGroup4], (instregex "BT32ri8")>; -def: InstRW<[SBWriteResGroup4], (instregex "BT32rr")>; -def: InstRW<[SBWriteResGroup4], (instregex "BTC32ri8")>; -def: InstRW<[SBWriteResGroup4], (instregex "BTC32rr")>; -def: InstRW<[SBWriteResGroup4], (instregex "BTR32ri8")>; -def: InstRW<[SBWriteResGroup4], (instregex "BTR32rr")>; -def: InstRW<[SBWriteResGroup4], (instregex "BTS32ri8")>; -def: InstRW<[SBWriteResGroup4], (instregex "BTS32rr")>; -def: InstRW<[SBWriteResGroup4], (instregex "CDQ")>; -def: InstRW<[SBWriteResGroup4], (instregex "CQO")>; -def: InstRW<[SBWriteResGroup4], (instregex "LAHF")>; -def: InstRW<[SBWriteResGroup4], (instregex "SAHF")>; -def: InstRW<[SBWriteResGroup4], (instregex "SAR32ri")>; -def: InstRW<[SBWriteResGroup4], (instregex "SAR8ri")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETAEr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETBr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETEr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETGEr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETGr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETLEr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETLr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETNEr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETNOr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETNPr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETNSr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETOr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETPr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SETSr")>; -def: InstRW<[SBWriteResGroup4], (instregex "SHL32ri")>; -def: InstRW<[SBWriteResGroup4], (instregex "SHL64r1")>; -def: InstRW<[SBWriteResGroup4], (instregex "SHL8r1")>; -def: InstRW<[SBWriteResGroup4], (instregex "SHL8ri")>; -def: InstRW<[SBWriteResGroup4], (instregex "SHR32ri")>; -def: InstRW<[SBWriteResGroup4], (instregex "SHR8ri")>; -def: InstRW<[SBWriteResGroup4], (instregex "VBLENDPDYrri")>; -def: InstRW<[SBWriteResGroup4], (instregex "VBLENDPDrri")>; -def: InstRW<[SBWriteResGroup4], (instregex "VBLENDPSYrri")>; -def: InstRW<[SBWriteResGroup4], (instregex "VBLENDPSrri")>; -def: InstRW<[SBWriteResGroup4], (instregex "VMOVDQAYrr")>; -def: InstRW<[SBWriteResGroup4], (instregex "VMOVDQArr")>; -def: InstRW<[SBWriteResGroup4], (instregex "VMOVDQUYrr")>; -def: InstRW<[SBWriteResGroup4], (instregex "VMOVDQUrr")>; - -def SBWriteResGroup5 : SchedWriteRes<[SBPort15]> { - let Latency = 1; - let NumMicroOps = 1; - let ResourceCycles = [1]; -} -def: InstRW<[SBWriteResGroup5], (instregex "KORTESTBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "MMX_PABSBrr64")>; -def: InstRW<[SBWriteResGroup5], (instregex "MMX_PABSDrr64")>; -def: InstRW<[SBWriteResGroup5], (instregex "MMX_PABSWrr64")>; -def: InstRW<[SBWriteResGroup5], (instregex "MMX_PADDQirr")>; -def: InstRW<[SBWriteResGroup5], (instregex "MMX_PALIGNR64irr")>; -def: InstRW<[SBWriteResGroup5], (instregex "MMX_PSHUFBrr64")>; -def: InstRW<[SBWriteResGroup5], (instregex "MMX_PSIGNBrr64")>; -def: InstRW<[SBWriteResGroup5], (instregex "MMX_PSIGNDrr64")>; -def: InstRW<[SBWriteResGroup5], (instregex "MMX_PSIGNWrr64")>; -def: InstRW<[SBWriteResGroup5], (instregex "PABSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PABSDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PABSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PACKSSDWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PACKSSWBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PACKUSDWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PACKUSWBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PADDBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PADDDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PADDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PADDSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PADDSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PADDUSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PADDUSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PADDWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PALIGNRrri")>; -def: InstRW<[SBWriteResGroup5], (instregex "PAVGBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PAVGWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PBLENDWrri")>; -def: InstRW<[SBWriteResGroup5], (instregex "PCMPEQBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PCMPEQDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PCMPEQQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PCMPEQWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PCMPGTBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PCMPGTDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PCMPGTWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMAXSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMAXSDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMAXSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMAXUBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMAXUDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMAXUWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMINSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMINSDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMINSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMINUBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMINUDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMINUWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVSXBDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVSXBQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVSXBWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVSXDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVSXWDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVSXWQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVZXBDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVZXBQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVZXBWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVZXDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVZXWDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PMOVZXWQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSHUFBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSHUFDri")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSHUFHWri")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSHUFLWri")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSIGNBrr128")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSIGNDrr128")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSIGNWrr128")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSLLDQri")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSRLDQri")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSUBBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSUBDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSUBQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSUBSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSUBSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSUBUSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSUBUSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PSUBWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PUNPCKHBWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PUNPCKHDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PUNPCKHQDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PUNPCKHWDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PUNPCKLBWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PUNPCKLDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PUNPCKLQDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "PUNPCKLWDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VMASKMOVPSYrm")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPABSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPABSDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPABSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPACKSSDWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPACKSSWBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPACKUSDWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPACKUSWBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPADDBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPADDDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPADDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPADDUSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPADDUSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPALIGNRrri")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPAVGBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPAVGWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPBLENDWrri")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPCMPEQBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPCMPEQDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPCMPEQWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPCMPGTBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPCMPGTDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPCMPGTWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMAXSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMAXSDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMAXSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMAXUBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMAXUDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMAXUWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMINSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMINSDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMINSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMINUBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMINUDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMINUWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVSXBDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVSXBQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVSXBWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVSXDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVSXWDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVSXWQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVZXBDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVZXBQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVZXBWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVZXDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVZXWDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPMOVZXWQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSHUFBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSHUFDri")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSHUFLWri")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSIGNBrr128")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSIGNDrr128")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSIGNWrr128")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSLLDQri")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSRLDQri")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSUBBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSUBDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSUBQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSUBSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSUBSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSUBUSBrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSUBUSWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPSUBWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPUNPCKHBWrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPUNPCKHDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPUNPCKHWDrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPUNPCKLDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPUNPCKLQDQrr")>; -def: InstRW<[SBWriteResGroup5], (instregex "VPUNPCKLWDrr")>; - -def SBWriteResGroup6 : SchedWriteRes<[SBPort015]> { - let Latency = 1; - let NumMicroOps = 1; - let ResourceCycles = [1]; -} -def: InstRW<[SBWriteResGroup6], (instregex "ADD32ri8")>; -def: InstRW<[SBWriteResGroup6], (instregex "ADD32rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "ADD8ri")>; -def: InstRW<[SBWriteResGroup6], (instregex "ADD8rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "AND32ri")>; -def: InstRW<[SBWriteResGroup6], (instregex "AND64ri8")>; -def: InstRW<[SBWriteResGroup6], (instregex "AND64rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "AND8ri")>; -def: InstRW<[SBWriteResGroup6], (instregex "AND8rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "CBW")>; -def: InstRW<[SBWriteResGroup6], (instregex "CMC")>; -def: InstRW<[SBWriteResGroup6], (instregex "CMP16ri8")>; -def: InstRW<[SBWriteResGroup6], (instregex "CMP32i32")>; -def: InstRW<[SBWriteResGroup6], (instregex "CMP64rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "CMP8ri")>; -def: InstRW<[SBWriteResGroup6], (instregex "CMP8rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "CWDE")>; -def: InstRW<[SBWriteResGroup6], (instregex "DEC64r")>; -def: InstRW<[SBWriteResGroup6], (instregex "DEC8r")>; -def: InstRW<[SBWriteResGroup6], (instregex "INC64r")>; -def: InstRW<[SBWriteResGroup6], (instregex "INC8r")>; -def: InstRW<[SBWriteResGroup6], (instregex "MMX_MOVD64from64rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "MMX_MOVQ2DQrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOV32rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOV8ri")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOV8rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOVDQArr")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOVDQUrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOVPQI2QIrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOVSX32rr16")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOVSX32rr8")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOVZX32rr16")>; -def: InstRW<[SBWriteResGroup6], (instregex "MOVZX32rr8")>; -def: InstRW<[SBWriteResGroup6], (instregex "NEG64r")>; -def: InstRW<[SBWriteResGroup6], (instregex "NEG8r")>; -def: InstRW<[SBWriteResGroup6], (instregex "NOT64r")>; -def: InstRW<[SBWriteResGroup6], (instregex "NOT8r")>; -def: InstRW<[SBWriteResGroup6], (instregex "OR64ri8")>; -def: InstRW<[SBWriteResGroup6], (instregex "OR64rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "OR8ri")>; -def: InstRW<[SBWriteResGroup6], (instregex "OR8rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "PANDNrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "PANDrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "PORrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "PXORrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "STC")>; -def: InstRW<[SBWriteResGroup6], (instregex "SUB64ri8")>; -def: InstRW<[SBWriteResGroup6], (instregex "SUB64rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "SUB8ri")>; -def: InstRW<[SBWriteResGroup6], (instregex "SUB8rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "TEST64rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "TEST8ri")>; -def: InstRW<[SBWriteResGroup6], (instregex "TEST8rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "VMOVPQI2QIrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "VMOVZPQILo2PQIrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "VPANDNrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "VPANDrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "VPORrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "VPXORrr")>; -def: InstRW<[SBWriteResGroup6], (instregex "XOR32rr")>; -def: InstRW<[SBWriteResGroup6], (instregex "XOR64ri8")>; -def: InstRW<[SBWriteResGroup6], (instregex "XOR8ri")>; -def: InstRW<[SBWriteResGroup6], (instregex "XOR8rr")>; - -def SBWriteResGroup7 : SchedWriteRes<[SBPort0]> { - let Latency = 2; - let NumMicroOps = 1; - let ResourceCycles = [1]; -} -def: InstRW<[SBWriteResGroup7], (instregex "MOVMSKPDrr")>; -def: InstRW<[SBWriteResGroup7], (instregex "MOVMSKPSrr")>; -def: InstRW<[SBWriteResGroup7], (instregex "MOVPDI2DIrr")>; -def: InstRW<[SBWriteResGroup7], (instregex "MOVPQIto64rr")>; -def: InstRW<[SBWriteResGroup7], (instregex "PMOVMSKBrr")>; -def: InstRW<[SBWriteResGroup7], (instregex "VMOVMSKPDYrr")>; -def: InstRW<[SBWriteResGroup7], (instregex "VMOVMSKPDrr")>; -def: InstRW<[SBWriteResGroup7], (instregex "VMOVMSKPSrr")>; -def: InstRW<[SBWriteResGroup7], (instregex "VMOVPDI2DIrr")>; -def: InstRW<[SBWriteResGroup7], (instregex "VMOVPQIto64rr")>; - -def SBWriteResGroup9 : SchedWriteRes<[SBPort0]> { - let Latency = 2; - let NumMicroOps = 2; - let ResourceCycles = [2]; -} -def: InstRW<[SBWriteResGroup9], (instregex "BLENDVPDrr0")>; -def: InstRW<[SBWriteResGroup9], (instregex "BLENDVPSrr0")>; -def: InstRW<[SBWriteResGroup9], (instregex "ROL32ri")>; -def: InstRW<[SBWriteResGroup9], (instregex "ROL8ri")>; -def: InstRW<[SBWriteResGroup9], (instregex "ROR32ri")>; -def: InstRW<[SBWriteResGroup9], (instregex "ROR8ri")>; -def: InstRW<[SBWriteResGroup9], (instregex "SETAr")>; -def: InstRW<[SBWriteResGroup9], (instregex "SETBEr")>; -def: InstRW<[SBWriteResGroup9], (instregex "VBLENDVPDYrr")>; -def: InstRW<[SBWriteResGroup9], (instregex "VBLENDVPDrr")>; -def: InstRW<[SBWriteResGroup9], (instregex "VBLENDVPSYrr")>; -def: InstRW<[SBWriteResGroup9], (instregex "VBLENDVPSrr")>; - -def SBWriteResGroup10 : SchedWriteRes<[SBPort15]> { - let Latency = 2; - let NumMicroOps = 2; - let ResourceCycles = [2]; -} -def: InstRW<[SBWriteResGroup10], (instregex "VPBLENDVBrr")>; - -def SBWriteResGroup11 : SchedWriteRes<[SBPort015]> { - let Latency = 2; - let NumMicroOps = 2; - let ResourceCycles = [2]; -} -def: InstRW<[SBWriteResGroup11], (instregex "SCASB")>; -def: InstRW<[SBWriteResGroup11], (instregex "SCASL")>; -def: InstRW<[SBWriteResGroup11], (instregex "SCASQ")>; -def: InstRW<[SBWriteResGroup11], (instregex "SCASW")>; - -def SBWriteResGroup12 : SchedWriteRes<[SBPort0,SBPort1]> { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Aug 24 20:49:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2ADBDE7D81; Thu, 24 Aug 2017 20:49:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67C7D6581E; Thu, 24 Aug 2017 20:49:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7OKnJwp077695; Thu, 24 Aug 2017 20:49:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OKnJF4077693; Thu, 24 Aug 2017 20:49:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201708242049.v7OKnJF4077693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 24 Aug 2017 20:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322856 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 322856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 20:49:20 -0000 Author: glebius Date: Thu Aug 24 20:49:19 2017 New Revision: 322856 URL: https://svnweb.freebsd.org/changeset/base/322856 Log: Third take on the r319685 and r320480. Actually allow for call soisconnected() via soisdisconnected(), and in the earlier unlock earlier to avoid lock recursion. This fixes a situation when a socket on accept queue is reset before being accepted. Reported by: Jason Eggleston Modified: head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Thu Aug 24 20:19:27 2017 (r322855) +++ head/sys/kern/uipc_sockbuf.c Thu Aug 24 20:49:19 2017 (r322856) @@ -334,7 +334,7 @@ sowakeup(struct socket *so, struct sockbuf *sb) if (sb->sb_flags & SB_AIO) sowakeup_aio(so, sb); SOCKBUF_UNLOCK(sb); - if (ret == SU_ISCONNECTED && !(so->so_state & SS_ISDISCONNECTED)) + if (ret == SU_ISCONNECTED) soisconnected(so); if ((so->so_state & SS_ASYNC) && so->so_sigio != NULL) pgsigio(&so->so_sigio, SIGIO, 0); Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Aug 24 20:19:27 2017 (r322855) +++ head/sys/kern/uipc_socket.c Thu Aug 24 20:49:19 2017 (r322856) @@ -3769,13 +3769,14 @@ soisdisconnected(struct socket *so) so->so_state |= SS_ISDISCONNECTED; if (!SOLISTENING(so)) { + SOCK_UNLOCK(so); SOCKBUF_LOCK(&so->so_rcv); socantrcvmore_locked(so); SOCKBUF_LOCK(&so->so_snd); sbdrop_locked(&so->so_snd, sbused(&so->so_snd)); socantsendmore_locked(so); - } - SOCK_UNLOCK(so); + } else + SOCK_UNLOCK(so); wakeup(&so->so_timeo); } From owner-svn-src-head@freebsd.org Thu Aug 24 20:52:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01E15DE7F89; Thu, 24 Aug 2017 20:52:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF93D65C91; Thu, 24 Aug 2017 20:52:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7OKq3Kl080944; Thu, 24 Aug 2017 20:52:03 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OKq3kk080943; Thu, 24 Aug 2017 20:52:03 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201708242052.v7OKq3kk080943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 24 Aug 2017 20:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322858 - head/tools/regression/sockets/accf_data_attach X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/tools/regression/sockets/accf_data_attach X-SVN-Commit-Revision: 322858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 20:52:04 -0000 Author: glebius Date: Thu Aug 24 20:52:02 2017 New Revision: 322858 URL: https://svnweb.freebsd.org/changeset/base/322858 Log: Add a test case for a connection on accept queue that is reset before it is accepted. In that case accept(2) shall return ECONNABORTED. Accept filters provide help with easily replicating that case. Modified: head/tools/regression/sockets/accf_data_attach/accf_data_attach.c Modified: head/tools/regression/sockets/accf_data_attach/accf_data_attach.c ============================================================================== --- head/tools/regression/sockets/accf_data_attach/accf_data_attach.c Thu Aug 24 20:51:16 2017 (r322857) +++ head/tools/regression/sockets/accf_data_attach/accf_data_attach.c Thu Aug 24 20:52:02 2017 (r322858) @@ -64,6 +64,7 @@ main(void) { struct accept_filter_arg afa; struct sockaddr_in sin; + struct linger linger; socklen_t len; int lso, so, i, ret; @@ -231,8 +232,32 @@ main(void) usleep(10000); if (accept(lso, NULL, 0) < 1) errx(-1, "not ok 11 - accept #2 %s", strerror(errno)); + if (close(so) != 0) + errx(-1, "not ok 11 - close(): %s", strerror(errno)); printf("ok 11 - accept\n"); + /* + * Step 12: reset connection before accept filter allows it. + * In this case the connection must make it to the listen + * queue, but with ECONNABORTED code. + */ + so = socket(PF_INET, SOCK_STREAM, 0); + if (so == -1) + errx(-1, "not ok 12 - socket: %s", strerror(errno)); + if (connect(so, (struct sockaddr *)&sin, sizeof(sin)) < 0) + errx(-1, "not ok 12 - connect %s", strerror(errno)); + linger.l_onoff = 1; + linger.l_linger = 0; + ret = setsockopt(so, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger)); + if (ret != 0) + errx(-1, "not ok 12 - setsockopt(SO_LINGER) failed with %d " + "(%s)", errno, strerror(errno)); + if (close(so) != 0) + errx(-1, "not ok 12 - close(): %s", strerror(errno)); + if (accept(lso, NULL, 0) != -1 && errno != ECONNABORTED) + errx(-1, "not ok 12 - accept #3 %s", strerror(errno)); + printf("ok 12 - accept\n"); + #if 1 /* * XXXGL: this doesn't belong to the test itself, but is known @@ -242,31 +267,33 @@ main(void) */ so = socket(PF_INET, SOCK_STREAM, 0); if (so == -1) - errx(-1, "not ok 12 - socket: %s", strerror(errno)); + errx(-1, "not ok 13 - socket: %s", strerror(errno)); if (connect(so, (struct sockaddr *)&sin, sizeof(sin)) < 0) - errx(-1, "not ok 12 - connect %s", strerror(errno)); + errx(-1, "not ok 13 - connect %s", strerror(errno)); #endif /* - * Step 11: Remove accept filter. After removing the accept filter + * Step 12: Remove accept filter. After removing the accept filter * getsockopt() should fail with EINVAL. */ ret = setsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0); if (ret != 0) - errx(-1, "not ok 12 - setsockopt() after listen() " + errx(-1, "not ok 13 - setsockopt() after listen() " "failed with %d (%s)", errno, strerror(errno)); bzero(&afa, sizeof(afa)); len = sizeof(afa); ret = getsockopt(lso, SOL_SOCKET, SO_ACCEPTFILTER, &afa, &len); if (ret == 0) - errx(-1, "not ok 12 - getsockopt() after removing " + errx(-1, "not ok 13 - getsockopt() after removing " "the accept filter returns valid accept filter %s", afa.af_name); if (errno != EINVAL) - errx(-1, "not ok 12 - getsockopt() after removing the accept" + errx(-1, "not ok 13 - getsockopt() after removing the accept" "filter failed with %d (%s)", errno, strerror(errno)); - printf("ok 12 - setsockopt\n"); + if (close(lso) != 0) + errx(-1, "not ok 13 - close() of listening socket: %s", + strerror(errno)); + printf("ok 13 - setsockopt\n"); - close(lso); return (0); } From owner-svn-src-head@freebsd.org Thu Aug 24 22:11:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54F11DE8FDF; Thu, 24 Aug 2017 22:11:00 +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 mx1.freebsd.org (Postfix) with ESMTPS id 222F867CA4; Thu, 24 Aug 2017 22:11:00 +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 v7OMAxlL012500; Thu, 24 Aug 2017 22:10:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OMAxZ3012497; Thu, 24 Aug 2017 22:10:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708242210.v7OMAxZ3012497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 24 Aug 2017 22:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322862 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 322862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 22:11:00 -0000 Author: imp Date: Thu Aug 24 22:10:58 2017 New Revision: 322862 URL: https://svnweb.freebsd.org/changeset/base/322862 Log: Fix 32-bit overflow on latency measurements o Allow I/O scheduler to gather times on 32-bit systems. We do this by shifting the sbintime_t over by 8 bits and truncating to 32-bits. This gives us 8.24 time. This is sufficient both in range (256 seconds is about 128x what current users need) and precision (60ns easily meets the 1ms smallest bucket size measurements). 64-bit systems are unchanged. Centralize all the time math so it's easy to tweak tha range / precision tradeoffs in the future. o While I'm here, the I/O scheduler should be using periph_data rather than sim_data since it is operating on behalf of the periph. Differential Review: https://reviews.freebsd.org/D12119 Modified: head/sys/cam/cam_iosched.c head/sys/cam/cam_iosched.h head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Thu Aug 24 21:49:44 2017 (r322861) +++ head/sys/cam/cam_iosched.c Thu Aug 24 22:10:58 2017 (r322862) @@ -1428,7 +1428,8 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc } if (!(bp->bio_flags & BIO_ERROR)) - cam_iosched_io_metric_update(isc, done_ccb->ccb_h.qos.sim_data, + cam_iosched_io_metric_update(isc, + cam_iosched_sbintime_t(done_ccb->ccb_h.qos.periph_data), bp->bio_cmd, bp->bio_bcount); #endif return retval; Modified: head/sys/cam/cam_iosched.h ============================================================================== --- head/sys/cam/cam_iosched.h Thu Aug 24 21:49:44 2017 (r322861) +++ head/sys/cam/cam_iosched.h Thu Aug 24 22:10:58 2017 (r322862) @@ -41,6 +41,44 @@ struct sysctl_oid; union ccb; struct bio; +/* + * For 64-bit platforms, we know that uintptr_t is the same size as sbintime_t + * so we can store values in it. For 32-bit systems, however, uintptr_t is only + * 32-bits, so it won't fit. For those systems, store 24 bits of fraction and 8 + * bits of seconds. This allows us to measure an interval of up to ~256s, which + * is ~200x what our current uses require. Provide some convenience functions to + * get the time, subtract two times and convert back to sbintime_t in a safe way + * that can be centralized. + */ +#ifdef __LP64__ +#define CAM_IOSCHED_TIME_SHIFT 0 +#else +#define CAM_IOSCHED_TIME_SHIFT 8 +#endif +static inline uintptr_t +cam_iosched_now(void) +{ + + /* Cast here is to avoid right shifting a signed value */ + return (uintptr_t)((uint64_t)sbinuptime() >> CAM_IOSCHED_TIME_SHIFT); +} + +static inline uintptr_t +cam_iosched_delta_t(uintptr_t then) +{ + + /* Since the types are identical, wrapping works correctly */ + return (cam_iosched_now() - then); +} + +static inline sbintime_t +cam_iosched_sbintime_t(uintptr_t delta) +{ + + /* Cast here is to widen the type so the left shift doesn't lose precision */ + return (sbintime_t)((uint64_t)delta << CAM_IOSCHED_TIME_SHIFT); +} + int cam_iosched_init(struct cam_iosched_softc **, struct cam_periph *periph); void cam_iosched_fini(struct cam_iosched_softc *); void cam_iosched_sysctl_init(struct cam_iosched_softc *, struct sysctl_ctx_list *, struct sysctl_oid *); Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Aug 24 21:49:44 2017 (r322861) +++ head/sys/cam/cam_xpt.c Thu Aug 24 22:10:58 2017 (r322862) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -3494,7 +3495,7 @@ xpt_run_devq(struct cam_devq *devq) mtx_lock(mtx); else mtx = NULL; - work_ccb->ccb_h.qos.sim_data = sbinuptime(); // xxx uintprt_t too small 32bit platforms + work_ccb->ccb_h.qos.periph_data = cam_iosched_now(); (*(sim->sim_action))(sim, work_ccb); if (mtx) mtx_unlock(mtx); @@ -4641,7 +4642,7 @@ xpt_done(union ccb *done_ccb) return; /* Store the time the ccb was in the sim */ - done_ccb->ccb_h.qos.sim_data = sbinuptime() - done_ccb->ccb_h.qos.sim_data; + done_ccb->ccb_h.qos.periph_data = cam_iosched_delta_t(done_ccb->ccb_h.qos.periph_data); hash = (done_ccb->ccb_h.path_id + done_ccb->ccb_h.target_id + done_ccb->ccb_h.target_lun) % cam_num_doneqs; queue = &cam_doneqs[hash]; @@ -4664,7 +4665,7 @@ xpt_done_direct(union ccb *done_ccb) return; /* Store the time the ccb was in the sim */ - done_ccb->ccb_h.qos.sim_data = sbinuptime() - done_ccb->ccb_h.qos.sim_data; + done_ccb->ccb_h.qos.periph_data = cam_iosched_delta_t(done_ccb->ccb_h.qos.periph_data); xpt_done_process(&done_ccb->ccb_h); } From owner-svn-src-head@freebsd.org Thu Aug 24 22:11:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4B62DE9009; Thu, 24 Aug 2017 22:11:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B15C867D57; Thu, 24 Aug 2017 22:11:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7OMBA7f012583; Thu, 24 Aug 2017 22:11:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OMBAlc012582; Thu, 24 Aug 2017 22:11:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708242211.v7OMBAlc012582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 24 Aug 2017 22:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322863 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 322863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 22:11:12 -0000 Author: imp Date: Thu Aug 24 22:11:10 2017 New Revision: 322863 URL: https://svnweb.freebsd.org/changeset/base/322863 Log: Expand the latency tracking array from 1.024s to 8.192s to help track extreme outliers from dodgy drives. Adjust comments to reflect this, and make sure that the number of latency buckets match in the two places where it matters. Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Thu Aug 24 22:10:58 2017 (r322862) +++ head/sys/cam/cam_iosched.c Thu Aug 24 22:11:10 2017 (r322863) @@ -233,7 +233,7 @@ struct iop_stats { uint32_t state_flags; #define IOP_RATE_LIMITED 1u -#define LAT_BUCKETS 12 /* < 1ms < 2ms ... 512ms < 1024ms > 1024ms */ +#define LAT_BUCKETS 15 /* < 1ms < 2ms ... < 2^(n-1)ms >= 2^(n-1)ms*/ uint64_t latencies[LAT_BUCKETS]; struct cam_iosched_softc *softc; @@ -1520,7 +1520,7 @@ isqrt64(uint64_t val) return res; } -static sbintime_t latencies[] = { +static sbintime_t latencies[LAT_BUCKETS - 1] = { SBT_1MS << 0, SBT_1MS << 1, SBT_1MS << 2, @@ -1531,7 +1531,10 @@ static sbintime_t latencies[] = { SBT_1MS << 7, SBT_1MS << 8, SBT_1MS << 9, - SBT_1MS << 10 + SBT_1MS << 10, + SBT_1MS << 11, + SBT_1MS << 12, + SBT_1MS << 13 /* 8.192s */ }; static void From owner-svn-src-head@freebsd.org Thu Aug 24 22:56:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 693B0DE9BB6; Thu, 24 Aug 2017 22:56:23 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3D4D26966A; Thu, 24 Aug 2017 22:56:23 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7OMuMBM030693; Thu, 24 Aug 2017 22:56:22 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7OMuMGX030692; Thu, 24 Aug 2017 22:56:22 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201708242256.v7OMuMGX030692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 24 Aug 2017 22:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322865 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 322865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 22:56:23 -0000 Author: erj Date: Thu Aug 24 22:56:22 2017 New Revision: 322865 URL: https://svnweb.freebsd.org/changeset/base/322865 Log: ixv(4): Add more robust mailbox API negotiation The previous update to the driver to 3.2.12-k changed the VF's API version to 1.2, but did not let the VF fall back to 1.1 or 1.0 versions. So, this patch tries 1.2 first, then the older versions in succession if that fails. This should allow the VF driver to negotiate 1.1 and work with older PF drivers, such as the one used in Amazon's EC2 service. PR: 220872 Submitted by: Jeb Cramer MFC after: 1 week Sponsored by: Intel Corporation Modified: head/sys/dev/ixgbe/if_ixv.c Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Thu Aug 24 22:33:42 2017 (r322864) +++ head/sys/dev/ixgbe/if_ixv.c Thu Aug 24 22:56:22 2017 (r322865) @@ -93,6 +93,7 @@ static int ixv_configure_interrupts(struct adapte static void ixv_free_pci_resources(struct adapter *); static void ixv_local_timer(void *); static void ixv_setup_interface(device_t, struct adapter *); +static int ixv_negotiate_api(struct adapter *); static void ixv_initialize_transmit_units(struct adapter *); static void ixv_initialize_receive_units(struct adapter *); @@ -384,11 +385,10 @@ ixv_attach(device_t dev) } /* Negotiate mailbox API version */ - error = ixgbevf_negotiate_api_version(hw, ixgbe_mbox_api_12); + error = ixv_negotiate_api(adapter); if (error) { - device_printf(dev, "MBX API 1.2 negotiation failed! Error %d\n", - error); - error = EIO; + device_printf(dev, + "Mailbox API negotiation failed during attach!\n"); goto err_out; } @@ -584,10 +584,12 @@ ixv_init_locked(struct adapter *adapter) /* Reset VF and renegotiate mailbox API version */ hw->mac.ops.reset_hw(hw); - error = ixgbevf_negotiate_api_version(hw, ixgbe_mbox_api_12); - if (error) - device_printf(dev, "MBX API 1.2 negotiation failed! Error %d\n", - error); + error = ixv_negotiate_api(adapter); + if (error) { + device_printf(dev, + "Mailbox API negotiation failed in init_locked!\n"); + return; + } ixv_initialize_transmit_units(adapter); @@ -873,6 +875,31 @@ ixv_media_change(struct ifnet *ifp) return (0); } /* ixv_media_change */ + + +/************************************************************************ + * ixv_negotiate_api + * + * Negotiate the Mailbox API with the PF; + * start with the most featured API first. + ************************************************************************/ +static int +ixv_negotiate_api(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + int mbx_api[] = { ixgbe_mbox_api_11, + ixgbe_mbox_api_10, + ixgbe_mbox_api_unknown }; + int i = 0; + + while (mbx_api[i] != ixgbe_mbox_api_unknown) { + if (ixgbevf_negotiate_api_version(hw, mbx_api[i]) == 0) + return (0); + i++; + } + + return (EINVAL); +} /* ixv_negotiate_api */ /************************************************************************ From owner-svn-src-head@freebsd.org Thu Aug 24 23:08:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DCDCDE9F0F; Thu, 24 Aug 2017 23:08:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44A0169C39; Thu, 24 Aug 2017 23:08:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7ON8CkR034654; Thu, 24 Aug 2017 23:08:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7ON8CBq034653; Thu, 24 Aug 2017 23:08:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201708242308.v7ON8CBq034653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 24 Aug 2017 23:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322866 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 322866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 23:08:13 -0000 Author: glebius Date: Thu Aug 24 23:08:12 2017 New Revision: 322866 URL: https://svnweb.freebsd.org/changeset/base/322866 Log: Garbage collect RT_NORTREF, which is no longer in use after FLOWTABLE removal. Modified: head/sys/net/route.h Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Thu Aug 24 22:56:22 2017 (r322865) +++ head/sys/net/route.h Thu Aug 24 23:08:12 2017 (r322866) @@ -67,8 +67,6 @@ struct route { #define RT_MAY_LOOP_BIT 3 /* dst may require loop copy */ #define RT_HAS_HEADER_BIT 4 /* mbuf already have its header prepended */ -#define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ -#define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ #define RT_L2_ME (1 << RT_L2_ME_BIT) /* 0x0004 */ #define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) /* 0x0008 */ #define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) /* 0x0010 */ @@ -411,14 +409,8 @@ struct rt_addrinfo { #define RO_RTFREE(_ro) do { \ if ((_ro)->ro_rt) { \ - if ((_ro)->ro_flags & RT_NORTREF) { \ - (_ro)->ro_flags &= ~RT_NORTREF; \ - (_ro)->ro_rt = NULL; \ - (_ro)->ro_lle = NULL; \ - } else { \ - RT_LOCK((_ro)->ro_rt); \ - RTFREE_LOCKED((_ro)->ro_rt); \ - } \ + RT_LOCK((_ro)->ro_rt); \ + RTFREE_LOCKED((_ro)->ro_rt); \ } \ } while (0) From owner-svn-src-head@freebsd.org Thu Aug 24 23:09:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48C42DE9FA8; Thu, 24 Aug 2017 23:09:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 31D2069DA6; Thu, 24 Aug 2017 23:09:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v7ON9cx3017856 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 24 Aug 2017 16:09:38 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v7ON9bJ4017855; Thu, 24 Aug 2017 16:09:38 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 24 Aug 2017 16:09:37 -0700 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322866 - head/sys/net Message-ID: <20170824230937.GI1071@FreeBSD.org> References: <201708242308.v7ON8CBq034653@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201708242308.v7ON8CBq034653@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 24 Aug 2017 23:09:40 -0000 Hi, On Thu, Aug 24, 2017 at 11:08:12PM +0000, Gleb Smirnoff wrote: T> Log: T> Garbage collect RT_NORTREF, which is no longer in use after FLOWTABLE removal. T> T> Modified: T> head/sys/net/route.h T> T> Modified: head/sys/net/route.h T> ============================================================================== T> --- head/sys/net/route.h Thu Aug 24 22:56:22 2017 (r322865) T> +++ head/sys/net/route.h Thu Aug 24 23:08:12 2017 (r322866) T> @@ -67,8 +67,6 @@ struct route { T> #define RT_MAY_LOOP_BIT 3 /* dst may require loop copy */ T> #define RT_HAS_HEADER_BIT 4 /* mbuf already have its header prepended */ T> T> -#define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ T> -#define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ T> #define RT_L2_ME (1 << RT_L2_ME_BIT) /* 0x0004 */ T> #define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) /* 0x0008 */ T> #define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) /* 0x0010 */ T> @@ -411,14 +409,8 @@ struct rt_addrinfo { T> T> #define RO_RTFREE(_ro) do { \ T> if ((_ro)->ro_rt) { \ T> - if ((_ro)->ro_flags & RT_NORTREF) { \ T> - (_ro)->ro_flags &= ~RT_NORTREF; \ T> - (_ro)->ro_rt = NULL; \ T> - (_ro)->ro_lle = NULL; \ T> - } else { \ T> - RT_LOCK((_ro)->ro_rt); \ T> - RTFREE_LOCKED((_ro)->ro_rt); \ T> - } \ T> + RT_LOCK((_ro)->ro_rt); \ T> + RTFREE_LOCKED((_ro)->ro_rt); \ T> } \ T> } while (0) It may also make sense to unroll all instances of RO_RTFREE into two lines of code and remove RO_RTFREE() as well. But I don't have solid opinion on that. Anyone to support me on this as well? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Aug 25 00:28:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0910DEB9E9; Fri, 25 Aug 2017 00:28:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id B32326C0DA; Fri, 25 Aug 2017 00:28:57 +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 v7P0SugI067109; Fri, 25 Aug 2017 00:28:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P0SuB7067106; Fri, 25 Aug 2017 00:28:56 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201708250028.v7P0SuB7067106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 25 Aug 2017 00:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322868 - head/etc/periodic/security X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/etc/periodic/security X-SVN-Commit-Revision: 322868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 00:28:58 -0000 Author: asomers Date: Fri Aug 25 00:28:56 2017 New Revision: 322868 URL: https://svnweb.freebsd.org/changeset/base/322868 Log: Fix 100.chksetuid and 110.neggrpperm for mountpoints with spaces Also, fix them for mountpoints with tabs. PR: 48325 Reported by: pguyot@kallisys.net, aaron@baugher.biz MFC after: 3 weeks Modified: head/etc/periodic/security/100.chksetuid head/etc/periodic/security/110.neggrpperm head/etc/periodic/security/security.functions Modified: head/etc/periodic/security/100.chksetuid ============================================================================== --- head/etc/periodic/security/100.chksetuid Fri Aug 25 00:11:29 2017 (r322867) +++ head/etc/periodic/security/100.chksetuid Fri Aug 25 00:28:56 2017 (r322868) @@ -45,7 +45,13 @@ if check_yesno_period security_status_chksetuid_enable then echo "" echo 'Checking setuid files and devices:' - MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'` + IFS=$'\n' # Don't split mount points with spaces or tabs + MP=`mount -t ufs,zfs | awk ' + $0 !~ /no(suid|exec)/ { + sub(/^.* on \//, "/"); + sub(/ \(.*\)/, ""); + print $0 + }'` find -sx $MP /dev/null \( ! -fstype local \) -prune -o -type f \ \( -perm -u+x -or -perm -g+x -or -perm -o+x \) \ \( -perm -u+s -or -perm -g+s \) -exec ls -liTd \{\} \+ | Modified: head/etc/periodic/security/110.neggrpperm ============================================================================== --- head/etc/periodic/security/110.neggrpperm Fri Aug 25 00:11:29 2017 (r322867) +++ head/etc/periodic/security/110.neggrpperm Fri Aug 25 00:28:56 2017 (r322868) @@ -43,7 +43,13 @@ if check_yesno_period security_status_neggrpperm_enabl then echo "" echo 'Checking negative group permissions:' - MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'` + IFS=$'\n' # Don't split mount points with spaces or tabs + MP=`mount -t ufs,zfs | awk ' + $0 !~ /no(suid|exec)/ { + sub(/^.* on \//, "/"); + sub(/ \(.*\)/, ""); + print $0 + }'` n=$(find -sx $MP /dev/null \( ! -fstype local \) -prune -o -type f \ \( \( ! -perm +010 -and -perm +001 \) -or \ \( ! -perm +020 -and -perm +002 \) -or \ Modified: head/etc/periodic/security/security.functions ============================================================================== --- head/etc/periodic/security/security.functions Fri Aug 25 00:11:29 2017 (r322867) +++ head/etc/periodic/security/security.functions Fri Aug 25 00:28:56 2017 (r322868) @@ -48,6 +48,7 @@ rc=0 # LABEL is the base name of the ${LOG}/${label}.{today,yesterday} files. check_diff() { + unset IFS rc=0 if [ "$1" = "new_only" ]; then shift From owner-svn-src-head@freebsd.org Fri Aug 25 02:37:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 832B3DED6B2; Fri, 25 Aug 2017 02:37:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 547936F3AB; Fri, 25 Aug 2017 02:37:33 +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 v7P2bWNq019310; Fri, 25 Aug 2017 02:37:32 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P2bWHs019309; Fri, 25 Aug 2017 02:37:32 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201708250237.v7P2bWHs019309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 25 Aug 2017 02:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322869 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 322869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 02:37:33 -0000 Author: bde Date: Fri Aug 25 02:37:32 2017 New Revision: 322869 URL: https://svnweb.freebsd.org/changeset/base/322869 Log: Fix missing switching of the terminal emulator when switching the terminal state for kernel console output. r56043 in 2000 added many complications to support dynamic selection of the terminal emulator using modules and the ioctl CONS_SETTERM. This was never completed. There are still no modules, but it is easy to restore the scterm and dumb emulators at compile time. Then boot-time configuration for the preferred one doesn't work right, but CONS_SETTERM almost works after fixing this bug. CONS_SETTERM only switches the emulator for the user state, leaving the kernel state(s) still using the boot-time emulator. The fix is especially important when switching from sc to scteken, since the scteken state has pointers in it. Rename kernel_console_ts to sc_kts. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Fri Aug 25 00:28:56 2017 (r322868) +++ head/sys/dev/syscons/syscons.c Fri Aug 25 02:37:32 2017 (r322869) @@ -98,7 +98,8 @@ static int sc_console_unit = -1; static int sc_saver_keyb_only = 1; static scr_stat *sc_console; static struct consdev *sc_consptr; -static void *kernel_console_ts[MAXCPU]; +static void *sc_kts[MAXCPU]; +static struct sc_term_sw *sc_ktsw; static scr_stat main_console; static struct tty *main_devs[MAXCONS]; @@ -564,6 +565,7 @@ sc_attach_unit(int unit, int flags) scinit(unit, flags); if (sc_console->tsw->te_size > 0) { + sc_ktsw = sc_console->tsw; /* assert(sc_console->ts != NULL); */ oldts = sc_console->ts; for (i = 0; i <= mp_maxid; i++) { @@ -573,7 +575,7 @@ sc_attach_unit(int unit, int flags) sc_console->ts = ts; (*sc_console->tsw->te_default_attr)(sc_console, sc_kattrtab[i], SC_KERNEL_CONS_REV_ATTR); - kernel_console_ts[i] = ts; + sc_kts[i] = ts; } sc_console->ts = oldts; (*sc_console->tsw->te_default_attr)(sc_console, SC_NORM_ATTR, @@ -1728,11 +1730,14 @@ sc_cnterm(struct consdev *cp) sccnupdate(sc_console); #endif - for (i = 0; i <= mp_maxid; i++) { - ts = kernel_console_ts[i]; - kernel_console_ts[i] = NULL; - (*sc_console->tsw->te_term)(sc_console, &ts); - free(ts, M_DEVBUF); + if (sc_ktsw != NULL) { + for (i = 0; i <= mp_maxid; i++) { + ts = sc_kts[i]; + sc_kts[i] = NULL; + (*sc_ktsw->te_term)(sc_console, &ts); + free(ts, M_DEVBUF); + } + sc_ktsw = NULL; } scterm(sc_console_unit, SC_KERNEL_CONSOLE); sc_console_unit = -1; @@ -1992,13 +1997,16 @@ sc_cnputc(struct consdev *cd, int c) sizeof(sc_cnputc_log)) continue; /* Console output has a per-CPU "input" state. Switch for it. */ + oldtsw = scp->tsw; oldts = scp->ts; - ts = kernel_console_ts[PCPU_GET(cpuid)]; + ts = sc_kts[PCPU_GET(cpuid)]; if (ts != NULL) { + scp->tsw = sc_ktsw; scp->ts = ts; (*scp->tsw->te_sync)(scp); } sc_puts(scp, buf, 1); + scp->tsw = oldtsw; scp->ts = oldts; (*scp->tsw->te_sync)(scp); } From owner-svn-src-head@freebsd.org Fri Aug 25 02:41:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55C9FDED763; Fri, 25 Aug 2017 02:41:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id 206216F552; Fri, 25 Aug 2017 02:41:02 +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 v7P2f1bD020212; Fri, 25 Aug 2017 02:41:01 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P2f1La020211; Fri, 25 Aug 2017 02:41:01 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201708250241.v7P2f1La020211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 25 Aug 2017 02:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322870 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 322870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 02:41:02 -0000 Author: bde Date: Fri Aug 25 02:41:01 2017 New Revision: 322870 URL: https://svnweb.freebsd.org/changeset/base/322870 Log: Oops, the previous commit was missing 1 line. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Fri Aug 25 02:37:32 2017 (r322869) +++ head/sys/dev/syscons/syscons.c Fri Aug 25 02:41:01 2017 (r322870) @@ -1933,6 +1933,7 @@ sc_cnputc(struct consdev *cd, int c) u_char buf[1]; scr_stat *scp = sc_console; void *oldts, *ts; + struct sc_term_sw *oldtsw; #ifndef SC_NO_HISTORY #if 0 struct tty *tp; From owner-svn-src-head@freebsd.org Fri Aug 25 03:15:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3AE5DEDFA3; Fri, 25 Aug 2017 03:15:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id B9000707A2; Fri, 25 Aug 2017 03:15:19 +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 v7P3FITI036184; Fri, 25 Aug 2017 03:15:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P3FID8036183; Fri, 25 Aug 2017 03:15:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708250315.v7P3FID8036183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 25 Aug 2017 03:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322872 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 322872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 03:15:20 -0000 Author: imp Date: Fri Aug 25 03:15:18 2017 New Revision: 322872 URL: https://svnweb.freebsd.org/changeset/base/322872 Log: Enable bus mastering on the device before resetting the device. The card has to do PCIe transactions to complete the reset process, but can't do them, per the PCIe spec, unless bus mastering is enabled. Submitted by: Kinjal Patel PR: 22166 Modified: head/sys/dev/nvme/nvme.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Fri Aug 25 02:48:31 2017 (r322871) +++ head/sys/dev/nvme/nvme.c Fri Aug 25 03:15:18 2017 (r322872) @@ -246,6 +246,12 @@ nvme_attach(device_t dev) } /* + * Enable busmastering so the completion status messages can + * be busmastered back to the host. + */ + pci_enable_busmaster(dev); + + /* * Reset controller twice to ensure we do a transition from cc.en==1 * to cc.en==0. This is because we don't really know what status * the controller was left in when boot handed off to OS. @@ -261,8 +267,6 @@ nvme_attach(device_t dev) nvme_ctrlr_destruct(ctrlr, dev); return (status); } - - pci_enable_busmaster(dev); ctrlr->config_hook.ich_func = nvme_ctrlr_start_config_hook; ctrlr->config_hook.ich_arg = ctrlr; From owner-svn-src-head@freebsd.org Fri Aug 25 03:18:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAF8FDEE0FE; Fri, 25 Aug 2017 03:18:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C35270A0C; Fri, 25 Aug 2017 03:18:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id C0C8E9D84; Fri, 25 Aug 2017 03:18:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 93906728B; Fri, 25 Aug 2017 03:18:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 1ldS6IP9FPuL; Fri, 25 Aug 2017 03:18:25 +0000 (UTC) Subject: Re: svn commit: r306512 - in head/sys: kern sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 4E0367286 To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov References: <201609301727.u8UHRIgD051373@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <6ea06065-ea5c-b83b-3854-224626be0d77@FreeBSD.org> Date: Thu, 24 Aug 2017 20:18:03 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201609301727.u8UHRIgD051373@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gf0jINtmXxvW3VvgtjP6UiJJWd4L63TTo" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 03:18:30 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gf0jINtmXxvW3VvgtjP6UiJJWd4L63TTo Content-Type: multipart/mixed; boundary="W4A4iApjpvSIriNGx07PeIPoIwROtm800"; protected-headers="v1" From: Bryan Drewery To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov Message-ID: <6ea06065-ea5c-b83b-3854-224626be0d77@FreeBSD.org> Subject: Re: svn commit: r306512 - in head/sys: kern sys References: <201609301727.u8UHRIgD051373@repo.freebsd.org> In-Reply-To: <201609301727.u8UHRIgD051373@repo.freebsd.org> --W4A4iApjpvSIriNGx07PeIPoIwROtm800 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 9/30/2016 10:27 AM, Mateusz Guzik wrote: > Author: mjg > Date: Fri Sep 30 17:27:17 2016 > New Revision: 306512 > URL: https://svnweb.freebsd.org/changeset/base/306512 >=20 > Log: > vfs: batch free vnodes in per-mnt lists > =20 > Previously free vnodes would always by directly returned to the globa= l > LRU list. With this change up to mnt_free_list_batch vnodes are colle= cted > first. > =20 > syncer runs always return the batch regardless of its size. > =20 > While vnodes on per-mnt lists are not counted as free, they can be > returned in case of vnode shortage. > =20 > Reviewed by: kib > Tested by: pho >=20 > Modified: > head/sys/kern/vfs_mount.c > head/sys/kern/vfs_subr.c > head/sys/sys/mount.h > head/sys/sys/vnode.h >=20 =2E.. > @@ -2753,17 +2824,25 @@ _vhold(struct vnode *vp, bool locked) > * Remove a vnode from the free list, mark it as in use, > * and put it on the active list. > */ > - mtx_lock(&vnode_free_list_mtx); > - TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist); > - freevnodes--; > - vp->v_iflag &=3D ~VI_FREE; > + mp =3D vp->v_mount; > + mtx_lock(&mp->mnt_listmtx); ^^ > + if ((vp->v_mflag & VMP_TMPMNTFREELIST) !=3D 0) { > + TAILQ_REMOVE(&mp->mnt_tmpfreevnodelist, vp, v_actfreelist); > + mp->mnt_tmpfreevnodelistsize--; > + vp->v_mflag &=3D ~VMP_TMPMNTFREELIST; > + } else { > + mtx_lock(&vnode_free_list_mtx); > + TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist); > + freevnodes--; > + mtx_unlock(&vnode_free_list_mtx); > + } > KASSERT((vp->v_iflag & VI_ACTIVE) =3D=3D 0, > ("Activating already active vnode")); > + vp->v_iflag &=3D ~VI_FREE; > vp->v_iflag |=3D VI_ACTIVE; > - mp =3D vp->v_mount; > TAILQ_INSERT_HEAD(&mp->mnt_activevnodelist, vp, v_actfreelist); > mp->mnt_activevnodelistsize++; > - mtx_unlock(&vnode_free_list_mtx); > + mtx_unlock(&mp->mnt_listmtx); > refcount_acquire(&vp->v_holdcnt); > if (!locked) > VI_UNLOCK(vp); > @@ -2819,21 +2898,25 @@ _vdrop(struct vnode *vp, bool locked) > if ((vp->v_iflag & VI_OWEINACT) =3D=3D 0) { > vp->v_iflag &=3D ~VI_ACTIVE; > mp =3D vp->v_mount; > - mtx_lock(&vnode_free_list_mtx); > + mtx_lock(&mp->mnt_listmtx); ^^ If code runs getnewvnode() and then immediately runs vhold() or vrele(), without first running insmntque(vp, mp), then vp->v_mount is NULL here and the lock/freelist dereferencing just panic. Locking the vnode and then using vgone() and vput() on it avoids the issue since it marks the vnode VI_DOOMED and instead frees it in _vdrop() rather than try to re-add it to its NULL per-mount free list. I'm not sure what the right thing here is. Is it a requirement to insmntque() a new vnode immediately, or to vgone() it before releasing it if was just returned from getnewvnode()? Perhaps these cases should assert that v_mount is not NULL or handle the odd case and just free the vnode instead, or can it still just add to the global vnode_free_list if mp is NULL? The old code handled the case fine since the freelist was global and not per-mount. 'mp' was only dereferenced below if the vnode had been active, which was not the case for my example. > if (active) { > TAILQ_REMOVE(&mp->mnt_activevnodelist, vp, > v_actfreelist); > mp->mnt_activevnodelistsize--; > } > - TAILQ_INSERT_TAIL(&vnode_free_list, vp, > + TAILQ_INSERT_TAIL(&mp->mnt_tmpfreevnodelist, vp, > v_actfreelist); > - freevnodes++; > + mp->mnt_tmpfreevnodelistsize++; > vp->v_iflag |=3D VI_FREE; > - mtx_unlock(&vnode_free_list_mtx); > + vp->v_mflag |=3D VMP_TMPMNTFREELIST; > + VI_UNLOCK(vp); > + if (mp->mnt_tmpfreevnodelistsize >=3D mnt_free_list_batch) > + vnlru_return_batch_locked(mp); > + mtx_unlock(&mp->mnt_listmtx); > } else { > + VI_UNLOCK(vp); > atomic_add_long(&free_owe_inact, 1); > } > - VI_UNLOCK(vp); > return; > } > /* --=20 Regards, Bryan Drewery --W4A4iApjpvSIriNGx07PeIPoIwROtm800-- --gf0jINtmXxvW3VvgtjP6UiJJWd4L63TTo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZn5bxAAoJEDXXcbtuRpfPKMYIAKtRFjDNaq8J+4uSaeptaHBz DK71HOEk+C7vmFm5wWb+Mvhg+bBqlqwO7/ohQT4rYQ3TnxZHEnknR4Gbk0ClzHJa fajS9AdzfdL1qN8mDhfIErNf9UDfcgu4Nc2G8mmaorXvylb29vgv91hf924s1RhX 9CFTqe5tI+v3mbfOO6jj5qvptuIV5MgnaTyb/9M7v81fm1jYo5mUWUx+EXTFBnDL f16f6k3KzdHH2+MjGqstOOokui79WQL5f/URo8NS4qcTDIlqTdNU9IhOEslP65El f1neC87RdTX9WiRfWavAc6TeZzvSI6j95d0y3SYVjvLqpj5oTzjVgqJNWnkLadE= =AwAI -----END PGP SIGNATURE----- --gf0jINtmXxvW3VvgtjP6UiJJWd4L63TTo-- From owner-svn-src-head@freebsd.org Fri Aug 25 04:05:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 368B3DEEE85; Fri, 25 Aug 2017 04:05: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 mx1.freebsd.org (Postfix) with ESMTPS id 0E08E71DBB; Fri, 25 Aug 2017 04:05:54 +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 v7P45smP056427; Fri, 25 Aug 2017 04:05:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P45rBf056425; Fri, 25 Aug 2017 04:05:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708250405.v7P45rBf056425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 25 Aug 2017 04:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322874 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 322874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 04:05:55 -0000 Author: imp Date: Fri Aug 25 04:05:53 2017 New Revision: 322874 URL: https://svnweb.freebsd.org/changeset/base/322874 Log: Sanity check sizes Add compile time sanity checks to make sure that packed structures are the proper size, typically as defined in the NVMe standard. Modified: head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_util.c Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Fri Aug 25 04:00:13 2017 (r322873) +++ head/sys/dev/nvme/nvme.h Fri Aug 25 04:05:53 2017 (r322874) @@ -69,6 +69,8 @@ union cap_lo_register { } bits __packed; } __packed; +CTASSERT(sizeof(union cap_lo_register) == 4); + union cap_hi_register { uint32_t raw; struct { @@ -93,6 +95,8 @@ union cap_hi_register { } bits __packed; } __packed; +CTASSERT(sizeof(union cap_hi_register) == 4); + union cc_register { uint32_t raw; struct { @@ -123,6 +127,8 @@ union cc_register { } bits __packed; } __packed; +CTASSERT(sizeof(union cc_register) == 4); + enum shn_value { NVME_SHN_NORMAL = 0x1, NVME_SHN_ABRUPT = 0x2, @@ -144,6 +150,8 @@ union csts_register { } bits __packed; } __packed; +CTASSERT(sizeof(union csts_register) == 4); + enum shst_value { NVME_SHST_NORMAL = 0x0, NVME_SHST_OCCURRING = 0x1, @@ -165,6 +173,8 @@ union aqa_register { } bits __packed; } __packed; +CTASSERT(sizeof(union aqa_register) == 4); + struct nvme_registers { /** controller capabilities */ @@ -198,6 +208,8 @@ struct nvme_registers } doorbell[1] __packed; } __packed; +CTASSERT(sizeof(struct nvme_registers) == 0x1008); + struct nvme_command { /* dword 0 */ @@ -231,6 +243,8 @@ struct nvme_command uint32_t cdw15; /* command-specific */ } __packed; +CTASSERT(sizeof(struct nvme_command) == 16 * 4); + struct nvme_status { uint16_t p : 1; /* phase tag */ @@ -241,6 +255,8 @@ struct nvme_status { uint16_t dnr : 1; /* do not retry */ } __packed; +CTASSERT(sizeof(struct nvme_status) == 2); + struct nvme_completion { /* dword 0 */ @@ -258,6 +274,8 @@ struct nvme_completion { struct nvme_status status; } __packed; +CTASSERT(sizeof(struct nvme_completion) == 4 * 4); + struct nvme_dsm_range { uint32_t attributes; @@ -265,6 +283,8 @@ struct nvme_dsm_range { uint64_t starting_lba; } __packed; +CTASSERT(sizeof(struct nvme_dsm_range) == 16); + /* status code types */ enum nvme_status_code_type { NVME_SCT_GENERIC = 0x0, @@ -423,6 +443,8 @@ struct nvme_power_state { uint8_t ps_rsvd10[9]; } __packed; +CTASSERT(sizeof(struct nvme_power_state) == 32); + #define NVME_SERIAL_NUMBER_LENGTH 20 #define NVME_MODEL_NUMBER_LENGTH 40 #define NVME_FIRMWARE_REVISION_LENGTH 8 @@ -583,6 +605,8 @@ struct nvme_controller_data { uint8_t vs[1024]; } __packed __aligned(4); +CTASSERT(sizeof(struct nvme_controller_data) == 4096); + struct nvme_namespace_data { /** namespace size */ @@ -673,6 +697,8 @@ struct nvme_namespace_data { uint8_t vendor_specific[3712]; } __packed __aligned(4); +CTASSERT(sizeof(struct nvme_namespace_data) == 4096); + enum nvme_log_page { /* 0x00 - reserved */ @@ -715,6 +741,8 @@ struct nvme_error_information_entry { uint8_t reserved[35]; } __packed __aligned(4); +CTASSERT(sizeof(struct nvme_error_information_entry) == 64); + union nvme_critical_warning_state { uint8_t raw; @@ -729,6 +757,8 @@ union nvme_critical_warning_state { } __packed bits; } __packed; +CTASSERT(sizeof(union nvme_critical_warning_state) == 1); + struct nvme_health_information_page { union nvme_critical_warning_state critical_warning; @@ -765,6 +795,8 @@ struct nvme_health_information_page { uint8_t reserved2[296]; } __packed __aligned(4); +CTASSERT(sizeof(struct nvme_health_information_page) == 512); + struct nvme_firmware_page { struct { @@ -777,6 +809,8 @@ struct nvme_firmware_page { uint8_t reserved2[448]; } __packed __aligned(4); +CTASSERT(sizeof(struct nvme_firmware_page) == 512); + struct intel_log_temp_stats { uint64_t current; @@ -789,6 +823,8 @@ struct intel_log_temp_stats uint64_t min_oper_temp; uint64_t est_offset; } __packed __aligned(4); + +CTASSERT(sizeof(struct intel_log_temp_stats) == 13 * 8); #define NVME_TEST_MAX_THREADS 128 Modified: head/sys/dev/nvme/nvme_util.c ============================================================================== --- head/sys/dev/nvme/nvme_util.c Fri Aug 25 04:00:13 2017 (r322873) +++ head/sys/dev/nvme/nvme_util.c Fri Aug 25 04:05:53 2017 (r322874) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include void From owner-svn-src-head@freebsd.org Fri Aug 25 04:33:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F4C8DEF5C1; Fri, 25 Aug 2017 04:33:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id F048E72936; Fri, 25 Aug 2017 04:33:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7P4X74x068461; Fri, 25 Aug 2017 04:33:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P4X7h6068459; Fri, 25 Aug 2017 04:33:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708250433.v7P4X7h6068459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 25 Aug 2017 04:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322875 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 322875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 04:33:08 -0000 Author: imp Date: Fri Aug 25 04:33:06 2017 New Revision: 322875 URL: https://svnweb.freebsd.org/changeset/base/322875 Log: Use _Static_assert These files are compiled in userland too, so we can't use sys/systm.h and rely on CTASSERT. Switch to using _Static_assert instead. MFC After: 3 days Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_util.c Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Fri Aug 25 04:05:53 2017 (r322874) +++ head/sys/dev/nvme/nvme.h Fri Aug 25 04:33:06 2017 (r322875) @@ -69,7 +69,7 @@ union cap_lo_register { } bits __packed; } __packed; -CTASSERT(sizeof(union cap_lo_register) == 4); +_Static_assert(sizeof(union cap_lo_register) == 4, "bad size for cap_lo_register"); union cap_hi_register { uint32_t raw; @@ -95,7 +95,7 @@ union cap_hi_register { } bits __packed; } __packed; -CTASSERT(sizeof(union cap_hi_register) == 4); +_Static_assert(sizeof(union cap_hi_register) == 4, "bad size of cap_hi_register"); union cc_register { uint32_t raw; @@ -127,7 +127,7 @@ union cc_register { } bits __packed; } __packed; -CTASSERT(sizeof(union cc_register) == 4); +_Static_assert(sizeof(union cc_register) == 4, "bad size for cc_register"); enum shn_value { NVME_SHN_NORMAL = 0x1, @@ -150,7 +150,7 @@ union csts_register { } bits __packed; } __packed; -CTASSERT(sizeof(union csts_register) == 4); +_Static_assert(sizeof(union csts_register) == 4, "bad size for csts_register"); enum shst_value { NVME_SHST_NORMAL = 0x0, @@ -173,7 +173,7 @@ union aqa_register { } bits __packed; } __packed; -CTASSERT(sizeof(union aqa_register) == 4); +_Static_assert(sizeof(union aqa_register) == 4, "bad size for aqa_resgister"); struct nvme_registers { @@ -208,7 +208,7 @@ struct nvme_registers } doorbell[1] __packed; } __packed; -CTASSERT(sizeof(struct nvme_registers) == 0x1008); +_Static_assert(sizeof(struct nvme_registers) == 0x1008, "bad size for nvme_registers"); struct nvme_command { @@ -243,7 +243,7 @@ struct nvme_command uint32_t cdw15; /* command-specific */ } __packed; -CTASSERT(sizeof(struct nvme_command) == 16 * 4); +_Static_assert(sizeof(struct nvme_command) == 16 * 4, "bad size for nvme_command"); struct nvme_status { @@ -255,7 +255,7 @@ struct nvme_status { uint16_t dnr : 1; /* do not retry */ } __packed; -CTASSERT(sizeof(struct nvme_status) == 2); +_Static_assert(sizeof(struct nvme_status) == 2, "bad size for nvme_status"); struct nvme_completion { @@ -274,7 +274,7 @@ struct nvme_completion { struct nvme_status status; } __packed; -CTASSERT(sizeof(struct nvme_completion) == 4 * 4); +_Static_assert(sizeof(struct nvme_completion) == 4 * 4, "bad size for nvme_completion"); struct nvme_dsm_range { @@ -283,7 +283,7 @@ struct nvme_dsm_range { uint64_t starting_lba; } __packed; -CTASSERT(sizeof(struct nvme_dsm_range) == 16); +_Static_assert(sizeof(struct nvme_dsm_range) == 16, "bad size for nvme_dsm_ranage"); /* status code types */ enum nvme_status_code_type { @@ -443,7 +443,7 @@ struct nvme_power_state { uint8_t ps_rsvd10[9]; } __packed; -CTASSERT(sizeof(struct nvme_power_state) == 32); +_Static_assert(sizeof(struct nvme_power_state) == 32, "bad size for nvme_power_state"); #define NVME_SERIAL_NUMBER_LENGTH 20 #define NVME_MODEL_NUMBER_LENGTH 40 @@ -605,7 +605,7 @@ struct nvme_controller_data { uint8_t vs[1024]; } __packed __aligned(4); -CTASSERT(sizeof(struct nvme_controller_data) == 4096); +_Static_assert(sizeof(struct nvme_controller_data) == 4096, "bad size for nvme_controller_data"); struct nvme_namespace_data { @@ -697,7 +697,7 @@ struct nvme_namespace_data { uint8_t vendor_specific[3712]; } __packed __aligned(4); -CTASSERT(sizeof(struct nvme_namespace_data) == 4096); +_Static_assert(sizeof(struct nvme_namespace_data) == 4096, "bad size for nvme_namepsace_data"); enum nvme_log_page { @@ -741,7 +741,7 @@ struct nvme_error_information_entry { uint8_t reserved[35]; } __packed __aligned(4); -CTASSERT(sizeof(struct nvme_error_information_entry) == 64); +_Static_assert(sizeof(struct nvme_error_information_entry) == 64, "bad size for nvme_error_information_entry"); union nvme_critical_warning_state { @@ -757,7 +757,7 @@ union nvme_critical_warning_state { } __packed bits; } __packed; -CTASSERT(sizeof(union nvme_critical_warning_state) == 1); +_Static_assert(sizeof(union nvme_critical_warning_state) == 1, "bad size for nvme_critical_warning_state"); struct nvme_health_information_page { @@ -795,7 +795,7 @@ struct nvme_health_information_page { uint8_t reserved2[296]; } __packed __aligned(4); -CTASSERT(sizeof(struct nvme_health_information_page) == 512); +_Static_assert(sizeof(struct nvme_health_information_page) == 512, "bad size for nvme_health_information_page"); struct nvme_firmware_page { @@ -809,7 +809,7 @@ struct nvme_firmware_page { uint8_t reserved2[448]; } __packed __aligned(4); -CTASSERT(sizeof(struct nvme_firmware_page) == 512); +_Static_assert(sizeof(struct nvme_firmware_page) == 512, "bad size for nvme_firmware_page"); struct intel_log_temp_stats { @@ -824,7 +824,7 @@ struct intel_log_temp_stats uint64_t est_offset; } __packed __aligned(4); -CTASSERT(sizeof(struct intel_log_temp_stats) == 13 * 8); +_Static_assert(sizeof(struct intel_log_temp_stats) == 13 * 8, "bad size for intel_log_temp_stats"); #define NVME_TEST_MAX_THREADS 128 Modified: head/sys/dev/nvme/nvme_util.c ============================================================================== --- head/sys/dev/nvme/nvme_util.c Fri Aug 25 04:05:53 2017 (r322874) +++ head/sys/dev/nvme/nvme_util.c Fri Aug 25 04:33:06 2017 (r322875) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include void From owner-svn-src-head@freebsd.org Fri Aug 25 06:32:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D46DF0B13 for ; Fri, 25 Aug 2017 06:32:17 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-57.reflexion.net [208.70.210.57]) (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 A9D4874F76 for ; Fri, 25 Aug 2017 06:32:16 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 18654 invoked from network); 25 Aug 2017 06:32:09 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 25 Aug 2017 06:32:09 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.2) with SMTP; Fri, 25 Aug 2017 02:32:09 -0400 (EDT) Received: (qmail 31944 invoked from network); 25 Aug 2017 06:32:09 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 25 Aug 2017 06:32:09 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 9CF8FEC9255; Thu, 24 Aug 2017 23:32:08 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r322875 - head/sys/dev/nvme Message-Id: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> Date: Thu, 24 Aug 2017 23:32:07 -0700 To: imp@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 06:32:17 -0000 > Author: imp > Date: Fri Aug 25 04:33:06 2017 > New Revision: 322875 > URL:=20 > https://svnweb.freebsd.org/changeset/base/322875 >=20 >=20 > Log: > Use _Static_assert > =20 > These files are compiled in userland too, so we can't use = sys/systm.h > and rely on CTASSERT. Switch to using _Static_assert instead. > =20 > MFC After: 3 days > Sponsored by: Netflix >=20 > Modified: > head/sys/dev/nvme/nvme.h > head/sys/dev/nvme/nvme_util.c As I remember _Static_assert is from C11, not the older C99. As I understand head/sys/dev/nvme/nvme.h use by C++ code could now reject attempts to use _Static_assert . There have been at least one old bugzilla report for such. An example is 205453 (back around 2015-Dec). =46rom back then: > # more main.cc > #include "/usr/include/sys/cdefs.h" > _Static_assert(1,"Test"); > int main(void) > { > return 0; > } >=20 > For example: >=20 > # g++49 main.cc > main.cc:2:15: error: expected constructor, destructor, or type = conversion before '(' token > _Static_assert(1,"Test"); > . . . > g++49, g++5, and powerpc64-portbld-freebsd11.0-g++ all reject the = above source the same way that libcxxrt/guard.cc compiles are rejected = during powerpc64-portbld-freebsd11.0-g++ based buildworld lib32 -m32 = compiles.=20 >=20 > gcc49, gcc5, and powerpc64-portbld-freebsd11.0-gcc all accept the = above instead (when in main.c instead of main.cc so it is handle as C = code), with or without the include. _Static_assert is specific to C11 = and is not part of C++. It takes explicit definitions to make the syntax = acceptable as C++. >=20 > Note: clang++ (3.7) accepts the use of the C11 _Static_assert, with or = without the include, going well outside the C++ language definition. >=20 > . . . >=20 > Fixed in r297299 . (The context was a C++ file head/contrib/libcxxrt/guard.cc so C++'s static_assert was used instead and -std=3Dc++11 was added for the library in question [libcxxrt].) Unless head/sys/dev/nvme/nvme.h is not to be used from C++ code: use of _Static_assert in the header would appear to be a problem. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Fri Aug 25 06:39:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F8BEDF0EFD; Fri, 25 Aug 2017 06:39:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D631C754F0; Fri, 25 Aug 2017 06:39:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA22328; Fri, 25 Aug 2017 09:39:35 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dl8HH-0001kK-PY; Fri, 25 Aug 2017 09:39:35 +0300 Subject: Re: svn commit: r322872 - head/sys/dev/nvme To: Warner Losh , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201708250315.v7P3FID8036183@repo.freebsd.org> From: Andriy Gapon Message-ID: <6a5f32b3-a90e-21ef-dfdb-593573bc38e7@FreeBSD.org> Date: Fri, 25 Aug 2017 09:38:42 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201708250315.v7P3FID8036183@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 06:39:45 -0000 On 25/08/2017 06:15, Warner Losh wrote: > Author: imp > Date: Fri Aug 25 03:15:18 2017 > New Revision: 322872 > URL: https://svnweb.freebsd.org/changeset/base/322872 > > Log: > Enable bus mastering on the device before resetting the device. The > card has to do PCIe transactions to complete the reset process, but > can't do them, per the PCIe spec, unless bus mastering is enabled. > > Submitted by: Kinjal Patel > PR: 22166 The bug number seems to be incorrect. > Modified: > head/sys/dev/nvme/nvme.c -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Aug 25 07:04:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D838DF1457; Fri, 25 Aug 2017 07:04:43 +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 mx1.freebsd.org (Postfix) with ESMTPS id B50AA75E88; Fri, 25 Aug 2017 07:04:42 +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 v7P74fPh028901; Fri, 25 Aug 2017 07:04:41 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P74fE9028895; Fri, 25 Aug 2017 07:04:41 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201708250704.v7P74fE9028895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 25 Aug 2017 07:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322878 - in head: sys/dev/syscons sys/sys usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head: sys/dev/syscons sys/sys usr.sbin/vidcontrol X-SVN-Commit-Revision: 322878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 07:04:43 -0000 Author: bde Date: Fri Aug 25 07:04:41 2017 New Revision: 322878 URL: https://svnweb.freebsd.org/changeset/base/322878 Log: Support setting the colors of cursors for the VGA renderer. Advertise this by changing the defaults to mostly red. If you don't like this, change them (almost) back using: vidcontrol -c charcolors,base=7,height=0 vidcontrol -c mousecolors,base=0[,height=15] The (graphics mode only) mouse cursor colors were hard-coded to a black border and lightwhite interior. Black for the border is the worst possible default, since it is the same as the default black background and not good for any dark background. Reversing this gives the better default of X Windows. Coloring everything works better still. Now the coloring defaults to a lightwhite border and red interior. Coloring for the character cursor is more complicated and mode dependent. The new coloring doesn't apply for hardware cursors. For non-block cursors, it only applies in graphics mode. In text mode, the cursor color was usually a hard-coded (dull)white for the background only, unless the foreground was white when it was a hard-coded black for the background only, unless the foreground was white and the background was black it was reverse video. In graphics mode, it was always reverse video for the block cursor. Reverse video is worse, especially over cutmarking regions, since cutmarking still uses simple reverse video (nothing better is possible in text mode) and double reverse video for the cursor gives normal video. Now, graphics mode uses the same algorithm as the best case for text mode in all cases for graphics mode. The hard-coded sequence { white, black, } for the background is now { red, white, blue, } where the first 2 colors can be configured. The blue color at the end is a sentinel which prevents reverse video being used in most cases but breaks the compatibility setting for white on black and black on white characters. This will be fixed later. The compatibility setting is most needed for mono modes. The previous commit to syscons.c changed sc_cnterm() to be more careful. It followed null pointers in some cases. But sc_cnterm() has been unreachable for 15+ years since changes for multiple consoles turned off calls to the the cnterm destructor for all console drivers. Before them, it was only called at boot time. So no driver with an attached console has ever been unloadable and not even the non-console destructors have been tested much. Modified: head/sys/dev/syscons/scvgarndr.c head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h head/sys/sys/consio.h head/usr.sbin/vidcontrol/vidcontrol.1 head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Aug 25 05:49:37 2017 (r322877) +++ head/sys/dev/syscons/scvgarndr.c Fri Aug 25 07:04:41 2017 (r322878) @@ -356,32 +356,28 @@ vga_flipattr(u_short a, int blink) } static u_short -vga_cursorattr_adj(u_short a, int blink) +vga_cursorattr_adj(scr_stat *scp, u_short a, int blink) { - /* - * !blink means pixel mode, and the cursor attribute in that case - * is simplistic reverse video. - */ - if (!blink) - return (vga_flipattr(a, blink)); + int i; + u_short bg, bgmask, fg, newbg; /* * The cursor attribute is usually that of the underlying char - * with the bg changed to white. If the bg is already white, - * then the bg is changed to black. The fg is usually not - * changed, but if it is the same as the new bg then it is - * changed to the inverse of the new bg. + * with only the bg changed, to the first preferred color that + * differs from both the fg and bg. If there is no such color, + * use reverse video. */ - if ((a & 0x7000) == 0x7000) { - a &= 0x8f00; - if ((a & 0x0700) == 0) - a |= 0x0700; - } else { - a |= 0x7000; - if ((a & 0x0700) == 0x0700) - a &= 0xf000; + bgmask = blink ? 0x7000 : 0xf000; + bg = a & bgmask; + fg = a & 0x0f00; + for (i = 0; i < nitems(scp->curs_attr.bg); i++) { + newbg = (scp->curs_attr.bg[i] << 12) & bgmask; + if (newbg != bg && newbg != (fg << 4)) + break; } - return (a); + if (i == nitems(scp->curs_attr.bg)) + return (vga_flipattr(a, blink)); + return (fg | newbg | (blink ? a & 0x8000 : 0)); } static void @@ -522,6 +518,12 @@ draw_txtcharcursor(scr_stat *scp, int at, u_short c, u return; if (flip) a = vga_flipattr(a, TRUE); + /* + * This clause handles partial-block cursors in text mode. + * We want to change the attribute only under the partial + * block, but in text mode we can only change full blocks. + * Use reverse video instead. + */ bcopy(font + c*h, font + sc->cursor_char*h, h); font = font + sc->cursor_char*h; for (i = imax(h - scp->curs_attr.base - scp->curs_attr.height, 0); @@ -536,7 +538,7 @@ draw_txtcharcursor(scr_stat *scp, int at, u_short c, u { if (flip) a = vga_flipattr(a, TRUE); - a = vga_cursorattr_adj(a, TRUE); + a = vga_cursorattr_adj(scp, a, TRUE); sc_vtb_putc(&scp->scr, at, c, a); } } @@ -1026,7 +1028,7 @@ draw_pxlcursor_direct(scr_stat *scp, int at, int on, i if (flip) a = vga_flipattr(a, FALSE); if (on) - a = vga_cursorattr_adj(a, FALSE); + a = vga_cursorattr_adj(scp, a, FALSE); col1 = (a & 0x0f00) >> 8; col2 = a >> 12; @@ -1070,7 +1072,7 @@ draw_pxlcursor_planar(scr_stat *scp, int at, int on, i if (flip) a = vga_flipattr(a, FALSE); if (on) - a = vga_cursorattr_adj(a, FALSE); + a = vga_cursorattr_adj(scp, a, FALSE); col = (a & 0xf000) >> 4; outw(GDCIDX, col | 0x00); /* set/reset */ outw(GDCIDX, 0xff08); /* bit mask */ @@ -1202,7 +1204,7 @@ draw_pxlmouse_planar(scr_stat *scp, int x, int y) outw(GDCIDX, 0x0003); /* data rotate/function select */ outw(GDCIDX, 0x0f01); /* set/reset enable */ - outw(GDCIDX, (0 << 8) | 0x00); /* set/reset */ + outw(GDCIDX, (scp->curs_attr.mouse_ba << 8) | 0x00); /* set/reset */ p = scp->sc->adp->va_window + line_width*y + x/8; for (i = y, j = 0; i < ymax; ++i, ++j) { m = mdp->md_border[j] << 8 >> xoff; @@ -1221,7 +1223,7 @@ draw_pxlmouse_planar(scr_stat *scp, int x, int y) } p += line_width; } - outw(GDCIDX, (15 << 8) | 0x00); /* set/reset */ + outw(GDCIDX, (scp->curs_attr.mouse_ia << 8) | 0x00); /* set/reset */ p = scp->sc->adp->va_window + line_width*y + x/8; for (i = y, j = 0; i < ymax; ++i, ++j) { m = mdp->md_interior[j] << 8 >> xoff; @@ -1325,9 +1327,11 @@ do_on: for (i = 0; i < yend - y; i++, p += line_width) for (j = xend - x - 1; j >= 0; j--) if (mdp->md_interior[i] & (1 << (15 - j))) - DRAW_PIXEL(scp, p + j * pixel_size, 15); + DRAW_PIXEL(scp, p + j * pixel_size, + scp->curs_attr.mouse_ia); else if (mdp->md_border[i] & (1 << (15 - j))) - DRAW_PIXEL(scp, p + j * pixel_size, 0); + DRAW_PIXEL(scp, p + j * pixel_size, + scp->curs_attr.mouse_ba); } static void Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Fri Aug 25 05:49:37 2017 (r322877) +++ head/sys/dev/syscons/syscons.c Fri Aug 25 07:04:41 2017 (r322878) @@ -959,8 +959,16 @@ sctty_ioctl(struct tty *tp, u_long cmd, caddr_t data, cap = &scp->dflt_curs_attr; break; } - ((int *)data)[1] = cap->base; - ((int *)data)[2] = cap->height; + if (((int *)data)[0] & CONS_CHARCURSOR_COLORS) { + ((int *)data)[1] = cap->bg[0]; + ((int *)data)[2] = cap->bg[1]; + } else if (((int *)data)[0] & CONS_MOUSECURSOR_COLORS) { + ((int *)data)[1] = cap->mouse_ba; + ((int *)data)[2] = cap->mouse_ia; + } else { + ((int *)data)[1] = cap->base; + ((int *)data)[2] = cap->height; + } ((int *)data)[0] = cap->flags; return 0; @@ -3025,8 +3033,12 @@ sc_set_cursor_image(scr_stat *scp) static void sc_adjust_ca(struct cursor_attr *cap, int flags, int base, int height) { - if (0) { - /* Dummy clause to avoid changing indentation later. */ + if (flags & CONS_CHARCURSOR_COLORS) { + cap->bg[0] = base & 0xff; + cap->bg[1] = height & 0xff; + } else if (flags & CONS_MOUSECURSOR_COLORS) { + cap->mouse_ba = base & 0xff; + cap->mouse_ia = height & 0xff; } else { if (base >= 0) cap->base = base; @@ -3243,8 +3255,14 @@ scinit(int unit, int flags) sc->dflt_curs_attr.base = 0; sc->dflt_curs_attr.height = howmany(scp->font_size, 8); sc->dflt_curs_attr.flags = 0; + sc->dflt_curs_attr.bg[0] = FG_RED; + sc->dflt_curs_attr.bg[1] = FG_LIGHTGREY; + sc->dflt_curs_attr.bg[2] = FG_BLUE; + sc->dflt_curs_attr.mouse_ba = FG_WHITE; + sc->dflt_curs_attr.mouse_ia = FG_RED; sc->curs_attr = sc->dflt_curs_attr; scp->base_curs_attr = scp->dflt_curs_attr = sc->curs_attr; + scp->curs_attr = scp->base_curs_attr; #ifndef SC_NO_SYSMOUSE sc_mouse_move(scp, scp->xpixel/2, scp->ypixel/2); Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Fri Aug 25 05:49:37 2017 (r322877) +++ head/sys/dev/syscons/syscons.h Fri Aug 25 07:04:41 2017 (r322878) @@ -167,11 +167,14 @@ typedef struct sc_vtb { int vtb_tail; /* valid for VTB_RINGBUFFER only */ } sc_vtb_t; -/* text cursor attributes */ +/* text and some mouse cursor attributes */ struct cursor_attr { - int flags; - int base; - int height; + u_char flags; + u_char base; + u_char height; + u_char bg[3]; + u_char mouse_ba; + u_char mouse_ia; }; /* softc */ Modified: head/sys/sys/consio.h ============================================================================== --- head/sys/sys/consio.h Fri Aug 25 05:49:37 2017 (r322877) +++ head/sys/sys/consio.h Fri Aug 25 07:04:41 2017 (r322878) @@ -187,6 +187,8 @@ typedef struct mouse_info mouse_info_t; #define CONS_HIDDEN_CURSOR (1 << 2) #define CONS_CURSOR_ATTRS (CONS_BLINK_CURSOR | CONS_CHAR_CURSOR | \ CONS_HIDDEN_CURSOR) +#define CONS_CHARCURSOR_COLORS (1 << 26) +#define CONS_MOUSECURSOR_COLORS (1 << 27) #define CONS_DEFAULT_CURSOR (1 << 28) #define CONS_SHAPEONLY_CURSOR (1 << 29) #define CONS_RESET_CURSOR (1 << 30) Modified: head/usr.sbin/vidcontrol/vidcontrol.1 ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.1 Fri Aug 25 05:49:37 2017 (r322877) +++ head/usr.sbin/vidcontrol/vidcontrol.1 Fri Aug 25 07:04:41 2017 (r322878) @@ -219,6 +219,50 @@ Set or clear the hidden attribute. The following (non-sticky) flags control application of the .Cm setting Ns s : .Bl -tag -width indent +.It Cm charcolors +Apply +.Cm base +and +.Cm height +to the (character) cursor's list of preferred colors instead of its shape. +Beware that the color numbers are raw VGA palette indexes, +not ANSI color numbers. +The indexes are reduced mod 8, 16 or 256, +or ignored, +depending on the video mode and renderer. +.It Cm mousecolors +Colors for the mouse cursor in graphics mode. +Like +.Cm charcolors , +except there is no preference or sequence; +.Cm base +gives the mouse border color and +.Cm height +gives the mouse interior color. +Together with +.Cm charcolors , +this gives 2 selection bits which select between +only 3 of 4 sub-destinations of the 4 destinations selected by +.Cm default +and +.Cm local +(by ignoring +.Cm mousecolors +if +.Cm charcolors +is also set). +.It Cm default +Apply the changes to the default settings and then to the active settings, +instead of only to the active settings. +Together with +.Cm local , +this gives 2 selection bits which select between 4 destinations. +.It Cm shapeonly +Ignore any changes to the +.Cm block +and +.Cm hidden +attributes. .It Cm local Apply the changes to the current vty. The default is to apply them to a global place @@ -233,10 +277,8 @@ to default local settings. Otherwise, the current global settings are reset to default global settings and then copied to the current and default settings for all vtys. -The global defaults are decided (not quite right) at boot time -and cannot be fixed up. -The local defaults are obtained as above and cannot be fixed up -locally. +.It Cm show +Show the current changes. .El .It Fl d Print out current output screen map. Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Fri Aug 25 05:49:37 2017 (r322877) +++ head/usr.sbin/vidcontrol/vidcontrol.c Fri Aug 25 07:04:41 2017 (r322878) @@ -650,10 +650,21 @@ parse_cursor_params(char *param, struct cshape *shape) shape->shape[1] = strtol(word + 5, NULL, 0); else if (strncmp(word, "height=", 7) == 0) shape->shape[2] = strtol(word + 7, NULL, 0); + else if (strcmp(word, "charcolors") == 0) + type |= CONS_CHARCURSOR_COLORS; + else if (strcmp(word, "mousecolors") == 0) + type |= CONS_MOUSECURSOR_COLORS; + else if (strcmp(word, "default") == 0) + type |= CONS_DEFAULT_CURSOR; + else if (strcmp(word, "shapeonly") == 0) + type |= CONS_SHAPEONLY_CURSOR; else if (strcmp(word, "local") == 0) type |= CONS_LOCAL_CURSOR; else if (strcmp(word, "reset") == 0) type |= CONS_RESET_CURSOR; + else if (strcmp(word, "show") == 0) + printf("flags %#x, base %d, height %d\n", + type, shape->shape[1], shape->shape[2]); else { revert(); errx(1, @@ -676,11 +687,13 @@ set_cursor_type(char *param) { struct cshape shape; - /* Determine if the new setting is local (default to non-local). */ + /* Dry run to determine color, default and local flags. */ shape.shape[0] = 0; + shape.shape[1] = -1; + shape.shape[2] = -1; parse_cursor_params(param, &shape); - /* Get the relevant shape (the local flag is the only input arg). */ + /* Get the relevant old setting. */ if (ioctl(0, CONS_GETCURSORSHAPE, &shape) != 0) { revert(); err(1, "ioctl(CONS_GETCURSORSHAPE)"); From owner-svn-src-head@freebsd.org Fri Aug 25 07:15:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CC1BDF171F for ; Fri, 25 Aug 2017 07:15:01 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x230.google.com (mail-yw0-x230.google.com [IPv6:2607:f8b0:4002:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64F91763B6 for ; Fri, 25 Aug 2017 07:15:01 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x230.google.com with SMTP id x21so8899702ywg.2 for ; Fri, 25 Aug 2017 00:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=g2DTfZoMebmJh2RzdfhBmnMV+mEIa9ANAGkPWa8fN18=; b=XdY6n85AI4F+VOihOJ9lUK4Ie6b2nk7NcO7w2tFYbOTDeIyJIkLgCGxOM6/n7R5Ywb PG6AxXf0Pj+9ZeMaAR9c5KKPvTcGBSeqPkFgoPrs53CizcMMFLf8IwDPEoL0ARH2w5jk sDWxqL+ijG/b7pLNE3AMIrDFoxJK9rLsob+4CKWWcIk6O0jCZk+Aqk9RVHbMTwO1wXgf oQIgsa91jTimPBkVGRM2i4sG5jvutXbvyK3GmAR/T4T8fDYOUyFgfbT80oNstaUkFbk6 TeJSrUFe04sk+EDIaRP5niElUNLLDQZdfmwd6jZlp0EyZcu7eFxKrHi6W0OYEqYhWC+p pJ6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=g2DTfZoMebmJh2RzdfhBmnMV+mEIa9ANAGkPWa8fN18=; b=JWnAMjv8kU/gzhVAB7heOKs2cXQuNPNuEHIyMUOVl672+pGbKnFUYZi/8jGrBnWYt3 GWxfkba/Lip6H7VfDkcoYtNjcPR0p4ayAFH20fhB5wgsMXrN2s3LfXJ9nKhy/aJThbwp 5lGsHeQGiZDGfw94DP5yxPnJb8quAFEgBb7/HgUgSZYywHCAB7QrB1+qScTWAq4YQ2Uf 0/0rG42AcJtwLNr3WdsiOqTiyjczmH8xLjephm/KZCdsBpJQ7I4iE4ugQZGZMFUBvaxK gfQwdUAdQeYCtBu/WabcFJM4vZsrM1XImofTi9QXdFUmCBtzX+FFk76mpKTMijkCROsA kTdA== X-Gm-Message-State: AHYfb5i4RICCPvfcVzYrpfU5tzm5OZ/Nrat0IdOjKbEn+y+CyS2QLHPO OyDxYFH5Xw7v3Zl1yn98XDXIGlxs9go0 X-Received: by 10.129.44.85 with SMTP id s82mr7075965yws.254.1503645300382; Fri, 25 Aug 2017 00:15:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.227.193 with HTTP; Fri, 25 Aug 2017 00:14:29 -0700 (PDT) In-Reply-To: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> References: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> From: Ed Schouten Date: Fri, 25 Aug 2017 09:14:29 +0200 Message-ID: Subject: Re: svn commit: r322875 - head/sys/dev/nvme To: Mark Millard Cc: Warner Losh , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 07:15:01 -0000 2017-08-25 8:32 GMT+02:00 Mark Millard : >> # g++49 main.cc >> main.cc:2:15: error: expected constructor, destructor, or type conversion before '(' token >> _Static_assert(1,"Test"); Yeah, that's because GCC is such a pain in the neck compiler that it doesn't want to expose these C11 keywords when building C++, even though they are in the reserved namespace (_[A-Z]). GCC would be permitted to expose these and still comply to standards. Doing so would make things so much easier for operating system implementors, like us. Clang does get it right, in my opinion. We should just extend to define _Static_assert() when using GCC in C++ mode (if we're not doing so already). -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri Aug 25 07:14:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C8ECDF1711; Fri, 25 Aug 2017 07:14:59 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (xvm-110-62.dc2.ghst.net [46.226.110.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E146763B3; Fri, 25 Aug 2017 07:14:57 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.1.65] (host86-138-54-151.range86-138.btcentralplus.com [86.138.54.151]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id v7P7EkFL066989 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 25 Aug 2017 07:14:48 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: d60e724c-75b0-4b63-9702-f4a9d2bf6793: Host host86-138-54-151.range86-138.btcentralplus.com [86.138.54.151] claimed to be [192.168.1.65] Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r322875 - head/sys/dev/nvme From: David Chisnall In-Reply-To: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> Date: Fri, 25 Aug 2017 08:14:41 +0100 Cc: imp@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> To: Mark Millard X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 07:14:59 -0000 On 25 Aug 2017, at 07:32, Mark Millard wrote: >=20 > As I remember _Static_assert is from C11, not > the older C99. In pre-C11 dialects of C, _Static_assert is an identifier reserved for = the implementation. sys/cdefs.h defines it to generate a zero-length = array if the condition is true or a negative-length array if it is = false, emulating the behaviour (though giving less helpful error = messages) >=20 > As I understand head/sys/dev/nvme/nvme.h use by > C++ code could now reject attempts to use > _Static_assert . In C++, _Static_assert is an identifier reserved for the implementation, = but in C++11 or newer static_assert is a keyword. sys/cdefs.h defines = _Static_assert to static_assert for newer versions of C++ and defines it = to the C-before-11-compatible version for C++-before-11. TL;DR: We have gone to a lot of effort to ensure that these keywords = work in all C/C++ dialects, please use them, please report bugs if you = find a case where they don=E2=80=99t work. David From owner-svn-src-head@freebsd.org Fri Aug 25 07:46:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6295BDF2320 for ; Fri, 25 Aug 2017 07:46:55 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-57.reflexion.net [208.70.210.57]) (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 151F277578 for ; Fri, 25 Aug 2017 07:46:54 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 1657 invoked from network); 25 Aug 2017 07:46:53 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 25 Aug 2017 07:46:53 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.2) with SMTP; Fri, 25 Aug 2017 03:46:53 -0400 (EDT) Received: (qmail 18096 invoked from network); 25 Aug 2017 07:46:53 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 25 Aug 2017 07:46:53 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id E0223EC901F; Fri, 25 Aug 2017 00:46:51 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r322875 - head/sys/dev/nvme From: Mark Millard In-Reply-To: Date: Fri, 25 Aug 2017 00:46:50 -0700 Cc: imp@FreeBSD.org, svn-src-head@freebsd.org, FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> To: David Chisnall X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 07:46:55 -0000 On 2017-Aug-25, at 12:14 AM, David Chisnall = wrote: > On 25 Aug 2017, at 07:32, Mark Millard wrote: >>=20 >> As I remember _Static_assert is from C11, not >> the older C99. >=20 > In pre-C11 dialects of C, _Static_assert is an identifier reserved for = the implementation. sys/cdefs.h defines it to generate a zero-length = array if the condition is true or a negative-length array if it is = false, emulating the behaviour (though giving less helpful error = messages) >=20 >>=20 >> As I understand head/sys/dev/nvme/nvme.h use by >> C++ code could now reject attempts to use >> _Static_assert . >=20 > In C++, _Static_assert is an identifier reserved for the = implementation, but in C++11 or newer static_assert is a keyword. = sys/cdefs.h defines _Static_assert to static_assert for newer versions = of C++ and defines it to the C-before-11-compatible version for = C++-before-11. >=20 > TL;DR: We have gone to a lot of effort to ensure that these keywords = work in all C/C++ dialects, please use them, please report bugs if you = find a case where they don=E2=80=99t work. It appears that at least 11.1-STABLE -r322807 does not handle -std=3Dc++98 styles of use of _Static_assert for g++7 in that g++7 reports an error: # uname -apKU FreeBSD hzFreeBSD11S 11.1-STABLE FreeBSD 11.1-STABLE r322807 amd64 = amd64 1101501 1101501 # more main.cc #include "/usr/include/sys/cdefs.h" _Static_assert(1,"Test"); int main(void) { return 0; } # g++7 -std=3Dc++98 main.cc main.cc:2:15: error: expected constructor, destructor, or type = conversion before '(' token _Static_assert(1,"Test"); ^ So it appears that as stands the _Static_assert implementation requires a more modern C++ standard vintage. With the likes of -Wpedantic clang++ from 11.1-STABLE -r322807 reports a warning: # clang++ -Wpedantic -std=3Dc++11 main.cc main.cc:2:1: warning: _Static_assert is a C11-specific feature = [-Wc11-extensions] _Static_assert(1,"Test"); ^ 1 warning generated. # clang++ -Wpedantic -std=3Dc++98 main.cc In file included from main.cc:1: /usr/include/sys/cdefs.h:852:27: warning: variadic macros are a C99 = feature [-Wvariadic-macros] #define __locks_exclusive(...) \ ^ . . . (more such macro reports) . . . main.cc:2:1: warning: _Static_assert is a C11-specific feature = [-Wc11-extensions] _Static_assert(1,"Test"); ^ 11 warnings generated. By contrast "g++7 -Wpedantic -std=3Dc++11 main.cc" is silent about it. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Fri Aug 25 08:21:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DE63DF2F7B; Fri, 25 Aug 2017 08:21:04 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 1D7257C6FB; Fri, 25 Aug 2017 08:21:04 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7P8L3g2060379; Fri, 25 Aug 2017 08:21:03 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P8L3Ji060378; Fri, 25 Aug 2017 08:21:03 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201708250821.v7P8L3Ji060378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 25 Aug 2017 08:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322881 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: smh X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 322881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 08:21:04 -0000 Author: smh Date: Fri Aug 25 08:21:02 2017 New Revision: 322881 URL: https://svnweb.freebsd.org/changeset/base/322881 Log: Add myself (smh) to calendar.freebsd Sponsored by: Multiplay Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Fri Aug 25 07:49:51 2017 (r322880) +++ head/usr.bin/calendar/calendars/calendar.freebsd Fri Aug 25 08:21:02 2017 (r322881) @@ -333,6 +333,7 @@ 09/07 Chris Rees born in Kettering, United Kingdom, 1987 09/08 Boris Samorodov born in Krasnodar, Russian Federation, 1963 09/09 Yoshio Mita born in Hiroshima, Japan, 1972 +09/09 Steven Hartland born in Wordsley, United Kingdom, 1973 09/10 Wesley R. Peters born in Hartford, Alabama, United States, 1961 09/12 Weongyo Jeong born in Haman, Korea, 1980 09/12 Benedict Christopher Reuschling born in Darmstadt, Germany, 1981 From owner-svn-src-head@freebsd.org Fri Aug 25 09:51:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55354DD3C73; Fri, 25 Aug 2017 09:51:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 213137EFA7; Fri, 25 Aug 2017 09:51:23 +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 v7P9pM7h095002; Fri, 25 Aug 2017 09:51:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7P9pMjm095001; Fri, 25 Aug 2017 09:51:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708250951.v7P9pMjm095001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Aug 2017 09:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322883 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 322883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 09:51:23 -0000 Author: kib Date: Fri Aug 25 09:51:22 2017 New Revision: 322883 URL: https://svnweb.freebsd.org/changeset/base/322883 Log: Protect v_rdev dereference with the vnode interlock instead of the vnode lock. Caller of softdep_count_dependencies() may own a buffer lock, which might conflict with the lock order. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 10 days Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Aug 25 08:24:29 2017 (r322882) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Aug 25 09:51:22 2017 (r322883) @@ -13937,9 +13937,9 @@ softdep_count_dependencies(bp, wantcount) */ retry: if (vp->v_type == VCHR) { - VOP_LOCK(vp, LK_RETRY | LK_EXCLUSIVE); + VI_LOCK(vp); mp = vp->v_type == VCHR ? vp->v_rdev->si_mountpt : NULL; - VOP_UNLOCK(vp, 0); + VI_UNLOCK(vp); if (mp == NULL) goto retry; } else if (vp->v_type == VREG) { From owner-svn-src-head@freebsd.org Fri Aug 25 10:35:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2504DD47F7; Fri, 25 Aug 2017 10:35:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 389AF806E3; Fri, 25 Aug 2017 10:35:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v7PAZYUZ046534 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 25 Aug 2017 13:35:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v7PAZYUZ046534 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v7PAZYhx046533; Fri, 25 Aug 2017 13:35:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 Aug 2017 13:35:34 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r306512 - in head/sys: kern sys Message-ID: <20170825103534.GK1700@kib.kiev.ua> References: <201609301727.u8UHRIgD051373@repo.freebsd.org> <6ea06065-ea5c-b83b-3854-224626be0d77@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6ea06065-ea5c-b83b-3854-224626be0d77@FreeBSD.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 10:35:41 -0000 On Thu, Aug 24, 2017 at 08:18:03PM -0700, Bryan Drewery wrote: > On 9/30/2016 10:27 AM, Mateusz Guzik wrote: > > Author: mjg > > Date: Fri Sep 30 17:27:17 2016 > > New Revision: 306512 > > URL: https://svnweb.freebsd.org/changeset/base/306512 > > > > Log: > > vfs: batch free vnodes in per-mnt lists > > > > Previously free vnodes would always by directly returned to the global > > LRU list. With this change up to mnt_free_list_batch vnodes are collected > > first. > > > > syncer runs always return the batch regardless of its size. > > > > While vnodes on per-mnt lists are not counted as free, they can be > > returned in case of vnode shortage. > > > > Reviewed by: kib > > Tested by: pho > > > > Modified: > > head/sys/kern/vfs_mount.c > > head/sys/kern/vfs_subr.c > > head/sys/sys/mount.h > > head/sys/sys/vnode.h > > > ... > > @@ -2753,17 +2824,25 @@ _vhold(struct vnode *vp, bool locked) > > * Remove a vnode from the free list, mark it as in use, > > * and put it on the active list. > > */ > > - mtx_lock(&vnode_free_list_mtx); > > - TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist); > > - freevnodes--; > > - vp->v_iflag &= ~VI_FREE; > > + mp = vp->v_mount; > > + mtx_lock(&mp->mnt_listmtx); > ^^ > > > + if ((vp->v_mflag & VMP_TMPMNTFREELIST) != 0) { > > + TAILQ_REMOVE(&mp->mnt_tmpfreevnodelist, vp, v_actfreelist); > > + mp->mnt_tmpfreevnodelistsize--; > > + vp->v_mflag &= ~VMP_TMPMNTFREELIST; > > + } else { > > + mtx_lock(&vnode_free_list_mtx); > > + TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist); > > + freevnodes--; > > + mtx_unlock(&vnode_free_list_mtx); > > + } > > KASSERT((vp->v_iflag & VI_ACTIVE) == 0, > > ("Activating already active vnode")); > > + vp->v_iflag &= ~VI_FREE; > > vp->v_iflag |= VI_ACTIVE; > > - mp = vp->v_mount; > > TAILQ_INSERT_HEAD(&mp->mnt_activevnodelist, vp, v_actfreelist); > > mp->mnt_activevnodelistsize++; > > - mtx_unlock(&vnode_free_list_mtx); > > + mtx_unlock(&mp->mnt_listmtx); > > refcount_acquire(&vp->v_holdcnt); > > if (!locked) > > VI_UNLOCK(vp); > > @@ -2819,21 +2898,25 @@ _vdrop(struct vnode *vp, bool locked) > > if ((vp->v_iflag & VI_OWEINACT) == 0) { > > vp->v_iflag &= ~VI_ACTIVE; > > mp = vp->v_mount; > > - mtx_lock(&vnode_free_list_mtx); > > + mtx_lock(&mp->mnt_listmtx); > ^^ > > If code runs getnewvnode() and then immediately runs vhold() or vrele(), > without first running insmntque(vp, mp), then vp->v_mount is NULL here > and the lock/freelist dereferencing just panic. getnewvnode() returns vref-ed vnode, i.e. both hold and use counts are set to 1. What is the use case there which requires vhold-ing vnode without finishing its construction ? > Locking the vnode and then using vgone() and vput() on it avoids the > issue since it marks the vnode VI_DOOMED and instead frees it in > _vdrop() rather than try to re-add it to its NULL per-mount free list. This is the common pattern where insmntque() fails. > > I'm not sure what the right thing here is. Is it a requirement to > insmntque() a new vnode immediately, or to vgone() it before releasing > it if was just returned from getnewvnode()? These are the only uses of a newly allocated vnode which make sense. Do you need this for something that does not happen in the svn tree ? > > Perhaps these cases should assert that v_mount is not NULL or handle the > odd case and just free the vnode instead, or can it still just add to > the global vnode_free_list if mp is NULL? > > The old code handled the case fine since the freelist was global and not > per-mount. 'mp' was only dereferenced below if the vnode had been > active, which was not the case for my example. From owner-svn-src-head@freebsd.org Fri Aug 25 10:57:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F577DD4FD1; Fri, 25 Aug 2017 10:57:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0B18E81011; Fri, 25 Aug 2017 10:57:18 +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 v7PAvHPl024427; Fri, 25 Aug 2017 10:57:17 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PAvHFf024426; Fri, 25 Aug 2017 10:57:17 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201708251057.v7PAvHFf024426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 25 Aug 2017 10:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322884 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 322884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 10:57:19 -0000 Author: bde Date: Fri Aug 25 10:57:17 2017 New Revision: 322884 URL: https://svnweb.freebsd.org/changeset/base/322884 Log: Fix bugs in (mostly) not-yet-activated parts of early/emergency output: - map the hard-coded frame buffer address above KERNBASE. Using the physical address only worked because of larger mapping bugs. The hard-coded frame buffer address only works on x86. Use messy ifdefs to try to avoid warnings about unused code for other arches. - remove the sysctl for reading and writing the table kernel console attributes. Writing only worked for emergency output since normal output uses unalterd copies. - fix the test for the emergency console being usable - explain why a hard-coded attribute is used very early. Emergency output works on x86 even before the pcpu pointer is initialized. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Fri Aug 25 09:51:22 2017 (r322883) +++ head/sys/dev/syscons/syscons.c Fri Aug 25 10:57:17 2017 (r322884) @@ -76,6 +76,13 @@ __FBSDID("$FreeBSD$"); #endif #include +#if defined(__amd64__) || defined(__i386__) +#include + +#include +#include +#endif + #include #include #include @@ -137,8 +144,6 @@ static int sc_no_suspend_vtswitch = 0; static int sc_susp_scr; static SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD, 0, "syscons"); -SYSCTL_OPAQUE(_hw_syscons, OID_AUTO, kattr, CTLFLAG_RW, - &sc_kattrtab, sizeof(sc_kattrtab), "CU", "kernel console attributes"); static SYSCTL_NODE(_hw_syscons, OID_AUTO, saver, CTLFLAG_RD, 0, "saver"); SYSCTL_INT(_hw_syscons_saver, OID_AUTO, keybonly, CTLFLAG_RW, &sc_saver_keyb_only, 0, "screen saver interrupted by input only"); @@ -277,16 +282,17 @@ ec_putc(int c) if (sc_console == NULL) { #if !defined(__amd64__) && !defined(__i386__) return; -#endif +#else /* * This is enough for ec_putc() to work very early on x86 * if the kernel starts in normal color text mode. */ - fb = 0xb8000; + fb = KERNBASE + 0xb8000; xsize = 80; ysize = 25; +#endif } else { - if (main_console.status & GRAPHICS_MODE) + if (!ISTEXTSC(&main_console)) return; fb = main_console.sc->adp->va_window; xsize = main_console.xsize; @@ -4159,7 +4165,7 @@ static int sc_kattr(void) { if (sc_console == NULL) - return (SC_KERNEL_CONS_ATTR); + return (SC_KERNEL_CONS_ATTR); /* for very early, before pcpu */ return (sc_kattrtab[PCPU_GET(cpuid) % nitems(sc_kattrtab)]); } From owner-svn-src-head@freebsd.org Fri Aug 25 11:01:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB47FDD51F4; Fri, 25 Aug 2017 11:01:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 6E1DB813A6; Fri, 25 Aug 2017 11:01:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PB1e7C027713; Fri, 25 Aug 2017 11:01:40 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PB1doR027697; Fri, 25 Aug 2017 11:01:39 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201708251101.v7PB1doR027697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 25 Aug 2017 11:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322885 - in head: sys/compat/cloudabi sys/compat/cloudabi32 sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head: sys/compat/cloudabi sys/compat/cloudabi32 sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss X-SVN-Commit-Revision: 322885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 11:01:41 -0000 Author: ed Date: Fri Aug 25 11:01:39 2017 New Revision: 322885 URL: https://svnweb.freebsd.org/changeset/base/322885 Log: Sync CloudABI compatibility against the latest upstream version (v0.13). With Flower (CloudABI's network connection daemon) becoming more complete, there is no longer any need for creating any unconnected sockets. Socket pairs in combination with file descriptor passing is all that is necessary, as that is what is used by Flower to pass network connections from the public internet to listening processes. Remove all of the kernel bits that were used to implement socket(), listen(), bindat() and connectat(). In principle, accept() and SO_ACCEPTCONN may also be removed, but there are still some consumers left. Obtained from: https://github.com/NuxiNL/cloudabi MFC after: 1 month Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/cloudabi/cloudabi_sock.c head/sys/compat/cloudabi32/cloudabi32_proto.h head/sys/compat/cloudabi32/cloudabi32_syscall.h head/sys/compat/cloudabi32/cloudabi32_syscalls.c head/sys/compat/cloudabi32/cloudabi32_sysent.c head/sys/compat/cloudabi32/cloudabi32_systrace_args.c head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c head/sys/contrib/cloudabi/cloudabi_types_common.h head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S head/sys/contrib/cloudabi/cloudabi_vdso_i686.S head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S head/sys/contrib/cloudabi/syscalls32.master head/sys/contrib/cloudabi/syscalls64.master head/usr.bin/truss/syscalls.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi/cloudabi_fd.c Fri Aug 25 11:01:39 2017 (r322885) @@ -79,11 +79,6 @@ __FBSDID("$FreeBSD$"); MAPPING(CLOUDABI_RIGHT_POLL_WAIT, CAP_KQUEUE_EVENT) \ MAPPING(CLOUDABI_RIGHT_PROC_EXEC, CAP_FEXECVE) \ MAPPING(CLOUDABI_RIGHT_SOCK_ACCEPT, CAP_ACCEPT) \ - MAPPING(CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY, CAP_BINDAT) \ - MAPPING(CLOUDABI_RIGHT_SOCK_BIND_SOCKET, CAP_BIND) \ - MAPPING(CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY, CAP_CONNECTAT) \ - MAPPING(CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET, CAP_CONNECT) \ - MAPPING(CLOUDABI_RIGHT_SOCK_LISTEN, CAP_LISTEN) \ MAPPING(CLOUDABI_RIGHT_SOCK_SHUTDOWN, CAP_SHUTDOWN) \ MAPPING(CLOUDABI_RIGHT_SOCK_STAT_GET, CAP_GETPEERNAME, \ CAP_GETSOCKNAME, CAP_GETSOCKOPT) @@ -109,10 +104,6 @@ cloudabi_sys_fd_create1(struct thread *td, cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_MMAP_RWX); return (kern_shm_open(td, SHM_ANON, O_RDWR, 0, &fcaps)); - case CLOUDABI_FILETYPE_SOCKET_DGRAM: - return (kern_socket(td, AF_UNIX, SOCK_DGRAM, 0)); - case CLOUDABI_FILETYPE_SOCKET_STREAM: - return (kern_socket(td, AF_UNIX, SOCK_STREAM, 0)); default: return (EINVAL); } @@ -312,9 +303,7 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES | CLOUDABI_RIGHT_FILE_SYMLINK | CLOUDABI_RIGHT_FILE_UNLINK | - CLOUDABI_RIGHT_POLL_FD_READWRITE | - CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY | - CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY; + CLOUDABI_RIGHT_POLL_FD_READWRITE; *inheriting &= CLOUDABI_RIGHT_FD_DATASYNC | CLOUDABI_RIGHT_FD_READ | CLOUDABI_RIGHT_FD_SEEK | @@ -344,9 +333,7 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t CLOUDABI_RIGHT_MEM_MAP | CLOUDABI_RIGHT_MEM_MAP_EXEC | CLOUDABI_RIGHT_POLL_FD_READWRITE | - CLOUDABI_RIGHT_PROC_EXEC | - CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY | - CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY; + CLOUDABI_RIGHT_PROC_EXEC; break; case CLOUDABI_FILETYPE_FIFO: *base &= CLOUDABI_RIGHT_FD_READ | @@ -400,9 +387,6 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t CLOUDABI_RIGHT_FILE_STAT_FGET | CLOUDABI_RIGHT_POLL_FD_READWRITE | CLOUDABI_RIGHT_SOCK_ACCEPT | - CLOUDABI_RIGHT_SOCK_BIND_SOCKET | - CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET | - CLOUDABI_RIGHT_SOCK_LISTEN | CLOUDABI_RIGHT_SOCK_SHUTDOWN | CLOUDABI_RIGHT_SOCK_STAT_GET; break; Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi/cloudabi_sock.c Fri Aug 25 11:01:39 2017 (r322885) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -49,28 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* Copies a pathname into a UNIX socket address structure. */ -static int -copyin_sockaddr_un(const char *path, size_t pathlen, struct sockaddr_un *sun) -{ - int error; - - /* Copy in pathname string if there's enough space. */ - if (pathlen >= sizeof(sun->sun_path)) - return (ENAMETOOLONG); - error = copyin(path, &sun->sun_path, pathlen); - if (error != 0) - return (error); - if (memchr(sun->sun_path, '\0', pathlen) != NULL) - return (EINVAL); - - /* Initialize the rest of the socket address. */ - sun->sun_path[pathlen] = '\0'; - sun->sun_family = AF_UNIX; - sun->sun_len = sizeof(*sun); - return (0); -} - int cloudabi_sys_sock_accept(struct thread *td, struct cloudabi_sys_sock_accept_args *uap) @@ -80,41 +57,6 @@ cloudabi_sys_sock_accept(struct thread *td, } int -cloudabi_sys_sock_bind(struct thread *td, - struct cloudabi_sys_sock_bind_args *uap) -{ - struct sockaddr_un sun; - int error; - - error = copyin_sockaddr_un(uap->path, uap->path_len, &sun); - if (error != 0) - return (error); - return (kern_bindat(td, uap->fd, uap->sock, (struct sockaddr *)&sun)); -} - -int -cloudabi_sys_sock_connect(struct thread *td, - struct cloudabi_sys_sock_connect_args *uap) -{ - struct sockaddr_un sun; - int error; - - error = copyin_sockaddr_un(uap->path, uap->path_len, &sun); - if (error != 0) - return (error); - return (kern_connectat(td, uap->fd, uap->sock, - (struct sockaddr *)&sun)); -} - -int -cloudabi_sys_sock_listen(struct thread *td, - struct cloudabi_sys_sock_listen_args *uap) -{ - - return (kern_listen(td, uap->sock, uap->backlog)); -} - -int cloudabi_sys_sock_shutdown(struct thread *td, struct cloudabi_sys_sock_shutdown_args *uap) { @@ -174,10 +116,7 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd cloudabi_riflags_t flags, size_t *rdatalen, size_t *rfdslen, cloudabi_roflags_t *rflags) { - struct sockaddr_storage ss; struct msghdr hdr = { - .msg_name = &ss, - .msg_namelen = sizeof(ss), .msg_iov = data, .msg_iovlen = datalen, }; Modified: head/sys/compat/cloudabi32/cloudabi32_proto.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_proto.h Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi32/cloudabi32_proto.h Fri Aug 25 11:01:39 2017 (r322885) @@ -259,22 +259,6 @@ struct cloudabi_sys_sock_accept_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char unused_l_[PADL_(void *)]; void * unused; char unused_r_[PADR_(void *)]; }; -struct cloudabi_sys_sock_bind_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; -}; -struct cloudabi_sys_sock_connect_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; -}; -struct cloudabi_sys_sock_listen_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char backlog_l_[PADL_(cloudabi_backlog_t)]; cloudabi_backlog_t backlog; char backlog_r_[PADR_(cloudabi_backlog_t)]; -}; struct cloudabi32_sys_sock_recv_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi32_recv_in_t *)]; const cloudabi32_recv_in_t * in; char in_r_[PADR_(const cloudabi32_recv_in_t *)]; @@ -349,9 +333,6 @@ int cloudabi_sys_proc_fork(struct thread *, struct clo int cloudabi_sys_proc_raise(struct thread *, struct cloudabi_sys_proc_raise_args *); int cloudabi_sys_random_get(struct thread *, struct cloudabi_sys_random_get_args *); int cloudabi_sys_sock_accept(struct thread *, struct cloudabi_sys_sock_accept_args *); -int cloudabi_sys_sock_bind(struct thread *, struct cloudabi_sys_sock_bind_args *); -int cloudabi_sys_sock_connect(struct thread *, struct cloudabi_sys_sock_connect_args *); -int cloudabi_sys_sock_listen(struct thread *, struct cloudabi_sys_sock_listen_args *); int cloudabi32_sys_sock_recv(struct thread *, struct cloudabi32_sys_sock_recv_args *); int cloudabi32_sys_sock_send(struct thread *, struct cloudabi32_sys_sock_send_args *); int cloudabi_sys_sock_shutdown(struct thread *, struct cloudabi_sys_sock_shutdown_args *); @@ -440,9 +421,6 @@ int cloudabi_sys_thread_yield(struct thread *, struct #define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_raise AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_random_get AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_accept AUE_NULL -#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_bind AUE_NULL -#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_connect AUE_NULL -#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_listen AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_sock_recv AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_sock_send AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_shutdown AUE_NULL Modified: head/sys/compat/cloudabi32/cloudabi32_syscall.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscall.h Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi32/cloudabi32_syscall.h Fri Aug 25 11:01:39 2017 (r322885) @@ -50,14 +50,11 @@ #define CLOUDABI32_SYS_cloudabi_sys_proc_raise 42 #define CLOUDABI32_SYS_cloudabi_sys_random_get 43 #define CLOUDABI32_SYS_cloudabi_sys_sock_accept 44 -#define CLOUDABI32_SYS_cloudabi_sys_sock_bind 45 -#define CLOUDABI32_SYS_cloudabi_sys_sock_connect 46 -#define CLOUDABI32_SYS_cloudabi_sys_sock_listen 47 -#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 48 -#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 49 -#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 50 -#define CLOUDABI32_SYS_cloudabi_sys_sock_stat_get 51 -#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 52 -#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 53 -#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 54 -#define CLOUDABI32_SYS_MAXSYSCALL 55 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 45 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 46 +#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 47 +#define CLOUDABI32_SYS_cloudabi_sys_sock_stat_get 48 +#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 49 +#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 50 +#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 51 +#define CLOUDABI32_SYS_MAXSYSCALL 52 Modified: head/sys/compat/cloudabi32/cloudabi32_syscalls.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscalls.c Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi32/cloudabi32_syscalls.c Fri Aug 25 11:01:39 2017 (r322885) @@ -51,14 +51,11 @@ const char *cloudabi32_syscallnames[] = { "cloudabi_sys_proc_raise", /* 42 = cloudabi_sys_proc_raise */ "cloudabi_sys_random_get", /* 43 = cloudabi_sys_random_get */ "cloudabi_sys_sock_accept", /* 44 = cloudabi_sys_sock_accept */ - "cloudabi_sys_sock_bind", /* 45 = cloudabi_sys_sock_bind */ - "cloudabi_sys_sock_connect", /* 46 = cloudabi_sys_sock_connect */ - "cloudabi_sys_sock_listen", /* 47 = cloudabi_sys_sock_listen */ - "cloudabi32_sys_sock_recv", /* 48 = cloudabi32_sys_sock_recv */ - "cloudabi32_sys_sock_send", /* 49 = cloudabi32_sys_sock_send */ - "cloudabi_sys_sock_shutdown", /* 50 = cloudabi_sys_sock_shutdown */ - "cloudabi_sys_sock_stat_get", /* 51 = cloudabi_sys_sock_stat_get */ - "cloudabi32_sys_thread_create", /* 52 = cloudabi32_sys_thread_create */ - "cloudabi_sys_thread_exit", /* 53 = cloudabi_sys_thread_exit */ - "cloudabi_sys_thread_yield", /* 54 = cloudabi_sys_thread_yield */ + "cloudabi32_sys_sock_recv", /* 45 = cloudabi32_sys_sock_recv */ + "cloudabi32_sys_sock_send", /* 46 = cloudabi32_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 47 = cloudabi_sys_sock_shutdown */ + "cloudabi_sys_sock_stat_get", /* 48 = cloudabi_sys_sock_stat_get */ + "cloudabi32_sys_thread_create", /* 49 = cloudabi32_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 50 = cloudabi_sys_thread_exit */ + "cloudabi_sys_thread_yield", /* 51 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi32/cloudabi32_sysent.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_sysent.c Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi32/cloudabi32_sysent.c Fri Aug 25 11:01:39 2017 (r322885) @@ -59,14 +59,11 @@ struct sysent cloudabi32_sysent[] = { { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_raise */ { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_random_get */ { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_sock_accept */ - { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_bind */ - { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_connect */ - { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_listen */ - { AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi32_sys_sock_recv */ - { AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi32_sys_sock_send */ - { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_sock_shutdown */ - { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_sock_stat_get */ - { AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi32_sys_thread_create */ - { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_thread_exit */ - { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_yield */ + { AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi32_sys_sock_recv */ + { AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi32_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_stat_get */ + { AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi32_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_thread_exit */ + { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi32/cloudabi32_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Fri Aug 25 11:01:39 2017 (r322885) @@ -415,36 +415,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } - /* cloudabi_sys_sock_bind */ - case 45: { - struct cloudabi_sys_sock_bind_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->fd; /* cloudabi_fd_t */ - uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->path_len; /* size_t */ - *n_args = 4; - break; - } - /* cloudabi_sys_sock_connect */ - case 46: { - struct cloudabi_sys_sock_connect_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->fd; /* cloudabi_fd_t */ - uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->path_len; /* size_t */ - *n_args = 4; - break; - } - /* cloudabi_sys_sock_listen */ - case 47: { - struct cloudabi_sys_sock_listen_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->backlog; /* cloudabi_backlog_t */ - *n_args = 2; - break; - } /* cloudabi32_sys_sock_recv */ - case 48: { + case 45: { struct cloudabi32_sys_sock_recv_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_recv_in_t * */ @@ -453,7 +425,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_sock_send */ - case 49: { + case 46: { struct cloudabi32_sys_sock_send_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_send_in_t * */ @@ -462,7 +434,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_shutdown */ - case 50: { + case 47: { struct cloudabi_sys_sock_shutdown_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ @@ -470,7 +442,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_stat_get */ - case 51: { + case 48: { struct cloudabi_sys_sock_stat_get_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ @@ -479,14 +451,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_thread_create */ - case 52: { + case 49: { struct cloudabi32_sys_thread_create_args *p = params; uarg[0] = (intptr_t) p->attr; /* cloudabi32_threadattr_t * */ *n_args = 1; break; } /* cloudabi_sys_thread_exit */ - case 53: { + case 50: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ @@ -494,7 +466,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_thread_yield */ - case 54: { + case 51: { *n_args = 0; break; } @@ -1224,64 +1196,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* cloudabi_sys_sock_bind */ + /* cloudabi32_sys_sock_recv */ case 45: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: - p = "cloudabi_fd_t"; - break; - case 2: - p = "userland const char *"; - break; - case 3: - p = "size_t"; - break; - default: - break; - }; - break; - /* cloudabi_sys_sock_connect */ - case 46: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "cloudabi_fd_t"; - break; - case 2: - p = "userland const char *"; - break; - case 3: - p = "size_t"; - break; - default: - break; - }; - break; - /* cloudabi_sys_sock_listen */ - case 47: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "cloudabi_backlog_t"; - break; - default: - break; - }; - break; - /* cloudabi32_sys_sock_recv */ - case 48: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: p = "userland const cloudabi32_recv_in_t *"; break; case 2: @@ -1292,7 +1213,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_sock_send */ - case 49: + case 46: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1308,7 +1229,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_shutdown */ - case 50: + case 47: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1321,7 +1242,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_stat_get */ - case 51: + case 48: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1337,7 +1258,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_thread_create */ - case 52: + case 49: switch(ndx) { case 0: p = "userland cloudabi32_threadattr_t *"; @@ -1347,7 +1268,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_thread_exit */ - case 53: + case 50: switch(ndx) { case 0: p = "userland cloudabi_lock_t *"; @@ -1360,7 +1281,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_thread_yield */ - case 54: + case 51: break; default: break; @@ -1595,53 +1516,38 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; - /* cloudabi_sys_sock_bind */ + /* cloudabi32_sys_sock_recv */ case 45: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_sock_connect */ + /* cloudabi32_sys_sock_send */ case 46: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_sock_listen */ + /* cloudabi_sys_sock_shutdown */ case 47: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi32_sys_sock_recv */ + /* cloudabi_sys_sock_stat_get */ case 48: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi32_sys_sock_send */ + /* cloudabi32_sys_thread_create */ case 49: if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_sock_shutdown */ - case 50: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_sock_stat_get */ - case 51: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi32_sys_thread_create */ - case 52: - if (ndx == 0 || ndx == 1) p = "cloudabi_tid_t"; break; /* cloudabi_sys_thread_exit */ - case 53: + case 50: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_thread_yield */ - case 54: + case 51: default: break; }; Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 25 11:01:39 2017 (r322885) @@ -259,22 +259,6 @@ struct cloudabi_sys_sock_accept_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char unused_l_[PADL_(void *)]; void * unused; char unused_r_[PADR_(void *)]; }; -struct cloudabi_sys_sock_bind_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; -}; -struct cloudabi_sys_sock_connect_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; -}; -struct cloudabi_sys_sock_listen_args { - char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; - char backlog_l_[PADL_(cloudabi_backlog_t)]; cloudabi_backlog_t backlog; char backlog_r_[PADR_(cloudabi_backlog_t)]; -}; struct cloudabi64_sys_sock_recv_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi64_recv_in_t *)]; const cloudabi64_recv_in_t * in; char in_r_[PADR_(const cloudabi64_recv_in_t *)]; @@ -349,9 +333,6 @@ int cloudabi_sys_proc_fork(struct thread *, struct clo int cloudabi_sys_proc_raise(struct thread *, struct cloudabi_sys_proc_raise_args *); int cloudabi_sys_random_get(struct thread *, struct cloudabi_sys_random_get_args *); int cloudabi_sys_sock_accept(struct thread *, struct cloudabi_sys_sock_accept_args *); -int cloudabi_sys_sock_bind(struct thread *, struct cloudabi_sys_sock_bind_args *); -int cloudabi_sys_sock_connect(struct thread *, struct cloudabi_sys_sock_connect_args *); -int cloudabi_sys_sock_listen(struct thread *, struct cloudabi_sys_sock_listen_args *); int cloudabi64_sys_sock_recv(struct thread *, struct cloudabi64_sys_sock_recv_args *); int cloudabi64_sys_sock_send(struct thread *, struct cloudabi64_sys_sock_send_args *); int cloudabi_sys_sock_shutdown(struct thread *, struct cloudabi_sys_sock_shutdown_args *); @@ -440,9 +421,6 @@ int cloudabi_sys_thread_yield(struct thread *, struct #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_raise AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_random_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_accept AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_bind AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_connect AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_listen AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_sock_recv AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_sock_send AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_shutdown AUE_NULL Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 25 11:01:39 2017 (r322885) @@ -50,14 +50,11 @@ #define CLOUDABI64_SYS_cloudabi_sys_proc_raise 42 #define CLOUDABI64_SYS_cloudabi_sys_random_get 43 #define CLOUDABI64_SYS_cloudabi_sys_sock_accept 44 -#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 45 -#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 46 -#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 47 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 48 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 49 -#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 50 -#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 51 -#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 52 -#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 53 -#define CLOUDABI64_SYS_cloudabi_sys_thread_yield 54 -#define CLOUDABI64_SYS_MAXSYSCALL 55 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 45 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 46 +#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 47 +#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 48 +#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 49 +#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 50 +#define CLOUDABI64_SYS_cloudabi_sys_thread_yield 51 +#define CLOUDABI64_SYS_MAXSYSCALL 52 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 25 11:01:39 2017 (r322885) @@ -51,14 +51,11 @@ const char *cloudabi64_syscallnames[] = { "cloudabi_sys_proc_raise", /* 42 = cloudabi_sys_proc_raise */ "cloudabi_sys_random_get", /* 43 = cloudabi_sys_random_get */ "cloudabi_sys_sock_accept", /* 44 = cloudabi_sys_sock_accept */ - "cloudabi_sys_sock_bind", /* 45 = cloudabi_sys_sock_bind */ - "cloudabi_sys_sock_connect", /* 46 = cloudabi_sys_sock_connect */ - "cloudabi_sys_sock_listen", /* 47 = cloudabi_sys_sock_listen */ - "cloudabi64_sys_sock_recv", /* 48 = cloudabi64_sys_sock_recv */ - "cloudabi64_sys_sock_send", /* 49 = cloudabi64_sys_sock_send */ - "cloudabi_sys_sock_shutdown", /* 50 = cloudabi_sys_sock_shutdown */ - "cloudabi_sys_sock_stat_get", /* 51 = cloudabi_sys_sock_stat_get */ - "cloudabi64_sys_thread_create", /* 52 = cloudabi64_sys_thread_create */ - "cloudabi_sys_thread_exit", /* 53 = cloudabi_sys_thread_exit */ - "cloudabi_sys_thread_yield", /* 54 = cloudabi_sys_thread_yield */ + "cloudabi64_sys_sock_recv", /* 45 = cloudabi64_sys_sock_recv */ + "cloudabi64_sys_sock_send", /* 46 = cloudabi64_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 47 = cloudabi_sys_sock_shutdown */ + "cloudabi_sys_sock_stat_get", /* 48 = cloudabi_sys_sock_stat_get */ + "cloudabi64_sys_thread_create", /* 49 = cloudabi64_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 50 = cloudabi_sys_thread_exit */ + "cloudabi_sys_thread_yield", /* 51 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 25 11:01:39 2017 (r322885) @@ -59,14 +59,11 @@ struct sysent cloudabi64_sysent[] = { { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_raise */ { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_random_get */ { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_sock_accept */ - { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_bind */ - { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_connect */ - { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_listen */ - { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi64_sys_sock_recv */ - { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi64_sys_sock_send */ - { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_sock_shutdown */ - { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_sock_stat_get */ - { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi64_sys_thread_create */ - { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_thread_exit */ - { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_yield */ + { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi64_sys_sock_recv */ + { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi64_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_stat_get */ + { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi64_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_thread_exit */ + { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Fri Aug 25 11:01:39 2017 (r322885) @@ -415,36 +415,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 2; break; } - /* cloudabi_sys_sock_bind */ - case 45: { - struct cloudabi_sys_sock_bind_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->fd; /* cloudabi_fd_t */ - uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->path_len; /* size_t */ - *n_args = 4; - break; - } - /* cloudabi_sys_sock_connect */ - case 46: { - struct cloudabi_sys_sock_connect_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->fd; /* cloudabi_fd_t */ - uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->path_len; /* size_t */ - *n_args = 4; - break; - } - /* cloudabi_sys_sock_listen */ - case 47: { - struct cloudabi_sys_sock_listen_args *p = params; - iarg[0] = p->sock; /* cloudabi_fd_t */ - iarg[1] = p->backlog; /* cloudabi_backlog_t */ - *n_args = 2; - break; - } /* cloudabi64_sys_sock_recv */ - case 48: { + case 45: { struct cloudabi64_sys_sock_recv_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_recv_in_t * */ @@ -453,7 +425,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi64_sys_sock_send */ - case 49: { + case 46: { struct cloudabi64_sys_sock_send_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_send_in_t * */ @@ -462,7 +434,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_shutdown */ - case 50: { + case 47: { struct cloudabi_sys_sock_shutdown_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ @@ -470,7 +442,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_stat_get */ - case 51: { + case 48: { struct cloudabi_sys_sock_stat_get_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ @@ -479,14 +451,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi64_sys_thread_create */ - case 52: { + case 49: { struct cloudabi64_sys_thread_create_args *p = params; uarg[0] = (intptr_t) p->attr; /* cloudabi64_threadattr_t * */ *n_args = 1; break; } /* cloudabi_sys_thread_exit */ - case 53: { + case 50: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ @@ -494,7 +466,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_thread_yield */ - case 54: { + case 51: { *n_args = 0; break; } @@ -1224,64 +1196,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* cloudabi_sys_sock_bind */ + /* cloudabi64_sys_sock_recv */ case 45: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: - p = "cloudabi_fd_t"; - break; - case 2: - p = "userland const char *"; - break; - case 3: - p = "size_t"; - break; - default: - break; - }; - break; - /* cloudabi_sys_sock_connect */ - case 46: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "cloudabi_fd_t"; - break; - case 2: - p = "userland const char *"; - break; - case 3: - p = "size_t"; - break; - default: - break; - }; - break; - /* cloudabi_sys_sock_listen */ - case 47: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "cloudabi_backlog_t"; - break; - default: - break; - }; - break; - /* cloudabi64_sys_sock_recv */ - case 48: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: p = "userland const cloudabi64_recv_in_t *"; break; case 2: @@ -1292,7 +1213,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi64_sys_sock_send */ - case 49: + case 46: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1308,7 +1229,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_shutdown */ - case 50: + case 47: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1321,7 +1242,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_stat_get */ - case 51: + case 48: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1337,7 +1258,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi64_sys_thread_create */ - case 52: + case 49: switch(ndx) { case 0: p = "userland cloudabi64_threadattr_t *"; @@ -1347,7 +1268,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_thread_exit */ - case 53: + case 50: switch(ndx) { case 0: p = "userland cloudabi_lock_t *"; @@ -1360,7 +1281,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_thread_yield */ - case 54: + case 51: break; default: break; @@ -1595,53 +1516,38 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; - /* cloudabi_sys_sock_bind */ + /* cloudabi64_sys_sock_recv */ case 45: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_sock_connect */ + /* cloudabi64_sys_sock_send */ case 46: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi_sys_sock_listen */ + /* cloudabi_sys_sock_shutdown */ case 47: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi64_sys_sock_recv */ + /* cloudabi_sys_sock_stat_get */ case 48: if (ndx == 0 || ndx == 1) p = "void"; break; - /* cloudabi64_sys_sock_send */ + /* cloudabi64_sys_thread_create */ case 49: if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_sock_shutdown */ - case 50: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_sock_stat_get */ - case 51: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi64_sys_thread_create */ - case 52: - if (ndx == 0 || ndx == 1) p = "cloudabi_tid_t"; break; /* cloudabi_sys_thread_exit */ - case 53: + case 50: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_thread_yield */ - case 54: + case 51: default: break; }; Modified: head/sys/contrib/cloudabi/cloudabi_types_common.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi_types_common.h Fri Aug 25 10:57:17 2017 (r322884) +++ head/sys/contrib/cloudabi/cloudabi_types_common.h Fri Aug 25 11:01:39 2017 (r322885) @@ -249,47 +249,42 @@ typedef uint16_t cloudabi_riflags_t; #define CLOUDABI_SOCK_RECV_WAITALL 0x0010 typedef uint64_t cloudabi_rights_t; -#define CLOUDABI_RIGHT_FD_DATASYNC 0x0000000000000001 -#define CLOUDABI_RIGHT_FD_READ 0x0000000000000002 -#define CLOUDABI_RIGHT_FD_SEEK 0x0000000000000004 -#define CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS 0x0000000000000008 -#define CLOUDABI_RIGHT_FD_SYNC 0x0000000000000010 -#define CLOUDABI_RIGHT_FD_TELL 0x0000000000000020 -#define CLOUDABI_RIGHT_FD_WRITE 0x0000000000000040 -#define CLOUDABI_RIGHT_FILE_ADVISE 0x0000000000000080 -#define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100 -#define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200 -#define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400 -#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800 -#define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000 -#define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000 -#define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000 -#define CLOUDABI_RIGHT_FILE_READDIR 0x0000000000008000 -#define CLOUDABI_RIGHT_FILE_READLINK 0x0000000000010000 -#define CLOUDABI_RIGHT_FILE_RENAME_SOURCE 0x0000000000020000 -#define CLOUDABI_RIGHT_FILE_RENAME_TARGET 0x0000000000040000 -#define CLOUDABI_RIGHT_FILE_STAT_FGET 0x0000000000080000 -#define CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE 0x0000000000100000 -#define CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES 0x0000000000200000 -#define CLOUDABI_RIGHT_FILE_STAT_GET 0x0000000000400000 -#define CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES 0x0000000000800000 -#define CLOUDABI_RIGHT_FILE_SYMLINK 0x0000000001000000 -#define CLOUDABI_RIGHT_FILE_UNLINK 0x0000000002000000 -#define CLOUDABI_RIGHT_MEM_MAP 0x0000000004000000 -#define CLOUDABI_RIGHT_MEM_MAP_EXEC 0x0000000008000000 -#define CLOUDABI_RIGHT_POLL_FD_READWRITE 0x0000000010000000 -#define CLOUDABI_RIGHT_POLL_MODIFY 0x0000000020000000 -#define CLOUDABI_RIGHT_POLL_PROC_TERMINATE 0x0000000040000000 -#define CLOUDABI_RIGHT_POLL_WAIT 0x0000000080000000 -#define CLOUDABI_RIGHT_PROC_EXEC 0x0000000100000000 -#define CLOUDABI_RIGHT_SOCK_ACCEPT 0x0000000200000000 -#define CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY 0x0000000400000000 -#define CLOUDABI_RIGHT_SOCK_BIND_SOCKET 0x0000000800000000 -#define CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY 0x0000001000000000 -#define CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET 0x0000002000000000 -#define CLOUDABI_RIGHT_SOCK_LISTEN 0x0000004000000000 -#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000 -#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000 +#define CLOUDABI_RIGHT_FD_DATASYNC 0x0000000000000001 +#define CLOUDABI_RIGHT_FD_READ 0x0000000000000002 +#define CLOUDABI_RIGHT_FD_SEEK 0x0000000000000004 +#define CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS 0x0000000000000008 +#define CLOUDABI_RIGHT_FD_SYNC 0x0000000000000010 +#define CLOUDABI_RIGHT_FD_TELL 0x0000000000000020 +#define CLOUDABI_RIGHT_FD_WRITE 0x0000000000000040 +#define CLOUDABI_RIGHT_FILE_ADVISE 0x0000000000000080 +#define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100 +#define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200 +#define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400 +#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800 +#define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000 +#define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000 +#define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000 +#define CLOUDABI_RIGHT_FILE_READDIR 0x0000000000008000 +#define CLOUDABI_RIGHT_FILE_READLINK 0x0000000000010000 +#define CLOUDABI_RIGHT_FILE_RENAME_SOURCE 0x0000000000020000 +#define CLOUDABI_RIGHT_FILE_RENAME_TARGET 0x0000000000040000 +#define CLOUDABI_RIGHT_FILE_STAT_FGET 0x0000000000080000 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Aug 25 11:24:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35FF7DD5AD7; Fri, 25 Aug 2017 11:24:47 +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 mx1.freebsd.org (Postfix) with ESMTPS id 02C0D81DCB; Fri, 25 Aug 2017 11:24:46 +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 v7PBOkuw036487; Fri, 25 Aug 2017 11:24:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PBOksv036486; Fri, 25 Aug 2017 11:24:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201708251124.v7PBOksv036486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 25 Aug 2017 11:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322886 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 322886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 11:24:47 -0000 Author: ae Date: Fri Aug 25 11:24:45 2017 New Revision: 322886 URL: https://svnweb.freebsd.org/changeset/base/322886 Log: Add melifaro@ to the calendar.freebsd Submitted by: melifaro Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Fri Aug 25 11:01:39 2017 (r322885) +++ head/usr.bin/calendar/calendars/calendar.freebsd Fri Aug 25 11:24:45 2017 (r322886) @@ -131,6 +131,7 @@ 03/30 Po-Chuan Hsieh born in Taipei, Taiwan, Republic of China, 1978 03/31 First quarter status reports are due on 04/15 04/01 Matthew Jacob born in San Francisco, California, United States, 1958 +04/01 Alexander V. Chernikov born in Moscow, Russian Federation, 1984 04/01 Bill Fenner born in Bellefonte, Pennsylvania, United States, 1971 04/01 Peter Edwards born in Dublin, Ireland, 1973 04/03 Hellmuth Michaelis born in Kiel, Schleswig-Holstein, Germany, 1958 From owner-svn-src-head@freebsd.org Fri Aug 25 12:28:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3668DD779E; Fri, 25 Aug 2017 12:28:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7369B8378D; Fri, 25 Aug 2017 12:28:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PCSYvV061203; Fri, 25 Aug 2017 12:28:34 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PCSYIN061202; Fri, 25 Aug 2017 12:28:34 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201708251228.v7PCSYIN061202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 25 Aug 2017 12:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322888 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 322888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 12:28:35 -0000 Author: ed Date: Fri Aug 25 12:28:34 2017 New Revision: 322888 URL: https://svnweb.freebsd.org/changeset/base/322888 Log: Make entries for the United States more consistent. MFC after: 1 week Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Fri Aug 25 12:16:03 2017 (r322887) +++ head/usr.bin/calendar/calendars/calendar.freebsd Fri Aug 25 12:28:34 2017 (r322888) @@ -224,7 +224,7 @@ 06/04 Johannes Jost Meixner born in Wiesbaden, Germany, 1987 06/06 Sergei Kolobov born in Karpinsk, Russian Federation, 1972 06/06 Ryan Libby born in Kirkland, Washington, United States, 1985 -06/06 Alan Eldridge died in Denver, Colorado, 2003 +06/06 Alan Eldridge died in Denver, Colorado, United States, 2003 06/07 Jimmy Olgeni born in Milano, Italy, 1976 06/07 Benjamin Close born in Adelaide, Australia, 1978 06/07 Roger Pau Monne born in Reus, Catalunya, Spain, 1986 @@ -436,7 +436,7 @@ 12/18 Semen Ustimenko born in Novosibirsk, Russian Federation, 1979 12/19 Stephen Hurd born in Estevan, Saskatchewan, Canada, 1975 12/19 Emmanuel Vadot born in Decines-Charpieu, France, 1983 -12/20 Sean Bruno born in Monterey, California, USA, 1974 +12/20 Sean Bruno born in Monterey, California, United States, 1974 12/21 Rong-En Fan born in Taipei, Taiwan, Republic of China, 1982 12/22 Alan L. Cox born in Warren, Ohio, United States, 1964 12/22 Maxim Sobolev born in Dnepropetrovsk, Ukraine, 1976 From owner-svn-src-head@freebsd.org Fri Aug 25 12:54:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91A1BDD7FB4 for ; Fri, 25 Aug 2017 12:54:09 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x234.google.com (mail-yw0-x234.google.com [IPv6:2607:f8b0:4002:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC3769A for ; Fri, 25 Aug 2017 12:54:09 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x234.google.com with SMTP id t188so2947479ywb.1 for ; Fri, 25 Aug 2017 05:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RIu2rjYI7wcozGH8zPBapRW1RXz24zKOdJ0SEla9VO0=; b=VGSa58wBffidV+vkXuVAs7kQ3orFskTbPu5WSJVn+GeOPGZ0sl6OS+9VIUSRCpKPRm 6XY3g+0vvg8N/bdl10M9IODLxGR/jGKwxZ7GEooeDWPzF3bOZnnb0OQGsrOxMivNjyOe w1joFEQ7JZ7Zy4pkcvdcTr2ukO+J+jUgm/F/Zq4jswabyGL5FWwg9jHDlkxpyFUXEEp8 Jp1IB+3D/b4+WdmiNV0jmHHL4KwNPge3ENtTcGdjP/yOd7WRWVhP/qfWw3vlPJnhG9wv Nax1IkkAHwooSTXdS5C/I1/dNQVMvjXKFv6KY+c+MDuEEYXXY5PoFdkNNYt2vwRWjAH5 ecYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RIu2rjYI7wcozGH8zPBapRW1RXz24zKOdJ0SEla9VO0=; b=LzfjTKzWjBpIajIy6CBGcqHNhXU6cLHt+jbAwQwEZiGsnxrOuHIoyQDjyMg+Qxc1ww yud6BQD3AkYPj19zW5zl0oNplRSD3PWbghwpOTxSvsMvbEo1+ZHbgfONsaaXqUvDzYMm lgyR/IoknsUXNkGAK/fJp8lh235KAV7GjcGY/IymgmHfdvevg2NkIpQdr1lo8Y4aRWAz /LKh7NZtrHMUkAHwwhY74DtluRiJLxvEiMT0pfIqCBnFx3Y7lEGGjVwfMwnuJL5OwkO7 Ikz//ZYKkTJdClMZd9XvEl0IFhwh5XOWX7Ln/o7mMxAMFmQE9ft4hUl0phGxHydf9mxX RByQ== X-Gm-Message-State: AHYfb5iwAx1jLdc0+pgEjj3m80QpMHW0h6mNF+J8DqmzmyAQHpMU/x19 4uld30UXcGiD8/TSNg4+dwSWBzTgxuXO X-Received: by 10.129.84.6 with SMTP id i6mr8156070ywb.203.1503665648453; Fri, 25 Aug 2017 05:54:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.227.193 with HTTP; Fri, 25 Aug 2017 05:53:37 -0700 (PDT) In-Reply-To: References: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> From: Ed Schouten Date: Fri, 25 Aug 2017 14:53:37 +0200 Message-ID: Subject: Re: svn commit: r322875 - head/sys/dev/nvme To: Mark Millard Cc: David Chisnall , Warner Losh , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 12:54:09 -0000 2017-08-25 9:46 GMT+02:00 Mark Millard : > It appears that at least 11.1-STABLE -r322807 does not handle > -std=c++98 styles of use of _Static_assert for g++7 in that > g++7 reports an error: Maybe we need to do something like this? Index: sys/sys/cdefs.h =================================================================== --- sys/sys/cdefs.h (revision 322887) +++ sys/sys/cdefs.h (working copy) @@ -294,7 +294,7 @@ #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_static_assert) #define _Static_assert(x, y) static_assert(x, y) -#elif __GNUC_PREREQ__(4,6) +#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus) /* Nothing, gcc 4.6 and higher has _Static_assert built-in */ #elif defined(__COUNTER__) #define _Static_assert(x, y) __Static_assert(x, __COUNTER__) -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri Aug 25 14:18:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90401DD964D; Fri, 25 Aug 2017 14:18:59 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FDED2C0C; Fri, 25 Aug 2017 14:18:59 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1dlElW-0007Rj-Km; Fri, 25 Aug 2017 16:35:14 +0300 Date: Fri, 25 Aug 2017 16:35:14 +0300 From: Slawa Olhovchenkov To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322863 - head/sys/cam Message-ID: <20170825133514.GA9110@zxy.spb.ru> References: <201708242211.v7OMBAlc012582@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201708242211.v7OMBAlc012582@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 14:18:59 -0000 On Thu, Aug 24, 2017 at 10:11:10PM +0000, Warner Losh wrote: > Author: imp > Date: Thu Aug 24 22:11:10 2017 > New Revision: 322863 > URL: https://svnweb.freebsd.org/changeset/base/322863 > > Log: > Expand the latency tracking array from 1.024s to 8.192s to help track > extreme outliers from dodgy drives. Adjust comments to reflect this, > and make sure that the number of latency buckets match in the two > places where it matters. May be up to 1min? From owner-svn-src-head@freebsd.org Fri Aug 25 14:32:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 507ADDD9C0A; Fri, 25 Aug 2017 14:32:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DBE035C1; Fri, 25 Aug 2017 14:32:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 58C4E10AF07; Fri, 25 Aug 2017 10:32:08 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322824 - in head: lib/clang share/mk usr.bin/clang Date: Thu, 24 Aug 2017 13:32:37 -0700 Message-ID: <55772661.irLqry82cl@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201708232330.v7NNUPpV052276@repo.freebsd.org> References: <201708232330.v7NNUPpV052276@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 25 Aug 2017 10:32:08 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 14:32:16 -0000 On Wednesday, August 23, 2017 11:30:25 PM John Baldwin wrote: > Author: jhb > Date: Wed Aug 23 23:30:25 2017 > New Revision: 322824 > URL: https://svnweb.freebsd.org/changeset/base/322824 > > Log: > Improve the coverage of debug symbols for MK_DEBUG_FILES. > > - Include debug symbols in static libraries. This permits binaries > to include debug symbols for functions obtained from static libraries. > - Permit the C/C++ compiler flags added for MK_DEBUG_FILES to be > overridden by setting DEBUG_FILES_CFLAGS. Use this to limit the debug > information for llvm libraries and binaries. > > Reviewed by: emaste > Sponsored by: DARPA / AFRL > Differential Revision: https://reviews.freebsd.org/D12025 This does increase the size of installed worlds when MK_DEBUG_FILES=yes is enabled (which is the default). On amd64 and mips64 the libraries in /usr/lib and /usr/lib32 each increased by about 150MB to 300MB. The debug info for binaries in /usr/bin (which is stored in /usr/lib/debug/usr/bin) increased another 300MB or so for a total increase of ~900MB. Most of the increase was in llvm binaries (clang, lld, lldb), but the svnlite binaries also have more debug info since previously we were not geneating debug info for private libraries. Without the changes to use -gline-tables-only/-g1 for llvm libraries and binaries the amd64 world increased by almost 4GB with most of that increase in the debug info for clang, lldb, lld, and llvm-tablegen. One thing that might make this less painful in the future is being able to use compressed debug symbols. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Aug 25 14:37:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF776DD9CBD; Fri, 25 Aug 2017 14:37:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4A9B3868; Fri, 25 Aug 2017 14:37:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f41.google.com with SMTP id r9so21939332oie.3; Fri, 25 Aug 2017 07:37:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=pS5TUcgcYhDUB31VwE94MgECbZYUnsi488v+FTt0DyE=; b=C1pzKebWAX4dMNGHymPtxNjGd63tP9jS9ErqcTgQncMpVZZttBp7BTVIU+KqrjaIjm ZnCrmr9gbuTWg5z2M9Twoyv10aibyg8hIDcT5pIX87/z4uNEv3YgMK83ImokgVQlJ23R 8Y5ET1rtyNgCuC29C2NQinEF3LDQTr35WjBjKG7UqgEhdu823MUBKJEVIujpobeefPfk KDVKr8TgMKr3dQ7OOFOfCjYKt7CCu7n/TMifza43xdYOH1wdEryZV1rjORxpT6xJhE6m Wi/fgkKSLpBQLFbENcIyVRTHsW65iaLAqZwqphTUN0eWUAWuivDZZ3+XtPGEDeAt5/jw h+vg== X-Gm-Message-State: AHYfb5jmf67C7glhhVOU2ig/cdRdzrgobYg3QuZrR0F0jMGHFDD9heYA 2Gb3ClLcDxWsz4iyUF0= X-Received: by 10.202.215.66 with SMTP id o63mr14240361oig.176.1503671841121; Fri, 25 Aug 2017 07:37:21 -0700 (PDT) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com. [209.85.214.41]) by smtp.gmail.com with ESMTPSA id z69sm9403940oig.32.2017.08.25.07.37.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Aug 2017 07:37:20 -0700 (PDT) Received: by mail-it0-f41.google.com with SMTP id f1so61352ith.0; Fri, 25 Aug 2017 07:37:20 -0700 (PDT) X-Received: by 10.36.14.216 with SMTP id 207mr2241290ite.151.1503671840683; Fri, 25 Aug 2017 07:37:20 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Fri, 25 Aug 2017 07:37:20 -0700 (PDT) In-Reply-To: <6a5f32b3-a90e-21ef-dfdb-593573bc38e7@FreeBSD.org> References: <201708250315.v7P3FID8036183@repo.freebsd.org> <6a5f32b3-a90e-21ef-dfdb-593573bc38e7@FreeBSD.org> From: Conrad Meyer Date: Fri, 25 Aug 2017 07:37:20 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r322872 - head/sys/dev/nvme To: Andriy Gapon Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 14:37:24 -0000 Yes, it should be 221616 ( https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221616 ). Best, Conrad On Thu, Aug 24, 2017 at 11:38 PM, Andriy Gapon wrote: > On 25/08/2017 06:15, Warner Losh wrote: >> Author: imp >> Date: Fri Aug 25 03:15:18 2017 >> New Revision: 322872 >> URL: https://svnweb.freebsd.org/changeset/base/322872 >> >> Log: >> Enable bus mastering on the device before resetting the device. The >> card has to do PCIe transactions to complete the reset process, but >> can't do them, per the PCIe spec, unless bus mastering is enabled. >> >> Submitted by: Kinjal Patel >> PR: 22166 > > The bug number seems to be incorrect. > >> Modified: >> head/sys/dev/nvme/nvme.c > > > > -- > Andriy Gapon > From owner-svn-src-head@freebsd.org Fri Aug 25 15:12:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A3FCDDA92E for ; Fri, 25 Aug 2017 15:12:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7EB863F71 for ; Fri, 25 Aug 2017 15:12:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22b.google.com with SMTP id f1so444372ith.0 for ; Fri, 25 Aug 2017 08:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=E3xfF4Q2s6msYkkCE1FuFmrVUvuChhx2V/2ZfJvFHq4=; b=YVCmy/ZTBfOo0O2YdHvZ0lqjpdYR/blwvNydjoDTbYcZh++P+BeubBJ3O9HuyImSUj 1pe6wjTaNoWqqBQQ/aLOzGxQw6upomuvW8dtYlB8fbPvXMGyO9t26CbAIO4z6B/8e832 Fasx6d3RIjPfRtz9eHkWkZ7dmDTPpxJH0ymBQecbUMIh3H7fGopfuj5CD3+gUAvLKPfd IiaxAqEJ4Y4GMaX/zLuwIESUWNDjszbBjJiEvRw8w+cTpZk0QV3Rj3getpWt9DGGz+sA mPbVP9WH6BAsgsWIgU1iPfTJ3t6+lQkCfUWDE4T5xm9RMqHKdt1rMBm/2478BEojKgq9 yUaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=E3xfF4Q2s6msYkkCE1FuFmrVUvuChhx2V/2ZfJvFHq4=; b=e7etZ0x8SjBqHVOQ5K8AicGSObG8AxjzLptGYKY6T6ncwkz+hi+sjPKfhQBBT6HzTw C6Np/Ve8AsGNXdvi9eTK88MJclebKgEoJhzL564PmUoSxMS+AYGbzdFyEZBgk9s5bvdx sMuSBiibR6P1++g75AeEfPCNJuFxiawS7UCCro9Izhxf0U571MceUuc0D9K9nTjcTbsb tRISMEqOep09CL8za90Oc3iZN7DZ28ymZZUJXjjIPMm0/dyKFsxHNcKqFmwpCr7M2RVx /EwL1K1K7dENuKKNk8/jqQBnYzbTP2JYnwjdQYn+Pq6PdDsIbLamqlureaGIDRDJzgKF agJw== X-Gm-Message-State: AHYfb5grkdaBTZX9niKX3WGklq9JnVmTP+JAioRmZzp4pDT6d/Wuhcz/ ZrYWoxf+DpLDxOaCrQcluWM8b+yx7pkV X-Received: by 10.36.159.194 with SMTP id c185mr2158592ite.31.1503673961110; Fri, 25 Aug 2017 08:12:41 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Fri, 25 Aug 2017 08:12:40 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:c525:dd46:ae7:666a] In-Reply-To: References: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> From: Warner Losh Date: Fri, 25 Aug 2017 09:12:40 -0600 X-Google-Sender-Auth: _kxfuPSK-xI_oIiFfngz2VSJxlU Message-ID: Subject: Re: svn commit: r322875 - head/sys/dev/nvme To: Ed Schouten Cc: Mark Millard , David Chisnall , Warner Losh , "svn-src-head@freebsd.org" , FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 15:12:42 -0000 On Fri, Aug 25, 2017 at 6:53 AM, Ed Schouten wrote: > 2017-08-25 9:46 GMT+02:00 Mark Millard : > > It appears that at least 11.1-STABLE -r322807 does not handle > > -std=c++98 styles of use of _Static_assert for g++7 in that > > g++7 reports an error: > > Maybe we need to do something like this? > > Index: sys/sys/cdefs.h > =================================================================== > --- sys/sys/cdefs.h (revision 322887) > +++ sys/sys/cdefs.h (working copy) > @@ -294,7 +294,7 @@ > #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ > __has_extension(cxx_static_assert) > #define _Static_assert(x, y) static_assert(x, y) > -#elif __GNUC_PREREQ__(4,6) > +#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus) > /* Nothing, gcc 4.6 and higher has _Static_assert built-in */ > #elif defined(__COUNTER__) > #define _Static_assert(x, y) __Static_assert(x, __COUNTER__) This looks good to my eye, but my level of C++ pedantic knowledge is suboptimal. Warner From owner-svn-src-head@freebsd.org Fri Aug 25 15:31:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61A6BDDB005; Fri, 25 Aug 2017 15:31:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3D6DE648F7; Fri, 25 Aug 2017 15:31:57 +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 v7PFVuNO038247; Fri, 25 Aug 2017 15:31:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PFVtoZ038242; Fri, 25 Aug 2017 15:31:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201708251531.v7PFVtoZ038242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 25 Aug 2017 15:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322893 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 322893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 15:31:57 -0000 Author: asomers Date: Fri Aug 25 15:31:55 2017 New Revision: 322893 URL: https://svnweb.freebsd.org/changeset/base/322893 Log: dd(1): Incorrect casting of arguments dd(1) casts many of its numeric arguments from uintmax_t to intmax_t and back again to detect whether or not the original arguments were negative. This is not correct, and causes problems with boundary cases, for example when count is SSIZE_MAX-1. PR: 191263 Submitted by: will@worrbase.com Reviewed by: pi, asomers MFC after: 3 weeks Modified: head/bin/dd/args.c head/bin/dd/conv.c head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/position.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Fri Aug 25 14:42:11 2017 (r322892) +++ head/bin/dd/args.c Fri Aug 25 15:31:55 2017 (r322893) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -184,7 +185,7 @@ f_bs(char *arg) res = get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "bs must be between 1 and %jd", (intmax_t)SSIZE_MAX); + errx(1, "bs must be between 1 and %zd", SSIZE_MAX); in.dbsz = out.dbsz = (size_t)res; } @@ -195,22 +196,22 @@ f_cbs(char *arg) res = get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "cbs must be between 1 and %jd", (intmax_t)SSIZE_MAX); + errx(1, "cbs must be between 1 and %zd", SSIZE_MAX); cbsz = (size_t)res; } static void f_count(char *arg) { - intmax_t res; + uintmax_t res; - res = (intmax_t)get_num(arg); - if (res < 0) - errx(1, "count cannot be negative"); + res = get_num(arg); + if (res == UINTMAX_MAX) + errc(1, ERANGE, "%s", oper); if (res == 0) - cpy_cnt = (uintmax_t)-1; + cpy_cnt = UINTMAX_MAX; else - cpy_cnt = (uintmax_t)res; + cpy_cnt = res; } static void @@ -219,7 +220,7 @@ f_files(char *arg) files_cnt = get_num(arg); if (files_cnt < 1) - errx(1, "files must be between 1 and %jd", (uintmax_t)-1); + errx(1, "files must be between 1 and %zu", SIZE_MAX); } static void @@ -240,8 +241,8 @@ f_ibs(char *arg) if (!(ddflags & C_BS)) { res = get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "ibs must be between 1 and %jd", - (intmax_t)SSIZE_MAX); + errx(1, "ibs must be between 1 and %zd", + SSIZE_MAX); in.dbsz = (size_t)res; } } @@ -261,8 +262,8 @@ f_obs(char *arg) if (!(ddflags & C_BS)) { res = get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "obs must be between 1 and %jd", - (intmax_t)SSIZE_MAX); + errx(1, "obs must be between 1 and %zd", + SSIZE_MAX); out.dbsz = (size_t)res; } } Modified: head/bin/dd/conv.c ============================================================================== --- head/bin/dd/conv.c Fri Aug 25 14:42:11 2017 (r322892) +++ head/bin/dd/conv.c Fri Aug 25 15:31:55 2017 (r322893) @@ -133,7 +133,7 @@ block(void) */ ch = 0; for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) { - maxlen = MIN(cbsz, in.dbcnt); + maxlen = MIN(cbsz, (size_t)in.dbcnt); if ((t = ctab) != NULL) for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; ++cnt) @@ -146,7 +146,7 @@ block(void) * Check for short record without a newline. Reassemble the * input block. */ - if (ch != '\n' && in.dbcnt < cbsz) { + if (ch != '\n' && (size_t)in.dbcnt < cbsz) { (void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt); break; } @@ -228,7 +228,7 @@ unblock(void) * translation has to already be done or we might not recognize the * spaces. */ - for (inp = in.db; in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { + for (inp = in.db; (size_t)in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t) ; if (t >= inp) { Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Fri Aug 25 14:42:11 2017 (r322892) +++ head/bin/dd/dd.c Fri Aug 25 15:31:55 2017 (r322893) @@ -204,10 +204,10 @@ setup(void) * record oriented I/O, only need a single buffer. */ if (!(ddflags & (C_BLOCK | C_UNBLOCK))) { - if ((in.db = malloc(out.dbsz + in.dbsz - 1)) == NULL) + if ((in.db = malloc((size_t)out.dbsz + in.dbsz - 1)) == NULL) err(1, "input buffer"); out.db = in.db; - } else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL || + } else if ((in.db = malloc(MAX((size_t)in.dbsz, cbsz) + cbsz)) == NULL || (out.db = malloc(out.dbsz + cbsz)) == NULL) err(1, "output buffer"); @@ -405,7 +405,7 @@ dd_in(void) ++st.in_full; /* Handle full input blocks. */ - } else if ((size_t)n == in.dbsz) { + } else if ((size_t)n == (size_t)in.dbsz) { in.dbcnt += in.dbrcnt = n; ++st.in_full; @@ -562,7 +562,7 @@ dd_out(int force) outp += nw; st.bytes += nw; - if ((size_t)nw == n && n == out.dbsz) + if ((size_t)nw == n && n == (size_t)out.dbsz) ++st.out_full; else ++st.out_part; Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Fri Aug 25 14:42:11 2017 (r322892) +++ head/bin/dd/dd.h Fri Aug 25 15:31:55 2017 (r322893) @@ -38,10 +38,9 @@ typedef struct { u_char *db; /* buffer address */ u_char *dbp; /* current buffer I/O address */ - /* XXX ssize_t? */ - size_t dbcnt; /* current buffer byte count */ - size_t dbrcnt; /* last read byte count */ - size_t dbsz; /* block size */ + ssize_t dbcnt; /* current buffer byte count */ + ssize_t dbrcnt; /* last read byte count */ + ssize_t dbsz; /* block size */ #define ISCHR 0x01 /* character device (warn on short) */ #define ISPIPE 0x02 /* pipe-like (see position.c) */ Modified: head/bin/dd/position.c ============================================================================== --- head/bin/dd/position.c Fri Aug 25 14:42:11 2017 (r322892) +++ head/bin/dd/position.c Fri Aug 25 15:31:55 2017 (r322893) @@ -207,7 +207,7 @@ pos_out(void) n = write(out.fd, out.db, out.dbsz); if (n == -1) err(1, "%s", out.name); - if ((size_t)n != out.dbsz) + if (n != out.dbsz) errx(1, "%s: write failure", out.name); } break; From owner-svn-src-head@freebsd.org Fri Aug 25 15:33:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B9B7DDB0B6 for ; Fri, 25 Aug 2017 15:33:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3CAC64BD8 for ; Fri, 25 Aug 2017 15:33:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id 81so400878ioj.5 for ; Fri, 25 Aug 2017 08:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OpLCwuun7XhTtykrkMUD7+TySvKiVlZfX3w9lVxWqYM=; b=gyAM04ViWzXsYZgle6/zxElUb18AqtGbrsskm0g6PSJ4lyUkloXoZq1QGgZpshbBhw Ru+ucmShrBqLR7Ja17rzXVTrGSFavwAzptF5neaWeHuDzuKcRh1nkzIIjg7ku9t/sRGB 9dbLLhh2hp+cHPJjgvH+heRMe2zQXxxqLHstiwbjJ70jacQHQQWUcOJACgDERAqlZ7dW 6BWZjdY7JXxeGwPqg+VRmYTWq/9BE8E+jGt/fi+Hcs8HlWajZtBV6Ui0aYw74UqCGWnP XNfmCR8ODpFiHzpDLTNxR9tB0MEYmqYHPb59ihWivJtGQAR72uuc4EVeULr6nTH8aVE6 ej9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OpLCwuun7XhTtykrkMUD7+TySvKiVlZfX3w9lVxWqYM=; b=molYjQMr8zhiBydAun4d34bI8waBXnbh0VMcl7BQEhsgSZ/CxV3l2XpM5ihXnhQPLp I8sdHyMdWNxwBR3p8G0kdv0bNxWA3qJsxGV5YH6N56ozk3nVhEcYaBH/F6cDsAKiMWZj qSa3kGZxUPEKrOs0+7TBU4tH/E+smSXWSwSxwwQygTfmXeNLgBTkmvIGJiWBsjlobcuD kn4hUCxBLTTKxC//1jmCjbzr+WGzyFBnBRuekgxuDTjy2z8DUv5GbVb1LFl9gUaZeAsm /axogI6yGZb26r9Yfp912I7qeBxYg19yBZeWA8P+c1dz7oYuzSzxxmhEvcU6VF4qHzIL RoUw== X-Gm-Message-State: AHYfb5gbJTCUOXIGyfz34ywTHqelbp5+Ky63EcQkIKEkOdxcXyh4GLpp NgxT7EKq3oYiOAjEm7vbmXNNx5MkDtv8 X-Received: by 10.107.131.219 with SMTP id n88mr8422310ioi.277.1503675216055; Fri, 25 Aug 2017 08:33:36 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Fri, 25 Aug 2017 08:33:35 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:c525:dd46:ae7:666a] In-Reply-To: <20170825133514.GA9110@zxy.spb.ru> References: <201708242211.v7OMBAlc012582@repo.freebsd.org> <20170825133514.GA9110@zxy.spb.ru> From: Warner Losh Date: Fri, 25 Aug 2017 09:33:35 -0600 X-Google-Sender-Auth: WEKr287hH-ZVi84qbMSZvcplTSA Message-ID: Subject: Re: svn commit: r322863 - head/sys/cam To: Slawa Olhovchenkov Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 15:33:37 -0000 On Fri, Aug 25, 2017 at 7:35 AM, Slawa Olhovchenkov wrote: > On Thu, Aug 24, 2017 at 10:11:10PM +0000, Warner Losh wrote: > > > Author: imp > > Date: Thu Aug 24 22:11:10 2017 > > New Revision: 322863 > > URL: https://svnweb.freebsd.org/changeset/base/322863 > > > > Log: > > Expand the latency tracking array from 1.024s to 8.192s to help track > > extreme outliers from dodgy drives. Adjust comments to reflect this, > > and make sure that the number of latency buckets match in the two > > places where it matters. > > May be up to 1min? > I'm not sure what additional data you'll get between "totally sucks, at least 8s latency" and "totally sucks, at least 32s." or "totally sucks, at least 64s" though the latter isn't possible with the default timeouts... I'm planning on adding a 'max' latency that's self-resetting instead of expanding the bucket upwards. I'm also contemplating expanding it down to 100us or even 10us since nda serves nvme drives which easily can be sub 100us. Warner From owner-svn-src-head@freebsd.org Fri Aug 25 15:38:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DCBCDDB2C7 for ; Fri, 25 Aug 2017 15:38:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61AA864EEE for ; Fri, 25 Aug 2017 15:38:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id g33so524755ioj.3 for ; Fri, 25 Aug 2017 08:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=QhitrVPRxNWwtnqgmU2UhIgNQ+GMlTvPPZzoE2FqFu0=; b=DvYRXKF1CDWhZs7TNl4pQF368N4DL4Gbp3LFflA8dslXdYxf98TjOPDTOmpiTQ4jes TUdRZOjBxfOUlm9uvdOB6MBVx8+Vaykvm8A82csn/tzZwW1ktaxDdcYFLVPWV7eEbeK1 hoclBOyQsEwmyP65y0iuqDcxOu6GHwuZ4HQ4fdylp30o4Przz1FIMCUQ6FmtwtvGRdF5 FZqX8CxiOs5puJRGa4AKdg0q6IRJKMuZ91X7IzAtI99VpXDO21njuLNODN06Q0H7cya5 rngl0Jyj03gJDR28fPbzODxeAUujpNMb+0MtcaFszEuqBSPNHFMorvSEaWDHeZLf0Z5r ugXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=QhitrVPRxNWwtnqgmU2UhIgNQ+GMlTvPPZzoE2FqFu0=; b=SfJ2wyDzsJOxflVCa6OduooiyTooosADcNKjiOhug4KeeAZWgfrqKOPIiyf5zxFXqq 0iPXF5XwijTUKsO1Wa8nSRpEjCiwpJExHduXcjzw2FrX9ieh06o+YLmJ9Rn8FYg1mqNM erjqH/7XD2IwzZVhhYy0U3yGS2ANqLO/Q54d9lMv6X2Yqugf3+ZcU4wyDGtRpQA+l/yY EvJxJnxA+UonTaW8AnHOk8XIp9Zpo5MD6+6RtvU/F6H9D49E8UkO8rSeQnHVS68+flJm HRvSVr/hEcNYYTZbaJ1sPgCQ58wrRVzLaz96uF4bo+3k8mOLYLock78pHm8VY7OPeaTn gHgQ== X-Gm-Message-State: AHYfb5jyiIn2OLJ/DrRdEyegyIlpa7s4CDgU14o6HtJRZkqjyWdDB9rH kCOYEXlAiDx/b1/HwkEq7ULZsON/ii3v X-Received: by 10.107.161.7 with SMTP id k7mr5469483ioe.189.1503675527837; Fri, 25 Aug 2017 08:38:47 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Fri, 25 Aug 2017 08:38:47 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:c525:dd46:ae7:666a] In-Reply-To: References: <201708250315.v7P3FID8036183@repo.freebsd.org> <6a5f32b3-a90e-21ef-dfdb-593573bc38e7@FreeBSD.org> From: Warner Losh Date: Fri, 25 Aug 2017 09:38:47 -0600 X-Google-Sender-Auth: 1FLgn7jwfGY55gLHCfBjjVs5JbA Message-ID: Subject: Re: svn commit: r322872 - head/sys/dev/nvme To: "Conrad E. Meyer" Cc: Andriy Gapon , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 15:38:48 -0000 On Fri, Aug 25, 2017 at 8:37 AM, Conrad Meyer wrote: > Yes, it should be 221616 ( > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221616 ). > It was a transcription error. I'd already added the commit message to 221616. I'll close it when I MFC it. Warner > Best, > Conrad > > On Thu, Aug 24, 2017 at 11:38 PM, Andriy Gapon wrote: > > On 25/08/2017 06:15, Warner Losh wrote: > >> Author: imp > >> Date: Fri Aug 25 03:15:18 2017 > >> New Revision: 322872 > >> URL: https://svnweb.freebsd.org/changeset/base/322872 > >> > >> Log: > >> Enable bus mastering on the device before resetting the device. The > >> card has to do PCIe transactions to complete the reset process, but > >> can't do them, per the PCIe spec, unless bus mastering is enabled. > >> > >> Submitted by: Kinjal Patel > >> PR: 22166 > > > > The bug number seems to be incorrect. > > > >> Modified: > >> head/sys/dev/nvme/nvme.c > > > > > > > > -- > > Andriy Gapon > > > > From owner-svn-src-head@freebsd.org Fri Aug 25 15:46:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94976DDB5AA; Fri, 25 Aug 2017 15:46:30 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 494ED6542F; Fri, 25 Aug 2017 15:46:30 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1dlGoV-0008Cf-0Y; Fri, 25 Aug 2017 18:46:27 +0300 Date: Fri, 25 Aug 2017 18:46:26 +0300 From: Slawa Olhovchenkov To: Warner Losh Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r322863 - head/sys/cam Message-ID: <20170825154626.GK9097@zxy.spb.ru> References: <201708242211.v7OMBAlc012582@repo.freebsd.org> <20170825133514.GA9110@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 15:46:30 -0000 On Fri, Aug 25, 2017 at 09:33:35AM -0600, Warner Losh wrote: > On Fri, Aug 25, 2017 at 7:35 AM, Slawa Olhovchenkov wrote: > > > On Thu, Aug 24, 2017 at 10:11:10PM +0000, Warner Losh wrote: > > > > > Author: imp > > > Date: Thu Aug 24 22:11:10 2017 > > > New Revision: 322863 > > > URL: https://svnweb.freebsd.org/changeset/base/322863 > > > > > > Log: > > > Expand the latency tracking array from 1.024s to 8.192s to help track > > > extreme outliers from dodgy drives. Adjust comments to reflect this, > > > and make sure that the number of latency buckets match in the two > > > places where it matters. > > > > May be up to 1min? > > > > I'm not sure what additional data you'll get between "totally sucks, at > least 8s latency" and "totally sucks, at least 32s." or "totally sucks, at > least 64s" though the latter isn't possible with the default timeouts... > > I'm planning on adding a 'max' latency that's self-resetting instead of > expanding the bucket upwards. I'm also contemplating expanding it down to > 100us or even 10us since nda serves nvme drives which easily can be sub > 100us. This is just stat data? Don't produce error messages about timeout commands and etc? From owner-svn-src-head@freebsd.org Fri Aug 25 15:47:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90E77DDB61F for ; Fri, 25 Aug 2017 15:47:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54C386559C for ; Fri, 25 Aug 2017 15:47:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22b.google.com with SMTP id n5so1010887itb.1 for ; Fri, 25 Aug 2017 08:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9sEQRn4N+eOQd3gz3T21FtdfVQriECvlprpkX+P8Sno=; b=Zh9I2tpTLeDed4UU6aPy8lE36DanywADnEwwD19g7cp0Bx6uuQhExrBf1qlqZdNvF5 8nxac469LNg0qyvhy45eUpfdgAFxINui3NWkbWFpLNVM1S5y3rVGSUj5POdoplFPJdfV uTDEyhTWcMSgQ/VOlQsWIANn1N81EMoP6yOGS1C3e2/vBl7L1k997rhnw6gFivIM4SUK FeHAXXErpa174AbPpt2c55pU5o8epwQc1pVJezR3Ngl2Wf/n0Q8aeA+3gCqOq7rm0Opb f8HmzwN5UNqggw4hfRUmWwaz+/JiTkkZdhuvSX8U8sxog+DDNneTNBD7zK+8mauR98Z0 shKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9sEQRn4N+eOQd3gz3T21FtdfVQriECvlprpkX+P8Sno=; b=Wc+GvIfg3OpMwdknvyvddHOzNwiUT9HGiToCSGXSoj4WrLGkWxzLrPhazkACwZlcDq SOQ4JLI/wWOd/YnCyTELVoqXtgosCb0aCaJvIrGz28LPBYWG8if7lesg+SGhYVVIND0D Qohyvf1IonlV9grvxPbNVrqhanNj9u2a8Lw4SqV0SxLQrK578PU8PRsyB1YxznfU/sGa 6erVboAHARZuWiOsxy/hKBJ1fx599e1ifryuV6JZZjBAnumcs/CUbeC+dqv7U3ZFr3J5 ELQ4PLEI/xRGcArgfYoOq0BWs0BoTLwBGIMUL10HIIdDuZffC/7IlUYzBssQRQRpGkbr +VVA== X-Gm-Message-State: AHYfb5hc64tCkUdQgedzOAp/luErHOQHAPYqjqTmyxdSZ4ElHPphPDyT hWThXITkwGYt6IlLMDBLhn9aaE/jPZ0P X-Received: by 10.36.159.194 with SMTP id c185mr2254656ite.31.1503676052791; Fri, 25 Aug 2017 08:47:32 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Fri, 25 Aug 2017 08:47:32 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:c525:dd46:ae7:666a] In-Reply-To: <20170825154626.GK9097@zxy.spb.ru> References: <201708242211.v7OMBAlc012582@repo.freebsd.org> <20170825133514.GA9110@zxy.spb.ru> <20170825154626.GK9097@zxy.spb.ru> From: Warner Losh Date: Fri, 25 Aug 2017 09:47:32 -0600 X-Google-Sender-Auth: 4W4H6abTuAG0NMtFhlTydC54P9o Message-ID: Subject: Re: svn commit: r322863 - head/sys/cam To: Slawa Olhovchenkov Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 15:47:33 -0000 On Fri, Aug 25, 2017 at 9:46 AM, Slawa Olhovchenkov wrote: > On Fri, Aug 25, 2017 at 09:33:35AM -0600, Warner Losh wrote: > > > On Fri, Aug 25, 2017 at 7:35 AM, Slawa Olhovchenkov > wrote: > > > > > On Thu, Aug 24, 2017 at 10:11:10PM +0000, Warner Losh wrote: > > > > > > > Author: imp > > > > Date: Thu Aug 24 22:11:10 2017 > > > > New Revision: 322863 > > > > URL: https://svnweb.freebsd.org/changeset/base/322863 > > > > > > > > Log: > > > > Expand the latency tracking array from 1.024s to 8.192s to help > track > > > > extreme outliers from dodgy drives. Adjust comments to reflect > this, > > > > and make sure that the number of latency buckets match in the two > > > > places where it matters. > > > > > > May be up to 1min? > > > > > > > I'm not sure what additional data you'll get between "totally sucks, at > > least 8s latency" and "totally sucks, at least 32s." or "totally sucks, > at > > least 64s" though the latter isn't possible with the default timeouts... > > > > I'm planning on adding a 'max' latency that's self-resetting instead of > > expanding the bucket upwards. I'm also contemplating expanding it down to > > 100us or even 10us since nda serves nvme drives which easily can be sub > > 100us. > > This is just stat data? > Don't produce error messages about timeout commands and etc? > This is 100% stats. There's no error messages produced. Warner From owner-svn-src-head@freebsd.org Fri Aug 25 16:10:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCDBEDDBE57; Fri, 25 Aug 2017 16:10:17 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9770F66015; Fri, 25 Aug 2017 16:10:17 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PGAGMn051555; Fri, 25 Aug 2017 16:10:16 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PGAGJ9051554; Fri, 25 Aug 2017 16:10:16 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201708251610.v7PGAGJ9051554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Fri, 25 Aug 2017 16:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322894 - head/usr.sbin/makefs X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/usr.sbin/makefs X-SVN-Commit-Revision: 322894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 16:10:17 -0000 Author: benno Date: Fri Aug 25 16:10:16 2017 New Revision: 322894 URL: https://svnweb.freebsd.org/changeset/base/322894 Log: Replace makefs' hand-rolled unescaping with strunvis mtree path names and link attributes are encoded, generally using strvis. Newer versions of mtree will use C-style escapes but previously the accepted form was octal escapes. makefs' mtree code spots the C-style escapes but fails to deal with octal escapes correctly. Remove mtree's escape-decoding code (except for a few instances where it's needed) and instead pass pathnames and link targets through strunvis prior to use. Reviewed by: marcel MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12104 Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Fri Aug 25 15:31:55 2017 (r322893) +++ head/usr.sbin/makefs/mtree.c Fri Aug 25 16:10:16 2017 (r322894) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "makefs.h" @@ -355,8 +356,6 @@ read_word(FILE *fp, char *buf, size_t bufsz) break; case '\\': esc++; - if (esc == 1) - continue; break; case '`': case '\'': @@ -401,34 +400,10 @@ read_word(FILE *fp, char *buf, size_t bufsz) fi->line++; } break; - case 'a': + default: if (esc) - c = '\a'; + buf[idx++] = '\\'; break; - case 'b': - if (esc) - c = '\b'; - break; - case 'f': - if (esc) - c = '\f'; - break; - case 'n': - if (esc) - c = '\n'; - break; - case 'r': - if (esc) - c = '\r'; - break; - case 't': - if (esc) - c = '\t'; - break; - case 'v': - if (esc) - c = '\v'; - break; } buf[idx++] = c; esc = 0; @@ -591,7 +566,15 @@ read_mtree_keywords(FILE *fp, fsnode *node) error = ENOATTR; break; } - node->symlink = estrdup(value); + node->symlink = emalloc(strlen(value) + 1); + if (node->symlink == NULL) { + error = errno; + break; + } + if (strunvis(node->symlink, value) < 0) { + error = errno; + break; + } } else error = ENOSYS; break; @@ -971,13 +954,18 @@ read_mtree_spec1(FILE *fp, bool def, const char *name) static int read_mtree_spec(FILE *fp) { - char pathspec[PATH_MAX]; + char pathspec[PATH_MAX], pathtmp[4*PATH_MAX + 1]; char *cp; int error; - error = read_word(fp, pathspec, sizeof(pathspec)); + error = read_word(fp, pathtmp, sizeof(pathtmp)); if (error) goto out; + if (strnunvis(pathspec, PATH_MAX, pathtmp) == -1) { + error = errno; + goto out; + } + error = 0; cp = strchr(pathspec, '/'); if (cp != NULL) { From owner-svn-src-head@freebsd.org Fri Aug 25 16:38:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C9D8DDC395; Fri, 25 Aug 2017 16:38:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id DBA7066BA1; Fri, 25 Aug 2017 16:38:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PGcLsk063463; Fri, 25 Aug 2017 16:38:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PGcLR0063459; Fri, 25 Aug 2017 16:38:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201708251638.v7PGcLR0063459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 25 Aug 2017 16:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322895 - in head/lib/libc: gen tests/gen X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/lib/libc: gen tests/gen X-SVN-Commit-Revision: 322895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 16:38:23 -0000 Author: cem Date: Fri Aug 25 16:38:21 2017 New Revision: 322895 URL: https://svnweb.freebsd.org/changeset/base/322895 Log: getmntinfo(3): Scale faster, and return sooner getmntinfo(3) is designed around a relatively static or slow growing set of current mounts. It tried to detect a race with somewhat concurrent mount and re-call getfsstat(2) in that case, looping indefinitely. It also allocated space for a single extra mount as slop. In the case where the user has a large number of mounts and is adding them at a rapid pace, it fell over. This patch makes two functional changes: 1. Allocate even more slop. Double whatever the last getfsstat(2) returned. 2. Abort and return some known results after looping a few times (arbitrarily, 3). If the list is constantly changing, we can't guarantee we return a full result to the user at any point anyways. While here, add very basic functional tests for getmntinfo(3) to the libc suite. PR: 221743 Submitted by: Peter Eriksson (earlier version) Sponsored by: Dell EMC Isilon Added: head/lib/libc/tests/gen/getmntinfo_test.c (contents, props changed) Modified: head/lib/libc/gen/getmntinfo.c head/lib/libc/tests/gen/Makefile Modified: head/lib/libc/gen/getmntinfo.c ============================================================================== --- head/lib/libc/gen/getmntinfo.c Fri Aug 25 16:10:16 2017 (r322894) +++ head/lib/libc/gen/getmntinfo.c Fri Aug 25 16:38:21 2017 (r322895) @@ -38,6 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include +#define MAX_TRIES 3 +#define SCALING_FACTOR 2 + /* * Return information about mounted filesystems. */ @@ -47,20 +50,21 @@ getmntinfo(struct statfs **mntbufp, int mode) static struct statfs *mntbuf; static int mntsize; static long bufsize; + unsigned tries = 0; if (mntsize <= 0 && (mntsize = getfsstat(0, 0, MNT_NOWAIT)) < 0) return (0); if (bufsize > 0 && (mntsize = getfsstat(mntbuf, bufsize, mode)) < 0) return (0); - while (bufsize <= mntsize * sizeof(struct statfs)) { - if (mntbuf) - free(mntbuf); - bufsize = (mntsize + 1) * sizeof(struct statfs); - if ((mntbuf = malloc(bufsize)) == NULL) + while (tries++ < MAX_TRIES && bufsize <= mntsize * sizeof(*mntbuf)) { + bufsize = (mntsize * SCALING_FACTOR) * sizeof(*mntbuf); + if ((mntbuf = reallocf(mntbuf, bufsize)) == NULL) return (0); if ((mntsize = getfsstat(mntbuf, bufsize, mode)) < 0) return (0); } *mntbufp = mntbuf; + if (mntsize > (bufsize / sizeof(*mntbuf))) + return (bufsize / sizeof(*mntbuf)); return (mntsize); } Modified: head/lib/libc/tests/gen/Makefile ============================================================================== --- head/lib/libc/tests/gen/Makefile Fri Aug 25 16:10:16 2017 (r322894) +++ head/lib/libc/tests/gen/Makefile Fri Aug 25 16:38:21 2017 (r322895) @@ -8,6 +8,7 @@ ATF_TESTS_C+= fmtmsg_test ATF_TESTS_C+= fnmatch2_test ATF_TESTS_C+= fpclassify2_test ATF_TESTS_C+= ftw_test +ATF_TESTS_C+= getmntinfo_test ATF_TESTS_C+= glob2_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test Added: head/lib/libc/tests/gen/getmntinfo_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/gen/getmntinfo_test.c Fri Aug 25 16:38:21 2017 (r322895) @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2017 Conrad Meyer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Limited test program for getmntinfo(3), a non-standard BSDism. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include + +static void +check_mntinfo(struct statfs *mntinfo, int n) +{ + int i; + + for (i = 0; i < n; i++) { + ATF_REQUIRE_MSG(mntinfo[i].f_version == STATFS_VERSION, "%ju", + (uintmax_t)mntinfo[i].f_version); + ATF_REQUIRE(mntinfo[i].f_namemax <= sizeof(mntinfo[0].f_mntonname)); + } +} + +ATF_TC_WITHOUT_HEAD(getmntinfo_test); +ATF_TC_BODY(getmntinfo_test, tc) +{ + int nmnts; + struct statfs *mntinfo; + + /* Test bogus mode */ + nmnts = getmntinfo(&mntinfo, 199); + ATF_REQUIRE_MSG(nmnts == 0 && errno == EINVAL, + "getmntinfo() succeeded; errno=%d", errno); + + /* Valid modes */ + nmnts = getmntinfo(&mntinfo, MNT_NOWAIT); + ATF_REQUIRE_MSG(nmnts != 0, "getmntinfo(MNT_NOWAIT) failed; errno=%d", + errno); + + check_mntinfo(mntinfo, nmnts); + memset(mntinfo, 0xdf, sizeof(*mntinfo) * nmnts); + + nmnts = getmntinfo(&mntinfo, MNT_WAIT); + ATF_REQUIRE_MSG(nmnts != 0, "getmntinfo(MNT_WAIT) failed; errno=%d", + errno); + + check_mntinfo(mntinfo, nmnts); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, getmntinfo_test); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Fri Aug 25 16:59:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58195DDC944; Fri, 25 Aug 2017 16:59:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25F6E6746A; Fri, 25 Aug 2017 16:59:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f46.google.com with SMTP id t88so3587713oij.0; Fri, 25 Aug 2017 09:59:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=JYFhYqx7M+lzb87tucfkmAzJ096mIIgo3MQDZuIQSAs=; b=Og4lgCSLDtHmsxu+Dfj6cK1dYekheADkm+p91/noSHkBPN+GmTznGpmeO2jG+uHsf0 OV8hc8WsS7XqJfsVoXVgOPXhMKTxD76UABOHA4NnX5JRbD2lE2eJjspCzNyGntcCpkEO oCg89+XVc6drBO6jxq1ojN/nd1GDUIbtXZ+42NYMpIPo3C766IhGk9B8D8ISkhoL+xUA 1BSgw9c5DXuiDJcaBjahafY2OI7EtDoIgdl2ZPmMEEc/xoIXKqF4Wea7cj4G/JNE8eur NlAgw6ivNb4pXrVOhwDbO34n/Rf9gjl8pltoDCDT6Fy4YvQz+hiaEoetjQQUO5yQkNa4 gItQ== X-Gm-Message-State: AHYfb5g9y2dnm05tdvGsbqSQv8DXyKQas07aX1F+RNge5f3aIZNWgzZK tiq+2q+AurdvHUN9hww= X-Received: by 10.202.212.210 with SMTP id l201mr15831348oig.180.1503680380076; Fri, 25 Aug 2017 09:59:40 -0700 (PDT) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.gmail.com with ESMTPSA id n203sm6766191oia.15.2017.08.25.09.59.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Aug 2017 09:59:39 -0700 (PDT) Received: by mail-io0-f172.google.com with SMTP id 81so1177168ioj.5; Fri, 25 Aug 2017 09:59:39 -0700 (PDT) X-Received: by 10.107.38.206 with SMTP id m197mr10094937iom.157.1503680378902; Fri, 25 Aug 2017 09:59:38 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Fri, 25 Aug 2017 09:59:38 -0700 (PDT) In-Reply-To: <201708251531.v7PFVtoZ038242@repo.freebsd.org> References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> From: Conrad Meyer Date: Fri, 25 Aug 2017 09:59:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r322893 - head/bin/dd To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 16:59:47 -0000 Hi Alan, By any chance did you test this change with /dev/kmem and kernel addresses ("negative" off_t values)? Thanks, Conrad On Fri, Aug 25, 2017 at 8:31 AM, Alan Somers wrote: > Author: asomers > Date: Fri Aug 25 15:31:55 2017 > New Revision: 322893 > URL: https://svnweb.freebsd.org/changeset/base/322893 > > Log: > dd(1): Incorrect casting of arguments > > dd(1) casts many of its numeric arguments from uintmax_t to intmax_t and > back again to detect whether or not the original arguments were negative. > This is not correct, and causes problems with boundary cases, for example > when count is SSIZE_MAX-1. > > PR: 191263 > Submitted by: will@worrbase.com > Reviewed by: pi, asomers > MFC after: 3 weeks From owner-svn-src-head@freebsd.org Fri Aug 25 17:08:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA37BDDCDC9; Fri, 25 Aug 2017 17:08:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EF80679AA; Fri, 25 Aug 2017 17:08:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id b79so2676809wmb.1; Fri, 25 Aug 2017 10:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=g5c9jkD+5HY9UrIvhuT6iCSs/AKFc+He2zzlreCKDyg=; b=aqOeCEXq/MHhSv4LMeNCnx1Gs0jCzAUI+cuk7WBvj0PBCiasTN/NtKwwYNbJnh9kSK 4LJcZ+++JDr+Ox9vcjzHs8YtY5gIzlBb/isHRGlnd8YpaXOVEMbBiFFl9x5DLdh+9tj2 rA+yfTMsg03qQe2xnXuuyeVo97PpE5Ywv5IHVOjVTcG/GW+cmzAhA7M3OaY9j2fvwBdn /wmK5cnyIEx8cf46jp1KZ5lwA7O1pmjn1v8KRfAob5CR0bye1zcHE+mkwwiASODNqYQk Bt/LhYscUGdsI7m73VMg7ZuO9a1/zO2D8vMTRarWjkj4Zkj/zzbfWg3wg/81tCMG2TH6 pZ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=g5c9jkD+5HY9UrIvhuT6iCSs/AKFc+He2zzlreCKDyg=; b=VSkjy4idFkM4oc58Uiu/dEv3GtKfEvVoFpfftwVkDzL/Rp/RjNDt7E9YEPy/ucQL8m TsVgUCz8TQTTP0xcNvB5XtCW7XwGpQK6l4+RcRvPKXZk+usLEuTgy7NiUGRsyY6pIWYE OdDN2xpVWMai3Dn3D5urFqkEXJOFZYmGOoHNoV3hv/SY1flLd8LDO+M1uQne3wkUTQXB RyH3ZUv6YYl4+EdLHKjYT91TSzezs9fshQWC636BDTp8djDk8jKjcHuBVzAOJ1gGbrVo VJ5RISTXd92Vkq7O6Xd7PKR2Iuw6w+hWpFSKx+zW6EcHGukwOOrLhIfwHOvsb4C9D3S9 /fYQ== X-Gm-Message-State: AHYfb5gGBgmVjkXITer22XlYfmI7pQXCrz9vKqYZB+qZ+b1Ikat8xRCZ DayCeIoy5ceILYUtEvRQ4AMy/KNlyQ== X-Received: by 10.28.5.136 with SMTP id 130mr76294wmf.4.1503680890633; Fri, 25 Aug 2017 10:08:10 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.28.56.194 with HTTP; Fri, 25 Aug 2017 10:08:09 -0700 (PDT) In-Reply-To: References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> From: Alan Somers Date: Fri, 25 Aug 2017 11:08:09 -0600 X-Google-Sender-Auth: _v9iRRzwXzMPNb7t-_-8x4TWcqc Message-ID: Subject: Re: svn commit: r322893 - head/bin/dd To: "Conrad E. Meyer" Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 17:08:13 -0000 Nope. Do you mean negative offsets for the iseek argument? I didn't know you could do that. On Fri, Aug 25, 2017 at 10:59 AM, Conrad Meyer wrote: > Hi Alan, > > By any chance did you test this change with /dev/kmem and kernel > addresses ("negative" off_t values)? > > Thanks, > Conrad > > On Fri, Aug 25, 2017 at 8:31 AM, Alan Somers wrote: >> Author: asomers >> Date: Fri Aug 25 15:31:55 2017 >> New Revision: 322893 >> URL: https://svnweb.freebsd.org/changeset/base/322893 >> >> Log: >> dd(1): Incorrect casting of arguments >> >> dd(1) casts many of its numeric arguments from uintmax_t to intmax_t and >> back again to detect whether or not the original arguments were negative. >> This is not correct, and causes problems with boundary cases, for example >> when count is SSIZE_MAX-1. >> >> PR: 191263 >> Submitted by: will@worrbase.com >> Reviewed by: pi, asomers >> MFC after: 3 weeks From owner-svn-src-head@freebsd.org Fri Aug 25 17:18:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 353B1DDD048; Fri, 25 Aug 2017 17:18:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0265C67E4F; Fri, 25 Aug 2017 17:18:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f44.google.com with SMTP id j144so3917646oib.1; Fri, 25 Aug 2017 10:18:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=L93maoUCuCS8ZcVHvQ32sc3RpCX2tYz4obaitLTRO0Q=; b=fKDrp1+1VBiHFLHSlHDwbnrLa+2V15JehdAXMKfUrkKWZqP/9F7nGVmlNHXJGWHwpT 2Bv+J1aYfqhzQJ5QwKS1ClpE75+kgW18BDLQVoq0u9n8+JumklPOqvQ5T5p5dH6wxSwV eUVTPm3G552eKDv/f7NaDhN/L8+cpTEb1DStoY56pp5n+gBtDGyRxiOEEKOXU7Pr5oKy HTgbZGNxtZrmWJ6DymlD8T2CvpoRFC5+yhPDHi1auBKRczFhB44XcivPmh1cOVsMagv8 re8S7OdD0breevIsbiXobakvp/mSfosMyWEOe1YaBjQaFMV9GB6KLdJJsoa9hsFXkSCU SAVQ== X-Gm-Message-State: AHYfb5iBkUGIvK8VE+xvnnvOlCHNEYntqhBRcZNflwnbB0xQiuhDDnyv qabIiX0ONtCqAmJKDHA= X-Received: by 10.202.252.199 with SMTP id a190mr14663900oii.268.1503681479301; Fri, 25 Aug 2017 10:17:59 -0700 (PDT) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com. [209.85.214.47]) by smtp.gmail.com with ESMTPSA id e206sm6292062oig.50.2017.08.25.10.17.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Aug 2017 10:17:59 -0700 (PDT) Received: by mail-it0-f47.google.com with SMTP id 77so2194119itj.0; Fri, 25 Aug 2017 10:17:59 -0700 (PDT) X-Received: by 10.36.14.216 with SMTP id 207mr127403ite.151.1503681478707; Fri, 25 Aug 2017 10:17:58 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Fri, 25 Aug 2017 10:17:58 -0700 (PDT) In-Reply-To: <201708251531.v7PFVtoZ038242@repo.freebsd.org> References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> From: Conrad Meyer Date: Fri, 25 Aug 2017 10:17:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r322893 - head/bin/dd To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 17:18:07 -0000 This change seems to break buildworld on MIPS: /home/cem/head.svn/bin/dd/args.c: In function 'f_bs': /home/cem/head.svn/bin/dd/args.c:188: warning: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' /home/cem/head.svn/bin/dd/args.c: In function 'f_cbs': /home/cem/head.svn/bin/dd/args.c:199: warning: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' /home/cem/head.svn/bin/dd/args.c: In function 'f_ibs': /home/cem/head.svn/bin/dd/args.c:245: warning: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' /home/cem/head.svn/bin/dd/args.c: In function 'f_obs': /home/cem/head.svn/bin/dd/args.c:266: warning: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' (Yes, it's odd that the SSIZE_MAX constant has 'long' type.) Best, Conrad On Fri, Aug 25, 2017 at 8:31 AM, Alan Somers wrote: > Author: asomers > Date: Fri Aug 25 15:31:55 2017 > New Revision: 322893 > URL: https://svnweb.freebsd.org/changeset/base/322893 > > Log: > dd(1): Incorrect casting of arguments > > dd(1) casts many of its numeric arguments from uintmax_t to intmax_t and > back again to detect whether or not the original arguments were negative. > This is not correct, and causes problems with boundary cases, for example > when count is SSIZE_MAX-1. > > PR: 191263 > Submitted by: will@worrbase.com > Reviewed by: pi, asomers > MFC after: 3 weeks > > Modified: > head/bin/dd/args.c > head/bin/dd/conv.c > head/bin/dd/dd.c > head/bin/dd/dd.h > head/bin/dd/position.c > > Modified: head/bin/dd/args.c > ============================================================================== > --- head/bin/dd/args.c Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/args.c Fri Aug 25 15:31:55 2017 (r322893) > @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); > > #include > > +#include > #include > #include > #include > @@ -184,7 +185,7 @@ f_bs(char *arg) > > res = get_num(arg); > if (res < 1 || res > SSIZE_MAX) > - errx(1, "bs must be between 1 and %jd", (intmax_t)SSIZE_MAX); > + errx(1, "bs must be between 1 and %zd", SSIZE_MAX); > in.dbsz = out.dbsz = (size_t)res; > } > > @@ -195,22 +196,22 @@ f_cbs(char *arg) > > res = get_num(arg); > if (res < 1 || res > SSIZE_MAX) > - errx(1, "cbs must be between 1 and %jd", (intmax_t)SSIZE_MAX); > + errx(1, "cbs must be between 1 and %zd", SSIZE_MAX); > cbsz = (size_t)res; > } > > static void > f_count(char *arg) > { > - intmax_t res; > + uintmax_t res; > > - res = (intmax_t)get_num(arg); > - if (res < 0) > - errx(1, "count cannot be negative"); > + res = get_num(arg); > + if (res == UINTMAX_MAX) > + errc(1, ERANGE, "%s", oper); > if (res == 0) > - cpy_cnt = (uintmax_t)-1; > + cpy_cnt = UINTMAX_MAX; > else > - cpy_cnt = (uintmax_t)res; > + cpy_cnt = res; > } > > static void > @@ -219,7 +220,7 @@ f_files(char *arg) > > files_cnt = get_num(arg); > if (files_cnt < 1) > - errx(1, "files must be between 1 and %jd", (uintmax_t)-1); > + errx(1, "files must be between 1 and %zu", SIZE_MAX); > } > > static void > @@ -240,8 +241,8 @@ f_ibs(char *arg) > if (!(ddflags & C_BS)) { > res = get_num(arg); > if (res < 1 || res > SSIZE_MAX) > - errx(1, "ibs must be between 1 and %jd", > - (intmax_t)SSIZE_MAX); > + errx(1, "ibs must be between 1 and %zd", > + SSIZE_MAX); > in.dbsz = (size_t)res; > } > } > @@ -261,8 +262,8 @@ f_obs(char *arg) > if (!(ddflags & C_BS)) { > res = get_num(arg); > if (res < 1 || res > SSIZE_MAX) > - errx(1, "obs must be between 1 and %jd", > - (intmax_t)SSIZE_MAX); > + errx(1, "obs must be between 1 and %zd", > + SSIZE_MAX); > out.dbsz = (size_t)res; > } > } > > Modified: head/bin/dd/conv.c > ============================================================================== > --- head/bin/dd/conv.c Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/conv.c Fri Aug 25 15:31:55 2017 (r322893) > @@ -133,7 +133,7 @@ block(void) > */ > ch = 0; > for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) { > - maxlen = MIN(cbsz, in.dbcnt); > + maxlen = MIN(cbsz, (size_t)in.dbcnt); > if ((t = ctab) != NULL) > for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; > ++cnt) > @@ -146,7 +146,7 @@ block(void) > * Check for short record without a newline. Reassemble the > * input block. > */ > - if (ch != '\n' && in.dbcnt < cbsz) { > + if (ch != '\n' && (size_t)in.dbcnt < cbsz) { > (void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt); > break; > } > @@ -228,7 +228,7 @@ unblock(void) > * translation has to already be done or we might not recognize the > * spaces. > */ > - for (inp = in.db; in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { > + for (inp = in.db; (size_t)in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { > for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t) > ; > if (t >= inp) { > > Modified: head/bin/dd/dd.c > ============================================================================== > --- head/bin/dd/dd.c Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/dd.c Fri Aug 25 15:31:55 2017 (r322893) > @@ -204,10 +204,10 @@ setup(void) > * record oriented I/O, only need a single buffer. > */ > if (!(ddflags & (C_BLOCK | C_UNBLOCK))) { > - if ((in.db = malloc(out.dbsz + in.dbsz - 1)) == NULL) > + if ((in.db = malloc((size_t)out.dbsz + in.dbsz - 1)) == NULL) > err(1, "input buffer"); > out.db = in.db; > - } else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL || > + } else if ((in.db = malloc(MAX((size_t)in.dbsz, cbsz) + cbsz)) == NULL || > (out.db = malloc(out.dbsz + cbsz)) == NULL) > err(1, "output buffer"); > > @@ -405,7 +405,7 @@ dd_in(void) > ++st.in_full; > > /* Handle full input blocks. */ > - } else if ((size_t)n == in.dbsz) { > + } else if ((size_t)n == (size_t)in.dbsz) { > in.dbcnt += in.dbrcnt = n; > ++st.in_full; > > @@ -562,7 +562,7 @@ dd_out(int force) > outp += nw; > st.bytes += nw; > > - if ((size_t)nw == n && n == out.dbsz) > + if ((size_t)nw == n && n == (size_t)out.dbsz) > ++st.out_full; > else > ++st.out_part; > > Modified: head/bin/dd/dd.h > ============================================================================== > --- head/bin/dd/dd.h Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/dd.h Fri Aug 25 15:31:55 2017 (r322893) > @@ -38,10 +38,9 @@ > typedef struct { > u_char *db; /* buffer address */ > u_char *dbp; /* current buffer I/O address */ > - /* XXX ssize_t? */ > - size_t dbcnt; /* current buffer byte count */ > - size_t dbrcnt; /* last read byte count */ > - size_t dbsz; /* block size */ > + ssize_t dbcnt; /* current buffer byte count */ > + ssize_t dbrcnt; /* last read byte count */ > + ssize_t dbsz; /* block size */ > > #define ISCHR 0x01 /* character device (warn on short) */ > #define ISPIPE 0x02 /* pipe-like (see position.c) */ > > Modified: head/bin/dd/position.c > ============================================================================== > --- head/bin/dd/position.c Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/position.c Fri Aug 25 15:31:55 2017 (r322893) > @@ -207,7 +207,7 @@ pos_out(void) > n = write(out.fd, out.db, out.dbsz); > if (n == -1) > err(1, "%s", out.name); > - if ((size_t)n != out.dbsz) > + if (n != out.dbsz) > errx(1, "%s: write failure", out.name); > } > break; > From owner-svn-src-head@freebsd.org Fri Aug 25 17:20:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 686BDDDD163; Fri, 25 Aug 2017 17:20:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3439C681C1; Fri, 25 Aug 2017 17:20:16 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f42.google.com with SMTP id j144so3964871oib.1; Fri, 25 Aug 2017 10:20:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=yr9LzJ1mUJ5mg6XqkB6hi6thCu5QNUcv23HTBi+axqg=; b=RSQuUE6/t80JGpkqt7hYcCA4qX5Udcrlbg/N0x0Ta1oBRU7IVWOH3v3En5tVroLWlP /C79zx5gxOGG5gpf/6kXSIOmkDcwryHHD8+R2Ys+OhMhba7tJbgcHaGoexj9JHmpFqW7 TaO4g+Kt0IDrU1LUevYSjWl0+gXeS7A7YijBkheFJOPAFf0h6w9Gf6BPcEDDS3qdx4/n Ymbe4+79Ja2UOHKBoiOrS12PmQPIOCo7QSWLK+oS+MIXV4lVT0vDf0AXGgS0OKgQDe0f bXEgB2j8VMnUdVWizyf/1JxdvOJqCgLAHqKKludUXIdXTxMaP6oleZ4Y4QkZ0kNNHeOi rv5A== X-Gm-Message-State: AHYfb5jszLLV/eQCCw/eMbR/KaNBX4rcIh+Kxxd/iSZysnpn8OGzjxcS MQHcEdYWMQW8e/eSJm8= X-Received: by 10.202.95.139 with SMTP id t133mr14562796oib.207.1503681610011; Fri, 25 Aug 2017 10:20:10 -0700 (PDT) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id e206sm6296027oig.50.2017.08.25.10.20.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Aug 2017 10:20:09 -0700 (PDT) Received: by mail-it0-f45.google.com with SMTP id 77so2221417itj.0; Fri, 25 Aug 2017 10:20:09 -0700 (PDT) X-Received: by 10.36.129.138 with SMTP id q132mr155784itd.174.1503681609622; Fri, 25 Aug 2017 10:20:09 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Fri, 25 Aug 2017 10:20:09 -0700 (PDT) In-Reply-To: References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> From: Conrad Meyer Date: Fri, 25 Aug 2017 10:20:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r322893 - head/bin/dd To: Alan Somers Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 17:20:17 -0000 Well, not negative, just large uint64_t numbers that would be negative as off_t (int64_t). E.g., dd if=/dev/kmem bs=1 iseek=0xfffff...foo count=8. I think we would like that to work. I don't recall whether it does or not before this change. Best, Conrad On Fri, Aug 25, 2017 at 10:08 AM, Alan Somers wrote: > Nope. Do you mean negative offsets for the iseek argument? I didn't > know you could do that. > > On Fri, Aug 25, 2017 at 10:59 AM, Conrad Meyer wrote: >> Hi Alan, >> >> By any chance did you test this change with /dev/kmem and kernel >> addresses ("negative" off_t values)? >> >> Thanks, >> Conrad From owner-svn-src-head@freebsd.org Fri Aug 25 17:29:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3619DDD34F; Fri, 25 Aug 2017 17:29:49 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 C038E686D6; Fri, 25 Aug 2017 17:29:49 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PHTmJd083823; Fri, 25 Aug 2017 17:29:48 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PHTmwd083819; Fri, 25 Aug 2017 17:29:48 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201708251729.v7PHTmwd083819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 25 Aug 2017 17:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322896 - in head/sys/boot: efi/loader efi/loader/arch/amd64 efi/loader/arch/i386 i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: in head/sys/boot: efi/loader efi/loader/arch/amd64 efi/loader/arch/i386 i386/libi386 X-SVN-Commit-Revision: 322896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 17:29:50 -0000 Author: sobomax Date: Fri Aug 25 17:29:48 2017 New Revision: 322896 URL: https://svnweb.freebsd.org/changeset/base/322896 Log: Make spinconsole platform independent and hook it up into EFI loader on i386 and amd64. Not enabled on ARMs, those are lacking timer routines. MFC after: 2 moths Sponsored by: Sippy Software, Inc. Modified: head/sys/boot/efi/loader/arch/amd64/Makefile.inc head/sys/boot/efi/loader/arch/i386/Makefile.inc head/sys/boot/efi/loader/conf.c head/sys/boot/i386/libi386/spinconsole.c Modified: head/sys/boot/efi/loader/arch/amd64/Makefile.inc ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/Makefile.inc Fri Aug 25 16:38:21 2017 (r322895) +++ head/sys/boot/efi/loader/arch/amd64/Makefile.inc Fri Aug 25 17:29:48 2017 (r322896) @@ -9,7 +9,8 @@ SRCS+= amd64_tramp.S \ .PATH: ${.CURDIR}/../../i386/libi386 SRCS+= nullconsole.c \ - comconsole.c + comconsole.c \ + spinconsole.c -CFLAGS+= -fPIC +CFLAGS+= -fPIC -DTERM_EMU LDFLAGS+= -Wl,-znocombreloc Modified: head/sys/boot/efi/loader/arch/i386/Makefile.inc ============================================================================== --- head/sys/boot/efi/loader/arch/i386/Makefile.inc Fri Aug 25 16:38:21 2017 (r322895) +++ head/sys/boot/efi/loader/arch/i386/Makefile.inc Fri Aug 25 17:29:48 2017 (r322896) @@ -7,7 +7,8 @@ SRCS+= start.S \ .PATH: ${.CURDIR}/../../i386/libi386 SRCS+= nullconsole.c \ - comconsole.c + comconsole.c \ + spinconsole.c -CFLAGS+= -fPIC +CFLAGS+= -fPIC -DTERM_EMU LDFLAGS+= -Wl,-znocombreloc Modified: head/sys/boot/efi/loader/conf.c ============================================================================== --- head/sys/boot/efi/loader/conf.c Fri Aug 25 16:38:21 2017 (r322895) +++ head/sys/boot/efi/loader/conf.c Fri Aug 25 17:29:48 2017 (r322896) @@ -69,6 +69,7 @@ extern struct console efi_console; #if defined(__amd64__) || defined(__i386__) extern struct console comconsole; extern struct console nullconsole; +extern struct console spinconsole; #endif struct console *consoles[] = { @@ -76,6 +77,7 @@ struct console *consoles[] = { #if defined(__amd64__) || defined(__i386__) &comconsole, &nullconsole, + &spinconsole, #endif NULL }; Modified: head/sys/boot/i386/libi386/spinconsole.c ============================================================================== --- head/sys/boot/i386/libi386/spinconsole.c Fri Aug 25 16:38:21 2017 (r322895) +++ head/sys/boot/i386/libi386/spinconsole.c Fri Aug 25 17:29:48 2017 (r322896) @@ -41,16 +41,14 @@ __FBSDID("$FreeBSD$"); #include #include -extern void get_pos(int *x, int *y); -extern void curs_move(int *_x, int *_y, int x, int y); -extern void vidc_biosputchar(int c); - static void spinc_probe(struct console *cp); static int spinc_init(int arg); static void spinc_putchar(int c); static int spinc_getchar(void); static int spinc_ischar(void); +extern struct console *consoles[]; + struct console spinconsole = { "spinconsole", "spin port", @@ -62,47 +60,53 @@ struct console spinconsole = { spinc_ischar }; +static struct console *parent = NULL; + static void spinc_probe(struct console *cp) { - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); + + if (parent == NULL) + parent = consoles[0]; + parent->c_probe(cp); } static int spinc_init(int arg) { - return(0); + + return(parent->c_init(arg)); } static void spinc_putchar(int c) { - static int curx, cury; static unsigned tw_chars = 0x5C2D2F7C; /* "\-/|" */ - static time_t lasttime; + static time_t lasttime = 0; time_t now; - now = time(NULL); + now = time(0); if (now < (lasttime + 1)) return; - lasttime = now; #ifdef TERM_EMU - get_pos(&curx, &cury); - if (curx > 0) - curs_move(&curx, &cury, curx - 1, cury); + if (lasttime > 0) + parent->c_out('\b'); #endif - vidc_biosputchar((char)tw_chars); + lasttime = now; + parent->c_out((char)tw_chars); tw_chars = (tw_chars >> 8) | ((tw_chars & (unsigned long)0xFF) << 24); } static int spinc_getchar(void) { + return(-1); } static int spinc_ischar(void) { + return(0); } From owner-svn-src-head@freebsd.org Fri Aug 25 17:59:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A39EDDD990; Fri, 25 Aug 2017 17:59:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78AC8698CD; Fri, 25 Aug 2017 17:59:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v7PHxLSe070179; Fri, 25 Aug 2017 10:59:21 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v7PHxKPD070178; Fri, 25 Aug 2017 10:59:20 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201708251759.v7PHxKPD070178@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r322863 - head/sys/cam In-Reply-To: To: Warner Losh Date: Fri, 25 Aug 2017 10:59:20 -0700 (PDT) CC: Slawa Olhovchenkov , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 17:59:32 -0000 [ Charset UTF-8 unsupported, converting... ] > On Fri, Aug 25, 2017 at 7:35 AM, Slawa Olhovchenkov wrote: > > > On Thu, Aug 24, 2017 at 10:11:10PM +0000, Warner Losh wrote: > > > > > Author: imp > > > Date: Thu Aug 24 22:11:10 2017 > > > New Revision: 322863 > > > URL: https://svnweb.freebsd.org/changeset/base/322863 > > > > > > Log: > > > Expand the latency tracking array from 1.024s to 8.192s to help track > > > extreme outliers from dodgy drives. Adjust comments to reflect this, > > > and make sure that the number of latency buckets match in the two > > > places where it matters. > > > > May be up to 1min? > > > > I'm not sure what additional data you'll get between "totally sucks, at > least 8s latency" and "totally sucks, at least 32s." or "totally sucks, at > least 64s" though the latter isn't possible with the default timeouts... > > I'm planning on adding a 'max' latency that's self-resetting instead of > expanding the bucket upwards. I'm also contemplating expanding it down to > 100us or even 10us since nda serves nvme drives which easily can be sub > 100us. > > Warner What about using a log2/log10 engineering style binning of 1, 2, 4, 8 us 10, 20, 40, 80 us 100, 200, 400, 800 us ... 10000000, 20000000, 40000000, 80000000 us This would give you a fairly fine grain in the high speed area and cource grain in the not very likely areas, and it all fits in a nice 32 ints. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Aug 25 18:02:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52E7BDDDC90; Fri, 25 Aug 2017 18:02:45 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-qt0-x22d.google.com (mail-qt0-x22d.google.com [IPv6:2607:f8b0:400d:c0d::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09D3569E32; Fri, 25 Aug 2017 18:02:45 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-qt0-x22d.google.com with SMTP id q53so2604228qtq.5; Fri, 25 Aug 2017 11:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=CVfiyVOv6LAMqc7XQWSS06hm5VkS8zG5pttzQsI5xJQ=; b=EwzNzBtuhIvY0WO2kEOn3YREUNT2BSUbVAY91VtmkiDyRAR0h0GsteYyAqfkn8BQe6 w/yQi6IRAQ9bqbloY6km4wagtzF5t3FmYycT8suHNM+92gDmyNIEh2JGkhANTyiTBTEf 9Re03aGMS1xKbDKq1Our5UqIywsiuc8jYU+MMlynNZYbCceGuIYEDcnWKm5BWlIqcLif PBOxcJJ8FqF0IyN0VDq8aHxY93l6VcWMjVJkXHDDPy+PNTQZVU32SNooc/3QfI0/XEnJ +6pT0MLYc/9w/wRWy3c35UMWuwhWWBCn4E/15LLEe+oTJOdnW3hqDgncsOCtYfSZfo1i BDlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=CVfiyVOv6LAMqc7XQWSS06hm5VkS8zG5pttzQsI5xJQ=; b=uiAu97Lx7TwiEFafRDAk5iTgm4iIVcQELB4Y3eUdQYF4wsQX3KUQ2Qz25JD0/vdosv UE41Qpda+WAJYoQSdtpl7h21Gje/1kPj23hchibPabRWkQd9N59nY/8rGcLg5HiVWT6Z cuJjyjpPhJLhMPRtAFM+qeBK6Nm/pjxnLW+N6sw3NRmy1EmOeCl+dpswunWh1ojyYwxE 6GEbncvScf3i4Dv9uOsT+oiSTmXMxhCbD8FKK+q8wTCFE7dswAEvRifBR5vfT+64hg6q J1m4FapU2BONEfhFDsT/hYXwbkF+i5kLqyPMtAS9m04H2QbBHcUnGXpWb3OQyURf7M6W rkBQ== X-Gm-Message-State: AHYfb5h2nafaze8IVZYn6VuFSAT8jSyif/qxVIp7q0yrZ/CpNtbZBhYv SSA+7727YQbARLaoelo= X-Received: by 10.200.22.57 with SMTP id p54mr16012390qtj.317.1503684163763; Fri, 25 Aug 2017 11:02:43 -0700 (PDT) Received: from [192.168.2.122] (71-212-20-168.tukw.qwest.net. [71.212.20.168]) by smtp.gmail.com with ESMTPSA id 22sm4488107qto.36.2017.08.25.11.02.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Aug 2017 11:02:41 -0700 (PDT) Subject: Re: svn commit: r322893 - head/bin/dd To: cem@freebsd.org, Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> From: Matt Joras Message-ID: <4b016f89-61c5-fc8a-a36a-aca8166c369e@gmail.com> Date: Fri, 25 Aug 2017 11:02:40 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:02:45 -0000 On 08/25/2017 10:17, Conrad Meyer wrote: > This change seems to break buildworld on MIPS: > > /home/cem/head.svn/bin/dd/args.c: In function 'f_bs': > /home/cem/head.svn/bin/dd/args.c:188: warning: format '%zd' expects > type 'signed size_t', but argument 3 has type 'long int' > /home/cem/head.svn/bin/dd/args.c: In function 'f_cbs': > /home/cem/head.svn/bin/dd/args.c:199: warning: format '%zd' expects > type 'signed size_t', but argument 3 has type 'long int' > /home/cem/head.svn/bin/dd/args.c: In function 'f_ibs': > /home/cem/head.svn/bin/dd/args.c:245: warning: format '%zd' expects > type 'signed size_t', but argument 3 has type 'long int' > /home/cem/head.svn/bin/dd/args.c: In function 'f_obs': > /home/cem/head.svn/bin/dd/args.c:266: warning: format '%zd' expects > type 'signed size_t', but argument 3 has type 'long int' > > (Yes, it's odd that the SSIZE_MAX constant has 'long' type.) > SSIZE_MAX should have type long, since ssize_t is a long on mips (and other arches besides i386 and arm). Re: the build failure, that's in the GCC C format string checking, so perhaps it's more accurate to say this breaks the (in-tree) GCC build. %zd is the right format specifier for ssize_t. I guess GCC's format string checking is getting confused because SSIZE_MAX is a constant that expands to type long. Perhaps casting to ssize_t would GCC happier, but that looks rather wrong. Matt From owner-svn-src-head@freebsd.org Fri Aug 25 18:07:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923EFDDDE3F; Fri, 25 Aug 2017 18:07:58 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-pg0-x22e.google.com (mail-pg0-x22e.google.com [IPv6:2607:f8b0:400e:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64F346A133; Fri, 25 Aug 2017 18:07:58 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-pg0-x22e.google.com with SMTP id b8so2766602pgn.5; Fri, 25 Aug 2017 11:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Wak70XuFlEEKHU/YFE7Pn3VuSdk6Fb7HviKY3XoyxD4=; b=uJfdKJWNzapNdZOUZJz4Wccm6R2ZgmGdxQW49hkNNspVQhAiFfI/aD1cI8AIWHZj8X daW4dhGdOIOX3lyasUYHunc4gKmcJZGaDvJNqYrzdk/+3KZM2oN9o5ZEwP9sFZ79iLsX xzn0/GfDLqcXCR1cTATGDTMZZVo5ru+/u0vAzp5IxFxqA+O4x4RLQJ3Puu7sgOJkwmsL dw9bj4istcFtsTtP/PvG0HiN20yWgd2Tx8h8YryGckwSgr4cUGRpHawSwVRS2uYQT3Dz i6TxpqBLvsVrmbgEt5SGPnm/fbKpm7rBF55scJsmrWx939ZuN5Z/t8GLL/IPGNG+0hRJ ulfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Wak70XuFlEEKHU/YFE7Pn3VuSdk6Fb7HviKY3XoyxD4=; b=VE1WfyY4yy3FC1c5ToI1LxRMuHZT1uX03AoqueRz8xJWfVPu/HiT5FrnKXh6Cfedcx mgrElSMKN8bnyQ7i3Q12PUvjb+YQRYPo+5ansfkAT5Mp4GZSEPJbSL2Cw2zIIQxQobk0 svK5jM0KbXOhNhjMawKRthMdBCze9TqUZJK1/jJGGQgAP84wrPPn2VpSfqzq+BYva7wd a3cQHfACIOEuJNzuVRC2dbr93DddhwQkgY9eozumWtGjkz2qLJQgIfN512Z+HSt5jbWb z/ZDePv5c9Ix5R1MfNP9eJufjL1EcEG+TEJNt6LVUnNbwZ+k0DN+aDlC7P1PoZr18r61 giIA== X-Gm-Message-State: AHYfb5g94bhmyqvDLYfh4B1+VZyvX4lMtZobc7fG+rVAQlY2TjE9BHXH Gv2sZXVmx2sGNzhF4o5ZYjjd4OttPlwuyRM= X-Received: by 10.98.217.210 with SMTP id b79mr10237223pfl.110.1503684477387; Fri, 25 Aug 2017 11:07:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.207.193 with HTTP; Fri, 25 Aug 2017 11:07:56 -0700 (PDT) In-Reply-To: <201708232330.v7NNUPpV052276@repo.freebsd.org> References: <201708232330.v7NNUPpV052276@repo.freebsd.org> From: Ryan Libby Date: Fri, 25 Aug 2017 11:07:56 -0700 Message-ID: Subject: Re: svn commit: r322824 - in head: lib/clang share/mk usr.bin/clang To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:07:58 -0000 On Wed, Aug 23, 2017 at 4:30 PM, John Baldwin wrote: > Author: jhb > Date: Wed Aug 23 23:30:25 2017 > New Revision: 322824 > URL: https://svnweb.freebsd.org/changeset/base/322824 > > Log: > Improve the coverage of debug symbols for MK_DEBUG_FILES. > > - Include debug symbols in static libraries. This permits binaries > to include debug symbols for functions obtained from static libraries. > - Permit the C/C++ compiler flags added for MK_DEBUG_FILES to be > overridden by setting DEBUG_FILES_CFLAGS. Use this to limit the debug > information for llvm libraries and binaries. > > Reviewed by: emaste > Sponsored by: DARPA / AFRL > Differential Revision: https://reviews.freebsd.org/D12025 > > Added: > head/lib/clang/Makefile.inc (contents, props changed) > Modified: > head/share/mk/bsd.lib.mk > head/share/mk/bsd.prog.mk > head/share/mk/bsd.sys.mk > head/usr.bin/clang/Makefile.inc This causes llvm to emit hundreds of new warnings [1] for "DWARF2 only supports one section per compilation unit" Are these expected? Are they a concern? Should we silence them? Is this an upstream llvm bug [2]? [1] https://ci.freebsd.org/job/FreeBSD-head-amd64-build/4719/warnings9Result/new/ $ grep -A 1 "warning: DWARF2 only supports one section" consoleText.txt | grep -o "\.section.*" | sort | uniq -c 3 .section .fini,"ax",@progbits 6 .section .init 4 .section .init,"ax",@progbits 17 .section .note.GNU-stack,"",@progbits 2785 .section .note.GNU-stack,"",%progbits 2 .section .reloc, "a" 21 .section .rodata 1 .section __xen_guest [2] https://lists.freebsd.org/pipermail/freebsd-toolchain/2016-March/002122.html From owner-svn-src-head@freebsd.org Fri Aug 25 18:09:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B64DDDECD for ; Fri, 25 Aug 2017 18:09:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D0DE6A291 for ; Fri, 25 Aug 2017 18:09:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id g33so1829903ioj.3 for ; Fri, 25 Aug 2017 11:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=IlMKhgy+ah0s3L0qC+4VwIMgXbK+j8E0xRJ/T92kG+Y=; b=bWasdCrCmsam3OfMlqh7MtYVAoMjl/D0CKWQvbD/o+xm+S8oIcsyYMzEG+xLZ6Fc0G OleVP9OX3GkcJX9Dj12P/kzhqmqfEM34Yb1PrMn4oYSpWT8567jY9asjGhDx9V7VyhFP ewh8XRvLNUsBKaCl75e8/uqlTA5He6bs8CjtL1wVpgZsWfu1jVJBJnwT1GkbQAfwJsFR fg6d25T12RQoXQGu/E2H4/N/7IkAuZ8LNAZ0DnNrBzaqvpbZAr7EgCOoq/sie1ZOK2CG rGyTPVif4U/Oq4LhvVRiYtVfnIC7F30O++zLTlMRBZ1Df1d1j9r6VzvoeWLjyh/ubioL +FfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=IlMKhgy+ah0s3L0qC+4VwIMgXbK+j8E0xRJ/T92kG+Y=; b=A3hIazHIHd3RUUxtHmtdBMooBRvA2GjOSPoUdKuB8PdnUa/zlDB256Cq9mIQNr1CUe aJScPv5c0I+HcoiwPEQJjjgsGxbS4GCZlJpmLQz6v27q4qcl/ctkYIFe3KyzlGDnOx+Y 52oG+AjHwtK//LriHJm6l/oWWFYCYvv0oWGyhq8XE6fNQo/F95omoZmybeaH202MvtoE cjlBAVJolT6xTF2cDmvB1t+UHs2OLVCBM9eq2B2F1RMG+/7DWwz2dVlMAL7rHh+5KAPa 8tUAq5D2jUGXBGxxJyOBR6kDSjlll2fL2TDJtZB5yuzpVq7vJV4ZNMgmp/mw5b9YQe+E eIZw== X-Gm-Message-State: AHYfb5iSvmHPt7tIZTJ6GJFOxYdgtGNPJzI6bpsIvWJWET55U2QMdnDF deP1+qHChpHU0iXrAyv658BFQEi/U8M8 X-Received: by 10.107.131.219 with SMTP id n88mr8847612ioi.277.1503684579474; Fri, 25 Aug 2017 11:09:39 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Fri, 25 Aug 2017 11:09:38 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <4b016f89-61c5-fc8a-a36a-aca8166c369e@gmail.com> References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> <4b016f89-61c5-fc8a-a36a-aca8166c369e@gmail.com> From: Warner Losh Date: Fri, 25 Aug 2017 12:09:38 -0600 X-Google-Sender-Auth: 4SFIqmYFJ93SZ4IenIDEILimWWw Message-ID: Subject: Re: svn commit: r322893 - head/bin/dd To: Matt Joras Cc: "Conrad E. Meyer" , Alan Somers , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:09:40 -0000 On Fri, Aug 25, 2017 at 12:02 PM, Matt Joras wrote: > On 08/25/2017 10:17, Conrad Meyer wrote: > > This change seems to break buildworld on MIPS: > > > > /home/cem/head.svn/bin/dd/args.c: In function 'f_bs': > > /home/cem/head.svn/bin/dd/args.c:188: warning: format '%zd' expects > > type 'signed size_t', but argument 3 has type 'long int' > > /home/cem/head.svn/bin/dd/args.c: In function 'f_cbs': > > /home/cem/head.svn/bin/dd/args.c:199: warning: format '%zd' expects > > type 'signed size_t', but argument 3 has type 'long int' > > /home/cem/head.svn/bin/dd/args.c: In function 'f_ibs': > > /home/cem/head.svn/bin/dd/args.c:245: warning: format '%zd' expects > > type 'signed size_t', but argument 3 has type 'long int' > > /home/cem/head.svn/bin/dd/args.c: In function 'f_obs': > > /home/cem/head.svn/bin/dd/args.c:266: warning: format '%zd' expects > > type 'signed size_t', but argument 3 has type 'long int' > > > > (Yes, it's odd that the SSIZE_MAX constant has 'long' type.) > > > SSIZE_MAX should have type long, since ssize_t is a long on mips (and > other arches besides i386 and arm). > > Re: the build failure, that's in the GCC C format string checking, so > perhaps it's more accurate to say this breaks the (in-tree) GCC build. > %zd is the right format specifier for ssize_t. I guess GCC's format > string checking is getting confused because SSIZE_MAX is a constant that > expands to type long. Perhaps casting to ssize_t would GCC happier, but > that looks rather wrong. > This is why it was cast in the first place due to issues with exact type. Maybe we should put the casts back for the printfs. Warner From owner-svn-src-head@freebsd.org Fri Aug 25 18:18:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E8B5DDE399 for ; Fri, 25 Aug 2017 18:18:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1BBC6A9C7 for ; Fri, 25 Aug 2017 18:18:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id 77so2943609itj.0 for ; Fri, 25 Aug 2017 11:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=8jl1rNuaRq9ley1VKQr4UgsPu9IBV13XJG/BNyOeoBQ=; b=PJTKc8pDt/N7z7MPQ6IW3MYldjqXVeEiezmP6M8SpTIYMfroJtoq0ynU7Q0frC3j28 JW+cvgvxz7W9SoFrv1Hgk6OCNMA1Nq/fJwYn/CKzVKnQQKtTJAx2+jvdrvSnZ7ErnEz6 JUoovP8c2/a1YEYQIGGDrITC8iP+OldLWACFI67T3PlCOinac1Qftc2YWbPJXlwYPhFR jAM3Jvp6nNsFkHbz41KLblu3qnJFSVcsSTQfltCToTCByp6B5JLxxQ7JHwd5Tv6RqDJt gnqzuhRj4ybG8eXOVya/awKu7/aCpmYYKsjp/DYWmJW9p7fdP8CfGkwA8O2rypF+aKma Mq7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=8jl1rNuaRq9ley1VKQr4UgsPu9IBV13XJG/BNyOeoBQ=; b=F4gMLPJuhoi5gLi8cCbqFcEuhpsUPCY7olkXlDnNNNA3RKayv0bCdjaJmuqImrwUav u9QZhZpeatyiT8CM9p6tvDVlMpPdgmUlD8dQ4f0nAUBPpYqHOQbp+GUJH/UOF/Dz6sxV Ef+dFopwKrnDfJC+XWrZXX2kCW+mn0XU9OAYjpn/MNh395r7B+yKs5OhBh6RXpV+JB6+ obdLhPvolQl/ydmLmwZXg9+rXzBeJpPpwoROzUGmMgzeX5L0M/+7Tt9rq56JDCJ6sGlD 5b6c1xVa3vGqcfUDhSpehMA1fUGsa4MCZ3fyyGQxqcqU/Os2EN2V6BHNi0Wj8TSsvsqW 28EQ== X-Gm-Message-State: AHYfb5iC8pjTVrpEyJYQ9XaJkOHAzYMf4Nr7C6KVbgPfugnQbzMrypOP /L2dee2XJnddx2SyrDQNjdQkbbvVGsNM X-Received: by 10.36.159.194 with SMTP id c185mr283271ite.31.1503685115228; Fri, 25 Aug 2017 11:18:35 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Fri, 25 Aug 2017 11:18:34 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <201708251759.v7PHxKPD070178@pdx.rh.CN85.dnsmgr.net> References: <201708251759.v7PHxKPD070178@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Fri, 25 Aug 2017 12:18:34 -0600 X-Google-Sender-Auth: XwYtFIJgetQN2osBrZcJ8DpLBE4 Message-ID: Subject: Re: svn commit: r322863 - head/sys/cam To: "Rodney W. Grimes" Cc: Slawa Olhovchenkov , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:18:36 -0000 On Fri, Aug 25, 2017 at 11:59 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Fri, Aug 25, 2017 at 7:35 AM, Slawa Olhovchenkov > wrote: > > > > > On Thu, Aug 24, 2017 at 10:11:10PM +0000, Warner Losh wrote: > > > > > > > Author: imp > > > > Date: Thu Aug 24 22:11:10 2017 > > > > New Revision: 322863 > > > > URL: https://svnweb.freebsd.org/changeset/base/322863 > > > > > > > > Log: > > > > Expand the latency tracking array from 1.024s to 8.192s to help > track > > > > extreme outliers from dodgy drives. Adjust comments to reflect > this, > > > > and make sure that the number of latency buckets match in the two > > > > places where it matters. > > > > > > May be up to 1min? > > > > > > > I'm not sure what additional data you'll get between "totally sucks, at > > least 8s latency" and "totally sucks, at least 32s." or "totally sucks, > at > > least 64s" though the latter isn't possible with the default timeouts... > > > > I'm planning on adding a 'max' latency that's self-resetting instead of > > expanding the bucket upwards. I'm also contemplating expanding it down to > > 100us or even 10us since nda serves nvme drives which easily can be sub > > 100us. > > > > Warner > > What about using a log2/log10 engineering style binning of > 1, 2, 4, 8 us > 10, 20, 40, 80 us > 100, 200, 400, 800 us > ... > 10000000, 20000000, 40000000, 80000000 us > > This would give you a fairly fine grain in the high speed > area and cource grain in the not very likely areas, and > it all fits in a nice 32 ints. > I don't like that at all. it's the worst of both worlds. 1/2/5 makes more sense because the difference between 8 and 10 is tiny, and there's an extra bin per 1000 with your proposal. However, powers of two is completely sufficient to get the data out of the system and is optimal for fitting the fewest bins. Doing either your suggestion or 1/2/5 makes the bins non-uniform, which makes the P99 estimates I'm making from these numbers less accurate mathematically. More bins makes this more expensive since this is a linear search which we do on each I/O. Power of two matches dtrace (though ms instead of us, which I may change). So I'm not inclined to make arbitrary changes here based on aesthetics. I don't see a good reason to do so, and I see only extra costs (including retooling code that I've written to consume this) for changing. Warner From owner-svn-src-head@freebsd.org Fri Aug 25 18:27:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A920EDDE8BF; Fri, 25 Aug 2017 18:27:24 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 701456B838; Fri, 25 Aug 2017 18:27:24 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x233.google.com with SMTP id g33so1970766ioj.3; Fri, 25 Aug 2017 11:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rMaMp9k+nKsLsbsFxMr5jivkmA7qNkxhQ18MSYXWVQM=; b=gliRbJUbsdBzBh+eRzWsBjQ7tpp5IBnDqahjVexVV+8krxPZ4QXQ8uIMiKPb0gGu72 HsqIlHOHJEKQ3c0IjJRPA8LBsoGZ+oMtvd3YNpYyPo+igwAsKk00BJXCl+JZ42nqJGD9 m87RCGAZPFImgDawORuDjflvWoGqMM2KYGvti5FQgJIM99LTLhLyckJkO/E6SvhBjt1R P3NU3pTplUrKdR6ceVPCYZJuKdT/27v/+qiGOVNJpxpzmdFpbm9jm4AXUC8f25QJ9wTM OgM+XnCXBWnRWPJ+dZa/opYDIYX2XuVDdF0ztLuLFEXls1pej6ekZe34ubhXw3r2NoUU anMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rMaMp9k+nKsLsbsFxMr5jivkmA7qNkxhQ18MSYXWVQM=; b=UHDUfIGYbOQwQeREVLT538cX2E+nbe1WT+JBGB2biRPxn9ilTyvoUVv0xicY0d3q9V a3D530nTG2U3HSa6fPnsywFT3uPFI//qO6N3H2DQbf1gB7ndmHEYkO0Qp1WT5UUbPNri ETdLnrWdPp+pOx92wB50ZO6xQwsIjmZFibuFDr7yTmtiECA08iOuJtT+oSFVVJW5GOPL 7eXfQUFCM+4VpNTeq+KHvrKufJMZGg8z487VPxo4qr9EL5mHeOJ+zzNcw9RHnDaQy2lR Nb/yWlm8NIT4lqSGUs75F19snZbp3ueHlngHNpmQiRjBgiMco+CZoRFDfeHtbfyYN09N uBXg== X-Gm-Message-State: AHYfb5itkhFHd8bVcrO5GbmmNmWU4I0Nvx1uhrp4uHIXq0Fhr+p3lzeG LGp0Usb9X1jEfc99QvMo7ncgXylElZKW X-Received: by 10.107.190.195 with SMTP id o186mr8617166iof.330.1503685643782; Fri, 25 Aug 2017 11:27:23 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.24.66 with HTTP; Fri, 25 Aug 2017 11:27:03 -0700 (PDT) In-Reply-To: References: <201708232330.v7NNUPpV052276@repo.freebsd.org> From: Ed Maste Date: Fri, 25 Aug 2017 14:27:03 -0400 X-Google-Sender-Auth: yMnblHXhGQuN7_vO9RSc9JIhGgA Message-ID: Subject: Re: svn commit: r322824 - in head: lib/clang share/mk usr.bin/clang To: Ryan Libby Cc: John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "freebsd-toolchain@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:27:24 -0000 On 25 August 2017 at 14:07, Ryan Libby wrote: > On Wed, Aug 23, 2017 at 4:30 PM, John Baldwin wrote: >> Author: jhb >> Date: Wed Aug 23 23:30:25 2017 >> New Revision: 322824 >> URL: https://svnweb.freebsd.org/changeset/base/322824 >> >> Log: >> Improve the coverage of debug symbols for MK_DEBUG_FILES. >> ... > This causes llvm to emit hundreds of new warnings [1] for > "DWARF2 only supports one section per compilation unit" > > Are these expected? Are they a concern? Should we silence them? > Is this an upstream llvm bug [2]? I'm not sure they were "expected" but I guess are an unsurprising consequence of building more things with debug. In any case they're not a concern. It is an llvm bug (the warning really ought not be emitted for empty sections), but upstream is probably not too concerned as (most? all) other platforms are not using dwarf2. The right answer for us is likely to just stop defaulting to dwarf2 (and specifying it via CFLAGS for kernel if necessary). From owner-svn-src-head@freebsd.org Fri Aug 25 18:30:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F0E4DDE972 for ; Fri, 25 Aug 2017 18:30:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59E1B6B9E4 for ; Fri, 25 Aug 2017 18:30:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id s101so2093167ioe.0 for ; Fri, 25 Aug 2017 11:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=AlFcnb+2+qxCj6q2XpwRWtNEQqKP5/gDkzQqvA4MBeY=; b=qeA3s+egf0RBj1U4qqocdoHH+YSgZRdaBrtiswPLJhu/OVKVRcc4ioQ99oLBKIlAji QsETTs5Sdx6FGyEKZw1L+ehxxK1c46AqST78lp5ZNdmM0uN7hBmzHCZEO1myNriDkTim ARn4H7Gmnkn1xbbZEnGh+K+AS/G4OwlUyNOAbKbvl0snMSRzy4xVdxt1bwyCnOy3e+fF R24rkZwGLV2F0KXuTVA/gpH8JwGY5oLKhAeMnJHchoIeuyHVGI2XQvn7TNtv2X9V1afJ YGjGCKPOyV7XlIETkMCrrhkhj8yG7AKk2ksp5CvYga94o9xt84PYMFjFS5WJEPVXgaNH so+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=AlFcnb+2+qxCj6q2XpwRWtNEQqKP5/gDkzQqvA4MBeY=; b=uDIuWfFtEqsn7f92rJZmmfdcnujsglvYcX8svS1QHshtlMFeD6eVrh3Dl6ftCVU/Zu SP/93HXXe/dU0OQPTHkuALRR7kwXnG/Wt/fmqRtFBYYUJhDlZSwG1TDXymApcmCN/0Ki itqKEWe9P/AUuDp8b5sA7Sq2tbi/AEUJAQPKGJWEPN4jXM6PO5rQW+Y+M2qDp22BYFJP xJUULUuxWCQs2GcGgFCwWnMeUpQB2vXgnraSB73N1BZ0gILNV2So1GaEopiMUhCPups6 rK0YjmgHEg8dlIphzs2Aky4eGIE8UQxedD5Oaj/0TNmGVzcIQEzx+CqjoTsluszIpbwk yaNw== X-Gm-Message-State: AHYfb5hBxtEXS8I3EX6ufmek6+vQquey+qZwEdhHXFZNrAnlCTpANxK6 cVPMsAbX5X2q+xWdmTB/RZbLPyUVSyA6 X-Received: by 10.107.17.19 with SMTP id z19mr9989886ioi.182.1503685811756; Fri, 25 Aug 2017 11:30:11 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Fri, 25 Aug 2017 11:30:11 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201708232330.v7NNUPpV052276@repo.freebsd.org> From: Warner Losh Date: Fri, 25 Aug 2017 12:30:11 -0600 X-Google-Sender-Auth: o-iwCwuRe80unh0TWMMrZZDAXZo Message-ID: Subject: Re: svn commit: r322824 - in head: lib/clang share/mk usr.bin/clang To: Ed Maste Cc: Ryan Libby , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , John Baldwin , "freebsd-toolchain@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:30:12 -0000 On Fri, Aug 25, 2017 at 12:27 PM, Ed Maste wrote: > On 25 August 2017 at 14:07, Ryan Libby wrote: > > On Wed, Aug 23, 2017 at 4:30 PM, John Baldwin wrote: > >> Author: jhb > >> Date: Wed Aug 23 23:30:25 2017 > >> New Revision: 322824 > >> URL: https://svnweb.freebsd.org/changeset/base/322824 > >> > >> Log: > >> Improve the coverage of debug symbols for MK_DEBUG_FILES. > >> > ... > > This causes llvm to emit hundreds of new warnings [1] for > > "DWARF2 only supports one section per compilation unit" > > > > Are these expected? Are they a concern? Should we silence them? > > Is this an upstream llvm bug [2]? > > I'm not sure they were "expected" but I guess are an unsurprising > consequence of building more things with debug. In any case they're > not a concern. > > It is an llvm bug (the warning really ought not be emitted for empty > sections), but upstream is probably not too concerned as (most? all) > other platforms are not using dwarf2. > > The right answer for us is likely to just stop defaulting to dwarf2 > (and specifying it via CFLAGS for kernel if necessary). > What's the status of kicking gdb out of the tree? If we kick it out, we can stop doing dwarf2 and move to something more modern. Last time this issue came up, that was the decision, pending a few issues with the gdb port which I think John Baldwin is getting close to reaching closure on. Warner From owner-svn-src-head@freebsd.org Fri Aug 25 18:47:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46212DDEDF6; Fri, 25 Aug 2017 18:47:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10B296C1A6; Fri, 25 Aug 2017 18:47:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PIlOvl018387; Fri, 25 Aug 2017 18:47:24 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PIlOxV018386; Fri, 25 Aug 2017 18:47:24 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201708251847.v7PIlOxV018386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 25 Aug 2017 18:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322897 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 322897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:47:25 -0000 Author: alc Date: Fri Aug 25 18:47:23 2017 New Revision: 322897 URL: https://svnweb.freebsd.org/changeset/base/322897 Log: Correct a regression in the previous change, r322459. Specifically, the removal of the "blk" parameter from blst_meta_alloc() had the unintended effect of generating an out-of-range allocation when the cursor reaches the end of the tree if the number of managed blocks in the tree equals the so-called "radix" (which in the blist code is not the standard notion of what a radix is but rather the maximum number of leaves in a tree of the current height.) In other words, only certain swap configurations were affected, which is why earlier testing did not reveal the problem. Submitted by: Doug Moore Reported by: pho, kib Tested by: pho X-MFC with: r322459 Differential Revision: https://reviews.freebsd.org/D12106 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri Aug 25 17:29:48 2017 (r322896) +++ head/sys/kern/subr_blist.c Fri Aug 25 18:47:23 2017 (r322897) @@ -251,6 +251,8 @@ blist_alloc(blist_t bl, daddr_t count) bl->bl_radix); if (blk != SWAPBLK_NONE) { bl->bl_cursor = blk + count; + if (bl->bl_cursor == bl->bl_blocks) + bl->bl_cursor = 0; return (blk); } else if (bl->bl_cursor != 0) bl->bl_cursor = 0; From owner-svn-src-head@freebsd.org Fri Aug 25 18:51:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CCDDDDEF5D; Fri, 25 Aug 2017 18:51:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6BCA26C4B1; Fri, 25 Aug 2017 18:51:11 +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 v7PIpA2J020557; Fri, 25 Aug 2017 18:51:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PIpAKx020542; Fri, 25 Aug 2017 18:51:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201708251851.v7PIpAKx020542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 25 Aug 2017 18:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322898 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 322898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:51:11 -0000 Author: asomers Date: Fri Aug 25 18:51:10 2017 New Revision: 322898 URL: https://svnweb.freebsd.org/changeset/base/322898 Log: Pacify GCC on mips32 after r322893 Though technically correct, GCC complains about usingi a "%zd" format specifier for a long. Reported by: cem MFC after: 3 weeks X-MFC-With: 322893 Sponsored by: Spectra Logic Modified: head/bin/dd/args.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Fri Aug 25 18:47:23 2017 (r322897) +++ head/bin/dd/args.c Fri Aug 25 18:51:10 2017 (r322898) @@ -185,7 +185,7 @@ f_bs(char *arg) res = get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "bs must be between 1 and %zd", SSIZE_MAX); + errx(1, "bs must be between 1 and %zd", (ssize_t)SSIZE_MAX); in.dbsz = out.dbsz = (size_t)res; } @@ -196,7 +196,7 @@ f_cbs(char *arg) res = get_num(arg); if (res < 1 || res > SSIZE_MAX) - errx(1, "cbs must be between 1 and %zd", SSIZE_MAX); + errx(1, "cbs must be between 1 and %zd", (ssize_t)SSIZE_MAX); cbsz = (size_t)res; } @@ -242,7 +242,7 @@ f_ibs(char *arg) res = get_num(arg); if (res < 1 || res > SSIZE_MAX) errx(1, "ibs must be between 1 and %zd", - SSIZE_MAX); + (ssize_t)SSIZE_MAX); in.dbsz = (size_t)res; } } @@ -263,7 +263,7 @@ f_obs(char *arg) res = get_num(arg); if (res < 1 || res > SSIZE_MAX) errx(1, "obs must be between 1 and %zd", - SSIZE_MAX); + (ssize_t)SSIZE_MAX); out.dbsz = (size_t)res; } } From owner-svn-src-head@freebsd.org Fri Aug 25 18:57:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEEF7DDF189; Fri, 25 Aug 2017 18:57:39 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-wr0-x232.google.com (mail-wr0-x232.google.com [IPv6:2a00:1450:400c:c0c::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CE676C82E; Fri, 25 Aug 2017 18:57:39 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-wr0-x232.google.com with SMTP id o76so1830984wrb.5; Fri, 25 Aug 2017 11:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=wdccCK024D+x2D8N6bED+Y/haj22zJqbxi6/1GQouBs=; b=iGnDHGMsoZ+JESl7DP/47Ehn9I5wJPfaDiZJDMxSUYal67noYcnD51+P0PO4/VTjPS kyQISkVezDSrEegCQ0Bgnuk24KJUYpYu1852FxoLJYkxGqI5MI15lpuAwSEpdNMtNV2F rkYs6YaF21hzRkwupvcbqfIP8M7E4bikgc120mPPyKYJyMXdzMUdS8vFi9IPIFbUSms5 BHtN+XdUlaxD711GXslWCjdIrk3vjE2ivZZnSvC0X5h0P5LAfJ6QLOgps0YhsuCNIhaR Mc3eDHzVOLXlERYlrsG4LJyP4UhS3QqHkpQvm6nZAHPfCMy/6kJvpuqlhC3THTTUoGIk vW4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wdccCK024D+x2D8N6bED+Y/haj22zJqbxi6/1GQouBs=; b=ewKAL++7Z1J1pt+dRXUe7Ek5//J2lPRRPr7soOSFftYq4xS3uD/eUb6zSuj9gHr68w TInKpMie3tJegw4KYb7abo2eHpUg+l/ipRy0dhieCW4zGkEy+GA8p6+bhULotG69xsjk 6ixgHu3Be9SM/VRlwkbMPhSterOQ7ug9E2XHbjjMsHSwS9vmm79he3QjpkjyxhoGyETU eW+WT5TQRVKtXeJGWgcmK8tP3KlfuKKvlsVXzjNrpfkHjUkEFK6BV+qEo8EXukA/JP7U JilTvNtvpeoaS/McZrc/VN8lukZmLiwB1383PKE0atPfQMml0ITy6s/cKTOuFHu/LSE0 qUQw== X-Gm-Message-State: AHYfb5jZgegupzXkpwI4XBRlK/P6hnM66guJ5OUDWLuGrRi0C6jBSvG9 NLoH+jVQAH/WgyBw+xJgftPw99ZAww== X-Received: by 10.223.174.225 with SMTP id y88mr7134509wrc.264.1503687457524; Fri, 25 Aug 2017 11:57:37 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.28.56.194 with HTTP; Fri, 25 Aug 2017 11:57:37 -0700 (PDT) In-Reply-To: References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> From: Alan Somers Date: Fri, 25 Aug 2017 12:57:37 -0600 X-Google-Sender-Auth: PXJUpPML6fmbkOf5fNz4DvzEko0 Message-ID: Subject: Re: svn commit: r322893 - head/bin/dd To: "Conrad E. Meyer" Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:57:39 -0000 That doesn't work either before or after this change. -Alan On Fri, Aug 25, 2017 at 11:20 AM, Conrad Meyer wrote: > Well, not negative, just large uint64_t numbers that would be negative > as off_t (int64_t). > > E.g., dd if=/dev/kmem bs=1 iseek=0xfffff...foo count=8. I think we > would like that to work. I don't recall whether it does or not before > this change. > > Best, > Conrad > > On Fri, Aug 25, 2017 at 10:08 AM, Alan Somers wrote: >> Nope. Do you mean negative offsets for the iseek argument? I didn't >> know you could do that. >> >> On Fri, Aug 25, 2017 at 10:59 AM, Conrad Meyer wrote: >>> Hi Alan, >>> >>> By any chance did you test this change with /dev/kmem and kernel >>> addresses ("negative" off_t values)? >>> >>> Thanks, >>> Conrad From owner-svn-src-head@freebsd.org Fri Aug 25 18:58:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6914DDF1FD; Fri, 25 Aug 2017 18:58:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7990F6C976; Fri, 25 Aug 2017 18:58:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::d91a:7f20:7200:12cd] (unknown [IPv6:2001:470:7a58:0:d91a:7f20:7200:12cd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6D21630D4F; Fri, 25 Aug 2017 20:58:31 +0200 (CEST) From: Dimitry Andric Message-Id: <00CB256A-DC74-4D65-B21E-16524A21AFF3@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_D5074571-40BC-44C3-9F2A-EE3ECC517CAE"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r322824 - in head: lib/clang share/mk usr.bin/clang Date: Fri, 25 Aug 2017 20:58:30 +0200 In-Reply-To: Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Ryan Libby References: <201708232330.v7NNUPpV052276@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:58:33 -0000 --Apple-Mail=_D5074571-40BC-44C3-9F2A-EE3ECC517CAE Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 25 Aug 2017, at 20:07, Ryan Libby wrote: > > On Wed, Aug 23, 2017 at 4:30 PM, John Baldwin wrote: >> Author: jhb >> Date: Wed Aug 23 23:30:25 2017 >> New Revision: 322824 >> URL: https://svnweb.freebsd.org/changeset/base/322824 >> >> Log: >> Improve the coverage of debug symbols for MK_DEBUG_FILES. >> >> - Include debug symbols in static libraries. This permits binaries >> to include debug symbols for functions obtained from static libraries. >> - Permit the C/C++ compiler flags added for MK_DEBUG_FILES to be >> overridden by setting DEBUG_FILES_CFLAGS. Use this to limit the debug >> information for llvm libraries and binaries. >> >> Reviewed by: emaste >> Sponsored by: DARPA / AFRL >> Differential Revision: https://reviews.freebsd.org/D12025 >> >> Added: >> head/lib/clang/Makefile.inc (contents, props changed) >> Modified: >> head/share/mk/bsd.lib.mk >> head/share/mk/bsd.prog.mk >> head/share/mk/bsd.sys.mk >> head/usr.bin/clang/Makefile.inc > > This causes llvm to emit hundreds of new warnings [1] for > "DWARF2 only supports one section per compilation unit" > > Are these expected? Are they a concern? Should we silence them? > Is this an upstream llvm bug [2]? Last time this came up, I put up an upstream review to fix the warning, since it is nonsensical to warn about a non-code section. I've pinged the review again, but now I'm inclined to just commit it. :) -Dimitry --Apple-Mail=_D5074571-40BC-44C3-9F2A-EE3ECC517CAE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.1 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWaBzVgAKCRCwXqMKLiCW o5XIAJwNbU4Q8dtOpUErFUlLpdnIjAtfyACgzdsrifvRBcymncSXM+se+rDvwc8= =8ugc -----END PGP SIGNATURE----- --Apple-Mail=_D5074571-40BC-44C3-9F2A-EE3ECC517CAE-- From owner-svn-src-head@freebsd.org Fri Aug 25 18:59:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42C0FDDF26F for ; Fri, 25 Aug 2017 18:59:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BAC36CAB4 for ; Fri, 25 Aug 2017 18:59:05 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 525eebba-89c7-11e7-950d-03a3531dacf2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 525eebba-89c7-11e7-950d-03a3531dacf2; Fri, 25 Aug 2017 18:58:03 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v7PIvtqV004074; Fri, 25 Aug 2017 12:57:55 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1503687475.56799.16.camel@freebsd.org> Subject: Re: svn commit: r322893 - head/bin/dd From: Ian Lepore To: Warner Losh , Matt Joras Cc: "Conrad E. Meyer" , Alan Somers , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Fri, 25 Aug 2017 12:57:55 -0600 In-Reply-To: References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> <4b016f89-61c5-fc8a-a36a-aca8166c369e@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 18:59:06 -0000 On Fri, 2017-08-25 at 12:09 -0600, Warner Losh wrote: > On Fri, Aug 25, 2017 at 12:02 PM, Matt Joras > wrote: > > > > > On 08/25/2017 10:17, Conrad Meyer wrote: > > > > > > This change seems to break buildworld on MIPS: > > > > > > /home/cem/head.svn/bin/dd/args.c: In function 'f_bs': > > > /home/cem/head.svn/bin/dd/args.c:188: warning: format '%zd' > > > expects > > > type 'signed size_t', but argument 3 has type 'long int' > > > /home/cem/head.svn/bin/dd/args.c: In function 'f_cbs': > > > /home/cem/head.svn/bin/dd/args.c:199: warning: format '%zd' > > > expects > > > type 'signed size_t', but argument 3 has type 'long int' > > > /home/cem/head.svn/bin/dd/args.c: In function 'f_ibs': > > > /home/cem/head.svn/bin/dd/args.c:245: warning: format '%zd' > > > expects > > > type 'signed size_t', but argument 3 has type 'long int' > > > /home/cem/head.svn/bin/dd/args.c: In function 'f_obs': > > > /home/cem/head.svn/bin/dd/args.c:266: warning: format '%zd' > > > expects > > > type 'signed size_t', but argument 3 has type 'long int' > > > > > > (Yes, it's odd that the SSIZE_MAX constant has 'long' type.) > > > > > SSIZE_MAX should have type long, since ssize_t is a long on mips > > (and > > other arches besides i386 and arm). > > > > Re: the build failure, that's in the GCC C format string checking, > > so > > perhaps it's more accurate to say this breaks the (in-tree) GCC > > build. > > %zd is the right format specifier for ssize_t. I guess GCC's format > > string checking is getting confused because SSIZE_MAX is a constant > > that > > expands to type long. Perhaps casting to ssize_t would GCC happier, > > but > > that looks rather wrong. > > > This is why it was cast in the first place due to issues with exact > type. > Maybe we should put the casts back for the printfs. > > Warner I think the right fix is to define SSIZE_MAX correctly based on the type of ssize_t.  The x86 and powerpc _limits.h files get this right, it looks like mips is the only one with both 32 and 64-bit support that doesn't define SSIZE_MAX based on ssize_t type. -- Ian From owner-svn-src-head@freebsd.org Fri Aug 25 19:06:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A87FDDF548; Fri, 25 Aug 2017 19:06: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 mx1.freebsd.org (Postfix) with ESMTPS id E198E6D1EA; Fri, 25 Aug 2017 19:06:37 +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 v7PJ6aAl026633; Fri, 25 Aug 2017 19:06:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PJ6a4C026632; Fri, 25 Aug 2017 19:06:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708251906.v7PJ6a4C026632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 25 Aug 2017 19:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322899 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 322899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 19:06:38 -0000 Author: jhb Date: Fri Aug 25 19:06:36 2017 New Revision: 322899 URL: https://svnweb.freebsd.org/changeset/base/322899 Log: Decode arguments passed to thr_set_name(). MFC after: 1 month Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Fri Aug 25 18:51:10 2017 (r322898) +++ head/usr.bin/truss/syscalls.c Fri Aug 25 19:06:36 2017 (r322899) @@ -483,6 +483,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Long, 0 }, { Signal, 1 } } }, { .name = "thr_self", .ret_type = 1, .nargs = 1, .args = { { Ptr, 0 } } }, + { .name = "thr_set_name", .ret_type = 1, .nargs = 2, + .args = { { Long, 0 }, { Name, 1 } } }, { .name = "truncate", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { QuadHex | IN, 1 } } }, #if 0 From owner-svn-src-head@freebsd.org Fri Aug 25 19:27:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C08E0DDFCF7; Fri, 25 Aug 2017 19:27:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 961906DCA1; Fri, 25 Aug 2017 19:27:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 0457410AB01; Fri, 25 Aug 2017 15:27:05 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: Ed Maste , Ryan Libby , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , "freebsd-toolchain@freebsd.org" Subject: Re: svn commit: r322824 - in head: lib/clang share/mk usr.bin/clang Date: Fri, 25 Aug 2017 11:53:59 -0700 Message-ID: <4019876.lu34otUPCV@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201708232330.v7NNUPpV052276@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 25 Aug 2017 15:27:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 19:27:06 -0000 On Friday, August 25, 2017 12:30:11 PM Warner Losh wrote: > On Fri, Aug 25, 2017 at 12:27 PM, Ed Maste wrote: > > > On 25 August 2017 at 14:07, Ryan Libby wrote: > > > On Wed, Aug 23, 2017 at 4:30 PM, John Baldwin wrote: > > >> Author: jhb > > >> Date: Wed Aug 23 23:30:25 2017 > > >> New Revision: 322824 > > >> URL: https://svnweb.freebsd.org/changeset/base/322824 > > >> > > >> Log: > > >> Improve the coverage of debug symbols for MK_DEBUG_FILES. > > >> > > ... > > > This causes llvm to emit hundreds of new warnings [1] for > > > "DWARF2 only supports one section per compilation unit" > > > > > > Are these expected? Are they a concern? Should we silence them? > > > Is this an upstream llvm bug [2]? > > > > I'm not sure they were "expected" but I guess are an unsurprising > > consequence of building more things with debug. In any case they're > > not a concern. > > > > It is an llvm bug (the warning really ought not be emitted for empty > > sections), but upstream is probably not too concerned as (most? all) > > other platforms are not using dwarf2. > > > > The right answer for us is likely to just stop defaulting to dwarf2 > > (and specifying it via CFLAGS for kernel if necessary). > > > > What's the status of kicking gdb out of the tree? If we kick it out, we can > stop doing dwarf2 and move to something more modern. Last time this issue > came up, that was the decision, pending a few issues with the gdb port > which I think John Baldwin is getting close to reaching closure on. gdb is mostly disabled in-tree, but there is no in-tree replacement for the kgdb stack trace from /usr/sbin/crashinfo if the gdb port is not installed, and there won't be until lldb grows some kernel support. OTOH, for most platforms /usr/bin/gdb is now disabled (hidden in /usr/libexec) so isn't relevant for userland binaries certainly. The kernel probably doesn't benefit much from DWARF > 2 (except perhaps for .dwo files if we decide to use those at some point) as the other things added since DWARF2 are largely about handling C++ features like r-value references, etc. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Aug 25 19:41:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C043EDE0103; Fri, 25 Aug 2017 19:41:39 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B4CB6E473; Fri, 25 Aug 2017 19:41:39 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PJfcXh040920; Fri, 25 Aug 2017 19:41:38 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PJfcI5040915; Fri, 25 Aug 2017 19:41:38 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201708251941.v7PJfcI5040915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 25 Aug 2017 19:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322900 - in head: . sys/netinet sys/sys usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head: . sys/netinet sys/sys usr.bin/netstat X-SVN-Commit-Revision: 322900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 19:41:39 -0000 Author: sbruno Date: Fri Aug 25 19:41:38 2017 New Revision: 322900 URL: https://svnweb.freebsd.org/changeset/base/322900 Log: Use counter(9) for PLPMTUD counters. Remove unused PLPMTUD sysctl counters. Bump UPDATING and FreeBSD Version to indicate a rebuild is required. Submitted by: kevin.bowling@kev009.com Reviewed by: jtl Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12003 Modified: head/UPDATING head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_var.h head/sys/sys/param.h head/usr.bin/netstat/inet.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Aug 25 19:06:36 2017 (r322899) +++ head/UPDATING Fri Aug 25 19:41:38 2017 (r322900) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20170825: + Move PMTUD blackhole counters to TCPSTATS and remove them from bare + sysctl values. Minor nit, but requires a rebuild of both world/kernel + to complete. + 20170814: "make check" behavior (made in ^/head@r295380) has been changed to execute from a limited sandbox, as opposed to executing from Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Fri Aug 25 19:06:36 2017 (r322899) +++ head/sys/netinet/tcp_timer.c Fri Aug 25 19:41:38 2017 (r322900) @@ -148,29 +148,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_de &VNET_NAME(tcp_pmtud_blackhole_detect), 0, "Path MTU Discovery Black Hole Detection Enabled"); -static VNET_DEFINE(int, tcp_pmtud_blackhole_activated); -#define V_tcp_pmtud_blackhole_activated \ - VNET(tcp_pmtud_blackhole_activated) -SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated, - CTLFLAG_RD|CTLFLAG_VNET, - &VNET_NAME(tcp_pmtud_blackhole_activated), 0, - "Path MTU Discovery Black Hole Detection, Activation Count"); - -static VNET_DEFINE(int, tcp_pmtud_blackhole_activated_min_mss); -#define V_tcp_pmtud_blackhole_activated_min_mss \ - VNET(tcp_pmtud_blackhole_activated_min_mss) -SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated_min_mss, - CTLFLAG_RD|CTLFLAG_VNET, - &VNET_NAME(tcp_pmtud_blackhole_activated_min_mss), 0, - "Path MTU Discovery Black Hole Detection, Activation Count at min MSS"); - -static VNET_DEFINE(int, tcp_pmtud_blackhole_failed); -#define V_tcp_pmtud_blackhole_failed VNET(tcp_pmtud_blackhole_failed) -SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_failed, - CTLFLAG_RD|CTLFLAG_VNET, - &VNET_NAME(tcp_pmtud_blackhole_failed), 0, - "Path MTU Discovery Black Hole Detection, Failure Count"); - #ifdef INET static VNET_DEFINE(int, tcp_pmtud_blackhole_mss) = 1200; #define V_tcp_pmtud_blackhole_mss VNET(tcp_pmtud_blackhole_mss) @@ -772,7 +749,7 @@ tcp_timer_rexmt(void * xtp) tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) { /* Use the sysctl tuneable blackhole MSS. */ tp->t_maxseg = V_tcp_v6pmtud_blackhole_mss; - V_tcp_pmtud_blackhole_activated++; + TCPSTAT_INC(tcps_pmtud_blackhole_activated); } else if (isipv6) { /* Use the default MSS. */ tp->t_maxseg = V_tcp_v6mssdflt; @@ -781,7 +758,7 @@ tcp_timer_rexmt(void * xtp) * minmss. */ tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; - V_tcp_pmtud_blackhole_activated_min_mss++; + TCPSTAT_INC(tcps_pmtud_blackhole_activated_min_mss); } #endif #if defined(INET6) && defined(INET) @@ -791,7 +768,7 @@ tcp_timer_rexmt(void * xtp) if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss) { /* Use the sysctl tuneable blackhole MSS. */ tp->t_maxseg = V_tcp_pmtud_blackhole_mss; - V_tcp_pmtud_blackhole_activated++; + TCPSTAT_INC(tcps_pmtud_blackhole_activated); } else { /* Use the default MSS. */ tp->t_maxseg = V_tcp_mssdflt; @@ -800,7 +777,7 @@ tcp_timer_rexmt(void * xtp) * minmss. */ tp->t_flags2 &= ~TF2_PLPMTU_PMTUD; - V_tcp_pmtud_blackhole_activated_min_mss++; + TCPSTAT_INC(tcps_pmtud_blackhole_activated_min_mss); } #endif /* @@ -823,7 +800,7 @@ tcp_timer_rexmt(void * xtp) tp->t_flags2 |= TF2_PLPMTU_PMTUD; tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE; tp->t_maxseg = tp->t_pmtud_saved_maxseg; - V_tcp_pmtud_blackhole_failed++; + TCPSTAT_INC(tcps_pmtud_blackhole_failed); /* * Reset the slow-start flight size as it * may depend on the new MSS. Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Fri Aug 25 19:06:36 2017 (r322899) +++ head/sys/netinet/tcp_var.h Fri Aug 25 19:41:38 2017 (r322900) @@ -580,6 +580,11 @@ struct tcpstat { uint64_t tcps_sig_err_sigopt; /* No signature expected by socket */ uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ + /* Path MTU Discovery Black Hole Detection related stats */ + uint64_t tcps_pmtud_blackhole_activated; /* Black Hole Count */ + uint64_t tcps_pmtud_blackhole_activated_min_mss; /* BH at min MSS Count */ + uint64_t tcps_pmtud_blackhole_failed; /* Black Hole Failure Count */ + uint64_t _pad[12]; /* 6 UTO, 6 TBD */ }; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Aug 25 19:06:36 2017 (r322899) +++ head/sys/sys/param.h Fri Aug 25 19:41:38 2017 (r322900) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200041 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200042 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Fri Aug 25 19:06:36 2017 (r322899) +++ head/usr.bin/netstat/inet.c Fri Aug 25 19:41:38 2017 (r322900) @@ -752,12 +752,24 @@ tcp_stats(u_long off, const char *name, int af1 __unus "{N:/time%s unexpected signature received}\n"); p(tcps_sig_err_nosigopt, "\t{:no-signature-provided/%ju} " "{N:/time%s no signature provided by segment}\n"); + + xo_close_container("tcp-signature"); + xo_open_container("pmtud"); + + p(tcps_pmtud_blackhole_activated, "\t{:pmtud-activated/%ju} " + "{N:/Path MTU discovery black hole detection activation%s}\n"); + p(tcps_pmtud_blackhole_activated_min_mss, + "\t{:pmtud-activated-min-mss/%ju} " + "{N:/Path MTU discovery black hole detection min MSS activation%s}\n"); + p(tcps_pmtud_blackhole_failed, "\t{:pmtud-failed/%ju} " + "{N:/Path MTU discovery black hole detection failure%s}\n"); #undef p #undef p1a #undef p2 #undef p2a #undef p3 - xo_close_container("tcp-signature"); + xo_close_container("pmtud"); + xo_open_container("TCP connection count by state"); xo_emit("{T:/TCP connection count by state}:\n"); From owner-svn-src-head@freebsd.org Fri Aug 25 21:13:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7109CDE1ABC; Fri, 25 Aug 2017 21:13:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 57A2070F1D; Fri, 25 Aug 2017 21:13:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v7PLDlem025824 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 25 Aug 2017 14:13:47 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v7PLDlo3025823; Fri, 25 Aug 2017 14:13:47 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 25 Aug 2017 14:13:47 -0700 From: Gleb Smirnoff To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322900 - in head: . sys/netinet sys/sys usr.bin/netstat Message-ID: <20170825211347.GO1071@FreeBSD.org> References: <201708251941.v7PJfcI5040915@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201708251941.v7PJfcI5040915@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 21:13:54 -0000 Sean, On Fri, Aug 25, 2017 at 07:41:38PM +0000, Sean Bruno wrote: S> Modified: head/sys/netinet/tcp_var.h S> ============================================================================== S> --- head/sys/netinet/tcp_var.h Fri Aug 25 19:06:36 2017 (r322899) S> +++ head/sys/netinet/tcp_var.h Fri Aug 25 19:41:38 2017 (r322900) S> @@ -580,6 +580,11 @@ struct tcpstat { S> uint64_t tcps_sig_err_sigopt; /* No signature expected by socket */ S> uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ S> S> + /* Path MTU Discovery Black Hole Detection related stats */ S> + uint64_t tcps_pmtud_blackhole_activated; /* Black Hole Count */ S> + uint64_t tcps_pmtud_blackhole_activated_min_mss; /* BH at min MSS Count */ S> + uint64_t tcps_pmtud_blackhole_failed; /* Black Hole Failure Count */ S> + S> uint64_t _pad[12]; /* 6 UTO, 6 TBD */ S> }; You may have used space in the _pad, and won't need to bump __FreeBSD_version or update UPDATING. This is what for these spares were made for :) -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Aug 25 21:29:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80A1ADE1CFB; Fri, 25 Aug 2017 21:29:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D673713C7; Fri, 25 Aug 2017 21:29:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 59CC91700B; Fri, 25 Aug 2017 21:29:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 41F738769; Fri, 25 Aug 2017 21:29:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 2kf16NeG8ST4; Fri, 25 Aug 2017 21:29:44 +0000 (UTC) Subject: Re: svn commit: r306512 - in head/sys: kern sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 3F2B48763 To: Konstantin Belousov Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201609301727.u8UHRIgD051373@repo.freebsd.org> <6ea06065-ea5c-b83b-3854-224626be0d77@FreeBSD.org> <20170825103534.GK1700@kib.kiev.ua> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Fri, 25 Aug 2017 14:29:28 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170825103534.GK1700@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SMKtgHVDJUU7B7Ljl2KSn0sxmOTpFiBl3" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 21:29:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SMKtgHVDJUU7B7Ljl2KSn0sxmOTpFiBl3 Content-Type: multipart/mixed; boundary="E5JqXpauGdNtMJa8VsIOOAsUlndGXmoRe"; protected-headers="v1" From: Bryan Drewery To: Konstantin Belousov Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r306512 - in head/sys: kern sys References: <201609301727.u8UHRIgD051373@repo.freebsd.org> <6ea06065-ea5c-b83b-3854-224626be0d77@FreeBSD.org> <20170825103534.GK1700@kib.kiev.ua> In-Reply-To: <20170825103534.GK1700@kib.kiev.ua> --E5JqXpauGdNtMJa8VsIOOAsUlndGXmoRe Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/25/2017 3:35 AM, Konstantin Belousov wrote: > On Thu, Aug 24, 2017 at 08:18:03PM -0700, Bryan Drewery wrote: >> On 9/30/2016 10:27 AM, Mateusz Guzik wrote: >>> Author: mjg >>> Date: Fri Sep 30 17:27:17 2016 >>> New Revision: 306512 >>> URL: https://svnweb.freebsd.org/changeset/base/306512 >>> >>> Log: >>> vfs: batch free vnodes in per-mnt lists >>> =20 >>> Previously free vnodes would always by directly returned to the glo= bal >>> LRU list. With this change up to mnt_free_list_batch vnodes are col= lected >>> first. >>> =20 >>> syncer runs always return the batch regardless of its size. >>> =20 >>> While vnodes on per-mnt lists are not counted as free, they can be >>> returned in case of vnode shortage. >>> =20 >>> Reviewed by: kib >>> Tested by: pho >>> >>> Modified: >>> head/sys/kern/vfs_mount.c >>> head/sys/kern/vfs_subr.c >>> head/sys/sys/mount.h >>> head/sys/sys/vnode.h >>> >> ... >>> @@ -2753,17 +2824,25 @@ _vhold(struct vnode *vp, bool locked) >>> * Remove a vnode from the free list, mark it as in use, >>> * and put it on the active list. >>> */ >>> - mtx_lock(&vnode_free_list_mtx); >>> - TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist); >>> - freevnodes--; >>> - vp->v_iflag &=3D ~VI_FREE; >>> + mp =3D vp->v_mount; >>> + mtx_lock(&mp->mnt_listmtx); >> ^^ >> >>> + if ((vp->v_mflag & VMP_TMPMNTFREELIST) !=3D 0) { >>> + TAILQ_REMOVE(&mp->mnt_tmpfreevnodelist, vp, v_actfreelist); >>> + mp->mnt_tmpfreevnodelistsize--; >>> + vp->v_mflag &=3D ~VMP_TMPMNTFREELIST; >>> + } else { >>> + mtx_lock(&vnode_free_list_mtx); >>> + TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist); >>> + freevnodes--; >>> + mtx_unlock(&vnode_free_list_mtx); >>> + } >>> KASSERT((vp->v_iflag & VI_ACTIVE) =3D=3D 0, >>> ("Activating already active vnode")); >>> + vp->v_iflag &=3D ~VI_FREE; >>> vp->v_iflag |=3D VI_ACTIVE; >>> - mp =3D vp->v_mount; >>> TAILQ_INSERT_HEAD(&mp->mnt_activevnodelist, vp, v_actfreelist); >>> mp->mnt_activevnodelistsize++; >>> - mtx_unlock(&vnode_free_list_mtx); >>> + mtx_unlock(&mp->mnt_listmtx); >>> refcount_acquire(&vp->v_holdcnt); >>> if (!locked) >>> VI_UNLOCK(vp); >>> @@ -2819,21 +2898,25 @@ _vdrop(struct vnode *vp, bool locked) >>> if ((vp->v_iflag & VI_OWEINACT) =3D=3D 0) { >>> vp->v_iflag &=3D ~VI_ACTIVE; >>> mp =3D vp->v_mount; >>> - mtx_lock(&vnode_free_list_mtx); >>> + mtx_lock(&mp->mnt_listmtx); >> ^^ >> >> If code runs getnewvnode() and then immediately runs vhold() or vrele(= ), >> without first running insmntque(vp, mp), then vp->v_mount is NULL here= >> and the lock/freelist dereferencing just panic. > getnewvnode() returns vref-ed vnode, i.e. both hold and use counts are > set to 1. What is the use case there which requires vhold-ing vnode > without finishing its construction ? None that I can think of. For vhold I was just observing that a NULL dereference is possible. >=20 >> Locking the vnode and then using vgone() and vput() on it avoids the >> issue since it marks the vnode VI_DOOMED and instead frees it in >> _vdrop() rather than try to re-add it to its NULL per-mount free list.= > This is the common pattern where insmntque() fails. >=20 >> >> I'm not sure what the right thing here is. Is it a requirement to >> insmntque() a new vnode immediately, or to vgone() it before releasing= >> it if was just returned from getnewvnode()? > These are the only uses of a newly allocated vnode which make sense. > Do you need this for something that does not happen in the svn tree ? Outside of the tree in OneFS, we have some code that does getnewvnode(), then adds the unlocked vnode to a kqueue event list (it's actually very complicated compared to the basic description), and then does insmntque. The event list registration is failing in a stress run and it only does a vrele in this case. I need to change it to lock/vgone/vrele (or swap the event registration and insmntque calls of which I'm unsure on the impact). Previously the vrele was enough, and not vgone too, since the vnode was just added back to the global free list. But now the v_mount is required since the free list is per-mount. It is trivial for me to fix the panic I am running into, but it feels like there's a bug in _vdrop now due to this commit and I want to be sure I follow through with it being fixed properly. My confusion/question is probably about what the real distinction here is between using vgone before vrele to cause the vnode to be free'd and not using vgone and causing it to go back into the free list instead - which I cannot do now without swapping the calls. It seems to me that an assert would now make sense in the _vdrop !VI_DOOMED case since a v_mount is required to add back into the free list, and probably _vhold, such as: VNASSERT(mp !=3D NULL, vn, ("%s: not on a mount vnode list")); Or we just add it back to the global mount list in _vdrop as it was supported before with something like: https://people.freebsd.org/~bdrewery/patches/vdrop-global-list.diff >=20 >> >> Perhaps these cases should assert that v_mount is not NULL or handle t= he >> odd case and just free the vnode instead, or can it still just add to >> the global vnode_free_list if mp is NULL? >> >> The old code handled the case fine since the freelist was global and n= ot >> per-mount. 'mp' was only dereferenced below if the vnode had been >> active, which was not the case for my example. >=20 --=20 Regards, Bryan Drewery --E5JqXpauGdNtMJa8VsIOOAsUlndGXmoRe-- --SMKtgHVDJUU7B7Ljl2KSn0sxmOTpFiBl3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZoJa5AAoJEDXXcbtuRpfPXXgIANkXmvByc7MGNIdvJFyLRxzT ZSiPuhoshBmaE5lk2ydctVikPPqp7ntFF3k7+8hwEGHw1+AySLIq+/aQSSeb3nbL zNO+QyNTlDeUeyFY4Ij08hwmEbSF+ltwihivoiNbeMDA5t3a8QaTlW8Rsl2J1tqf TGjEpiyuukLK6JZY/z2MVfui4viQtM5hfXYDGe6g54jgDSjCkZbI/96wp2AKvIxs Bi15Iyjqddmhze5mVbfmzLNBjwUaL6/PMntGNpwQ1J9OeillUPYzTb82QuJ43FjP g0ix4wY+1HzctlnUarTqnlU84cPrMKoi0doghrZwa8iutEsvxxmet/CYLeTIZXQ= =gpwn -----END PGP SIGNATURE----- --SMKtgHVDJUU7B7Ljl2KSn0sxmOTpFiBl3-- From owner-svn-src-head@freebsd.org Fri Aug 25 21:38:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04E47DE1ED0; Fri, 25 Aug 2017 21:38:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id B40D8717D5; Fri, 25 Aug 2017 21:38:30 +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 v7PLcT8W088391; Fri, 25 Aug 2017 21:38:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PLcTs1088390; Fri, 25 Aug 2017 21:38:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708252138.v7PLcTs1088390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 25 Aug 2017 21:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322901 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 322901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 21:38:31 -0000 Author: imp Date: Fri Aug 25 21:38:29 2017 New Revision: 322901 URL: https://svnweb.freebsd.org/changeset/base/322901 Log: Add feature codes from NVMe 1.3 specification: o Automomous Power State Transition o Host Memory Buffer o Timestamp o Keep Alive Timer o Host Controlled Thermal Management o Non-Operational Power State Config Also note that feature codes 0x78-0x7f are reserved for the NVMe Management Interface. Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme.h Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Fri Aug 25 19:41:38 2017 (r322900) +++ head/sys/dev/nvme/nvme.h Fri Aug 25 21:38:29 2017 (r322901) @@ -397,7 +397,14 @@ enum nvme_feature { NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION = 0x09, NVME_FEAT_WRITE_ATOMICITY = 0x0A, NVME_FEAT_ASYNC_EVENT_CONFIGURATION = 0x0B, - /* 0x0C-0x7F - reserved */ + NVME_FEAT_AUTONOMOUS_POWER_STATE_TRANSITION = 0x0C, + NVME_FEAT_HOST_MEMORY_BUFFER = 0x0D, + NVME_FEAT_TIMESTAMP = 0x0E, + NVME_FEAT_KEEP_ALIVE_TIMER = 0x0F, + NVME_FEAT_HOST_CONTROLLED_THERMAL_MGMT = 0x10, + NVME_FEAT_NON_OP_POWER_STATE_CONFIG = 0x11, + /* 0x12-0x77 - reserved */ + /* 0x78-0x7f - NVMe Management Interface */ NVME_FEAT_SOFTWARE_PROGRESS_MARKER = 0x80, /* 0x81-0xBF - command set specific (reserved) */ /* 0xC0-0xFF - vendor specific */ From owner-svn-src-head@freebsd.org Fri Aug 25 21:38:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78652DE1F0B; Fri, 25 Aug 2017 21:38:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A2607185A; Fri, 25 Aug 2017 21:38:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PLcddi088450; Fri, 25 Aug 2017 21:38:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PLcd3q088446; Fri, 25 Aug 2017 21:38:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708252138.v7PLcd3q088446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 25 Aug 2017 21:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322902 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 322902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 21:38:40 -0000 Author: imp Date: Fri Aug 25 21:38:38 2017 New Revision: 322902 URL: https://svnweb.freebsd.org/changeset/base/322902 Log: NVME Namespace ID is 32-bits, so widen interface to reflect that. Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_ctrlr_cmd.c head/sys/dev/nvme/nvme_ns.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Fri Aug 25 21:38:29 2017 (r322901) +++ head/sys/dev/nvme/nvme_ctrlr.c Fri Aug 25 21:38:38 2017 (r322902) @@ -460,7 +460,7 @@ static int nvme_ctrlr_construct_namespaces(struct nvme_controller *ctrlr) { struct nvme_namespace *ns; - int i; + uint32_t i; for (i = 0; i < min(ctrlr->cdata.nn, NVME_MAX_NAMESPACES); i++) { ns = &ctrlr->ns[i]; Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr_cmd.c Fri Aug 25 21:38:29 2017 (r322901) +++ head/sys/dev/nvme/nvme_ctrlr_cmd.c Fri Aug 25 21:38:38 2017 (r322902) @@ -52,7 +52,7 @@ nvme_ctrlr_cmd_identify_controller(struct nvme_control } void -nvme_ctrlr_cmd_identify_namespace(struct nvme_controller *ctrlr, uint16_t nsid, +nvme_ctrlr_cmd_identify_namespace(struct nvme_controller *ctrlr, uint32_t nsid, void *payload, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Fri Aug 25 21:38:29 2017 (r322901) +++ head/sys/dev/nvme/nvme_ns.c Fri Aug 25 21:38:38 2017 (r322902) @@ -476,7 +476,7 @@ nvme_ns_bio_process(struct nvme_namespace *ns, struct } int -nvme_ns_construct(struct nvme_namespace *ns, uint16_t id, +nvme_ns_construct(struct nvme_namespace *ns, uint32_t id, struct nvme_controller *ctrlr) { struct nvme_completion_poll_status status; Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Aug 25 21:38:29 2017 (r322901) +++ head/sys/dev/nvme/nvme_private.h Fri Aug 25 21:38:38 2017 (r322902) @@ -225,8 +225,8 @@ struct nvme_namespace { struct nvme_controller *ctrlr; struct nvme_namespace_data data; - uint16_t id; - uint16_t flags; + uint32_t id; + uint32_t flags; struct cdev *cdev; void *cons_cookie[NVME_MAX_CONSUMERS]; uint32_t stripesize; @@ -356,7 +356,7 @@ void nvme_ctrlr_cmd_identify_controller(struct nvme_co void *payload, nvme_cb_fn_t cb_fn, void *cb_arg); void nvme_ctrlr_cmd_identify_namespace(struct nvme_controller *ctrlr, - uint16_t nsid, void *payload, + uint32_t nsid, void *payload, nvme_cb_fn_t cb_fn, void *cb_arg); void nvme_ctrlr_cmd_set_interrupt_coalescing(struct nvme_controller *ctrlr, uint32_t microseconds, @@ -438,7 +438,7 @@ void nvme_io_qpair_enable(struct nvme_qpair *qpair); void nvme_io_qpair_disable(struct nvme_qpair *qpair); void nvme_io_qpair_destroy(struct nvme_qpair *qpair); -int nvme_ns_construct(struct nvme_namespace *ns, uint16_t id, +int nvme_ns_construct(struct nvme_namespace *ns, uint32_t id, struct nvme_controller *ctrlr); void nvme_ns_destruct(struct nvme_namespace *ns); From owner-svn-src-head@freebsd.org Fri Aug 25 21:38:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19ADBDE1F4F; Fri, 25 Aug 2017 21:38:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id D0FA5718C6; Fri, 25 Aug 2017 21:38:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PLch6B088503; Fri, 25 Aug 2017 21:38:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PLchjB088502; Fri, 25 Aug 2017 21:38:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708252138.v7PLchjB088502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 25 Aug 2017 21:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322903 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 322903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 21:38:45 -0000 Author: imp Date: Fri Aug 25 21:38:43 2017 New Revision: 322903 URL: https://svnweb.freebsd.org/changeset/base/322903 Log: Fill in reserved areas from NVMe spec in the IDENTIFY structure (struct nvme_controller_data) as defined in the NVM Express specification, revsion 1.3. Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme.h Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Fri Aug 25 21:38:38 2017 (r322902) +++ head/sys/dev/nvme/nvme.h Fri Aug 25 21:38:43 2017 (r322903) @@ -490,8 +490,28 @@ struct nvme_controller_data { /** Controller ID */ uint16_t ctrlr_id; - uint8_t reserved1[176]; + /** Version */ + uint32_t ver; + /** RTD3 Resume Latency */ + uint32_t rtd3r; + + /** RTD3 Enter Latency */ + uint32_t rtd3e; + + /** Optional Asynchronous Events Supported */ + uint32_t oaes; /* bitfield really */ + + /** Controller Attributes */ + uint32_t ctratt; /* bitfield really */ + + uint8_t reserved1[12]; + + /** FRU Globally Unique Identifier */ + uint8_t fguid[16]; + + uint8_t reserved2[128]; + /* bytes 256-511: admin command set attributes */ /** optional admin command support */ @@ -550,8 +570,29 @@ struct nvme_controller_data { uint8_t avscc_rsvd : 7; } __packed avscc; - uint8_t reserved2[15]; + /** Autonomous Power State Transition Attributes */ + struct { + /* Autonmous Power State Transitions supported */ + uint8_t apst_supp : 1; + uint8_t apsta_rsvd : 7; + } __packed apsta; + + /** Warning Composite Temperature Threshold */ + uint16_t wctemp; + + /** Critical Composite Temperature Threshold */ + uint16_t cctemp; + + /** Maximum Time for Firmware Activation */ + uint16_t mtfa; + + /** Host Memory Buffer Preferred Size */ + uint32_t hmpre; + + /** Host Memory Buffer Minimum Size */ + uint32_t hmmin; + /** Name space capabilities */ struct { /* if nsmgmt, report tnvmcap and unvmcap */ @@ -559,7 +600,34 @@ struct nvme_controller_data { uint8_t unvmcap[16]; } __packed untncap; - uint8_t reserved3[200]; + /** Replay Protected Memory Block Support */ + uint32_t rpmbs; /* Really a bitfield */ + + /** Extended Device Self-test Time */ + uint16_t edstt; + + /** Device Self-test Options */ + uint8_t dsto; /* Really a bitfield */ + + /** Firmware Update Granularity */ + uint8_t fwug; + + /** Keep Alive Support */ + uint16_t kas; + + /** Host Controlled Thermal Management Attributes */ + uint16_t hctma; /* Really a bitfield */ + + /** Minimum Thermal Management Temperature */ + uint16_t mntmt; + + /** Maximum Thermal Management Temperature */ + uint16_t mxtmt; + + /** Sanitize Capabilities */ + uint32_t sanicap; /* Really a bitfield */ + + uint8_t reserved3[180]; /* bytes 512-703: nvm command set attributes */ /** submission queue entry size */ @@ -574,7 +642,8 @@ struct nvme_controller_data { uint8_t max : 4; } __packed cqes; - uint8_t reserved4[2]; + /** Maximum Outstanding Commands */ + uint16_t maxcmd; /** number of namespaces */ uint32_t nn; From owner-svn-src-head@freebsd.org Fri Aug 25 22:14:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F018DE29B7; Fri, 25 Aug 2017 22:14:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id D7C6F72AB5; Fri, 25 Aug 2017 22:14:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 605A71A5DC7; Sat, 26 Aug 2017 07:54:09 +1000 (AEST) Date: Sat, 26 Aug 2017 07:54:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322893 - head/bin/dd In-Reply-To: <201708251531.v7PFVtoZ038242@repo.freebsd.org> Message-ID: <20170826061551.A976@besplex.bde.org> References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=hvvzoT6mHlCTYeWrSbEA:9 a=xkd4CAELegw4TTWS:21 a=nCJHprI3UMGEy-aH:21 a=gEigG_IEjzaiSYIh:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 22:14:13 -0000 On Fri, 25 Aug 2017, Alan Somers wrote: > Log: > dd(1): Incorrect casting of arguments It is indeed now incorrect. > dd(1) casts many of its numeric arguments from uintmax_t to intmax_t and > back again to detect whether or not the original arguments were negative. > This is not correct, and causes problems with boundary cases, for example > when count is SSIZE_MAX-1. The casts were correct. Did someone break the range checks? I wrote most of the cast, but would rarely write range checks using unportable casts. SSIZE_MAX-1 isn't a boundary case. The boundary is at SSIZE_MAX. %zd might work for it not. But %zd is wrong for SSIZE_MAX-1, since the expression might expand the type. > Modified: head/bin/dd/args.c > ============================================================================== > --- head/bin/dd/args.c Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/args.c Fri Aug 25 15:31:55 2017 (r322893) > @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); > > #include > > +#include Unrelated change. > #include > #include > #include > @@ -184,7 +185,7 @@ f_bs(char *arg) > > res = get_num(arg); > if (res < 1 || res > SSIZE_MAX) > - errx(1, "bs must be between 1 and %jd", (intmax_t)SSIZE_MAX); > + errx(1, "bs must be between 1 and %zd", SSIZE_MAX); > in.dbsz = out.dbsz = (size_t)res; > } > This is incorrect. The old version used the portable method of casting a signed value of unknown type to intmax_t before %zd existed. %zd still isn't useable in either theory or practice for printing ssize_t's. Theory: C99 defines %zd as being for the signed type "corresponding" to size_t. Who knows what "corresponding" is except for pure 2's complement with no padding bits? POSIX only defines ssize_t circularly as being "any signed integer type capable of representing the range -1 through SSIZE_MAX" where SSIZE_MAX is the maximum of ssize_t". It has a few restrictions that make this not completely circular, but I couldn't find anywhere where it states the usual restriction on limits -- that they have the type of the default promotion of the type that they limit. Practice: As reported in other replies, some arches define SSIZE_MAX in a way that makes its type not the default promotion of ssize_t. Most likely SSIZE_MAX is bogusly long and ssize_t is int, or vice versa, on an arch where int and long have the same representation. Printf format checking reports this type mismatch because it would be fatal on other arches. > @@ -195,22 +196,22 @@ f_cbs(char *arg) > > res = get_num(arg); > if (res < 1 || res > SSIZE_MAX) > - errx(1, "cbs must be between 1 and %jd", (intmax_t)SSIZE_MAX); > + errx(1, "cbs must be between 1 and %zd", SSIZE_MAX); > cbsz = (size_t)res; > } Similarly. > > static void > f_count(char *arg) > { > - intmax_t res; > + uintmax_t res; This breaks the not so careful checking for negative args. dd wants to allow negative args for seek offsets and not much else. It has a badly written get_off_t() to handle the offsets, but old code like this still used the old function get_num() that returns an unsigned type. This is a feature since get_off_t() is so badly written that it is better to convert get_num() almost as done here. My version does this internally: X /* X * Convert an expression of the above forms to an off_t. This version does X * not handle negative numbers perfectly. It assumes 2's complement and X * maybe nonnegative multipliers. I hope perfect handling is not necessary X * for dd. X */ X static off_t X get_off_t(const char *val) X { X u_quad_t num; X X num = get_num(val); X if (num != (u_quad_t)(off_t)num) X errx(1, "%s: offset too large", oper); X return ((off_t)num); X } This still uses the bogus type u_quad_t since that is what get_num() returns in the old version of dd that this patch is for. There should be no restriction except UINTMAX_MAX on counts. This is fixed in my version: X static void X f_count(char *arg) X { X X cpy_cnt = get_num(arg); X #if 0 X if (cpy_cnt == 0) X terminate(0); X #endif X } get_num() already did correct range checking. A count of 0 should mean infinity. Code elsewhere needs be careful to go to infinity for count 0 and to not multiply a large count by a block size. In practice, counts of nearly UINTMAX_MAX are unreachable. > > - res = (intmax_t)get_num(arg); > - if (res < 0) > - errx(1, "count cannot be negative"); > + res = get_num(arg); > + if (res == UINTMAX_MAX) > + errc(1, ERANGE, "%s", oper); This is nonsense error checking. get_num() already did correct checking and exited on range errors. A value of UINTMAX_MAX is not necessarily an error. After calling strtoumax(), it might be either a range error or at the end of the range (including the negative end). Since get_num() returned, it was not a range error. The check here does extra work to break the case where it is in-range. > if (res == 0) > - cpy_cnt = (uintmax_t)-1; > + cpy_cnt = UINTMAX_MAX; > else > - cpy_cnt = (uintmax_t)res; > + cpy_cnt = res; > } I count of 0 always meant infinity. It was converted to the huge value (uintmax_t)-1 which is an alternative spelling of UINTMAX_MAX. My version makes changes elswhere so that 0 works as itself and the user-specified UINTMAX_MAX is not corrupted. > > static void > @@ -219,7 +220,7 @@ f_files(char *arg) > > files_cnt = get_num(arg); > if (files_cnt < 1) > - errx(1, "files must be between 1 and %jd", (uintmax_t)-1); > + errx(1, "files must be between 1 and %zu", SIZE_MAX); > } %jd here was wrong. The value has type uintmax_t. It was printed as -1. Now a different wrong value is printed. The maximum returned by get_num() is still UINTMAX_MAX. This differs from SIZE_MAX on 64-bit arches. My version removes the range check and allows a count of 0. > > static void > @@ -240,8 +241,8 @@ f_ibs(char *arg) > if (!(ddflags & C_BS)) { > res = get_num(arg); > if (res < 1 || res > SSIZE_MAX) Range checks like this are of course correct. Some of the ones with bogus casts might be for portability to systems without OFF_MAX and/or UOFF_MAX. > - errx(1, "ibs must be between 1 and %jd", > - (intmax_t)SSIZE_MAX); > + errx(1, "ibs must be between 1 and %zd", > + SSIZE_MAX); > in.dbsz = (size_t)res; > } > } The change is unportable, as above > @@ -261,8 +262,8 @@ f_obs(char *arg) > if (!(ddflags & C_BS)) { > res = get_num(arg); > if (res < 1 || res > SSIZE_MAX) > - errx(1, "obs must be between 1 and %jd", > - (intmax_t)SSIZE_MAX); > + errx(1, "obs must be between 1 and %zd", > + SSIZE_MAX); > out.dbsz = (size_t)res; > } > } Unportable. > > Modified: head/bin/dd/conv.c > ============================================================================== > --- head/bin/dd/conv.c Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/conv.c Fri Aug 25 15:31:55 2017 (r322893) > @@ -133,7 +133,7 @@ block(void) > */ > ch = 0; > for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) { > - maxlen = MIN(cbsz, in.dbcnt); > + maxlen = MIN(cbsz, (size_t)in.dbcnt); > if ((t = ctab) != NULL) > for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; > ++cnt) Bogus cast to compensate for dbcnt being changed to ssize_t. ssize_t is a necessary evil holding the return value of read() and write() (except the return type should be plain int as in V7 and ssize_t shouldn't exist) (but the main design error was changing the arg type of read() and write() from int to unsigned and then to size_t. The different types give a type morass and args larger than than the signed max are unportable at best). Buffer sizes should have size <= SSIZE_MAX because the behaviour of read() and write() is implementation-defined and hard to use betteen SSIZE_MAX+(size_t)1 and SIZE_MAX. But don't use ssize_t for anything else. Not even for buffer sizes that it can hold. You also changed dbsz to ssize_t. That is the wrong type to pass to read() and write(). It gets converted implicitly by the prototype. The above cast does the same conversion to hide the bug that the types don't match. Both of the implicit conversions might be errors, but compilers don't warn enough for ones in prototypes because they are too common. > @@ -146,7 +146,7 @@ block(void) > * Check for short record without a newline. Reassemble the > * input block. > */ > - if (ch != '\n' && in.dbcnt < cbsz) { > + if (ch != '\n' && (size_t)in.dbcnt < cbsz) { > (void)memmove(in.db, in.dbp - in.dbcnt, in.dbcnt); > break; > } Lots more type poisoning. You didn't spread it to the memmove() call. The second and third args now have type ssize_t instead of size_t. This is hidden by thr prototype. Signed poisoning of cbsz would break the warning about the type mismatch in the comparison. I actually don't like unsigned types, but dd has always used them a lot and needs them to reach 4G on 32-bit systems. All unsigned works almost as well as all signed. > @@ -228,7 +228,7 @@ unblock(void) > * translation has to already be done or we might not recognize the > * spaces. > */ > - for (inp = in.db; in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { > + for (inp = in.db; (size_t)in.dbcnt >= cbsz; inp += cbsz, in.dbcnt -= cbsz) { > for (t = inp + cbsz - 1; t >= inp && *t == ' '; --t) > ; > if (t >= inp) { This cast also breaks the formatting. > > Modified: head/bin/dd/dd.c > ============================================================================== > --- head/bin/dd/dd.c Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/dd.c Fri Aug 25 15:31:55 2017 (r322893) > @@ -204,10 +204,10 @@ setup(void) > * record oriented I/O, only need a single buffer. > */ > if (!(ddflags & (C_BLOCK | C_UNBLOCK))) { > - if ((in.db = malloc(out.dbsz + in.dbsz - 1)) == NULL) > + if ((in.db = malloc((size_t)out.dbsz + in.dbsz - 1)) == NULL) > err(1, "input buffer"); > out.db = in.db; > - } else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL || > + } else if ((in.db = malloc(MAX((size_t)in.dbsz, cbsz) + cbsz)) == NULL || > (out.db = malloc(out.dbsz + cbsz)) == NULL) > err(1, "output buffer"); > Signed poisoning. > @@ -405,7 +405,7 @@ dd_in(void) > ++st.in_full; > > /* Handle full input blocks. */ > - } else if ((size_t)n == in.dbsz) { > + } else if ((size_t)n == (size_t)in.dbsz) { > in.dbcnt += in.dbrcnt = n; > ++st.in_full; > Old bogus cast. n already has type size_t. New signed poisoning. > @@ -562,7 +562,7 @@ dd_out(int force) > outp += nw; > st.bytes += nw; > > - if ((size_t)nw == n && n == out.dbsz) > + if ((size_t)nw == n && n == (size_t)out.dbsz) > ++st.out_full; > else > ++st.out_part; > Lots more signed poisoning. nw holds the value returned by write(), so it needs to be signed (ssize_t). This already poisoned most uses of it. > Modified: head/bin/dd/dd.h > ============================================================================== > --- head/bin/dd/dd.h Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/dd.h Fri Aug 25 15:31:55 2017 (r322893) > @@ -38,10 +38,9 @@ > typedef struct { > u_char *db; /* buffer address */ > u_char *dbp; /* current buffer I/O address */ > - /* XXX ssize_t? */ Comment written before someone understood the full brokenness of ssize_t. > - size_t dbcnt; /* current buffer byte count */ Counts should be signed (buffer counts for passing to read()/write() or just adding up). > - size_t dbrcnt; /* last read byte count */ The return value might need to be signed, but it should be converted to unsigned as soon as possible (after checking for errors) to minimise signed poisoning. > - size_t dbsz; /* block size */ Block sizes should be signed. > + ssize_t dbcnt; /* current buffer byte count */ > + ssize_t dbrcnt; /* last read byte count */ > + ssize_t dbsz; /* block size */ > > #define ISCHR 0x01 /* character device (warn on short) */ > #define ISPIPE 0x02 /* pipe-like (see position.c) */ > > Modified: head/bin/dd/position.c > ============================================================================== > --- head/bin/dd/position.c Fri Aug 25 14:42:11 2017 (r322892) > +++ head/bin/dd/position.c Fri Aug 25 15:31:55 2017 (r322893) > @@ -207,7 +207,7 @@ pos_out(void) > n = write(out.fd, out.db, out.dbsz); > if (n == -1) > err(1, "%s", out.name); > - if ((size_t)n != out.dbsz) > + if (n != out.dbsz) > errx(1, "%s: write failure", out.name); > } > break; This moves the ugly ugly conversions to an implicit one in the function call. The error handling is still broken. The non-error of a short write is not handled and this is misreported as a write failure (though correctly using errx()). The signed poisoning makes the critical old and new bugs hard to see. Bruce From owner-svn-src-head@freebsd.org Fri Aug 25 22:37:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DE93DE2D4E; Fri, 25 Aug 2017 22:37:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31E90731C5; Fri, 25 Aug 2017 22:37:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v7PMbqiL006177 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 26 Aug 2017 01:37:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v7PMbqiL006177 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v7PMbqcA006176; Sat, 26 Aug 2017 01:37:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Aug 2017 01:37:52 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r306512 - in head/sys: kern sys Message-ID: <20170825223752.GN1700@kib.kiev.ua> References: <201609301727.u8UHRIgD051373@repo.freebsd.org> <6ea06065-ea5c-b83b-3854-224626be0d77@FreeBSD.org> <20170825103534.GK1700@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 22:37:58 -0000 On Fri, Aug 25, 2017 at 02:29:28PM -0700, Bryan Drewery wrote: > https://people.freebsd.org/~bdrewery/patches/vdrop-global-list.diff I do not object against his handling. There is really very small amount of code shared between mp != NULL and mp == NULL cases, you may consider making them use separate paths instead of adding more than one check for mp != NULL. VNASSERT() statement has wrong indent on the continuation line. From owner-svn-src-head@freebsd.org Fri Aug 25 22:38:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41212DE2DD8; Fri, 25 Aug 2017 22:38:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7F273314; Fri, 25 Aug 2017 22:38:56 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PMcue1012684; Fri, 25 Aug 2017 22:38:56 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PMcujp012682; Fri, 25 Aug 2017 22:38:56 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201708252238.v7PMcujp012682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 25 Aug 2017 22:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322906 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 322906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 22:38:57 -0000 Author: sbruno Date: Fri Aug 25 22:38:55 2017 New Revision: 322906 URL: https://svnweb.freebsd.org/changeset/base/322906 Log: Add a different #define for the maximum number of transmit and recieve descriptors for the igb(4) class of devices. This will allow a better definition for maximum going forward. Some igb(4) devices support more than the default 4K. Reported by: Jason (j@nitrology.com) Sponsored by: Limelight Networks Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Aug 25 21:53:51 2017 (r322905) +++ head/sys/dev/e1000/if_em.c Fri Aug 25 22:38:55 2017 (r322906) @@ -515,8 +515,8 @@ static struct if_shared_ctx igb_sctx_init = { .isc_nrxd_min = {EM_MIN_RXD}, .isc_ntxd_min = {EM_MIN_TXD}, - .isc_nrxd_max = {EM_MAX_RXD}, - .isc_ntxd_max = {EM_MAX_TXD}, + .isc_nrxd_max = {IGB_MAX_RXD}, + .isc_ntxd_max = {IGB_MAX_TXD}, .isc_nrxd_default = {EM_DEFAULT_RXD}, .isc_ntxd_default = {EM_DEFAULT_TXD}, }; Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Fri Aug 25 21:53:51 2017 (r322905) +++ head/sys/dev/e1000/if_em.h Fri Aug 25 22:38:55 2017 (r322906) @@ -96,10 +96,10 @@ /* Tunables */ /* - * EM_TXD: Maximum number of Transmit Descriptors + * EM_MAX_TXD: Maximum number of Transmit Descriptors * Valid Range: 80-256 for 82542 and 82543-based adapters * 80-4096 for others - * Default Value: 256 + * Default Value: 1024 * This value is the number of transmit descriptors allocated by the driver. * Increasing this value allows the driver to queue more transmits. Each * descriptor is 16 bytes. @@ -111,12 +111,13 @@ #define EM_MAX_TXD 4096 #define EM_DEFAULT_TXD 1024 #define EM_DEFAULT_MULTI_TXD 4096 +#define IGB_MAX_TXD 4096 /* - * EM_RXD - Maximum number of receive Descriptors + * EM_MAX_RXD - Maximum number of receive Descriptors * Valid Range: 80-256 for 82542 and 82543-based adapters * 80-4096 for others - * Default Value: 256 + * Default Value: 1024 * This value is the number of receive descriptors allocated by the driver. * Increasing this value allows the driver to buffer more incoming packets. * Each descriptor is 16 bytes. A receive buffer is also allocated for each @@ -129,6 +130,7 @@ #define EM_MAX_RXD 4096 #define EM_DEFAULT_RXD 1024 #define EM_DEFAULT_MULTI_RXD 4096 +#define IGB_MAX_RXD 4096 /* * EM_TIDV - Transmit Interrupt Delay Value From owner-svn-src-head@freebsd.org Fri Aug 25 23:10:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80A32DE3758; Fri, 25 Aug 2017 23:10:28 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4D87A74599; Fri, 25 Aug 2017 23:10:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PNARnZ025379; Fri, 25 Aug 2017 23:10:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PNARk5025378; Fri, 25 Aug 2017 23:10:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708252310.v7PNARk5025378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 25 Aug 2017 23:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322912 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 322912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 23:10:28 -0000 Author: jhb Date: Fri Aug 25 23:10:27 2017 New Revision: 322912 URL: https://svnweb.freebsd.org/changeset/base/322912 Log: Don't grab SOCK_LOCK for soref() when queuing an AIO request. The AIO job holds a reference on the associated file descriptor, so the socket's count should already be > 0. This fixes a LOR with the socket buffer lock after recent socket locking changes in HEAD. Sponsored by: Chelsio Communications Modified: head/sys/kern/sys_socket.c Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Fri Aug 25 23:09:11 2017 (r322911) +++ head/sys/kern/sys_socket.c Fri Aug 25 23:10:27 2017 (r322912) @@ -746,11 +746,7 @@ sowakeup_aio(struct socket *so, struct sockbuf *sb) if (sb->sb_flags & SB_AIO_RUNNING) return; sb->sb_flags |= SB_AIO_RUNNING; - if (sb == &so->so_snd) - SOCK_LOCK(so); soref(so); - if (sb == &so->so_snd) - SOCK_UNLOCK(so); soaio_enqueue(&sb->sb_aiotask); } From owner-svn-src-head@freebsd.org Fri Aug 25 23:13:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA00ADE3948; Fri, 25 Aug 2017 23:13:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 729C274968; Fri, 25 Aug 2017 23:13:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PNDLu1029152; Fri, 25 Aug 2017 23:13:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PNDLk4029149; Fri, 25 Aug 2017 23:13:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708252313.v7PNDLk4029149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 25 Aug 2017 23:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322913 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 322913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 23:13:22 -0000 Author: kib Date: Fri Aug 25 23:13:21 2017 New Revision: 322913 URL: https://svnweb.freebsd.org/changeset/base/322913 Log: Replace global swhash in swap pager with per-object trie to track swap blocks assigned to the object pages. - The global swhash_mtx is removed, trie is synchronized by the corresponding object lock. - The swp_pager_meta_free_all() function used during object termination is optimized by only looking at the trie instead of having to search whole hash for the swap blocks owned by the object. - On swap_pager_swapoff(), instead of iterating over the swhash, global object list have to be inspected. There, we have to ensure that we do see valid trie content if we see that the object type is swap. Sizing of the swblk zone is same as for swblock zone, each swblk maps SWAP_META_PAGES pages. Proposed by: alc Reviewed by: alc, markj (previous version) Tested by: alc, pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D11435 Modified: head/sys/vm/swap_pager.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Aug 25 23:10:27 2017 (r322912) +++ head/sys/vm/swap_pager.c Fri Aug 25 23:13:21 2017 (r322913) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -127,22 +128,17 @@ __FBSDID("$FreeBSD$"); #define SWB_NPAGES MAX_PAGEOUT_CLUSTER #endif +#define SWAP_META_PAGES PCTRIE_COUNT + /* - * The swblock structure maps an object and a small, fixed-size range - * of page indices to disk addresses within a swap area. - * The collection of these mappings is implemented as a hash table. - * Unused disk addresses within a swap area are allocated and managed - * using a blist. + * A swblk structure maps each page index within a + * SWAP_META_PAGES-aligned and sized range to the address of an + * on-disk swap block (or SWAPBLK_NONE). The collection of these + * mappings for an entire vm object is implemented as a pc-trie. */ -#define SWAP_META_PAGES 32 -#define SWAP_META_MASK (SWAP_META_PAGES - 1) - -struct swblock { - struct swblock *swb_hnext; - vm_object_t swb_object; - vm_pindex_t swb_index; - int swb_count; - daddr_t swb_pages[SWAP_META_PAGES]; +struct swblk { + vm_pindex_t p; + daddr_t d[SWAP_META_PAGES]; }; static MALLOC_DEFINE(M_VMPGDATA, "vm_pgdata", "swap pager private data"); @@ -328,10 +324,6 @@ SYSCTL_PROC(_vm, OID_AUTO, swap_async_max, CTLTYPE_INT CTLFLAG_MPSAFE, NULL, 0, sysctl_swap_async_max, "I", "Maximum running async swap ops"); -static struct swblock **swhash; -static int swhash_mask; -static struct mtx swhash_mtx; - static struct sx sw_alloc_sx; /* @@ -345,7 +337,8 @@ static struct sx sw_alloc_sx; (&swap_pager_object_list[((int)(intptr_t)handle >> 4) & (NOBJLISTS-1)]) static struct pagerlst swap_pager_object_list[NOBJLISTS]; -static uma_zone_t swap_zone; +static uma_zone_t swblk_zone; +static uma_zone_t swpctrie_zone; /* * pagerops for OBJT_SWAP - "swap pager". Some ops are also global procedure @@ -403,12 +396,28 @@ static daddr_t swp_pager_getswapspace(int npages); /* * Metadata functions */ -static struct swblock **swp_pager_hash(vm_object_t object, vm_pindex_t index); static void swp_pager_meta_build(vm_object_t, vm_pindex_t, daddr_t); static void swp_pager_meta_free(vm_object_t, vm_pindex_t, vm_pindex_t); static void swp_pager_meta_free_all(vm_object_t); static daddr_t swp_pager_meta_ctl(vm_object_t, vm_pindex_t, int); +static void * +swblk_trie_alloc(struct pctrie *ptree) +{ + + return (uma_zalloc(swpctrie_zone, M_NOWAIT | (curproc == pageproc ? + M_USE_RESERVE : 0))); +} + +static void +swblk_trie_free(struct pctrie *ptree, void *node) +{ + + uma_zfree(swpctrie_zone, node); +} + +PCTRIE_DEFINE(SWAP, swblk, p, swblk_trie_alloc, swblk_trie_free); + /* * SWP_SIZECHECK() - update swap_pager_full indication * @@ -437,33 +446,6 @@ swp_sizecheck(void) } /* - * SWP_PAGER_HASH() - hash swap meta data - * - * This is an helper function which hashes the swapblk given - * the object and page index. It returns a pointer to a pointer - * to the object, or a pointer to a NULL pointer if it could not - * find a swapblk. - */ -static struct swblock ** -swp_pager_hash(vm_object_t object, vm_pindex_t index) -{ - struct swblock **pswap; - struct swblock *swap; - - index &= ~(vm_pindex_t)SWAP_META_MASK; - pswap = &swhash[(index ^ (int)(intptr_t)object) & swhash_mask]; - while ((swap = *pswap) != NULL) { - if (swap->swb_object == object && - swap->swb_index == index - ) { - break; - } - pswap = &swap->swb_hnext; - } - return (pswap); -} - -/* * SWAP_PAGER_INIT() - initialize the swap pager! * * Expected to be started from system init. NOTE: This code is run @@ -528,21 +510,25 @@ swap_pager_swap_init(void) mtx_unlock(&pbuf_mtx); /* - * Initialize our zone. Right now I'm just guessing on the number - * we need based on the number of pages in the system. Each swblock - * can hold 32 pages, so this is probably overkill. This reservation - * is typically limited to around 32MB by default. + * Initialize our zone, guessing on the number we need based + * on the number of pages in the system. */ n = vm_cnt.v_page_count / 2; - if (maxswzone && n > maxswzone / sizeof(struct swblock)) - n = maxswzone / sizeof(struct swblock); + if (maxswzone && n > maxswzone / sizeof(struct swblk)) + n = maxswzone / sizeof(struct swblk); + swpctrie_zone = uma_zcreate("swpctrie", pctrie_node_size(), NULL, NULL, + pctrie_zone_init, NULL, UMA_ALIGN_PTR, + UMA_ZONE_NOFREE | UMA_ZONE_VM); + if (swpctrie_zone == NULL) + panic("failed to create swap pctrie zone."); + swblk_zone = uma_zcreate("swblk", sizeof(struct swblk), NULL, NULL, + NULL, NULL, _Alignof(struct swblk) - 1, + UMA_ZONE_NOFREE | UMA_ZONE_VM); + if (swblk_zone == NULL) + panic("failed to create swap blk zone."); n2 = n; - swap_zone = uma_zcreate("SWAPMETA", sizeof(struct swblock), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_VM); - if (swap_zone == NULL) - panic("failed to create swap_zone."); do { - if (uma_zone_reserve_kva(swap_zone, n)) + if (uma_zone_reserve_kva(swblk_zone, n)) break; /* * if the allocation failed, try a zone two thirds the @@ -551,24 +537,13 @@ swap_pager_swap_init(void) n -= ((n + 2) / 3); } while (n > 0); if (n2 != n) - printf("Swap zone entries reduced from %lu to %lu.\n", n2, n); + printf("Swap blk zone entries reduced from %lu to %lu.\n", + n2, n); swap_maxpages = n * SWAP_META_PAGES; - swzone = n * sizeof(struct swblock); - n2 = n; - - /* - * Initialize our meta-data hash table. The swapper does not need to - * be quite as efficient as the VM system, so we do not use an - * oversized hash table. - * - * n: size of hash table, must be power of 2 - * swhash_mask: hash table index mask - */ - for (n = 1; n < n2 / 8; n *= 2) - ; - swhash = malloc(sizeof(struct swblock *) * n, M_VMPGDATA, M_WAITOK | M_ZERO); - swhash_mask = n - 1; - mtx_init(&swhash_mtx, "swap_pager swhash", NULL, MTX_DEF); + swzone = n * sizeof(struct swblk); + if (!uma_zone_reserve_kva(swpctrie_zone, n)) + printf("Cannot reserve swap pctrie zone, " + "reduce kern.maxswzone.\n"); } static vm_object_t @@ -582,14 +557,20 @@ swap_pager_alloc_init(void *handle, struct ucred *cred return (NULL); crhold(cred); } + + /* + * The un_pager.swp.swp_blks trie is initialized by + * vm_object_allocate() to ensure the correct order of + * visibility to other threads. + */ object = vm_object_allocate(OBJT_SWAP, OFF_TO_IDX(offset + PAGE_MASK + size)); + object->handle = handle; if (cred != NULL) { object->cred = cred; object->charge = size; } - object->un_pager.swp.swp_bcount = 0; return (object); } @@ -1651,50 +1632,56 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t static void swap_pager_swapoff(struct swdevt *sp) { - struct swblock *swap; - vm_object_t locked_obj, object; - vm_pindex_t pindex; - int i, j, retries; + struct swblk *sb; + vm_object_t object; + vm_pindex_t pi; + int i, retries; sx_assert(&swdev_syscall_lock, SA_XLOCKED); retries = 0; - locked_obj = NULL; full_rescan: - mtx_lock(&swhash_mtx); - for (i = 0; i <= swhash_mask; i++) { /* '<=' is correct here */ -restart: - for (swap = swhash[i]; swap != NULL; swap = swap->swb_hnext) { - object = swap->swb_object; - pindex = swap->swb_index; - for (j = 0; j < SWAP_META_PAGES; ++j) { - if (!swp_pager_isondev(swap->swb_pages[j], sp)) + mtx_lock(&vm_object_list_mtx); + TAILQ_FOREACH(object, &vm_object_list, object_list) { + if (object->type != OBJT_SWAP) + continue; + mtx_unlock(&vm_object_list_mtx); + /* Depends on type-stability. */ + VM_OBJECT_WLOCK(object); + + /* + * Dead objects are eventually terminated on their own. + */ + if ((object->flags & OBJ_DEAD) != 0) + goto next_obj; + + /* + * Sync with fences placed after pctrie + * initialization. We must not access pctrie below + * unless we checked that our object is swap and not + * dead. + */ + atomic_thread_fence_acq(); + if (object->type != OBJT_SWAP) + goto next_obj; + + for (pi = 0; (sb = SWAP_PCTRIE_LOOKUP_GE( + &object->un_pager.swp.swp_blks, pi)) != NULL; ) { + pi = sb->p + SWAP_META_PAGES; + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->d[i] == SWAPBLK_NONE) continue; - if (locked_obj != object) { - if (locked_obj != NULL) - VM_OBJECT_WUNLOCK(locked_obj); - locked_obj = object; - if (!VM_OBJECT_TRYWLOCK(object)) { - mtx_unlock(&swhash_mtx); - /* Depends on type-stability. */ - VM_OBJECT_WLOCK(object); - mtx_lock(&swhash_mtx); - goto restart; - } - } - MPASS(locked_obj == object); - mtx_unlock(&swhash_mtx); - swp_pager_force_pagein(object, pindex + j); - mtx_lock(&swhash_mtx); - goto restart; + if (swp_pager_isondev(sb->d[i], sp)) + swp_pager_force_pagein(object, + sb->p + i); } } +next_obj: + VM_OBJECT_WUNLOCK(object); + mtx_lock(&vm_object_list_mtx); } - mtx_unlock(&swhash_mtx); - if (locked_obj != NULL) { - VM_OBJECT_WUNLOCK(locked_obj); - locked_obj = NULL; - } + mtx_unlock(&vm_object_list_mtx); + if (sp->sw_used) { /* * Objects may be locked or paging to the device being @@ -1738,85 +1725,88 @@ restart: static void swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) { - static volatile int exhausted; - struct swblock *swap; - struct swblock **pswap; - int idx; + static volatile int swblk_zone_exhausted, swpctrie_zone_exhausted; + struct swblk *sb; + vm_pindex_t modpi, rdpi; + int error, i; VM_OBJECT_ASSERT_WLOCKED(object); + /* * Convert default object to swap object if necessary */ if (object->type != OBJT_SWAP) { + pctrie_init(&object->un_pager.swp.swp_blks); + + /* + * Ensure that swap_pager_swapoff()'s iteration over + * object_list does not see a garbage pctrie. + */ + atomic_thread_fence_rel(); + object->type = OBJT_SWAP; - object->un_pager.swp.swp_bcount = 0; KASSERT(object->handle == NULL, ("default pager with handle")); } - /* - * Locate hash entry. If not found create, but if we aren't adding - * anything just return. If we run out of space in the map we wait - * and, since the hash table may have changed, retry. - */ -retry: - mtx_lock(&swhash_mtx); - pswap = swp_pager_hash(object, pindex); - - if ((swap = *pswap) == NULL) { - int i; - + rdpi = rounddown(pindex, SWAP_META_PAGES); + sb = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, rdpi); + if (sb == NULL) { if (swapblk == SWAPBLK_NONE) - goto done; - - swap = *pswap = uma_zalloc(swap_zone, M_NOWAIT | - (curproc == pageproc ? M_USE_RESERVE : 0)); - if (swap == NULL) { - mtx_unlock(&swhash_mtx); + return; + for (;;) { + sb = uma_zalloc(swblk_zone, M_NOWAIT | (curproc == + pageproc ? M_USE_RESERVE : 0)); + if (sb != NULL) { + sb->p = rdpi; + for (i = 0; i < SWAP_META_PAGES; i++) + sb->d[i] = SWAPBLK_NONE; + if (atomic_cmpset_int(&swblk_zone_exhausted, + 1, 0)) + printf("swblk zone ok\n"); + break; + } VM_OBJECT_WUNLOCK(object); - if (uma_zone_exhausted(swap_zone)) { - if (atomic_cmpset_int(&exhausted, 0, 1)) - printf("swap zone exhausted, " + if (uma_zone_exhausted(swblk_zone)) { + if (atomic_cmpset_int(&swblk_zone_exhausted, + 0, 1)) + printf("swap blk zone exhausted, " "increase kern.maxswzone\n"); vm_pageout_oom(VM_OOM_SWAPZ); - pause("swzonex", 10); + pause("swzonxb", 10); } else VM_WAIT; VM_OBJECT_WLOCK(object); - goto retry; } - - if (atomic_cmpset_int(&exhausted, 1, 0)) - printf("swap zone ok\n"); - - swap->swb_hnext = NULL; - swap->swb_object = object; - swap->swb_index = pindex & ~(vm_pindex_t)SWAP_META_MASK; - swap->swb_count = 0; - - ++object->un_pager.swp.swp_bcount; - - for (i = 0; i < SWAP_META_PAGES; ++i) - swap->swb_pages[i] = SWAPBLK_NONE; + for (;;) { + error = SWAP_PCTRIE_INSERT( + &object->un_pager.swp.swp_blks, sb); + if (error == 0) { + if (atomic_cmpset_int(&swpctrie_zone_exhausted, + 1, 0)) + printf("swpctrie zone ok\n"); + break; + } + VM_OBJECT_WUNLOCK(object); + if (uma_zone_exhausted(swpctrie_zone)) { + if (atomic_cmpset_int(&swpctrie_zone_exhausted, + 0, 1)) + printf("swap pctrie zone exhausted, " + "increase kern.maxswzone\n"); + vm_pageout_oom(VM_OOM_SWAPZ); + pause("swzonxp", 10); + } else + VM_WAIT; + VM_OBJECT_WLOCK(object); + } } + MPASS(sb->p == rdpi); - /* - * Delete prior contents of metadata - */ - idx = pindex & SWAP_META_MASK; - - if (swap->swb_pages[idx] != SWAPBLK_NONE) { - swp_pager_freeswapspace(swap->swb_pages[idx], 1); - --swap->swb_count; - } - - /* - * Enter block into metadata - */ - swap->swb_pages[idx] = swapblk; - if (swapblk != SWAPBLK_NONE) - ++swap->swb_count; -done: - mtx_unlock(&swhash_mtx); + modpi = pindex % SWAP_META_PAGES; + /* Delete prior contents of metadata. */ + if (sb->d[modpi] != SWAPBLK_NONE) + swp_pager_freeswapspace(sb->d[modpi], 1); + /* Enter block into metadata. */ + sb->d[modpi] = swapblk; } /* @@ -1830,42 +1820,40 @@ done: * with resident pages. */ static void -swp_pager_meta_free(vm_object_t object, vm_pindex_t index, vm_pindex_t count) +swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count) { - struct swblock **pswap, *swap; - vm_pindex_t c; - daddr_t v; - int n, sidx; + struct swblk *sb; + vm_pindex_t last; + int i; + bool empty; VM_OBJECT_ASSERT_LOCKED(object); if (object->type != OBJT_SWAP || count == 0) return; - mtx_lock(&swhash_mtx); - for (c = 0; c < count;) { - pswap = swp_pager_hash(object, index); - sidx = index & SWAP_META_MASK; - n = SWAP_META_PAGES - sidx; - index += n; - if ((swap = *pswap) == NULL) { - c += n; - continue; - } - for (; c < count && sidx < SWAP_META_PAGES; ++c, ++sidx) { - if ((v = swap->swb_pages[sidx]) == SWAPBLK_NONE) + last = pindex + count - 1; + for (;;) { + sb = SWAP_PCTRIE_LOOKUP_GE(&object->un_pager.swp.swp_blks, + rounddown(pindex, SWAP_META_PAGES)); + if (sb == NULL || sb->p > last) + break; + empty = true; + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->d[i] == SWAPBLK_NONE) continue; - swp_pager_freeswapspace(v, 1); - swap->swb_pages[sidx] = SWAPBLK_NONE; - if (--swap->swb_count == 0) { - *pswap = swap->swb_hnext; - uma_zfree(swap_zone, swap); - --object->un_pager.swp.swp_bcount; - c += SWAP_META_PAGES - sidx; - break; - } + if (pindex <= sb->p + i && sb->p + i <= last) { + swp_pager_freeswapspace(sb->d[i], 1); + sb->d[i] = SWAPBLK_NONE; + } else + empty = false; } + pindex = sb->p + SWAP_META_PAGES; + if (empty) { + SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, + sb->p); + uma_zfree(swblk_zone, sb); + } } - mtx_unlock(&swhash_mtx); } /* @@ -1877,36 +1865,23 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t in static void swp_pager_meta_free_all(vm_object_t object) { - struct swblock **pswap, *swap; - vm_pindex_t index; - daddr_t v; + struct swblk *sb; + vm_pindex_t pindex; int i; VM_OBJECT_ASSERT_WLOCKED(object); if (object->type != OBJT_SWAP) return; - index = 0; - while (object->un_pager.swp.swp_bcount != 0) { - mtx_lock(&swhash_mtx); - pswap = swp_pager_hash(object, index); - if ((swap = *pswap) != NULL) { - for (i = 0; i < SWAP_META_PAGES; ++i) { - v = swap->swb_pages[i]; - if (v != SWAPBLK_NONE) { - --swap->swb_count; - swp_pager_freeswapspace(v, 1); - } - } - if (swap->swb_count != 0) - panic( - "swap_pager_meta_free_all: swb_count != 0"); - *pswap = swap->swb_hnext; - uma_zfree(swap_zone, swap); - --object->un_pager.swp.swp_bcount; + for (pindex = 0; (sb = SWAP_PCTRIE_LOOKUP_GE( + &object->un_pager.swp.swp_blks, pindex)) != NULL;) { + pindex = sb->p + SWAP_META_PAGES; + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->d[i] != SWAPBLK_NONE) + swp_pager_freeswapspace(sb->d[i], 1); } - mtx_unlock(&swhash_mtx); - index += SWAP_META_PAGES; + SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, sb->p); + uma_zfree(swblk_zone, sb); } } @@ -1920,9 +1895,6 @@ swp_pager_meta_free_all(vm_object_t object) * was invalid. This routine will automatically free any invalid * meta-data swapblks. * - * It is not possible to store invalid swapblks in the swap meta data - * (other then a literal 'SWAPBLK_NONE'), so we don't bother checking. - * * When acting on a busy resident page and paging is in progress, we * have to wait until paging is complete but otherwise can act on the * busy page. @@ -1933,10 +1905,9 @@ swp_pager_meta_free_all(vm_object_t object) static daddr_t swp_pager_meta_ctl(vm_object_t object, vm_pindex_t pindex, int flags) { - struct swblock **pswap; - struct swblock *swap; + struct swblk *sb; daddr_t r1; - int idx; + int i; VM_OBJECT_ASSERT_LOCKED(object); /* @@ -1946,30 +1917,29 @@ swp_pager_meta_ctl(vm_object_t object, vm_pindex_t pin if (object->type != OBJT_SWAP) return (SWAPBLK_NONE); - r1 = SWAPBLK_NONE; - mtx_lock(&swhash_mtx); - pswap = swp_pager_hash(object, pindex); - - if ((swap = *pswap) != NULL) { - idx = pindex & SWAP_META_MASK; - r1 = swap->swb_pages[idx]; - - if (r1 != SWAPBLK_NONE) { - if (flags & SWM_FREE) { - swp_pager_freeswapspace(r1, 1); - r1 = SWAPBLK_NONE; - } - if (flags & (SWM_FREE|SWM_POP)) { - swap->swb_pages[idx] = SWAPBLK_NONE; - if (--swap->swb_count == 0) { - *pswap = swap->swb_hnext; - uma_zfree(swap_zone, swap); - --object->un_pager.swp.swp_bcount; - } - } + sb = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, + rounddown(pindex, SWAP_META_PAGES)); + if (sb == NULL) + return (SWAPBLK_NONE); + r1 = sb->d[pindex % SWAP_META_PAGES]; + if (r1 == SWAPBLK_NONE) + return (SWAPBLK_NONE); + if ((flags & (SWM_FREE | SWM_POP)) != 0) { + sb->d[pindex % SWAP_META_PAGES] = SWAPBLK_NONE; + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->d[i] != SWAPBLK_NONE) + break; } + if (i == SWAP_META_PAGES) { + SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, + rounddown(pindex, SWAP_META_PAGES)); + uma_zfree(swblk_zone, sb); + } } - mtx_unlock(&swhash_mtx); + if ((flags & SWM_FREE) != 0) { + swp_pager_freeswapspace(r1, 1); + r1 = SWAPBLK_NONE; + } return (r1); } @@ -1983,32 +1953,38 @@ swp_pager_meta_ctl(vm_object_t object, vm_pindex_t pin vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex) { - struct swblock **pswap, *swap; - vm_pindex_t i, j, lim; - int idx; + struct swblk *sb; + int i; VM_OBJECT_ASSERT_LOCKED(object); - if (object->type != OBJT_SWAP || object->un_pager.swp.swp_bcount == 0) + if (object->type != OBJT_SWAP) return (object->size); - mtx_lock(&swhash_mtx); - for (j = pindex; j < object->size; j = lim) { - pswap = swp_pager_hash(object, j); - lim = rounddown2(j + SWAP_META_PAGES, SWAP_META_PAGES); - if (lim > object->size) - lim = object->size; - if ((swap = *pswap) != NULL) { - for (idx = j & SWAP_META_MASK, i = j; i < lim; - i++, idx++) { - if (swap->swb_pages[idx] != SWAPBLK_NONE) - goto found; - } + sb = SWAP_PCTRIE_LOOKUP_GE(&object->un_pager.swp.swp_blks, + rounddown(pindex, SWAP_META_PAGES)); + if (sb == NULL) + return (object->size); + if (sb->p < pindex) { + for (i = pindex % SWAP_META_PAGES; i < SWAP_META_PAGES; i++) { + if (sb->d[i] != SWAPBLK_NONE) + return (sb->p + i); } + sb = SWAP_PCTRIE_LOOKUP_GE(&object->un_pager.swp.swp_blks, + roundup(pindex, SWAP_META_PAGES)); + if (sb == NULL) + return (object->size); } - i = object->size; -found: - mtx_unlock(&swhash_mtx); - return (i); + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->d[i] != SWAPBLK_NONE) + return (sb->p + i); + } + + /* + * We get here if a swblk is present in the trie but it + * doesn't map any blocks. + */ + MPASS(0); + return (object->size); } /* @@ -2044,7 +2020,7 @@ sys_swapon(struct thread *td, struct swapon_args *uap) * Swap metadata may not fit in the KVM if we have physical * memory of >1GB. */ - if (swap_zone == NULL) { + if (swblk_zone == NULL) { error = ENOMEM; goto done; } @@ -2088,7 +2064,7 @@ swapon_check_swzone(unsigned long npages) unsigned long maxpages; /* absolute maximum we can handle assuming 100% efficiency */ - maxpages = uma_zone_get_max(swap_zone) * SWAP_META_PAGES; + maxpages = uma_zone_get_max(swblk_zone) * SWAP_META_PAGES; /* recommend using no more than half that amount */ if (npages > maxpages / 2) { @@ -2413,15 +2389,9 @@ SYSCTL_NODE(_vm, OID_AUTO, swap_info, CTLFLAG_RD | CTL "Swap statistics by device"); /* - * vmspace_swap_count() - count the approximate swap usage in pages for a - * vmspace. - * - * The map must be locked. - * - * Swap usage is determined by taking the proportional swap used by - * VM objects backing the VM map. To make up for fractional losses, - * if the VM object has any swap use at all the associated map entries - * count for at least 1 swap page. + * Count the approximate swap usage in pages for a vmspace. The + * shadowed or not yet copied on write swap blocks are not accounted. + * The map must be locked. */ long vmspace_swap_count(struct vmspace *vmspace) @@ -2429,23 +2399,38 @@ vmspace_swap_count(struct vmspace *vmspace) vm_map_t map; vm_map_entry_t cur; vm_object_t object; - long count, n; + struct swblk *sb; + vm_pindex_t e, pi; + long count; + int i; map = &vmspace->vm_map; count = 0; for (cur = map->header.next; cur != &map->header; cur = cur->next) { - if ((cur->eflags & MAP_ENTRY_IS_SUB_MAP) == 0 && - (object = cur->object.vm_object) != NULL) { - VM_OBJECT_WLOCK(object); - if (object->type == OBJT_SWAP && - object->un_pager.swp.swp_bcount != 0) { - n = (cur->end - cur->start) / PAGE_SIZE; - count += object->un_pager.swp.swp_bcount * - SWAP_META_PAGES * n / object->size + 1; + if ((cur->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) + continue; + object = cur->object.vm_object; + if (object == NULL || object->type != OBJT_SWAP) + continue; + VM_OBJECT_RLOCK(object); + if (object->type != OBJT_SWAP) + goto unlock; + pi = OFF_TO_IDX(cur->offset); + e = pi + OFF_TO_IDX(cur->end - cur->start); + for (;; pi = sb->p + SWAP_META_PAGES) { + sb = SWAP_PCTRIE_LOOKUP_GE( + &object->un_pager.swp.swp_blks, pi); + if (sb == NULL || sb->p >= e) + break; + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->p + i < e && + sb->d[i] != SWAPBLK_NONE) + count++; } - VM_OBJECT_WUNLOCK(object); } +unlock: + VM_OBJECT_RUNLOCK(object); } return (count); } Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Aug 25 23:10:27 2017 (r322912) +++ head/sys/vm/vm_object.c Fri Aug 25 23:13:21 2017 (r322913) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include /* for curproc, pageproc */ @@ -208,6 +209,7 @@ vm_object_zinit(void *mem, int size, int flags) object->paging_in_progress = 0; object->resident_page_count = 0; object->shadow_count = 0; + object->flags = OBJ_DEAD; mtx_lock(&vm_object_list_mtx); TAILQ_INSERT_TAIL(&vm_object_list, object, object_list); @@ -223,6 +225,16 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, LIST_INIT(&object->shadow_head); object->type = type; + if (type == OBJT_SWAP) + pctrie_init(&object->un_pager.swp.swp_blks); + + /* + * Ensure that swap_pager_swapoff() iteration over object_list + * sees up to date type and pctrie head if it observed + * non-dead object. + */ + atomic_thread_fence_rel(); + switch (type) { case OBJT_DEAD: panic("_vm_object_allocate: can't create OBJT_DEAD"); Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Fri Aug 25 23:10:27 2017 (r322912) +++ head/sys/vm/vm_object.h Fri Aug 25 23:13:21 2017 (r322913) @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -151,13 +152,12 @@ struct vm_object { * the handle changed and hash-chain * invalid. * - * swp_bcount - number of swap 'swblock' metablocks, each - * contains up to 16 swapblk assignments. - * see vm/swap_pager.h + * swp_blks - pc-trie of the allocated swap blocks. + * */ struct { void *swp_tmpfs; - int swp_bcount; + struct pctrie swp_blks; } swp; } un_pager; struct ucred *cred; From owner-svn-src-head@freebsd.org Fri Aug 25 23:18:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C111BDE3A07; Fri, 25 Aug 2017 23:18:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8391374AE6; Fri, 25 Aug 2017 23:18:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id B8E0E1899F; Fri, 25 Aug 2017 23:18:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id A7D918A4C; Fri, 25 Aug 2017 23:18:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id CPjV7Wi9Z9lW; Fri, 25 Aug 2017 23:18:15 +0000 (UTC) Subject: Re: svn commit: r306512 - in head/sys: kern sys DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 80B4D8A46 To: Konstantin Belousov Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201609301727.u8UHRIgD051373@repo.freebsd.org> <6ea06065-ea5c-b83b-3854-224626be0d77@FreeBSD.org> <20170825103534.GK1700@kib.kiev.ua> <20170825223752.GN1700@kib.kiev.ua> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <25ad986d-7a39-7854-5680-390c20a16743@FreeBSD.org> Date: Fri, 25 Aug 2017 16:17:59 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170825223752.GN1700@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ckNkO69sC6vSopMtmTNabeTjjuTFbw2Ln" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 23:18:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ckNkO69sC6vSopMtmTNabeTjjuTFbw2Ln Content-Type: multipart/mixed; boundary="XcVkcx4Ax0N4CvI0m0sJTwwIAQNHHrAqp"; protected-headers="v1" From: Bryan Drewery To: Konstantin Belousov Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <25ad986d-7a39-7854-5680-390c20a16743@FreeBSD.org> Subject: Re: svn commit: r306512 - in head/sys: kern sys References: <201609301727.u8UHRIgD051373@repo.freebsd.org> <6ea06065-ea5c-b83b-3854-224626be0d77@FreeBSD.org> <20170825103534.GK1700@kib.kiev.ua> <20170825223752.GN1700@kib.kiev.ua> In-Reply-To: <20170825223752.GN1700@kib.kiev.ua> --XcVkcx4Ax0N4CvI0m0sJTwwIAQNHHrAqp Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/25/2017 3:37 PM, Konstantin Belousov wrote: > On Fri, Aug 25, 2017 at 02:29:28PM -0700, Bryan Drewery wrote: >> https://people.freebsd.org/~bdrewery/patches/vdrop-global-list.diff > I do not object against his handling. >=20 > There is really very small amount of code shared between mp !=3D NULL > and mp =3D=3D NULL cases, you may consider making them use separate pat= hs > instead of adding more than one check for mp !=3D NULL. >=20 Sure, and I incorrectly was adding VMP_TMPMNTFREELIST flag for mp=3D=3DNU= LL case. I'll open a review. > VNASSERT() statement has wrong indent on the continuation line. >=20 --=20 Regards, Bryan Drewery --XcVkcx4Ax0N4CvI0m0sJTwwIAQNHHrAqp-- --ckNkO69sC6vSopMtmTNabeTjjuTFbw2Ln Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZoLAnAAoJEDXXcbtuRpfPRJ0IANds7jjlR2FGihpYQv0WqPvE 5ZGVBB8raABuIacEkeZUjnHP2eAcbNvAdg0LUvelIRRyTLKJI8pc/LR1tT45qZfU 36Zhher7I+75ymxYbnzhi/sQJ2CUiyzHORaByCJXHhVvUyysgEDNqyuZXCfF8fMB 3Kj+Ztlt8e5da4f6GPnzJSxG0qzzuU+JqMALWWu5rfNToUH0HyYOphMu+rqcgPki TvZ6z5rVgwMf6SfWpOvTf6qZh0p7Lt3wkKGdvpA96arkiGFCyBfUl3COkcr+5OU1 UTaOU5iQE2hD2RXneiIYi0vYnIkaKSBCMn0Y58EchGA6q4UBUFXGaai6wjSpi0c= =84mS -----END PGP SIGNATURE----- --ckNkO69sC6vSopMtmTNabeTjjuTFbw2Ln-- From owner-svn-src-head@freebsd.org Fri Aug 25 23:22:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BB45DE3BDC; Fri, 25 Aug 2017 23:22:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF4E74D31; Fri, 25 Aug 2017 23:22:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id F1A293C9552; Sat, 26 Aug 2017 08:49:12 +1000 (AEST) Date: Sat, 26 Aug 2017 08:49:12 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Alan Somers , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r322893 - head/bin/dd In-Reply-To: Message-ID: <20170826075540.X976@besplex.bde.org> References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=XdQGbixj9DvC8Hh_ePsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 23:22:05 -0000 On Fri, 25 Aug 2017, Conrad Meyer wrote: > Well, not negative, just large uint64_t numbers that would be negative > as off_t (int64_t). > > E.g., dd if=/dev/kmem bs=1 iseek=0xfffff...foo count=8. I think we > would like that to work. I don't recall whether it does or not before > this change. This is broken on 64-bit systems, first by the horrible get_off_t(), then by broken range checking in at least old versions of dd. The first bug in get_off_t() is that it uses strtoimax(). This fails for offsets >= INTMAX_MAX. This breaks the natural use of dd to seek to the kernel part of kmem using dd. E.g.: dd if=/dev/kmem bs=1 count=1 iseek=0xffffffff802d2100 This should give a negative offset than then works. (lseek() to negative offsets is implementation-defined for special files, and FreeBSD defines it so that it works for seeking in kmem. This depends on some 2's complement magic to represent large unsigned offsets as negative signed.) However, it doesn't work to double bs and halve iseek. The multiplication is then done by a higher level. It exceeds OFF_MAX, so the lseek() isn't tried. get_off_t() but not the higher level is fixed in my version. It does work to calculate the negative offset in another way inside get_off_t(). E.g., bs=1 iseek=-1 gives -1 which is passed to lseek(). bs=2 iseek=-1 also works to give the correct offset of -2 for lseek(). The arithmetic for converting large number like 0xffffffff802d2100 to a negative value is painful, especially since shells have similar bugs near INTMAX_MAX and UINTMAX_MAX and with signed and/or unsigned types even if they support 64-bit integers. The buggy range checking for bs=2 iseek=0x7fffffff802d2100 seems to be only in old versions of dd. It was in jcl(), and was just for the initial args (multiplying them would exceed OFF_MAX). Now there seems to be no check for overflow. The multiplication in pos_in() just overflows even if the check in jcl() passed, later when the seek point advances past INTMAX_MAX (if this exceeds OFF_MAX, then passing the result of the multiplicating to lseek() starts overflowing before the multiplication does). [Context lost to top posting]. Bruce From owner-svn-src-head@freebsd.org Fri Aug 25 23:23:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 329A1DE3C59; Fri, 25 Aug 2017 23:23:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id ED6EE74FBC; Fri, 25 Aug 2017 23:23:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 12CA5102F24; Sat, 26 Aug 2017 09:23:07 +1000 (AEST) Date: Sat, 26 Aug 2017 09:23:06 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Matt Joras cc: cem@freebsd.org, Alan Somers , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322893 - head/bin/dd In-Reply-To: <4b016f89-61c5-fc8a-a36a-aca8166c369e@gmail.com> Message-ID: <20170826085102.S976@besplex.bde.org> References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> <4b016f89-61c5-fc8a-a36a-aca8166c369e@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=LI0WeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=FwyhkCkCfzX_Wn5THrUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 23:23:14 -0000 On Fri, 25 Aug 2017, Matt Joras wrote: > On 08/25/2017 10:17, Conrad Meyer wrote: >> This change seems to break buildworld on MIPS: >> >> /home/cem/head.svn/bin/dd/args.c: In function 'f_bs': >> /home/cem/head.svn/bin/dd/args.c:188: warning: format '%zd' expects >> type 'signed size_t', but argument 3 has type 'long int' >> /home/cem/head.svn/bin/dd/args.c: In function 'f_cbs': >> /home/cem/head.svn/bin/dd/args.c:199: warning: format '%zd' expects >> type 'signed size_t', but argument 3 has type 'long int' >> /home/cem/head.svn/bin/dd/args.c: In function 'f_ibs': >> /home/cem/head.svn/bin/dd/args.c:245: warning: format '%zd' expects >> type 'signed size_t', but argument 3 has type 'long int' >> /home/cem/head.svn/bin/dd/args.c: In function 'f_obs': >> /home/cem/head.svn/bin/dd/args.c:266: warning: format '%zd' expects >> type 'signed size_t', but argument 3 has type 'long int' >> >> (Yes, it's odd that the SSIZE_MAX constant has 'long' type.) >> > SSIZE_MAX should have type long, since ssize_t is a long on mips (and > other arches besides i386 and arm). Actually the reverse. ssize_t has the correct type int32_t (which happens to be int) on all 32-bit arches. SSIZE_MAX shouldn't have type long on 32-bit arches, but is broken by having that type on arm > Re: the build failure, that's in the GCC C format string checking, so > perhaps it's more accurate to say this breaks the (in-tree) GCC build. > %zd is the right format specifier for ssize_t. I guess GCC's format > string checking is getting confused because SSIZE_MAX is a constant that > expands to type long. Perhaps casting to ssize_t would GCC happier, but > that looks rather wrong. This is because gcc's format checking actually works. It detects that SSIZE_MAX has the incorrect type long on mips because it is defined as LONG_MAX there. arm/arm64, powerpc and x86 have ifdefs to define it correctly as INT_MAX in the 32-bit case. I finally found where POSIX requires SSIZE_MAX to have the "correct" type (POSIX doesn't define what that is. but C99 does). SSIZE_MAX is just in convered by the same rule as most C99 limits for integer types. So SSIZE_MAX is not permitted to be what it is on mips. Bruce From owner-svn-src-head@freebsd.org Fri Aug 25 23:31:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19C38DE3DB1; Fri, 25 Aug 2017 23:31:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCDE5753D9; Fri, 25 Aug 2017 23:31:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7PNVF76033830; Fri, 25 Aug 2017 23:31:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7PNVFFI033829; Fri, 25 Aug 2017 23:31:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708252331.v7PNVFFI033829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 25 Aug 2017 23:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322914 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 322914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 25 Aug 2017 23:31:17 -0000 Author: np Date: Fri Aug 25 23:31:15 2017 New Revision: 322914 URL: https://svnweb.freebsd.org/changeset/base/322914 Log: cxgbe(4): Dump the mailbox contents in the same format as CH_DUMP_MBOX. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Aug 25 23:13:21 2017 (r322913) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Aug 25 23:31:15 2017 (r322914) @@ -333,9 +333,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int * presaged the firmware crashing ... */ if (ctl & F_MBMSGVALID) { - CH_ERR(adap, "found VALID command in mbox %u: " - "%llx %llx %llx %llx %llx %llx %llx %llx\n", mbox, - (unsigned long long)t4_read_reg64(adap, data_reg), + CH_ERR(adap, "found VALID command in mbox %u: %016llx %016llx " + "%016llx %016llx %016llx %016llx %016llx %016llx\n", + mbox, (unsigned long long)t4_read_reg64(adap, data_reg), (unsigned long long)t4_read_reg64(adap, data_reg + 8), (unsigned long long)t4_read_reg64(adap, data_reg + 16), (unsigned long long)t4_read_reg64(adap, data_reg + 24), From owner-svn-src-head@freebsd.org Sat Aug 26 00:02:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93179DE47D2; Sat, 26 Aug 2017 00:02:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1C376043; Sat, 26 Aug 2017 00:02:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f52.google.com with SMTP id j144so10909600oib.1; Fri, 25 Aug 2017 17:02:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=mMTMisdGIqLkSzb6my5ijBV6p915NTUHIdXbZtCoUTE=; b=To4xyNRGiR4x4W1vs2H5AmQmceLVKnnLCFHf5CTixUO9lB6Ei5ZP/EdPlE49hqr0Ac 2OIKe8v4S1pax1cBJMXHrvAD0KQ6oL05GHSRjF+WfRpQuiDVeQ+wxmsoUcwBAwowsA2+ pUSK2eJuJEBw9ChdqccYq6opIN75urNsZdvAIGYjFEnhTSGtzmSNMF6EQYBQ98Vyk+/f jC0M5Jjxb4t6h4xigHCv/Wo9JUfBZAeLNsR4VTVLSDRRe1Erax6ITLEHJMwZK72zqrfq Ac0hLBBIzD3byk55kczIE5mmXZuNnJk8gfc9uVO4bO4VL+qI3p3S3ce4edqWJeORvrM5 MVbQ== X-Gm-Message-State: AHYfb5inM/dRZZySJDpl0CkTM+64+fLYSqf5DqO8IzemyPWYfuheHX/A Ssh6fmjaH2kjyL/RoOY= X-Received: by 10.202.52.69 with SMTP id b66mr258268oia.121.1503705732572; Fri, 25 Aug 2017 17:02:12 -0700 (PDT) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com. [209.85.223.182]) by smtp.gmail.com with ESMTPSA id u77sm9219223oiu.25.2017.08.25.17.02.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Aug 2017 17:02:12 -0700 (PDT) Received: by mail-io0-f182.google.com with SMTP id c18so4161393ioj.1; Fri, 25 Aug 2017 17:02:12 -0700 (PDT) X-Received: by 10.107.140.88 with SMTP id o85mr139177iod.248.1503705731975; Fri, 25 Aug 2017 17:02:11 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Fri, 25 Aug 2017 17:02:11 -0700 (PDT) In-Reply-To: <20170826075540.X976@besplex.bde.org> References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> <20170826075540.X976@besplex.bde.org> From: Conrad Meyer Date: Fri, 25 Aug 2017 17:02:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r322893 - head/bin/dd To: Bruce Evans Cc: Alan Somers , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 00:02:20 -0000 On Fri, Aug 25, 2017 at 3:49 PM, Bruce Evans wrote: > get_off_t() but not the higher level is fixed in my version. Would you mind incorporating your version of dd into FreeBSD, or publishing it so someone else can? Thanks, Conrad From owner-svn-src-head@freebsd.org Sat Aug 26 00:17:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B6F2DE4B4C; Sat, 26 Aug 2017 00:17:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id BF64B765E4; Sat, 26 Aug 2017 00:17:58 +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 v7Q0HvFE054008; Sat, 26 Aug 2017 00:17:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7Q0Hv9f054007; Sat, 26 Aug 2017 00:17:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708260017.v7Q0Hv9f054007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 26 Aug 2017 00:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322915 - head/contrib/compiler-rt/lib/builtins X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/contrib/compiler-rt/lib/builtins X-SVN-Commit-Revision: 322915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 00:17:59 -0000 Author: jhb Date: Sat Aug 26 00:17:57 2017 New Revision: 322915 URL: https://svnweb.freebsd.org/changeset/base/322915 Log: Extend the workaround for LLVM bug 11663 to MIPS N32. This fixes infinite recursion in /sbin/init for MIPS N32. Submitted by: Robert M. Kovacsics MFC after: 1 week Sponsored by: DARPA / AFRL Modified: head/contrib/compiler-rt/lib/builtins/int_lib.h Modified: head/contrib/compiler-rt/lib/builtins/int_lib.h ============================================================================== --- head/contrib/compiler-rt/lib/builtins/int_lib.h Fri Aug 25 23:31:15 2017 (r322914) +++ head/contrib/compiler-rt/lib/builtins/int_lib.h Sat Aug 26 00:17:57 2017 (r322915) @@ -92,12 +92,13 @@ * does not have dedicated bit counting instructions. */ #if defined(__FreeBSD__) && (defined(__sparc64__) || \ - defined(__mips_n64) || defined(__mips_o64) || defined(__riscv)) + defined(__mips_n32) || defined(__mips_n64) || defined(__mips_o64) || \ + defined(__riscv)) si_int __clzsi2(si_int); si_int __ctzsi2(si_int); #define __builtin_clz __clzsi2 #define __builtin_ctz __ctzsi2 -#endif /* FreeBSD && (sparc64 || mips_n64 || mips_o64) */ +#endif /* FreeBSD && (sparc64 || mips_n32 || mips_n64 || mips_o64 || riscv) */ COMPILER_RT_ABI si_int __paritysi2(si_int a); COMPILER_RT_ABI si_int __paritydi2(di_int a); From owner-svn-src-head@freebsd.org Sat Aug 26 01:14:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 014D6DE5DB9; Sat, 26 Aug 2017 01:14:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id AA4517C261; Sat, 26 Aug 2017 01:14:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id A71081067BA; Sat, 26 Aug 2017 11:14:08 +1000 (AEST) Date: Sat, 26 Aug 2017 11:14:07 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , Alan Somers , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r322893 - head/bin/dd In-Reply-To: Message-ID: <20170826110740.P1968@besplex.bde.org> References: <201708251531.v7PFVtoZ038242@repo.freebsd.org> <20170826075540.X976@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=i4k9MQ4OOmfZME-L6QgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 01:14:11 -0000 On Fri, 25 Aug 2017, Conrad Meyer wrote: > On Fri, Aug 25, 2017 at 3:49 PM, Bruce Evans wrote: >> get_off_t() but not the higher level is fixed in my version. > > Would you mind incorporating your version of dd into FreeBSD, or > publishing it so someone else can? I guess it is in my queue, but unfortunately near the end. My patches for dd are about 8K (mostly style fixes). Bruce From owner-svn-src-head@freebsd.org Sat Aug 26 03:21:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65743DEB6BB; Sat, 26 Aug 2017 03:21:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3320380722; Sat, 26 Aug 2017 03:21:13 +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 v7Q3LCBK027951; Sat, 26 Aug 2017 03:21:12 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7Q3LCq2027950; Sat, 26 Aug 2017 03:21:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201708260321.v7Q3LCq2027950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 26 Aug 2017 03:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322920 - head/sys/mips/include X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/mips/include X-SVN-Commit-Revision: 322920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 03:21:13 -0000 Author: cem Date: Sat Aug 26 03:21:12 2017 New Revision: 322920 URL: https://svnweb.freebsd.org/changeset/base/322920 Log: Fix limits.h constants to have correct type on MIPS Use correctly typed constants to avoid bogus errors like https://lists.freebsd.org/pipermail/svn-src-all/2017-August/150400.html (like x86 _limits.h). Reported by: bde, asomers Reviewed by: mjoras, tinderbox Sponsored by: Dell EMC Isilon Modified: head/sys/mips/include/_limits.h Modified: head/sys/mips/include/_limits.h ============================================================================== --- head/sys/mips/include/_limits.h Sat Aug 26 00:35:49 2017 (r322919) +++ head/sys/mips/include/_limits.h Sat Aug 26 03:21:12 2017 (r322920) @@ -75,17 +75,23 @@ #define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ #define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ +#ifdef __mips_n64 #define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ - #define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ - -#define __OFF_MAX __LLONG_MAX /* max value for an off_t */ -#define __OFF_MIN __LLONG_MIN /* min value for an off_t */ - -/* Quads and long longs are the same size. Ensure they stay in sync. */ -#define __UQUAD_MAX __ULLONG_MAX /* max value for a uquad_t */ -#define __QUAD_MAX __LLONG_MAX /* max value for a quad_t */ -#define __QUAD_MIN __LLONG_MIN /* min value for a quad_t */ +#define __OFF_MAX __LONG_MAX /* max value for an off_t */ +#define __OFF_MIN __LONG_MIN /* min value for an off_t */ +#define __UQUAD_MAX __ULONG_MAX /* max value for a uquad_t */ +#define __QUAD_MAX __LONG_MAX /* max value for a quad_t */ +#define __QUAD_MIN __LONG_MIN /* min value for a quad_t */ +#else +#define __SSIZE_MAX __INT_MAX +#define __SIZE_T_MAX __UINT_MAX +#define __OFF_MAX __LLONG_MAX +#define __OFF_MIN __LLONG_MIN +#define __UQUAD_MAX __ULLONG_MAX +#define __QUAD_MAX __LLONG_MAX +#define __QUAD_MIN __LLONG_MIN +#endif #define __WORD_BIT 32 From owner-svn-src-head@freebsd.org Sat Aug 26 03:27:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 743DADEBA4B; Sat, 26 Aug 2017 03:27:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 04A9380C77; Sat, 26 Aug 2017 03:27:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 1B7AA429018; Sat, 26 Aug 2017 13:00:42 +1000 (AEST) Date: Sat, 26 Aug 2017 13:00:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers cc: Bruce Evans , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r322258 - head/sys/kern In-Reply-To: Message-ID: <20170826121557.K2180@besplex.bde.org> References: <201708081614.v78GEVGY066448@repo.freebsd.org> <20170809141608.I1096@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=6I5d2MoRAAAA:8 a=5bFV5GeewFy05cFWIRsA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 03:27:38 -0000 On Thu, 24 Aug 2017, Alan Somers wrote: > On Wed, Aug 9, 2017 at 1:05 AM, Bruce Evans wrote: >> On Tue, 8 Aug 2017, Alan Somers wrote: >> ... >> The compile-time definition of AIO_LISTIO_MAX seems to be broken. I think >> POSIX species that AIO_LISTIO_MAX shall not be defined if the value of >> {AIO_LISTIO_MAX} varies at runtime, but it is still defined. FreeBSD >> has this bug for many other sysconf() variables, e.g., {OPEN_MAX}. >> Perhaps AIO_LISTIO_MAX is easier to fix since it is not hard-coded as >> often as OPEN_MAX. > > What you describe is Linux's behavior, but the POSIX requirement is a > bit more general. All POSIX says is that "The value returned [by > sysconf(3)] shall not be more restrictive than the corresponding value > described to the application when it was compiled with the > implementation's or ". No, I described the POSIX requirement. See the section on limits.h. It says that - {AIO_LISTIO_MAX} is a runtime invariant (so sysctls that change it are not POSIX conformant) - for all runtime invariant limits, the definition shall be omitted from if it is unspecified (sic). This indetermination (sic) might depend on the memory size. [That was not a direct quote except for the sic words. POSIX says "indeterminate" in both places in the 1990 and 1996 versions, but this is broken in the 2001 and 2006 versions.] So defining AIO_LISTIO_MAX in is not conformant if you change it before runtime using something like a tunable. You quoted the section for sysconf(3). The wording there is too generic. It covers both runtime increasable and runtime invariant limits. It only really applies to the runtime increasable limits. For the runtime invariant, limits it only applies vacuously. The section on disallows defining runtime invariant limits unless they are known at compile time. If they would be different at runtime, then they were not known at comple time, so must not be defined then, and the requirement that the runtime limits are larger is vacuously satisfied. There aren't many runtime increasable limits, and at least in the 2006 version, only {OPEN_MAX} is allowed to vary within a process's lifetime. {OPEN_MAX} can be decreased in practice and the 2006 version doesn't disallow this provided OPEN_MAX is not defined in (then {OPEN_MAX} must be a compile-time invariant). When it is not defined, the requirement to only increase it is vacuously satisfied, so only the special requirement for {OPEN_MAX} applies. This allows changing it using setrlimit(). The direction of the change is not limited to an increase, but many more paragraphs are needed to speciy what happens when it does decrease (open files above the limit stay open, but obviously you can't use the current limit to limit the search for these files...). > ... > I dug deeper and found that there wasn't any good reason for the > aio_listio_max limit to exist in the first place. This DR eliminates > it, which I think will satisfy most of your concerns. > https://reviews.freebsd.org/D12120 This is inconvenient for me to review. Anything that removes the compile time limit is good. Except actually removing it from would break any applications that use it. Applications should use the minimum for the limit if they don't care, else sysconf(). The 2006 version of POSIX says in its section about profiles that most if its limits are inadequate (so profiles should change them). I don't know the mechanism for this. Just omitting most compile-time limits and increasing the sysconf() limits won't help for sloppy applications. Bruce From owner-svn-src-head@freebsd.org Sat Aug 26 06:44:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2A9ADEFB68; Sat, 26 Aug 2017 06:44:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8409F1B76; Sat, 26 Aug 2017 06:44:51 +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 v7Q6ioTo013143; Sat, 26 Aug 2017 06:44:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7Q6iocZ013142; Sat, 26 Aug 2017 06:44:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708260644.v7Q6iocZ013142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 26 Aug 2017 06:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322921 - head/lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/msun/tests X-SVN-Commit-Revision: 322921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 06:44:51 -0000 Author: ngie Date: Sat Aug 26 06:44:50 2017 New Revision: 322921 URL: https://svnweb.freebsd.org/changeset/base/322921 Log: Revert r321457 It doesn't fail after ^/head@r322855 (the releng_50 clang merge). PR: 220989 MFC after: 2 months MFC with: r321369, r322855 Modified: head/lib/msun/tests/trig_test.c Modified: head/lib/msun/tests/trig_test.c ============================================================================== --- head/lib/msun/tests/trig_test.c Sat Aug 26 03:21:12 2017 (r322920) +++ head/lib/msun/tests/trig_test.c Sat Aug 26 06:44:50 2017 (r322921) @@ -158,11 +158,6 @@ ATF_TC_BODY(reduction, tc) }; #endif -#if defined(__clang__) && \ - ((__clang_major__ >= 5)) - atf_tc_expect_fail("test fails with clang 5.0+ - bug 220989"); -#endif - unsigned i; for (i = 0; i < nitems(f_pi_odd); i++) { From owner-svn-src-head@freebsd.org Sat Aug 26 14:07:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65FEDDF7068; Sat, 26 Aug 2017 14:07:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 333B66CE0F; Sat, 26 Aug 2017 14:07:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QE7PkC093435; Sat, 26 Aug 2017 14:07:25 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QE7OtM093426; Sat, 26 Aug 2017 14:07:24 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201708261407.v7QE7OtM093426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 26 Aug 2017 14:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322923 - in head: . sbin/geom/class/eli sys/boot/geli sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: . sbin/geom/class/eli sys/boot/geli sys/geom/eli X-SVN-Commit-Revision: 322923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 14:07:26 -0000 Author: oshogbo Date: Sat Aug 26 14:07:24 2017 New Revision: 322923 URL: https://svnweb.freebsd.org/changeset/base/322923 Log: Hide length of geli passphrase during boot. Introduce additional flag to the geli which allows to restore previous behavior. Reviewed by: AllanJude@, cem@ (previous version) MFC: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11751 Modified: head/UPDATING head/sbin/geom/class/eli/geli.8 head/sbin/geom/class/eli/geom_eli.c head/sys/boot/geli/geliboot.c head/sys/boot/geli/geliboot.h head/sys/boot/geli/pwgets.c head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_ctl.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Aug 26 07:05:29 2017 (r322922) +++ head/UPDATING Sat Aug 26 14:07:24 2017 (r322923) @@ -51,6 +51,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20170826: + During boot the geli passphrase will be hidden. To restore previous + behavior see geli(8) configuration options. + 20170825: Move PMTUD blackhole counters to TCPSTATS and remove them from bare sysctl values. Minor nit, but requires a rebuild of both world/kernel Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Sat Aug 26 07:05:29 2017 (r322922) +++ head/sbin/geom/class/eli/geli.8 Sat Aug 26 14:07:24 2017 (r322923) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2016 +.Dd August 26, 2017 .Dt GELI 8 .Os .Sh NAME @@ -51,7 +51,7 @@ utility: .Pp .Nm .Cm init -.Op Fl bgPTv +.Op Fl bdgPTv .Op Fl a Ar aalgo .Op Fl B Ar backupfile .Op Fl e Ar ealgo @@ -88,7 +88,7 @@ utility: .Ar prov .Nm .Cm configure -.Op Fl bBgGtT +.Op Fl bBdDgGtT .Ar prov ... .Nm .Cm setkey @@ -279,6 +279,9 @@ To inhibit backups, you can use .Pa none as the .Ar backupfile . +.It Fl d +While booting from this encrypted root filesystem enable visibility of +passphrase length. .It Fl e Ar ealgo Encryption algorithm to use. Currently supported algorithms are: @@ -490,6 +493,12 @@ For more information, see the description of the subcommand. .It Fl B Remove the BOOT flag from the given providers. +.It Fl d +While booting from this encrypted root filesystem enable visibility of +passphrase length. +.It Fl D +While booting from this encrypted root filesystem disable visibility of +passphrase length. .It Fl g Enable booting from this encrypted root filesystem. The boot loader prompts for the passphrase and loads Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Sat Aug 26 07:05:29 2017 (r322922) +++ head/sbin/geom/class/eli/geom_eli.c Sat Aug 26 14:07:24 2017 (r322923) @@ -82,7 +82,7 @@ static int eli_backup_create(struct gctl_req *req, con /* * Available commands: * - * init [-bgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov + * init [-bdgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov * label - alias for 'init' * attach [-dprv] [-j passfile] [-k keyfile] prov * detach [-fl] prov ... @@ -107,6 +107,7 @@ struct g_command class_commands[] = { { 'a', "aalgo", "", G_TYPE_STRING }, { 'b', "boot", NULL, G_TYPE_BOOL }, { 'B', "backupfile", "", G_TYPE_STRING }, + { 'd', "displaypass", NULL, G_TYPE_BOOL }, { 'e', "ealgo", "", G_TYPE_STRING }, { 'g', "geliboot", NULL, G_TYPE_BOOL }, { 'i', "iterations", "-1", G_TYPE_NUMBER }, @@ -119,13 +120,14 @@ struct g_command class_commands[] = { { 'V', "mdversion", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - "[-bgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov" + "[-bdgPTv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov" }, { "label", G_FLAG_VERBOSE, eli_main, { { 'a', "aalgo", "", G_TYPE_STRING }, { 'b', "boot", NULL, G_TYPE_BOOL }, { 'B', "backupfile", "", G_TYPE_STRING }, + { 'd', "displaypass", NULL, G_TYPE_BOOL }, { 'e', "ealgo", "", G_TYPE_STRING }, { 'g', "geliboot", NULL, G_TYPE_BOOL }, { 'i', "iterations", "-1", G_TYPE_NUMBER }, @@ -182,13 +184,15 @@ struct g_command class_commands[] = { { { 'b', "boot", NULL, G_TYPE_BOOL }, { 'B', "noboot", NULL, G_TYPE_BOOL }, + { 'd', "displaypass", NULL, G_TYPE_BOOL }, + { 'D', "nodisplaypass", NULL, G_TYPE_BOOL }, { 'g', "geliboot", NULL, G_TYPE_BOOL }, { 'G', "nogeliboot", NULL, G_TYPE_BOOL }, { 't', "trim", NULL, G_TYPE_BOOL }, { 'T', "notrim", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-bBgGtT] prov ..." + "[-bBdDgGtT] prov ..." }, { "setkey", G_FLAG_VERBOSE, eli_main, { @@ -708,6 +712,8 @@ eli_init(struct gctl_req *req) md.md_flags |= G_ELI_FLAG_BOOT; if (gctl_get_int(req, "geliboot")) md.md_flags |= G_ELI_FLAG_GELIBOOT; + if (gctl_get_int(req, "displaypass")) + md.md_flags |= G_ELI_FLAG_GELIDISPLAYPASS; if (gctl_get_int(req, "notrim")) md.md_flags |= G_ELI_FLAG_NODELETE; md.md_ealgo = CRYPTO_ALGORITHM_MIN - 1; @@ -912,7 +918,7 @@ eli_attach(struct gctl_req *req) static void eli_configure_detached(struct gctl_req *req, const char *prov, int boot, - int geliboot, int trim) + int geliboot, int displaypass, int trim) { struct g_eli_metadata md; bool changed = 0; @@ -948,6 +954,21 @@ eli_configure_detached(struct gctl_req *req, const cha changed = 1; } + if (displaypass == 1 && (md.md_flags & G_ELI_FLAG_GELIDISPLAYPASS)) { + if (verbose) + printf("GELIDISPLAYPASS flag already configured for %s.\n", prov); + } else if (displaypass == 0 && + !(md.md_flags & G_ELI_FLAG_GELIDISPLAYPASS)) { + if (verbose) + printf("GELIDISPLAYPASS flag not configured for %s.\n", prov); + } else if (displaypass >= 0) { + if (displaypass) + md.md_flags |= G_ELI_FLAG_GELIDISPLAYPASS; + else + md.md_flags &= ~G_ELI_FLAG_GELIDISPLAYPASS; + changed = 1; + } + if (trim == 0 && (md.md_flags & G_ELI_FLAG_NODELETE)) { if (verbose) printf("TRIM disable flag already configured for %s.\n", prov); @@ -971,8 +992,9 @@ static void eli_configure(struct gctl_req *req) { const char *prov; - bool boot, noboot, geliboot, nogeliboot, trim, notrim; - int doboot, dogeliboot, dotrim; + bool boot, noboot, geliboot, nogeliboot, displaypass, nodisplaypass; + bool trim, notrim; + int doboot, dogeliboot, dodisplaypass, dotrim; int i, nargs; nargs = gctl_get_int(req, "nargs"); @@ -985,6 +1007,8 @@ eli_configure(struct gctl_req *req) noboot = gctl_get_int(req, "noboot"); geliboot = gctl_get_int(req, "geliboot"); nogeliboot = gctl_get_int(req, "nogeliboot"); + displaypass = gctl_get_int(req, "displaypass"); + nodisplaypass = gctl_get_int(req, "nodisplaypass"); trim = gctl_get_int(req, "trim"); notrim = gctl_get_int(req, "notrim"); @@ -1008,6 +1032,16 @@ eli_configure(struct gctl_req *req) else if (nogeliboot) dogeliboot = 0; + dodisplaypass = -1; + if (displaypass && nodisplaypass) { + gctl_error(req, "Options -d and -D are mutually exclusive."); + return; + } + if (displaypass) + dodisplaypass = 1; + else if (nodisplaypass) + dodisplaypass = 0; + dotrim = -1; if (trim && notrim) { gctl_error(req, "Options -t and -T are mutually exclusive."); @@ -1018,7 +1052,8 @@ eli_configure(struct gctl_req *req) else if (notrim) dotrim = 0; - if (doboot == -1 && dogeliboot == -1 && dotrim == -1) { + if (doboot == -1 && dogeliboot == -1 && dodisplaypass == -1 && + dotrim == -1) { gctl_error(req, "No option given."); return; } @@ -1028,8 +1063,10 @@ eli_configure(struct gctl_req *req) /* Now the rest. */ for (i = 0; i < nargs; i++) { prov = gctl_get_ascii(req, "arg%d", i); - if (!eli_is_attached(prov)) - eli_configure_detached(req, prov, doboot, dogeliboot, dotrim); + if (!eli_is_attached(prov)) { + eli_configure_detached(req, prov, doboot, dogeliboot, + dodisplaypass, dotrim); + } } } Modified: head/sys/boot/geli/geliboot.c ============================================================================== --- head/sys/boot/geli/geliboot.c Sat Aug 26 07:05:29 2017 (r322922) +++ head/sys/boot/geli/geliboot.c Sat Aug 26 14:07:24 2017 (r322923) @@ -220,8 +220,9 @@ geli_taste(int read_func(void *vdev, void *priv, off_t /* * Attempt to decrypt the device */ -int -geli_attach(struct dsk *dskp, const char *passphrase, const u_char *mkeyp) +static int +geli_attach(struct geli_entry *ge, struct dsk *dskp, const char *passphrase, + const u_char *mkeyp) { u_char key[G_ELI_USERKEYLEN], mkey[G_ELI_DATAIVKEYLEN], *mkp; u_int keynum; @@ -233,92 +234,83 @@ geli_attach(struct dsk *dskp, const char *passphrase, explicit_bzero(mkeyp, G_ELI_DATAIVKEYLEN); } - SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { - if (geli_same_device(geli_e, dskp) != 0) { - continue; - } + if (mkeyp != NULL || geli_findkey(ge, dskp, mkey) == 0) { + goto found_key; + } - if (mkeyp != NULL || geli_findkey(geli_e, dskp, mkey) == 0) { - goto found_key; - } + g_eli_crypto_hmac_init(&ctx, NULL, 0); + /* + * Prepare Derived-Key from the user passphrase. + */ + if (geli_e->md.md_iterations < 0) { + /* XXX TODO: Support loading key files. */ + return (1); + } else if (geli_e->md.md_iterations == 0) { + g_eli_crypto_hmac_update(&ctx, geli_e->md.md_salt, + sizeof(geli_e->md.md_salt)); + g_eli_crypto_hmac_update(&ctx, passphrase, + strlen(passphrase)); + } else if (geli_e->md.md_iterations > 0) { + printf("Calculating GELI Decryption Key disk%dp%d @ %d" + " iterations...\n", dskp->unit, + (dskp->slice > 0 ? dskp->slice : dskp->part), + geli_e->md.md_iterations); + u_char dkey[G_ELI_USERKEYLEN]; - g_eli_crypto_hmac_init(&ctx, NULL, 0); - /* - * Prepare Derived-Key from the user passphrase. - */ - if (geli_e->md.md_iterations < 0) { - /* XXX TODO: Support loading key files. */ - return (1); - } else if (geli_e->md.md_iterations == 0) { - g_eli_crypto_hmac_update(&ctx, geli_e->md.md_salt, - sizeof(geli_e->md.md_salt)); - g_eli_crypto_hmac_update(&ctx, passphrase, - strlen(passphrase)); - } else if (geli_e->md.md_iterations > 0) { - printf("Calculating GELI Decryption Key disk%dp%d @ %d" - " iterations...\n", dskp->unit, - (dskp->slice > 0 ? dskp->slice : dskp->part), - geli_e->md.md_iterations); - u_char dkey[G_ELI_USERKEYLEN]; + pkcs5v2_genkey(dkey, sizeof(dkey), geli_e->md.md_salt, + sizeof(geli_e->md.md_salt), passphrase, + geli_e->md.md_iterations); + g_eli_crypto_hmac_update(&ctx, dkey, sizeof(dkey)); + explicit_bzero(dkey, sizeof(dkey)); + } - pkcs5v2_genkey(dkey, sizeof(dkey), geli_e->md.md_salt, - sizeof(geli_e->md.md_salt), passphrase, - geli_e->md.md_iterations); - g_eli_crypto_hmac_update(&ctx, dkey, sizeof(dkey)); - explicit_bzero(dkey, sizeof(dkey)); - } + g_eli_crypto_hmac_final(&ctx, key, 0); - g_eli_crypto_hmac_final(&ctx, key, 0); + error = g_eli_mkey_decrypt(&geli_e->md, key, mkey, &keynum); + if (error == -1) { + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(key, sizeof(key)); + printf("Bad GELI key: bad password?\n"); + return (error); + } else if (error != 0) { + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(key, sizeof(key)); + printf("Failed to decrypt GELI master key: %d\n", error); + return (error); + } else { + /* Add key to keychain */ + save_key(key); + explicit_bzero(&key, sizeof(key)); + } - error = g_eli_mkey_decrypt(&geli_e->md, key, mkey, &keynum); - if (error == -1) { - explicit_bzero(mkey, sizeof(mkey)); - explicit_bzero(key, sizeof(key)); - printf("Bad GELI key: bad password?\n"); - return (error); - } else if (error != 0) { - explicit_bzero(mkey, sizeof(mkey)); - explicit_bzero(key, sizeof(key)); - printf("Failed to decrypt GELI master key: %d\n", error); - return (error); - } else { - /* Add key to keychain */ - save_key(key); - explicit_bzero(&key, sizeof(key)); - } - found_key: - /* Store the keys */ - bcopy(mkey, geli_e->sc.sc_mkey, sizeof(geli_e->sc.sc_mkey)); - bcopy(mkey, geli_e->sc.sc_ivkey, sizeof(geli_e->sc.sc_ivkey)); - mkp = mkey + sizeof(geli_e->sc.sc_ivkey); - if ((geli_e->sc.sc_flags & G_ELI_FLAG_AUTH) == 0) { - bcopy(mkp, geli_e->sc.sc_ekey, G_ELI_DATAKEYLEN); - } else { - /* - * The encryption key is: ekey = HMAC_SHA512(Data-Key, 0x10) - */ - g_eli_crypto_hmac(mkp, G_ELI_MAXKEYLEN, "\x10", 1, - geli_e->sc.sc_ekey, 0); - } - explicit_bzero(mkey, sizeof(mkey)); + /* Store the keys */ + bcopy(mkey, geli_e->sc.sc_mkey, sizeof(geli_e->sc.sc_mkey)); + bcopy(mkey, geli_e->sc.sc_ivkey, sizeof(geli_e->sc.sc_ivkey)); + mkp = mkey + sizeof(geli_e->sc.sc_ivkey); + if ((geli_e->sc.sc_flags & G_ELI_FLAG_AUTH) == 0) { + bcopy(mkp, geli_e->sc.sc_ekey, G_ELI_DATAKEYLEN); + } else { + /* + * The encryption key is: ekey = HMAC_SHA512(Data-Key, 0x10) + */ + g_eli_crypto_hmac(mkp, G_ELI_MAXKEYLEN, "\x10", 1, + geli_e->sc.sc_ekey, 0); + } + explicit_bzero(mkey, sizeof(mkey)); - /* Initialize the per-sector IV. */ - switch (geli_e->sc.sc_ealgo) { - case CRYPTO_AES_XTS: - break; - default: - SHA256_Init(&geli_e->sc.sc_ivctx); - SHA256_Update(&geli_e->sc.sc_ivctx, geli_e->sc.sc_ivkey, - sizeof(geli_e->sc.sc_ivkey)); - break; - } - - return (0); + /* Initialize the per-sector IV. */ + switch (geli_e->sc.sc_ealgo) { + case CRYPTO_AES_XTS: + break; + default: + SHA256_Init(&geli_e->sc.sc_ivctx); + SHA256_Update(&geli_e->sc.sc_ivctx, geli_e->sc.sc_ivkey, + sizeof(geli_e->sc.sc_ivkey)); + break; } - /* Disk not found. */ - return (2); + return (0); } int @@ -402,7 +394,7 @@ geli_havekey(struct dsk *dskp) } if (geli_findkey(geli_e, dskp, mkey) == 0) { - if (geli_attach(dskp, NULL, mkey) == 0) { + if (geli_attach(geli_e, dskp, NULL, mkey) == 0) { return (0); } } @@ -417,19 +409,27 @@ geli_passphrase(char *pw, int disk, int parttype, int { int i; - /* TODO: Implement GELI keyfile(s) support */ - for (i = 0; i < 3; i++) { - /* Try cached passphrase */ - if (i == 0 && pw[0] != '\0') { - if (geli_attach(dskp, pw, NULL) == 0) { + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { + if (geli_same_device(geli_e, dskp) != 0) { + continue; + } + + /* TODO: Implement GELI keyfile(s) support */ + for (i = 0; i < 3; i++) { + /* Try cached passphrase */ + if (i == 0 && pw[0] != '\0') { + if (geli_attach(geli_e, dskp, pw, NULL) == 0) { + return (0); + } + } + printf("GELI Passphrase for disk%d%c%d: ", disk, + parttype, part); + pwgets(pw, GELI_PW_MAXLEN, + (geli_e->md.md_flags & G_ELI_FLAG_GELIDISPLAYPASS) == 0); + printf("\n"); + if (geli_attach(geli_e, dskp, pw, NULL) == 0) { return (0); } - } - printf("GELI Passphrase for disk%d%c%d: ", disk, parttype, part); - pwgets(pw, GELI_PW_MAXLEN); - printf("\n"); - if (geli_attach(dskp, pw, NULL) == 0) { - return (0); } } Modified: head/sys/boot/geli/geliboot.h ============================================================================== --- head/sys/boot/geli/geliboot.h Sat Aug 26 07:05:29 2017 (r322922) +++ head/sys/boot/geli/geliboot.h Sat Aug 26 14:07:24 2017 (r322923) @@ -46,12 +46,11 @@ #define GELI_MAX_KEYS 64 #define GELI_PW_MAXLEN 256 -extern void pwgets(char *buf, int n); +extern void pwgets(char *buf, int n, int hide); void geli_init(void); int geli_taste(int read_func(void *vdev, void *priv, off_t off, void *buf, size_t bytes), struct dsk *dsk, daddr_t lastsector); -int geli_attach(struct dsk *dskp, const char *passphrase, const u_char *mkeyp); int is_geli(struct dsk *dsk); int geli_read(struct dsk *dsk, off_t offset, u_char *buf, size_t bytes); int geli_decrypt(u_int algo, u_char *data, size_t datasize, Modified: head/sys/boot/geli/pwgets.c ============================================================================== --- head/sys/boot/geli/pwgets.c Sat Aug 26 07:05:29 2017 (r322922) +++ head/sys/boot/geli/pwgets.c Sat Aug 26 14:07:24 2017 (r322923) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); /* gets() with constrained input length, for passwords */ void -pwgets(char *buf, int n) +pwgets(char *buf, int n, int hide) { int c; char *lp; @@ -55,9 +55,11 @@ pwgets(char *buf, int n) case '\177': if (lp > buf) { lp--; - putchar('\b'); - putchar(' '); - putchar('\b'); + if (hide == 0) { + putchar('\b'); + putchar(' '); + putchar('\b'); + } } break; case 'u'&037: @@ -68,7 +70,9 @@ pwgets(char *buf, int n) default: if ((n < 1) || ((lp - buf) < n - 1)) { *lp++ = c; - putchar('*'); + if (hide == 0) { + putchar('*'); + } } } /*NOTREACHED*/ Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sat Aug 26 07:05:29 2017 (r322922) +++ head/sys/geom/eli/g_eli.c Sat Aug 26 14:07:24 2017 (r322923) @@ -1023,7 +1023,7 @@ g_eli_taste(struct g_class *mp, struct g_provider *pp, struct hmac_ctx ctx; char passphrase[256]; u_char key[G_ELI_USERKEYLEN], mkey[G_ELI_DATAIVKEYLEN]; - u_int i, nkey, nkeyfiles, tries; + u_int i, nkey, nkeyfiles, tries, showpass; int error; struct keybuf *keybuf; @@ -1112,8 +1112,11 @@ g_eli_taste(struct g_class *mp, struct g_provider *pp, sizeof(passphrase)); } else { printf("Enter passphrase for %s: ", pp->name); + showpass = g_eli_visible_passphrase; + if ((md.md_flags & G_ELI_FLAG_GELIDISPLAYPASS) != 0) + showpass = GETS_ECHOPASS; cngets(passphrase, sizeof(passphrase), - g_eli_visible_passphrase); + showpass); memcpy(cached_passphrase, passphrase, sizeof(passphrase)); } @@ -1232,6 +1235,7 @@ g_eli_dumpconf(struct sbuf *sb, const char *indent, st ADD_FLAG(G_ELI_FLAG_RO, "READ-ONLY"); ADD_FLAG(G_ELI_FLAG_NODELETE, "NODELETE"); ADD_FLAG(G_ELI_FLAG_GELIBOOT, "GELIBOOT"); + ADD_FLAG(G_ELI_FLAG_GELIDISPLAYPASS, "GELIDISPLAYPASS"); #undef ADD_FLAG } sbuf_printf(sb, "\n"); Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Sat Aug 26 07:05:29 2017 (r322922) +++ head/sys/geom/eli/g_eli.h Sat Aug 26 14:07:24 2017 (r322923) @@ -100,6 +100,8 @@ #define G_ELI_FLAG_NODELETE 0x00000040 /* This GELI supports GELIBoot */ #define G_ELI_FLAG_GELIBOOT 0x00000080 +/* Hide passphrase length in GELIboot. */ +#define G_ELI_FLAG_GELIDISPLAYPASS 0x00000100 /* RUNTIME FLAGS. */ /* Provider was open for writing. */ #define G_ELI_FLAG_WOPEN 0x00010000 Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Sat Aug 26 07:05:29 2017 (r322922) +++ head/sys/geom/eli/g_eli_ctl.c Sat Aug 26 14:07:24 2017 (r322923) @@ -377,6 +377,7 @@ g_eli_ctl_configure(struct gctl_req *req, struct g_cla const char *prov; u_char *sector; int *nargs, *boot, *noboot, *trim, *notrim, *geliboot, *nogeliboot; + int *displaypass, *nodisplaypass; int zero, error, changed; u_int i; @@ -434,6 +435,19 @@ g_eli_ctl_configure(struct gctl_req *req, struct g_cla if (*geliboot || *nogeliboot) changed = 1; + displaypass = gctl_get_paraml(req, "displaypass", sizeof(*displaypass)); + if (displaypass == NULL) + displaypass = &zero; + nodisplaypass = gctl_get_paraml(req, "nodisplaypass", sizeof(*nodisplaypass)); + if (nodisplaypass == NULL) + nodisplaypass = &zero; + if (*displaypass && *nodisplaypass) { + gctl_error(req, "Options -d and -D are mutually exclusive."); + return; + } + if (*displaypass || *nodisplaypass) + changed = 1; + if (!changed) { gctl_error(req, "No option given."); return; @@ -492,6 +506,17 @@ g_eli_ctl_configure(struct gctl_req *req, struct g_cla continue; } + if (*displaypass && (sc->sc_flags & G_ELI_FLAG_GELIDISPLAYPASS)) { + G_ELI_DEBUG(1, "GELIDISPLAYPASS flag already configured for %s.", + prov); + continue; + } else if (*nodisplaypass && + !(sc->sc_flags & G_ELI_FLAG_GELIDISPLAYPASS)) { + G_ELI_DEBUG(1, "GELIDISPLAYPASS flag not configured for %s.", + prov); + continue; + } + if (!(sc->sc_flags & G_ELI_FLAG_ONETIME)) { /* * ONETIME providers don't write metadata to @@ -533,6 +558,14 @@ g_eli_ctl_configure(struct gctl_req *req, struct g_cla } else if (*nogeliboot) { md.md_flags &= ~G_ELI_FLAG_GELIBOOT; sc->sc_flags &= ~G_ELI_FLAG_GELIBOOT; + } + + if (*displaypass) { + md.md_flags |= G_ELI_FLAG_GELIDISPLAYPASS; + sc->sc_flags |= G_ELI_FLAG_GELIDISPLAYPASS; + } else if (*nodisplaypass) { + md.md_flags &= ~G_ELI_FLAG_GELIDISPLAYPASS; + sc->sc_flags &= ~G_ELI_FLAG_GELIDISPLAYPASS; } if (sc->sc_flags & G_ELI_FLAG_ONETIME) { From owner-svn-src-head@freebsd.org Sat Aug 26 15:08:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5B75DD41B9; Sat, 26 Aug 2017 15:08:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 952CA6E6E4; Sat, 26 Aug 2017 15:08:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QF8R4w017661; Sat, 26 Aug 2017 15:08:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QF8RaQ017660; Sat, 26 Aug 2017 15:08:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708261508.v7QF8RaQ017660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 26 Aug 2017 15:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322924 - head/contrib/cortex-strings/src/aarch64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/contrib/cortex-strings/src/aarch64 X-SVN-Commit-Revision: 322924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 15:08:29 -0000 Author: andrew Date: Sat Aug 26 15:08:27 2017 New Revision: 322924 URL: https://svnweb.freebsd.org/changeset/base/322924 Log: Work around a bug in QEMU when loading data with a load pair instruction where the source register is also the first destination register. If this is the case, and we raise an exception in the middle of the instruction, for example the load is across two pages and the second page isn't mapped, QEMU will have overwritten the address with invalid data. This is a valid behaviour in most cases, with the exception of when a destination register is also use in address generation. As such switch the order of the registers to ensure the address register is second so it will be written to second, after any exceptions have happened. This has been acknowledged in upstream QEMU, however as the workaround is simple also handle it here. Sponsored by: DARPA, AFRL Modified: head/contrib/cortex-strings/src/aarch64/memcpy.S Modified: head/contrib/cortex-strings/src/aarch64/memcpy.S ============================================================================== --- head/contrib/cortex-strings/src/aarch64/memcpy.S Sat Aug 26 14:07:24 2017 (r322923) +++ head/contrib/cortex-strings/src/aarch64/memcpy.S Sat Aug 26 15:08:27 2017 (r322924) @@ -77,8 +77,8 @@ #define D_h x13 #define E_l src #define E_h count -#define F_l srcend -#define F_h dst +#define F_l dst +#define F_h srcend #define tmp1 x9 #define L(l) .L ## l From owner-svn-src-head@freebsd.org Sat Aug 26 16:11:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9426FDD514E; Sat, 26 Aug 2017 16:11:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65C8C7005B; Sat, 26 Aug 2017 16:11:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QGBLM9044030; Sat, 26 Aug 2017 16:11:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QGBLDx044026; Sat, 26 Aug 2017 16:11:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201708261611.v7QGBLDx044026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 26 Aug 2017 16:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322925 - in head/lib/libc: gen locale X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/lib/libc: gen locale X-SVN-Commit-Revision: 322925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 16:11:22 -0000 Author: pfg Date: Sat Aug 26 16:11:21 2017 New Revision: 322925 URL: https://svnweb.freebsd.org/changeset/base/322925 Log: libc: minor indent(1) cleanups. Illumos and Schillix is adopting some of the locale code and our style(9) sometimes matches the Solaris cstyle, so the changes are also useful as a way to reduce diffs. No functional change. Discussed with: Joerg Schilling MFC after: 1 week Modified: head/lib/libc/gen/fnmatch.c head/lib/libc/locale/setlocale.c head/lib/libc/locale/setrunelocale.c Modified: head/lib/libc/gen/fnmatch.c ============================================================================== --- head/lib/libc/gen/fnmatch.c Sat Aug 26 15:08:27 2017 (r322924) +++ head/lib/libc/gen/fnmatch.c Sat Aug 26 16:11:21 2017 (r322925) @@ -249,7 +249,7 @@ rangematch(const char *pattern, wchar_t test, int flag * consistency with the regular expression syntax. * J.T. Conklin (conklin@ngai.kaleida.com) */ - if ( (negate = (*pattern == '!' || *pattern == '^')) ) + if ((negate = (*pattern == '!' || *pattern == '^'))) ++pattern; if (flags & FNM_CASEFOLD) Modified: head/lib/libc/locale/setlocale.c ============================================================================== --- head/lib/libc/locale/setlocale.c Sat Aug 26 15:08:27 2017 (r322924) +++ head/lib/libc/locale/setlocale.c Sat Aug 26 16:11:21 2017 (r322925) @@ -42,48 +42,48 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* for _PATH_LOCALE */ +#include /* for _PATH_LOCALE */ #include #include #include #include "collate.h" -#include "lmonetary.h" /* for __monetary_load_locale() */ -#include "lnumeric.h" /* for __numeric_load_locale() */ -#include "lmessages.h" /* for __messages_load_locale() */ +#include "lmonetary.h" /* for __monetary_load_locale() */ +#include "lnumeric.h" /* for __numeric_load_locale() */ +#include "lmessages.h" /* for __messages_load_locale() */ #include "setlocale.h" #include "ldpart.h" -#include "../stdtime/timelocal.h" /* for __time_load_locale() */ +#include "../stdtime/timelocal.h" /* for __time_load_locale() */ /* * Category names for getenv() */ static const char categories[_LC_LAST][12] = { - "LC_ALL", - "LC_COLLATE", - "LC_CTYPE", - "LC_MONETARY", - "LC_NUMERIC", - "LC_TIME", - "LC_MESSAGES", + "LC_ALL", + "LC_COLLATE", + "LC_CTYPE", + "LC_MONETARY", + "LC_NUMERIC", + "LC_TIME", + "LC_MESSAGES", }; /* * Current locales for each category */ static char current_categories[_LC_LAST][ENCODING_LEN + 1] = { - "C", - "C", - "C", - "C", - "C", - "C", - "C", + "C", + "C", + "C", + "C", + "C", + "C", + "C", }; /* * Path to locale storage directory */ -char *_PathLocale; +char *_PathLocale; /* * The locales we are going to try and load @@ -93,21 +93,20 @@ static char saved_categories[_LC_LAST][ENCODING_LEN + static char current_locale_string[_LC_LAST * (ENCODING_LEN + 1/*"/"*/ + 1)]; -static char *currentlocale(void); -static char *loadlocale(int); +static char *currentlocale(void); +static char *loadlocale(int); const char *__get_locale_env(int); char * setlocale(int category, const char *locale) { int i, j, len, saverr; - const char *env, *r; + const char *env, *r; if (category < LC_ALL || category >= _LC_LAST) { errno = EINVAL; return (NULL); } - if (locale == NULL) return (category != LC_ALL ? current_categories[category] : currentlocale()); @@ -162,13 +161,13 @@ setlocale(int category, const char *locale) } do { if (i == _LC_LAST) - break; /* Too many slashes... */ + break; /* Too many slashes... */ if ((len = r - locale) > ENCODING_LEN) { errno = EINVAL; return (NULL); } (void)strlcpy(new_categories[i], locale, - len + 1); + len + 1); i++; while (*r == '/') r++; @@ -178,7 +177,7 @@ setlocale(int category, const char *locale) } while (*locale); while (i < _LC_LAST) { (void)strcpy(new_categories[i], - new_categories[i-1]); + new_categories[i - 1]); i++; } } @@ -193,7 +192,7 @@ setlocale(int category, const char *locale) saverr = errno; for (j = 1; j < i; j++) { (void)strcpy(new_categories[j], - saved_categories[j]); + saved_categories[j]); if (loadlocale(j) == NULL) { (void)strcpy(new_categories[j], "C"); (void)loadlocale(j); @@ -218,7 +217,7 @@ currentlocale(void) for (i = 2; i < _LC_LAST; ++i) { (void)strcat(current_locale_string, "/"); (void)strcat(current_locale_string, - current_categories[i]); + current_categories[i]); } break; } @@ -230,16 +229,15 @@ loadlocale(int category) { char *new = new_categories[category]; char *old = current_categories[category]; - int (*func)(const char *); + int (*func) (const char *); int saved_errno; if ((new[0] == '.' && - (new[1] == '\0' || (new[1] == '.' && new[2] == '\0'))) || + (new[1] == '\0' || (new[1] == '.' && new[2] == '\0'))) || strchr(new, '/') != NULL) { errno = EINVAL; return (NULL); } - saved_errno = errno; errno = __detect_path_locale(); if (errno != 0) @@ -285,22 +283,22 @@ loadlocale(int category) const char * __get_locale_env(int category) { - const char *env; + const char *env; - /* 1. check LC_ALL. */ - env = getenv(categories[0]); + /* 1. check LC_ALL. */ + env = getenv(categories[0]); - /* 2. check LC_* */ + /* 2. check LC_* */ if (env == NULL || !*env) - env = getenv(categories[category]); + env = getenv(categories[category]); - /* 3. check LANG */ + /* 3. check LANG */ if (env == NULL || !*env) - env = getenv("LANG"); + env = getenv("LANG"); - /* 4. if none is set, fall to "C" */ + /* 4. if none is set, fall to "C" */ if (env == NULL || !*env) - env = "C"; + env = "C"; return (env); } @@ -326,4 +324,3 @@ __detect_path_locale(void) } return (0); } - Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Sat Aug 26 15:08:27 2017 (r322924) +++ head/lib/libc/locale/setrunelocale.c Sat Aug 26 16:11:21 2017 (r322925) @@ -38,7 +38,7 @@ #include __FBSDID("$FreeBSD$"); -#define __RUNETYPE_INTERNAL 1 +#define __RUNETYPE_INTERNAL 1 #include #include @@ -72,7 +72,7 @@ destruct_ctype(void *v) { struct xlocale_ctype *l = v; - if (&_DefaultRuneLocale != l->runes) + if (&_DefaultRuneLocale != l->runes) free(l->runes); free(l); } @@ -81,7 +81,7 @@ const _RuneLocale * __getCurrentRuneLocale(void) { - return XLOCALE_CTYPE(__get_locale())->runes; + return (XLOCALE_CTYPE(__get_locale())->runes); } static void @@ -144,7 +144,7 @@ __setrunelocale(struct xlocale_ctype *l, const char *e else if (strcmp(rl->__encoding, "EUC-TW") == 0) ret = _EUC_TW_init(l, rl); else if (strcmp(rl->__encoding, "GB18030") == 0) - ret = _GB18030_init(l, rl); + ret = _GB18030_init(l, rl); else if (strcmp(rl->__encoding, "GB2312") == 0) ret = _GB2312_init(l, rl); else if (strcmp(rl->__encoding, "GBK") == 0) @@ -204,10 +204,9 @@ __ctype_load(const char *locale, locale_t unused __unu struct xlocale_ctype *l = calloc(sizeof(struct xlocale_ctype), 1); l->header.header.destructor = destruct_ctype; - if (__setrunelocale(l, locale)) - { + if (__setrunelocale(l, locale)) { free(l); - return NULL; + return (NULL); } - return l; + return (l); } From owner-svn-src-head@freebsd.org Sat Aug 26 18:04:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6309EDD712C; Sat, 26 Aug 2017 18:04: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 mx1.freebsd.org (Postfix) with ESMTPS id 27E8473289; Sat, 26 Aug 2017 18:04: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 v7QI4UGE090783; Sat, 26 Aug 2017 18:04:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QI4UQn090782; Sat, 26 Aug 2017 18:04:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708261804.v7QI4UQn090782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 26 Aug 2017 18:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322926 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 322926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:04:31 -0000 Author: kib Date: Sat Aug 26 18:04:29 2017 New Revision: 322926 URL: https://svnweb.freebsd.org/changeset/base/322926 Log: MFamd64 r322719: Trim excessive 'extern'. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sat Aug 26 16:11:21 2017 (r322925) +++ head/sys/i386/i386/trap.c Sat Aug 26 18:04:29 2017 (r322926) @@ -107,8 +107,8 @@ PMC_SOFT_DEFINE( , , page_fault, write); #include #endif -extern void trap(struct trapframe *frame); -extern void syscall(struct trapframe *frame); +void trap(struct trapframe *frame); +void syscall(struct trapframe *frame); static int trap_pfault(struct trapframe *, int, vm_offset_t); static void trap_fatal(struct trapframe *, vm_offset_t); From owner-svn-src-head@freebsd.org Sat Aug 26 18:06:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6718BDD71B7; Sat, 26 Aug 2017 18:06:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 369A2733D8; Sat, 26 Aug 2017 18:06:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QI6Thf090898; Sat, 26 Aug 2017 18:06:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QI6TgQ090897; Sat, 26 Aug 2017 18:06:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708261806.v7QI6TgQ090897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 26 Aug 2017 18:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322927 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 322927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:06:30 -0000 Author: kib Date: Sat Aug 26 18:06:29 2017 New Revision: 322927 URL: https://svnweb.freebsd.org/changeset/base/322927 Log: MFamd64 r322718: Use ANSI C declaration for trap_pfault(). Style. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sat Aug 26 18:04:29 2017 (r322926) +++ head/sys/i386/i386/trap.c Sat Aug 26 18:06:29 2017 (r322927) @@ -751,17 +751,18 @@ out: } static int -trap_pfault(frame, usermode, eva) - struct trapframe *frame; - int usermode; - vm_offset_t eva; +trap_pfault(struct trapframe *frame, int usermode, vm_offset_t eva) { + struct thread *td; + struct proc *p; vm_offset_t va; vm_map_t map; - int rv = 0; + int rv; vm_prot_t ftype; - struct thread *td = curthread; - struct proc *p = td->td_proc; + + td = curthread; + p = td->td_proc; + rv = 0; if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) { /* From owner-svn-src-head@freebsd.org Sat Aug 26 18:09:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69A1BDD723F; Sat, 26 Aug 2017 18:09:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 376AB7352F; Sat, 26 Aug 2017 18:09:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QI9Rpp091039; Sat, 26 Aug 2017 18:09:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QI9RDm091038; Sat, 26 Aug 2017 18:09:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708261809.v7QI9RDm091038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 26 Aug 2017 18:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322928 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 322928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:09:28 -0000 Author: kib Date: Sat Aug 26 18:09:27 2017 New Revision: 322928 URL: https://svnweb.freebsd.org/changeset/base/322928 Log: Remove unused code. The machdep.uprintf_signal sysctl replaced it in more convenient way, not requiring recompilation to use and providing more information on fault. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sat Aug 26 18:06:29 2017 (r322927) +++ head/sys/i386/i386/trap.c Sat Aug 26 18:09:27 2017 (r322928) @@ -731,16 +731,6 @@ kernel_trctrap: KASSERT((read_eflags() & PSL_I) != 0, ("interrupts disabled")); trapsignal(td, &ksi); -#ifdef DEBUG - if (type <= MAX_TRAP_MSG) { - uprintf("fatal process exception: %s", - trap_msg[type]); - if ((type == T_PAGEFLT) || (type == T_PROTFLT)) - uprintf(", fault VA = 0x%lx", (u_long)eva); - uprintf("\n"); - } -#endif - user: userret(td, frame); KASSERT(PCB_USER_FPU(td->td_pcb), From owner-svn-src-head@freebsd.org Sat Aug 26 18:12:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E429EDD7646; Sat, 26 Aug 2017 18:12:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C147A73A77; Sat, 26 Aug 2017 18:12:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QICPS6092723; Sat, 26 Aug 2017 18:12:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QICPkt092722; Sat, 26 Aug 2017 18:12:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708261812.v7QICPkt092722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 26 Aug 2017 18:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322929 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 322929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:12:27 -0000 Author: kib Date: Sat Aug 26 18:12:25 2017 New Revision: 322929 URL: https://svnweb.freebsd.org/changeset/base/322929 Log: MFamd64 r322720, r322723: Simplify i386 trap(). - Use more relevant name 'signo' instead of 'i' for the local variable which contains a signal number to send for the current exception. - Eliminate two labels 'userout' and 'out' which point to the very end of the trap() function. Instead use return directly. - Re-indent the prot_fault_translation block by reducing if() nesting. - Some more monor style changes. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sat Aug 26 18:09:27 2017 (r322928) +++ head/sys/i386/i386/trap.c Sat Aug 26 18:12:25 2017 (r322929) @@ -178,41 +178,45 @@ trap(struct trapframe *frame) #ifdef KDTRACE_HOOKS struct reg regs; #endif - struct thread *td = curthread; - struct proc *p = td->td_proc; + ksiginfo_t ksi; + struct thread *td; + struct proc *p; #ifdef KDB register_t dr6; #endif - int i = 0, ucode = 0; + int signo, ucode; u_int type; - register_t addr = 0; + register_t addr; vm_offset_t eva; - ksiginfo_t ksi; #ifdef POWERFAIL_NMI static int lastalert = 0; #endif + td = curthread; + p = td->td_proc; + signo = 0; + ucode = 0; + addr = 0; + VM_CNT_INC(v_trap); type = frame->tf_trapno; #ifdef SMP /* Handler for NMI IPIs used for stopping CPUs. */ - if (type == T_NMI) { - if (ipi_nmi_handler() == 0) - goto out; - } + if (type == T_NMI && ipi_nmi_handler() == 0) + return; #endif /* SMP */ #ifdef KDB if (kdb_active) { kdb_reenter(); - goto out; + return; } #endif if (type == T_RESERVED) { trap_fatal(frame, 0); - goto out; + return; } if (type == T_NMI) { @@ -226,18 +230,18 @@ trap(struct trapframe *frame) */ if (pmc_intr != NULL && (*pmc_intr)(PCPU_GET(cpuid), frame) != 0) - goto out; + return; #endif #ifdef STACK if (stack_nmi_handler(frame) != 0) - goto out; + return; #endif } if (type == T_MCHK) { mca_intr(); - goto out; + return; } #ifdef KDTRACE_HOOKS @@ -250,7 +254,7 @@ trap(struct trapframe *frame) */ if ((type == T_PROTFLT || type == T_PAGEFLT) && dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) - goto out; + return; #endif if ((frame->tf_eflags & PSL_I) == 0) { @@ -312,7 +316,7 @@ trap(struct trapframe *frame) switch (type) { case T_PRIVINFLT: /* privileged instruction fault */ - i = SIGILL; + signo = SIGILL; ucode = ILL_PRVOPC; break; @@ -324,66 +328,64 @@ trap(struct trapframe *frame) fill_frame_regs(frame, ®s); if (dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) - goto out; + return; } #endif user_trctrap_out: frame->tf_eflags &= ~PSL_T; - i = SIGTRAP; + signo = SIGTRAP; ucode = (type == T_TRCTRAP ? TRAP_TRACE : TRAP_BRKPT); break; case T_ARITHTRAP: /* arithmetic trap */ ucode = npxtrap_x87(); if (ucode == -1) - goto userout; - i = SIGFPE; + return; + signo = SIGFPE; break; - /* - * The following two traps can happen in - * vm86 mode, and, if so, we want to handle - * them specially. - */ + /* + * The following two traps can happen in vm86 mode, + * and, if so, we want to handle them specially. + */ case T_PROTFLT: /* general protection fault */ case T_STKFLT: /* stack fault */ if (frame->tf_eflags & PSL_VM) { - i = vm86_emulate((struct vm86frame *)frame); - if (i == SIGTRAP) { + signo = vm86_emulate((struct vm86frame *)frame); + if (signo == SIGTRAP) { type = T_TRCTRAP; load_dr6(rdr6() | 0x4000); goto user_trctrap_out; } - if (i == 0) + if (signo == 0) goto user; break; } - i = SIGBUS; + signo = SIGBUS; ucode = (type == T_PROTFLT) ? BUS_OBJERR : BUS_ADRERR; break; case T_SEGNPFLT: /* segment not present fault */ - i = SIGBUS; + signo = SIGBUS; ucode = BUS_ADRERR; break; case T_TSSFLT: /* invalid TSS fault */ - i = SIGBUS; + signo = SIGBUS; ucode = BUS_OBJERR; break; case T_ALIGNFLT: - i = SIGBUS; + signo = SIGBUS; ucode = BUS_ADRALN; break; case T_DOUBLEFLT: /* double fault */ default: - i = SIGBUS; + signo = SIGBUS; ucode = BUS_OBJERR; break; case T_PAGEFLT: /* page fault */ - - i = trap_pfault(frame, TRUE, eva); + signo = trap_pfault(frame, TRUE, eva); #if defined(I586_CPU) && !defined(NO_F00F_HACK) - if (i == -2) { + if (signo == -2) { /* * The f00f hack workaround has triggered, so * treat the fault as an illegal instruction @@ -393,52 +395,50 @@ user_trctrap_out: /* Proceed as in that case. */ ucode = ILL_PRVOPC; - i = SIGILL; + signo = SIGILL; break; } #endif - if (i == -1) - goto userout; - if (i == 0) + if (signo == -1) + return; + if (signo == 0) goto user; - if (i == SIGSEGV) + if (signo == SIGSEGV) ucode = SEGV_MAPERR; - else { - if (prot_fault_translation == 0) { - /* - * Autodetect. - * This check also covers the images - * without the ABI-tag ELF note. - */ - if (SV_CURPROC_ABI() == SV_ABI_FREEBSD - && p->p_osrel >= P_OSREL_SIGSEGV) { - i = SIGSEGV; - ucode = SEGV_ACCERR; - } else { - i = SIGBUS; - ucode = BUS_PAGE_FAULT; - } - } else if (prot_fault_translation == 1) { - /* - * Always compat mode. - */ - i = SIGBUS; - ucode = BUS_PAGE_FAULT; - } else { - /* - * Always SIGSEGV mode. - */ - i = SIGSEGV; + else if (prot_fault_translation == 0) { + /* + * Autodetect. This check also covers + * the images without the ABI-tag ELF + * note. + */ + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD && + p->p_osrel >= P_OSREL_SIGSEGV) { + signo = SIGSEGV; ucode = SEGV_ACCERR; + } else { + signo = SIGBUS; + ucode = BUS_PAGE_FAULT; } + } else if (prot_fault_translation == 1) { + /* + * Always compat mode. + */ + signo = SIGBUS; + ucode = BUS_PAGE_FAULT; + } else { + /* + * Always SIGSEGV mode. + */ + signo = SIGSEGV; + ucode = SEGV_ACCERR; } addr = eva; break; case T_DIVIDE: /* integer divide fault */ ucode = FPE_INTDIV; - i = SIGFPE; + signo = SIGFPE; break; #ifdef DEV_ISA @@ -452,21 +452,21 @@ user_trctrap_out: sysbeep(880, hz); lastalert = time_second; } - goto userout; + return; #else /* !POWERFAIL_NMI */ nmi_handle_intr(type, frame); - goto out; + return; #endif /* POWERFAIL_NMI */ #endif /* DEV_ISA */ case T_OFLOW: /* integer overflow fault */ ucode = FPE_INTOVF; - i = SIGFPE; + signo = SIGFPE; break; case T_BOUND: /* bounds check fault */ ucode = FPE_FLTSUB; - i = SIGFPE; + signo = SIGFPE; break; case T_DNA: @@ -474,32 +474,31 @@ user_trctrap_out: ("kernel FPU ctx has leaked")); /* transparent fault (due to context switch "late") */ if (npxdna()) - goto userout; + return; uprintf("pid %d killed due to lack of floating point\n", p->p_pid); - i = SIGKILL; + signo = SIGKILL; ucode = 0; break; case T_FPOPFLT: /* FPU operand fetch fault */ ucode = ILL_COPROC; - i = SIGILL; + signo = SIGILL; break; case T_XMMFLT: /* SIMD floating-point exception */ ucode = npxtrap_sse(); if (ucode == -1) - goto userout; - i = SIGFPE; + return; + signo = SIGFPE; break; #ifdef KDTRACE_HOOKS case T_DTRACE_RET: enable_intr(); fill_frame_regs(frame, ®s); - if (dtrace_return_probe_ptr != NULL && - dtrace_return_probe_ptr(®s) == 0) - goto out; - goto userout; + if (dtrace_return_probe_ptr != NULL) + dtrace_return_probe_ptr(®s); + return; #endif } } else { @@ -510,13 +509,13 @@ user_trctrap_out: switch (type) { case T_PAGEFLT: /* page fault */ (void) trap_pfault(frame, FALSE, eva); - goto out; + return; case T_DNA: if (PCB_USER_FPU(td->td_pcb)) panic("Unregistered use of FPU in kernel"); if (npxdna()) - goto out; + return; break; case T_ARITHTRAP: /* arithmetic trap */ @@ -527,7 +526,7 @@ user_trctrap_out: * handler registration seems to be overkill */ trap_fatal(frame, 0); - goto out; + return; /* * The following two traps can happen in @@ -537,18 +536,18 @@ user_trctrap_out: case T_PROTFLT: /* general protection fault */ case T_STKFLT: /* stack fault */ if (frame->tf_eflags & PSL_VM) { - i = vm86_emulate((struct vm86frame *)frame); - if (i == SIGTRAP) { + signo = vm86_emulate((struct vm86frame *)frame); + if (signo == SIGTRAP) { type = T_TRCTRAP; load_dr6(rdr6() | 0x4000); goto kernel_trctrap; } - if (i != 0) + if (signo != 0) /* * returns to original process */ vm86_trap((struct vm86frame *)frame); - goto out; + return; } /* FALL THROUGH */ case T_SEGNPFLT: /* segment not present fault */ @@ -571,7 +570,7 @@ user_trctrap_out: kern_psignal(p, SIGBUS); PROC_UNLOCK(p); #endif - goto out; + return; } if (td->td_intr_nesting_level != 0) @@ -589,27 +588,26 @@ user_trctrap_out: */ if (frame->tf_eip == (int)doreti_iret) { frame->tf_eip = (int)doreti_iret_fault; - goto out; + return; } if (type == T_STKFLT) break; if (frame->tf_eip == (int)doreti_popl_ds) { frame->tf_eip = (int)doreti_popl_ds_fault; - goto out; + return; } if (frame->tf_eip == (int)doreti_popl_es) { frame->tf_eip = (int)doreti_popl_es_fault; - goto out; + return; } if (frame->tf_eip == (int)doreti_popl_fs) { frame->tf_eip = (int)doreti_popl_fs_fault; - goto out; + return; } if (curpcb->pcb_onfault != NULL) { - frame->tf_eip = - (int)curpcb->pcb_onfault; - goto out; + frame->tf_eip = (int)curpcb->pcb_onfault; + return; } break; @@ -625,7 +623,7 @@ user_trctrap_out: */ if (frame->tf_eflags & PSL_NT) { frame->tf_eflags &= ~PSL_NT; - goto out; + return; } break; @@ -638,7 +636,7 @@ kernel_trctrap: * silently until the syscall handler has * saved the flags. */ - goto out; + return; } if (frame->tf_eip == (int)IDTVEC(lcall_syscall) + 1) { /* @@ -646,7 +644,7 @@ kernel_trctrap: * flags. Stop single stepping it. */ frame->tf_eflags &= ~PSL_T; - goto out; + return; } /* * Ignore debug register trace traps due to @@ -665,7 +663,7 @@ kernel_trctrap: * processor doesn't */ load_dr6(rdr6() & ~0xf); - goto out; + return; } /* * FALLTHROUGH (TRCTRAP kernel mode, kernel address) @@ -680,7 +678,7 @@ kernel_trctrap: dr6 = rdr6(); load_dr6(dr6 & ~0x4000); if (kdb_trap(type, dr6, frame)) - goto out; + return; #endif break; @@ -692,24 +690,24 @@ kernel_trctrap: sysbeep(880, hz); lastalert = time_second; } - goto out; + return; #else /* !POWERFAIL_NMI */ nmi_handle_intr(type, frame); - goto out; + return; #endif /* POWERFAIL_NMI */ #endif /* DEV_ISA */ } trap_fatal(frame, eva); - goto out; + return; } /* Translate fault for emulators (e.g. Linux) */ - if (*p->p_sysent->sv_transtrap) - i = (*p->p_sysent->sv_transtrap)(i, type); + if (*p->p_sysent->sv_transtrap != NULL) + signo = (*p->p_sysent->sv_transtrap)(signo, type); ksiginfo_init_trap(&ksi); - ksi.ksi_signo = i; + ksi.ksi_signo = signo; ksi.ksi_code = ucode; ksi.ksi_addr = (void *)addr; ksi.ksi_trapno = type; @@ -717,8 +715,8 @@ kernel_trctrap: uprintf("pid %d comm %s: signal %d err %x code %d type %d " "addr 0x%x esp 0x%08x eip 0x%08x " "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", - p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, - frame->tf_esp, frame->tf_eip, + p->p_pid, p->p_comm, signo, frame->tf_err, ucode, type, + addr, frame->tf_esp, frame->tf_eip, fubyte((void *)(frame->tf_eip + 0)), fubyte((void *)(frame->tf_eip + 1)), fubyte((void *)(frame->tf_eip + 2)), @@ -735,9 +733,6 @@ user: userret(td, frame); KASSERT(PCB_USER_FPU(td->td_pcb), ("Return from trap with kernel FPU ctx leaked")); -userout: -out: - return; } static int From owner-svn-src-head@freebsd.org Sat Aug 26 18:29:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0D0FDD7D2B; Sat, 26 Aug 2017 18:29: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 mx1.freebsd.org (Postfix) with ESMTPS id 8C9D074549; Sat, 26 Aug 2017 18:29: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 v7QITOj6099386; Sat, 26 Aug 2017 18:29:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QITONI099380; Sat, 26 Aug 2017 18:29:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261829.v7QITONI099380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322930 - in head/sys/boot/efi: boot1 include libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: boot1 include libefi loader X-SVN-Commit-Revision: 322930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:29:25 -0000 Author: imp Date: Sat Aug 26 18:29:24 2017 New Revision: 322930 URL: https://svnweb.freebsd.org/changeset/base/322930 Log: Move efi_main into efi/loader Move the efi_main routine out of libefi into sys/boot/efi/loader. Since boot1 has its own efi_main routine, this effectively prevents boot1 from linking with libefi. By moving it out, we can share code better (though though some refactoring with boot1's efi_main and loader.efi's efi_main is definitely in order). Sponsored by: Netflix Added: head/sys/boot/efi/loader/efi_main.c - copied, changed from r322924, head/sys/boot/efi/libefi/libefi.c Modified: head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/include/efidevp.h head/sys/boot/efi/libefi/libefi.c head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Sat Aug 26 18:12:25 2017 (r322929) +++ head/sys/boot/efi/boot1/boot1.c Sat Aug 26 18:29:24 2017 (r322930) @@ -88,7 +88,7 @@ Free(void *buf, const char *file __unused, int line __ static BOOLEAN nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) { - int len; + size_t len; if (imgpath == NULL || imgpath->Type != devpath->Type || imgpath->SubType != devpath->SubType) Modified: head/sys/boot/efi/include/efidevp.h ============================================================================== --- head/sys/boot/efi/include/efidevp.h Sat Aug 26 18:12:25 2017 (r322929) +++ head/sys/boot/efi/include/efidevp.h Sat Aug 26 18:29:24 2017 (r322930) @@ -52,7 +52,7 @@ typedef struct _EFI_DEVICE_PATH { #define DevicePathType(a) ( ((a)->Type) & EFI_DP_TYPE_MASK ) #define DevicePathSubType(a) ( (a)->SubType ) -#define DevicePathNodeLength(a) ( ((a)->Length[0]) | ((a)->Length[1] << 8) ) +#define DevicePathNodeLength(a) ((size_t)(((a)->Length[0]) | ((a)->Length[1] << 8))) #define NextDevicePathNode(a) ( (EFI_DEVICE_PATH *) ( ((UINT8 *) (a)) + DevicePathNodeLength(a))) #define IsDevicePathType(a, t) ( DevicePathType(a) == t ) #define IsDevicePathEndType(a) IsDevicePathType(a, END_DEVICE_PATH_TYPE) Modified: head/sys/boot/efi/libefi/libefi.c ============================================================================== --- head/sys/boot/efi/libefi/libefi.c Sat Aug 26 18:12:25 2017 (r322929) +++ head/sys/boot/efi/libefi/libefi.c Sat Aug 26 18:29:24 2017 (r322930) @@ -32,32 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include -EFI_HANDLE IH; -EFI_SYSTEM_TABLE *ST; -EFI_BOOT_SERVICES *BS; -EFI_RUNTIME_SERVICES *RS; +extern EFI_SYSTEM_TABLE *ST; -static EFI_PHYSICAL_ADDRESS heap; -static UINTN heapsize; - -static CHAR16 * -arg_skipsep(CHAR16 *argp) -{ - - while (*argp == ' ' || *argp == '\t' || *argp == '\n') - argp++; - return (argp); -} - -static CHAR16 * -arg_skipword(CHAR16 *argp) -{ - - while (*argp && *argp != ' ' && *argp != '\t' && *argp != '\n') - argp++; - return (argp); -} - void * efi_get_table(EFI_GUID *tbl) { @@ -70,129 +46,4 @@ efi_get_table(EFI_GUID *tbl) return (ST->ConfigurationTable[i].VendorTable); } return (NULL); -} - -void exit(EFI_STATUS exit_code) -{ - - BS->FreePages(heap, EFI_SIZE_TO_PAGES(heapsize)); - BS->Exit(IH, exit_code, 0, NULL); -} - -void -efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table) -{ - static EFI_GUID image_protocol = LOADED_IMAGE_PROTOCOL; - static EFI_GUID console_control_protocol = - EFI_CONSOLE_CONTROL_PROTOCOL_GUID; - EFI_CONSOLE_CONTROL_PROTOCOL *console_control = NULL; - EFI_LOADED_IMAGE *img; - CHAR16 *argp, *args, **argv; - EFI_STATUS status; - int argc, addprog; - - IH = image_handle; - ST = system_table; - BS = ST->BootServices; - RS = ST->RuntimeServices; - - status = BS->LocateProtocol(&console_control_protocol, NULL, - (VOID **)&console_control); - if (status == EFI_SUCCESS) - (void)console_control->SetMode(console_control, - EfiConsoleControlScreenText); - - heapsize = 64 * 1024 * 1024; - status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, - EFI_SIZE_TO_PAGES(heapsize), &heap); - if (status != EFI_SUCCESS) - BS->Exit(IH, status, 0, NULL); - - setheap((void *)(uintptr_t)heap, (void *)(uintptr_t)(heap + heapsize)); - - /* Use exit() from here on... */ - - status = BS->HandleProtocol(IH, &image_protocol, (VOID**)&img); - if (status != EFI_SUCCESS) - exit(status); - - /* - * Pre-process the (optional) load options. If the option string - * is given as an ASCII string, we use a poor man's ASCII to - * Unicode-16 translation. The size of the option string as given - * to us includes the terminating null character. We assume the - * string is an ASCII string if strlen() plus the terminating - * '\0' is less than LoadOptionsSize. Even if all Unicode-16 - * characters have the upper 8 bits non-zero, the terminating - * null character will cause a one-off. - * If the string is already in Unicode-16, we make a copy so that - * we know we can always modify the string. - */ - if (img->LoadOptionsSize > 0 && img->LoadOptions != NULL) { - if (img->LoadOptionsSize == strlen(img->LoadOptions) + 1) { - args = malloc(img->LoadOptionsSize << 1); - for (argc = 0; argc < img->LoadOptionsSize; argc++) - args[argc] = ((char*)img->LoadOptions)[argc]; - } else { - args = malloc(img->LoadOptionsSize); - memcpy(args, img->LoadOptions, img->LoadOptionsSize); - } - } else - args = NULL; - - /* - * Use a quick and dirty algorithm to build the argv vector. We - * first count the number of words. Then, after allocating the - * vector, we split the string up. We don't deal with quotes or - * other more advanced shell features. - * The EFI shell will pass the name of the image as the first - * word in the argument list. This does not happen if we're - * loaded by the boot manager. This is not so easy to figure - * out though. The ParentHandle is not always NULL, because - * there can be a function (=image) that will perform the task - * for the boot manager. - */ - /* Part 1: Figure out if we need to add our program name. */ - addprog = (args == NULL || img->ParentHandle == NULL || - img->FilePath == NULL) ? 1 : 0; - if (!addprog) { - addprog = - (DevicePathType(img->FilePath) != MEDIA_DEVICE_PATH || - DevicePathSubType(img->FilePath) != MEDIA_FILEPATH_DP || - DevicePathNodeLength(img->FilePath) <= - sizeof(FILEPATH_DEVICE_PATH)) ? 1 : 0; - if (!addprog) { - /* XXX todo. */ - } - } - /* Part 2: count words. */ - argc = (addprog) ? 1 : 0; - argp = args; - while (argp != NULL && *argp != 0) { - argp = arg_skipsep(argp); - if (*argp == 0) - break; - argc++; - argp = arg_skipword(argp); - } - /* Part 3: build vector. */ - argv = malloc((argc + 1) * sizeof(CHAR16*)); - argc = 0; - if (addprog) - argv[argc++] = (CHAR16 *)L"loader.efi"; - argp = args; - while (argp != NULL && *argp != 0) { - argp = arg_skipsep(argp); - if (*argp == 0) - break; - argv[argc++] = argp; - argp = arg_skipword(argp); - /* Terminate the words. */ - if (*argp != 0) - *argp++ = 0; - } - argv[argc] = NULL; - - status = main(argc, argv); - exit(status); } Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Sat Aug 26 18:12:25 2017 (r322929) +++ head/sys/boot/efi/loader/Makefile Sat Aug 26 18:29:24 2017 (r322930) @@ -16,6 +16,7 @@ SRCS= autoload.c \ bootinfo.c \ conf.c \ copy.c \ + efi_main.c \ main.c \ self_reloc.c \ smbios.c \ Copied and modified: head/sys/boot/efi/loader/efi_main.c (from r322924, head/sys/boot/efi/libefi/libefi.c) ============================================================================== --- head/sys/boot/efi/libefi/libefi.c Sat Aug 26 15:08:27 2017 (r322924, copy source) +++ head/sys/boot/efi/loader/efi_main.c Sat Aug 26 18:29:24 2017 (r322930) @@ -40,6 +40,14 @@ EFI_RUNTIME_SERVICES *RS; static EFI_PHYSICAL_ADDRESS heap; static UINTN heapsize; +void +exit(EFI_STATUS exit_code) +{ + + BS->FreePages(heap, EFI_SIZE_TO_PAGES(heapsize)); + BS->Exit(IH, exit_code, 0, NULL); +} + static CHAR16 * arg_skipsep(CHAR16 *argp) { @@ -58,27 +66,8 @@ arg_skipword(CHAR16 *argp) return (argp); } -void * -efi_get_table(EFI_GUID *tbl) -{ - EFI_GUID *id; - int i; +void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table); - for (i = 0; i < ST->NumberOfTableEntries; i++) { - id = &ST->ConfigurationTable[i].VendorGuid; - if (!memcmp(id, tbl, sizeof(EFI_GUID))) - return (ST->ConfigurationTable[i].VendorTable); - } - return (NULL); -} - -void exit(EFI_STATUS exit_code) -{ - - BS->FreePages(heap, EFI_SIZE_TO_PAGES(heapsize)); - BS->Exit(IH, exit_code, 0, NULL); -} - void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table) { @@ -131,7 +120,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *sy if (img->LoadOptionsSize > 0 && img->LoadOptions != NULL) { if (img->LoadOptionsSize == strlen(img->LoadOptions) + 1) { args = malloc(img->LoadOptionsSize << 1); - for (argc = 0; argc < img->LoadOptionsSize; argc++) + for (argc = 0; argc < (int)img->LoadOptionsSize; argc++) args[argc] = ((char*)img->LoadOptions)[argc]; } else { args = malloc(img->LoadOptionsSize); From owner-svn-src-head@freebsd.org Sat Aug 26 18:29:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81AE0DD7D7F; Sat, 26 Aug 2017 18:29:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id 45F2974637; Sat, 26 Aug 2017 18:29:39 +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 v7QITct8099443; Sat, 26 Aug 2017 18:29:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QITcjP099439; Sat, 26 Aug 2017 18:29:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261829.v7QITcjP099439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322931 - in head/sys/boot/efi: boot1 include loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: boot1 include loader X-SVN-Commit-Revision: 322931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:29:39 -0000 Author: imp Date: Sat Aug 26 18:29:37 2017 New Revision: 322931 URL: https://svnweb.freebsd.org/changeset/base/322931 Log: Cleanup efi_main return type Make the return type of efi_main uniform. Declare the Exit() function as not returning. Move efi_main's declaration to the proper header. Sponsored by: Netflix Modified: head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/include/efiapi.h head/sys/boot/efi/include/efilib.h head/sys/boot/efi/loader/efi_main.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Sat Aug 26 18:29:24 2017 (r322930) +++ head/sys/boot/efi/boot1/boot1.c Sat Aug 26 18:29:37 2017 (r322931) @@ -47,8 +47,6 @@ static const boot_module_t *boot_modules[] = /* The initial number of handles used to query EFI for partitions. */ #define NUM_HANDLES_INIT 24 -EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); - EFI_SYSTEM_TABLE *systab; EFI_BOOT_SERVICES *bs; static EFI_HANDLE *image; Modified: head/sys/boot/efi/include/efiapi.h ============================================================================== --- head/sys/boot/efi/include/efiapi.h Sat Aug 26 18:29:24 2017 (r322930) +++ head/sys/boot/efi/include/efiapi.h Sat Aug 26 18:29:37 2017 (r322931) @@ -353,7 +353,7 @@ EFI_STATUS IN EFI_STATUS ExitStatus, IN UINTN ExitDataSize, IN CHAR16 *ExitData OPTIONAL - ); + ) __dead2; typedef EFI_STATUS Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Sat Aug 26 18:29:24 2017 (r322930) +++ head/sys/boot/efi/include/efilib.h Sat Aug 26 18:29:37 2017 (r322931) @@ -89,8 +89,10 @@ EFI_STATUS errno_to_efi_status(int errno); void efi_time_init(void); void efi_time_fini(void); +EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); + EFI_STATUS main(int argc, CHAR16 *argv[]); -void exit(EFI_STATUS status); +void exit(EFI_STATUS status) __dead2; void delay(int usecs); /* EFI environment initialization. */ Modified: head/sys/boot/efi/loader/efi_main.c ============================================================================== --- head/sys/boot/efi/loader/efi_main.c Sat Aug 26 18:29:24 2017 (r322930) +++ head/sys/boot/efi/loader/efi_main.c Sat Aug 26 18:29:37 2017 (r322931) @@ -66,9 +66,7 @@ arg_skipword(CHAR16 *argp) return (argp); } -void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table); - -void +EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table) { static EFI_GUID image_protocol = LOADED_IMAGE_PROTOCOL; @@ -184,4 +182,5 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *sy status = main(argc, argv); exit(status); + return (status); } From owner-svn-src-head@freebsd.org Sat Aug 26 18:29:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5D9EDD7DCB; Sat, 26 Aug 2017 18:29:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFB8B746CB; Sat, 26 Aug 2017 18:29:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QIThm7099500; Sat, 26 Aug 2017 18:29:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QIThDc099496; Sat, 26 Aug 2017 18:29:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261829.v7QIThDc099496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322932 - head/sys/boot/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/efi/boot1 X-SVN-Commit-Revision: 322932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:29:45 -0000 Author: imp Date: Sat Aug 26 18:29:43 2017 New Revision: 322932 URL: https://svnweb.freebsd.org/changeset/base/322932 Log: Use the loader.efi conventions for the various EFI tables. Sponsored by: Netflix Modified: head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/boot1/boot_module.h head/sys/boot/efi/boot1/ufs_module.c head/sys/boot/efi/boot1/zfs_module.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Sat Aug 26 18:29:37 2017 (r322931) +++ head/sys/boot/efi/boot1/boot1.c Sat Aug 26 18:29:43 2017 (r322932) @@ -47,9 +47,10 @@ static const boot_module_t *boot_modules[] = /* The initial number of handles used to query EFI for partitions. */ #define NUM_HANDLES_INIT 24 -EFI_SYSTEM_TABLE *systab; -EFI_BOOT_SERVICES *bs; -static EFI_HANDLE *image; +EFI_HANDLE IH; +EFI_SYSTEM_TABLE *ST; +EFI_BOOT_SERVICES *BS; +EFI_RUNTIME_SERVICES *RS; static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; @@ -66,7 +67,7 @@ Malloc(size_t len, const char *file __unused, int line { void *out; - if (bs->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) + if (BS->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) return (out); return (NULL); @@ -76,7 +77,7 @@ void Free(void *buf, const char *file __unused, int line __unused) { if (buf != NULL) - (void)bs->FreePool(buf); + (void)BS->FreePool(buf); } /* @@ -398,14 +399,14 @@ try_boot(void) buf = NULL; } - if ((status = bs->LoadImage(TRUE, image, devpath_last(dev->devpath), + if ((status = BS->LoadImage(TRUE, IH, devpath_last(dev->devpath), loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) { printf("Failed to load image provided by %s, size: %zu, (%lu)\n", mod->name, loadersize, EFI_ERROR_CODE(status)); goto errout; } - if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, + if ((status = BS->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image)) != EFI_SUCCESS) { printf("Failed to query LoadedImage provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); @@ -431,7 +432,7 @@ try_boot(void) DSTALL(1000000); DPRINTF(".\n"); - if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != + if ((status = BS->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { printf("Failed to start image provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); @@ -465,7 +466,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B UINTN i; /* Figure out if we're dealing with an actual partition. */ - status = bs->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); if (status == EFI_UNSUPPORTED) return (status); @@ -477,7 +478,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B DPRINTF("probing: %s\n", devpath_str(devpath)); - status = bs->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); if (status == EFI_UNSUPPORTED) return (status); @@ -494,7 +495,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B /* Run through each module, see if it can load this partition */ for (i = 0; i < NUM_BOOT_MODULES; i++) { - if ((status = bs->AllocatePool(EfiLoaderData, + if ((status = BS->AllocatePool(EfiLoaderData, sizeof(*devinfo), (void **)&devinfo)) != EFI_SUCCESS) { DPRINTF("\nFailed to allocate devinfo (%lu)\n", @@ -511,7 +512,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B status = boot_modules[i]->probe(devinfo); if (status == EFI_SUCCESS) return (EFI_SUCCESS); - (void)bs->FreePool(devinfo); + (void)BS->FreePool(devinfo); } return (EFI_UNSUPPORTED); @@ -565,12 +566,13 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; /* Basic initialization*/ - systab = Xsystab; - image = Ximage; - bs = Xsystab->BootServices; + ST = Xsystab; + IH = Ximage; + BS = ST->BootServices; + RS = ST->RuntimeServices; /* Set up the console, so printf works. */ - status = bs->LocateProtocol(&ConsoleControlGUID, NULL, + status = BS->LocateProtocol(&ConsoleControlGUID, NULL, (VOID **)&ConsoleControl); if (status == EFI_SUCCESS) (void)ConsoleControl->SetMode(ConsoleControl, @@ -578,7 +580,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) /* * Reset the console and find the best text mode. */ - conout = systab->ConOut; + conout = ST->ConOut; conout->Reset(conout, TRUE); max_dim = best_mode = 0; for (i = 0; ; i++) { @@ -607,24 +609,24 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) /* Get all the device handles */ hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); - if ((status = bs->AllocatePool(EfiLoaderData, hsize, (void **)&handles)) + if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void **)&handles)) != EFI_SUCCESS) panic("Failed to allocate %d handles (%lu)", NUM_HANDLES_INIT, EFI_ERROR_CODE(status)); - status = bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, + status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, &hsize, handles); switch (status) { case EFI_SUCCESS: break; case EFI_BUFFER_TOO_SMALL: - (void)bs->FreePool(handles); - if ((status = bs->AllocatePool(EfiLoaderData, hsize, + (void)BS->FreePool(handles); + if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void **)&handles)) != EFI_SUCCESS) { panic("Failed to allocate %zu handles (%lu)", hsize / sizeof(*handles), EFI_ERROR_CODE(status)); } - status = bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, + status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, &hsize, handles); if (status != EFI_SUCCESS) panic("Failed to get device handles (%lu)\n", @@ -641,10 +643,10 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) DPRINTF("\n"); /* Determine the devpath of our image so we can prefer it. */ - status = bs->HandleProtocol(image, &LoadedImageGUID, (VOID**)&img); + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); imgpath = NULL; if (status == EFI_SUCCESS) { - status = bs->HandleProtocol(img->DeviceHandle, &DevicePathGUID, + status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, (void **)&imgpath); if (status != EFI_SUCCESS) DPRINTF("Failed to get image DevicePath (%lu)\n", @@ -709,9 +711,9 @@ putchar(int c) if (c == '\n') { buf[0] = '\r'; buf[1] = 0; - systab->ConOut->OutputString(systab->ConOut, buf); + ST->ConOut->OutputString(ST->ConOut, buf); } buf[0] = c; buf[1] = 0; - systab->ConOut->OutputString(systab->ConOut, buf); + ST->ConOut->OutputString(ST->ConOut, buf); } Modified: head/sys/boot/efi/boot1/boot_module.h ============================================================================== --- head/sys/boot/efi/boot1/boot_module.h Sat Aug 26 18:29:37 2017 (r322931) +++ head/sys/boot/efi/boot1/boot_module.h Sat Aug 26 18:29:43 2017 (r322932) @@ -37,7 +37,7 @@ #ifdef EFI_DEBUG #define DPRINTF(fmt, args...) printf(fmt, ##args) -#define DSTALL(d) bs->Stall(d) +#define DSTALL(d) BS->Stall(d) #else #define DPRINTF(fmt, ...) {} #define DSTALL(d) {} @@ -106,9 +106,6 @@ extern const boot_module_t zfs_module; /* Functions available to modules. */ extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); - -extern EFI_SYSTEM_TABLE *systab; -extern EFI_BOOT_SERVICES *bs; extern int devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devpath); extern char *devpath_str(EFI_DEVICE_PATH *devpath); Modified: head/sys/boot/efi/boot1/ufs_module.c ============================================================================== --- head/sys/boot/efi/boot1/ufs_module.c Sat Aug 26 18:29:37 2017 (r322931) +++ head/sys/boot/efi/boot1/ufs_module.c Sat Aug 26 18:29:43 2017 (r322932) @@ -118,7 +118,7 @@ load(const char *filepath, dev_info_t *dev, void **buf return (EFI_INVALID_PARAMETER); } - if ((status = bs->AllocatePool(EfiLoaderData, size, &buf)) != + if ((status = BS->AllocatePool(EfiLoaderData, size, &buf)) != EFI_SUCCESS) { printf("Failed to allocate read buffer %zu for '%s' (%lu)\n", size, filepath, EFI_ERROR_CODE(status)); @@ -129,7 +129,7 @@ load(const char *filepath, dev_info_t *dev, void **buf if ((size_t)read != size) { printf("Failed to read '%s' (%zd != %zu)\n", filepath, read, size); - (void)bs->FreePool(buf); + (void)BS->FreePool(buf); return (EFI_INVALID_PARAMETER); } Modified: head/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- head/sys/boot/efi/boot1/zfs_module.c Sat Aug 26 18:29:37 2017 (r322931) +++ head/sys/boot/efi/boot1/zfs_module.c Sat Aug 26 18:29:43 2017 (r322932) @@ -118,7 +118,7 @@ probe(dev_info_t *dev) EFI_STATUS status; /* ZFS consumes the dev on success so we need a copy. */ - if ((status = bs->AllocatePool(EfiLoaderData, sizeof(*dev), + if ((status = BS->AllocatePool(EfiLoaderData, sizeof(*dev), (void**)&tdev)) != EFI_SUCCESS) { DPRINTF("Failed to allocate tdev (%lu)\n", EFI_ERROR_CODE(status)); @@ -127,7 +127,7 @@ probe(dev_info_t *dev) memcpy(tdev, dev, sizeof(*dev)); if (vdev_probe(vdev_read, tdev, &spa) != 0) { - (void)bs->FreePool(tdev); + (void)BS->FreePool(tdev); return (EFI_UNSUPPORTED); } @@ -180,7 +180,7 @@ load(const char *filepath, dev_info_t *devinfo, void * return (EFI_INVALID_PARAMETER); } - if ((status = bs->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf)) + if ((status = BS->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf)) != EFI_SUCCESS) { printf("Failed to allocate load buffer %jd for pool '%s' for '%s' " "(%lu)\n", (intmax_t)st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); @@ -190,7 +190,7 @@ load(const char *filepath, dev_info_t *devinfo, void * if ((err = dnode_read(spa, &dn, 0, buf, st.st_size)) != 0) { printf("Failed to read node from %s (%d)\n", spa->spa_name, err); - (void)bs->FreePool(buf); + (void)BS->FreePool(buf); return (EFI_INVALID_PARAMETER); } From owner-svn-src-head@freebsd.org Sat Aug 26 18:29:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6A41DD7E86; Sat, 26 Aug 2017 18:29:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8973E747F9; Sat, 26 Aug 2017 18:29:54 +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 v7QITrQf099605; Sat, 26 Aug 2017 18:29:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QITrBo099604; Sat, 26 Aug 2017 18:29:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261829.v7QITrBo099604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322934 - head/sys/boot/geli X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/geli X-SVN-Commit-Revision: 322934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:29:55 -0000 Author: imp Date: Sat Aug 26 18:29:53 2017 New Revision: 322934 URL: https://svnweb.freebsd.org/changeset/base/322934 Log: _STAND is sometimes defined on the command line. Make the define here match. Sponsored by: Netflix Modified: head/sys/boot/geli/geliboot_internal.h Modified: head/sys/boot/geli/geliboot_internal.h ============================================================================== --- head/sys/boot/geli/geliboot_internal.h Sat Aug 26 18:29:48 2017 (r322933) +++ head/sys/boot/geli/geliboot_internal.h Sat Aug 26 18:29:53 2017 (r322934) @@ -51,7 +51,7 @@ #include /* AES-XTS implementation */ -#define _STAND +#define _STAND 1 #define STAND_H /* We don't want stand.h in {gpt,zfs,gptzfs}boot */ #include From owner-svn-src-head@freebsd.org Sat Aug 26 18:30:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F191DD7F70; Sat, 26 Aug 2017 18:30: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 mx1.freebsd.org (Postfix) with ESMTPS id 61CC374949; Sat, 26 Aug 2017 18:30: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 v7QIU3WO099735; Sat, 26 Aug 2017 18:30:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QIU3G7099734; Sat, 26 Aug 2017 18:30:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261830.v7QIU3G7099734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322936 - head/sys/boot/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/i386/libi386 X-SVN-Commit-Revision: 322936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:30:04 -0000 Author: imp Date: Sat Aug 26 18:30:03 2017 New Revision: 322936 URL: https://svnweb.freebsd.org/changeset/base/322936 Log: Remove useless 'static' for an enum definition. Sponsored by: Netflix Modified: head/sys/boot/i386/libi386/biosdisk.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Sat Aug 26 18:29:58 2017 (r322935) +++ head/sys/boot/i386/libi386/biosdisk.c Sat Aug 26 18:30:03 2017 (r322936) @@ -139,7 +139,7 @@ static int bd_ioctl(struct open_file *f, u_long cmd, v static int bd_print(int verbose); #ifdef LOADER_GELI_SUPPORT -static enum isgeli { +enum isgeli { ISGELI_UNKNOWN, ISGELI_NO, ISGELI_YES From owner-svn-src-head@freebsd.org Sat Aug 26 18:29:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E635ADD7E0D; Sat, 26 Aug 2017 18:29:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id A63897475E; Sat, 26 Aug 2017 18:29:49 +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 v7QITmON099553; Sat, 26 Aug 2017 18:29:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QITmBf099552; Sat, 26 Aug 2017 18:29:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261829.v7QITmBf099552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322933 - head/sys/boot/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/efi/boot1 X-SVN-Commit-Revision: 322933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:29:50 -0000 Author: imp Date: Sat Aug 26 18:29:48 2017 New Revision: 322933 URL: https://svnweb.freebsd.org/changeset/base/322933 Log: No need for MK_ZFS around these: they are by their nature only active when MK_ZFS is true. Sponsored by: Netflix Modified: head/sys/boot/efi/boot1/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Sat Aug 26 18:29:43 2017 (r322932) +++ head/sys/boot/efi/boot1/Makefile Sat Aug 26 18:29:48 2017 (r322933) @@ -10,7 +10,6 @@ PROG= boot1.sym INTERNALPROG= WARNS?= 6 -.if ${MK_ZFS} != "no" # Disable warnings that are currently incompatible with the zfs boot code CWARNFLAGS.zfs_module.c += -Wno-array-bounds CWARNFLAGS.zfs_module.c += -Wno-cast-align @@ -24,7 +23,6 @@ CWARNFLAGS.skein.c += -Wno-cast-align CWARNFLAGS.skein.c += -Wno-missing-variable-declarations .else if ${COMPILER_TYPE} == "gcc" CWARNFLAGS.skein.c += -Wno-missing-declarations -.endif .endif # architecture-specific loader code From owner-svn-src-head@freebsd.org Sat Aug 26 18:29:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A97A1DD7EDA; Sat, 26 Aug 2017 18:29:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6E36D748A6; Sat, 26 Aug 2017 18:29:59 +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 v7QITwk7099659; Sat, 26 Aug 2017 18:29:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QITwJF099658; Sat, 26 Aug 2017 18:29:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261829.v7QITwJF099658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322935 - head/sys/boot/geli X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/geli X-SVN-Commit-Revision: 322935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:29:59 -0000 Author: imp Date: Sat Aug 26 18:29:58 2017 New Revision: 322935 URL: https://svnweb.freebsd.org/changeset/base/322935 Log: Fix warnings due to type mismatch. Cast ctxp to caddr_t to pass data as expected. While void * is a universal type, char * isn't (and that's what caddr_t is defined as). One could argue these prototypes should take void * rather than caddr_t, but changing that is much more invasive. Sponsored by: Netflix Modified: head/sys/boot/geli/geliboot_crypto.c Modified: head/sys/boot/geli/geliboot_crypto.c ============================================================================== --- head/sys/boot/geli/geliboot_crypto.c Sat Aug 26 18:29:53 2017 (r322934) +++ head/sys/boot/geli/geliboot_crypto.c Sat Aug 26 18:29:58 2017 (r322935) @@ -82,17 +82,17 @@ geliboot_crypt(u_int algo, int enc, u_char *data, size rijndael_set_key(&ctxp->key1, key, xts_len / 2); rijndael_set_key(&ctxp->key2, key + (xts_len / 16), xts_len / 2); - enc_xform_aes_xts.reinit(ctxp, iv); + enc_xform_aes_xts.reinit((caddr_t)ctxp, iv); switch (enc) { case 0: /* decrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.decrypt(ctxp, data + i); + enc_xform_aes_xts.decrypt((caddr_t)ctxp, data + i); } break; case 1: /* encrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.encrypt(ctxp, data + i); + enc_xform_aes_xts.encrypt((caddr_t)ctxp, data + i); } break; } From owner-svn-src-head@freebsd.org Sat Aug 26 18:30:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D319DD7FFC; Sat, 26 Aug 2017 18:30: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 mx1.freebsd.org (Postfix) with ESMTPS id 1A04374A04; Sat, 26 Aug 2017 18:30:10 +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 v7QIU9Uv099789; Sat, 26 Aug 2017 18:30:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QIU9Fj099788; Sat, 26 Aug 2017 18:30:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261830.v7QIU9Fj099788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322937 - head/sys/boot/geli X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/geli X-SVN-Commit-Revision: 322937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:30:10 -0000 Author: imp Date: Sat Aug 26 18:30:08 2017 New Revision: 322937 URL: https://svnweb.freebsd.org/changeset/base/322937 Log: Forward declare struct dsk to avoid warnings when building libi386. Sponsored by: Netflix Modified: head/sys/boot/geli/geliboot.h Modified: head/sys/boot/geli/geliboot.h ============================================================================== --- head/sys/boot/geli/geliboot.h Sat Aug 26 18:30:03 2017 (r322936) +++ head/sys/boot/geli/geliboot.h Sat Aug 26 18:30:08 2017 (r322937) @@ -48,6 +48,8 @@ extern void pwgets(char *buf, int n, int hide); +struct dsk; + void geli_init(void); int geli_taste(int read_func(void *vdev, void *priv, off_t off, void *buf, size_t bytes), struct dsk *dsk, daddr_t lastsector); From owner-svn-src-head@freebsd.org Sat Aug 26 18:30:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F042ADD80A1; Sat, 26 Aug 2017 18:30:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id BD88F74AC5; Sat, 26 Aug 2017 18:30:15 +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 v7QIUEt3099846; Sat, 26 Aug 2017 18:30:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QIUEVX099842; Sat, 26 Aug 2017 18:30:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708261830.v7QIUEVX099842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 18:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322938 - in head/sys/boot/efi: boot1 libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: boot1 libefi loader X-SVN-Commit-Revision: 322938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 18:30:16 -0000 Author: imp Date: Sat Aug 26 18:30:14 2017 New Revision: 322938 URL: https://svnweb.freebsd.org/changeset/base/322938 Log: Link in libefi for boot1 Add libefi to the list of libraries we'll link in. Move EFI table definitions back to libefi so we don't have drift between the two efi_main routines. Sponsored by: Netflix Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/libefi/libefi.c head/sys/boot/efi/loader/efi_main.c Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Sat Aug 26 18:30:08 2017 (r322937) +++ head/sys/boot/efi/boot1/Makefile Sat Aug 26 18:30:14 2017 (r322938) @@ -76,13 +76,15 @@ CFLAGS+= -fPIC LDFLAGS+= -Wl,-znocombreloc .endif +LIBEFI= ${.OBJDIR}/../libefi/libefi.a + # # Add libstand for the runtime functions used by the compiler - for example # __aeabi_* (arm) or __divdi3 (i386). # as well as required string and memory functions for all platforms. # -DPADD+= ${LIBSTAND} -LDADD+= -lstand +DPADD+= ${LIBEFI} ${LIBSTAND} +LDADD+= ${LIBEFI} -lstand DPADD+= ${LDSCRIPT} Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Sat Aug 26 18:30:08 2017 (r322937) +++ head/sys/boot/efi/boot1/boot1.c Sat Aug 26 18:30:14 2017 (r322938) @@ -47,11 +47,6 @@ static const boot_module_t *boot_modules[] = /* The initial number of handles used to query EFI for partitions. */ #define NUM_HANDLES_INIT 24 -EFI_HANDLE IH; -EFI_SYSTEM_TABLE *ST; -EFI_BOOT_SERVICES *BS; -EFI_RUNTIME_SERVICES *RS; - static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; Modified: head/sys/boot/efi/libefi/libefi.c ============================================================================== --- head/sys/boot/efi/libefi/libefi.c Sat Aug 26 18:30:08 2017 (r322937) +++ head/sys/boot/efi/libefi/libefi.c Sat Aug 26 18:30:14 2017 (r322938) @@ -32,7 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include -extern EFI_SYSTEM_TABLE *ST; +EFI_HANDLE IH; +EFI_SYSTEM_TABLE *ST; +EFI_BOOT_SERVICES *BS; +EFI_RUNTIME_SERVICES *RS; void * efi_get_table(EFI_GUID *tbl) Modified: head/sys/boot/efi/loader/efi_main.c ============================================================================== --- head/sys/boot/efi/loader/efi_main.c Sat Aug 26 18:30:08 2017 (r322937) +++ head/sys/boot/efi/loader/efi_main.c Sat Aug 26 18:30:14 2017 (r322938) @@ -32,11 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include -EFI_HANDLE IH; -EFI_SYSTEM_TABLE *ST; -EFI_BOOT_SERVICES *BS; -EFI_RUNTIME_SERVICES *RS; - static EFI_PHYSICAL_ADDRESS heap; static UINTN heapsize; From owner-svn-src-head@freebsd.org Sat Aug 26 23:04:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C80ABDDCECA; Sat, 26 Aug 2017 23:04:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9773B7FEE4; Sat, 26 Aug 2017 23:04:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QN4J7o013281; Sat, 26 Aug 2017 23:04:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QN4JPM013277; Sat, 26 Aug 2017 23:04:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708262304.v7QN4JPM013277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 26 Aug 2017 23:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322939 - head/sys/boot/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/efi/boot1 X-SVN-Commit-Revision: 322939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 23:04:20 -0000 Author: imp Date: Sat Aug 26 23:04:19 2017 New Revision: 322939 URL: https://svnweb.freebsd.org/changeset/base/322939 Log: Use efi_devpath_str for debug path info. Kill our own hand-rolled (and somewhat flawed) devpath_str in favor of the recently added efi_devpath_str in libefi. This gives us much better names at the expense of not being able to debug on EFI 1.2 machines (since the UEFI protocol efi_devpath_str depends on was added in UEFI 2.0). However, this isn't the first thing that requires newer than EFI 1.2, so it's quite possible that this doesn't change the universe of machines we can EFI boot from. This will now give us the full UEFI path, even for devices we don't yet know about. More importantly, it gives us the full HD(...) part of the path, which is sufficient by itself to locate disks that follow the rules (dd one disk (but not partition) to another still needs the rest of the path to disambiguate, but that isn't following the rules that require every GPT table to have globally unique GUIDs for every partion). This also has the side effect of shrinking boot1.efi by ~3k. Sponsored by: Netflix Modified: head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/boot1/boot_module.h head/sys/boot/efi/boot1/ufs_module.c head/sys/boot/efi/boot1/zfs_module.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Sat Aug 26 18:30:14 2017 (r322938) +++ head/sys/boot/efi/boot1/boot1.c Sat Aug 26 23:04:19 2017 (r322939) @@ -136,178 +136,6 @@ devpath_last(EFI_DEVICE_PATH *devpath) } /* - * devpath_node_str is a basic output method for a devpath node which - * only understands a subset of the available sub types. - * - * If we switch to UEFI 2.x then we should update it to use: - * EFI_DEVICE_PATH_TO_TEXT_PROTOCOL. - */ -static int -devpath_node_str(char *buf, size_t size, EFI_DEVICE_PATH *devpath) -{ - - switch (devpath->Type) { - case MESSAGING_DEVICE_PATH: - switch (devpath->SubType) { - case MSG_ATAPI_DP: { - ATAPI_DEVICE_PATH *atapi; - - atapi = (ATAPI_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "ata(%s,%s,0x%x)", - (atapi->PrimarySecondary == 1) ? "Sec" : "Pri", - (atapi->SlaveMaster == 1) ? "Slave" : "Master", - atapi->Lun); - } - case MSG_USB_DP: { - USB_DEVICE_PATH *usb; - - usb = (USB_DEVICE_PATH *)devpath; - return snprintf(buf, size, "usb(0x%02x,0x%02x)", - usb->ParentPortNumber, usb->InterfaceNumber); - } - case MSG_SCSI_DP: { - SCSI_DEVICE_PATH *scsi; - - scsi = (SCSI_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "scsi(0x%02x,0x%02x)", - scsi->Pun, scsi->Lun); - } - case MSG_SATA_DP: { - SATA_DEVICE_PATH *sata; - - sata = (SATA_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "sata(0x%x,0x%x,0x%x)", - sata->HBAPortNumber, sata->PortMultiplierPortNumber, - sata->Lun); - } - default: - return snprintf(buf, size, "msg(0x%02x)", - devpath->SubType); - } - break; - case HARDWARE_DEVICE_PATH: - switch (devpath->SubType) { - case HW_PCI_DP: { - PCI_DEVICE_PATH *pci; - - pci = (PCI_DEVICE_PATH *)devpath; - return snprintf(buf, size, "pci(0x%02x,0x%02x)", - pci->Device, pci->Function); - } - default: - return snprintf(buf, size, "hw(0x%02x)", - devpath->SubType); - } - break; - case ACPI_DEVICE_PATH: { - ACPI_HID_DEVICE_PATH *acpi; - - acpi = (ACPI_HID_DEVICE_PATH *)(void *)devpath; - if ((acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { - switch (EISA_ID_TO_NUM(acpi->HID)) { - case 0x0a03: - return snprintf(buf, size, "pciroot(0x%x)", - acpi->UID); - case 0x0a08: - return snprintf(buf, size, "pcieroot(0x%x)", - acpi->UID); - case 0x0604: - return snprintf(buf, size, "floppy(0x%x)", - acpi->UID); - case 0x0301: - return snprintf(buf, size, "keyboard(0x%x)", - acpi->UID); - case 0x0501: - return snprintf(buf, size, "serial(0x%x)", - acpi->UID); - case 0x0401: - return snprintf(buf, size, "parallelport(0x%x)", - acpi->UID); - default: - return snprintf(buf, size, "acpi(pnp%04x,0x%x)", - EISA_ID_TO_NUM(acpi->HID), acpi->UID); - } - } - - return snprintf(buf, size, "acpi(0x%08x,0x%x)", acpi->HID, - acpi->UID); - } - case MEDIA_DEVICE_PATH: - switch (devpath->SubType) { - case MEDIA_CDROM_DP: { - CDROM_DEVICE_PATH *cdrom; - - cdrom = (CDROM_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "cdrom(%x)", - cdrom->BootEntry); - } - case MEDIA_HARDDRIVE_DP: { - HARDDRIVE_DEVICE_PATH *hd; - - hd = (HARDDRIVE_DEVICE_PATH *)(void *)devpath; - return snprintf(buf, size, "hd(%x)", - hd->PartitionNumber); - } - default: - return snprintf(buf, size, "media(0x%02x)", - devpath->SubType); - } - case BBS_DEVICE_PATH: - return snprintf(buf, size, "bbs(0x%02x)", devpath->SubType); - case END_DEVICE_PATH_TYPE: - return (0); - } - - return snprintf(buf, size, "type(0x%02x, 0x%02x)", devpath->Type, - devpath->SubType); -} - -/* - * devpath_strlcat appends a text description of devpath to buf but not more - * than size - 1 characters followed by NUL-terminator. - */ -int -devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devpath) -{ - size_t len, used; - const char *sep; - - sep = ""; - used = 0; - while (!IsDevicePathEnd(devpath)) { - len = snprintf(buf, size - used, "%s", sep); - used += len; - if (used > size) - return (used); - buf += len; - - len = devpath_node_str(buf, size - used, devpath); - used += len; - if (used > size) - return (used); - buf += len; - devpath = NextDevicePathNode(devpath); - sep = ":"; - } - - return (used); -} - -/* - * devpath_str is convenience method which returns the text description of - * devpath using a static buffer, so it isn't thread safe! - */ -char * -devpath_str(EFI_DEVICE_PATH *devpath) -{ - static char buf[256]; - - devpath_strlcat(buf, sizeof(buf), devpath); - - return buf; -} - -/* * load_loader attempts to load the loader image data. * * It tries each module and its respective devices, identified by mod->probe, @@ -470,9 +298,13 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B EFI_ERROR_CODE(status)); return (status); } - - DPRINTF("probing: %s\n", devpath_str(devpath)); - +#ifdef EFI_DEBUG + { + CHAR16 *text = efi_devpath_name(devpath); + DPRINTF("probing: %S\n", text); + efi_free_devpath_name(text); + } +#endif status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); if (status == EFI_UNSUPPORTED) return (status); @@ -646,7 +478,13 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) if (status != EFI_SUCCESS) DPRINTF("Failed to get image DevicePath (%lu)\n", EFI_ERROR_CODE(status)); - DPRINTF("boot1 imagepath: %s\n", devpath_str(imgpath)); +#ifdef EFI_DEBUG + { + CHAR16 *text = efi_devpath_name(imgpath); + DPRINTF("boot1 imagepath: %S\n", text); + efi_free_devpath_name(text); + } +#endif } for (i = 0; i < nhandles; i++) Modified: head/sys/boot/efi/boot1/boot_module.h ============================================================================== --- head/sys/boot/efi/boot1/boot_module.h Sat Aug 26 18:30:14 2017 (r322938) +++ head/sys/boot/efi/boot1/boot_module.h Sat Aug 26 23:04:19 2017 (r322939) @@ -106,7 +106,4 @@ extern const boot_module_t zfs_module; /* Functions available to modules. */ extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); - -extern int devpath_strlcat(char *buf, size_t size, EFI_DEVICE_PATH *devpath); -extern char *devpath_str(EFI_DEVICE_PATH *devpath); #endif Modified: head/sys/boot/efi/boot1/ufs_module.c ============================================================================== --- head/sys/boot/efi/boot1/ufs_module.c Sat Aug 26 18:30:14 2017 (r322938) +++ head/sys/boot/efi/boot1/ufs_module.c Sat Aug 26 23:04:19 2017 (r322939) @@ -101,8 +101,13 @@ load(const char *filepath, dev_info_t *dev, void **buf ssize_t read; void *buf; - DPRINTF("Loading '%s' from %s\n", filepath, devpath_str(dev->devpath)); - +#ifdef EFI_DEBUG + { + CHAR16 *text = efi_devpath_name(dev->devpath); + DPRINTF("Loading '%s' from %S\n", filepath, text); + efi_free_devpath_name(text); + } +#endif if (init_dev(dev) < 0) { DPRINTF("Failed to init device\n"); return (EFI_UNSUPPORTED); Modified: head/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- head/sys/boot/efi/boot1/zfs_module.c Sat Aug 26 18:30:14 2017 (r322938) +++ head/sys/boot/efi/boot1/zfs_module.c Sat Aug 26 23:04:19 2017 (r322939) @@ -150,9 +150,14 @@ load(const char *filepath, dev_info_t *devinfo, void * spa = devinfo->devdata; - DPRINTF("load: '%s' spa: '%s', devpath: %s\n", filepath, spa->spa_name, - devpath_str(devinfo->devpath)); - +#ifdef EFI_DEBUG + { + CHAR16 *text = efi_devpath_name(devinfo->devpath); + DPRINTF("load: '%s' spa: '%s', devpath: %S\n", filepath, + spa->spa_name, text); + efi_free_devpath_name(text); + } +#endif if ((err = zfs_spa_init(spa)) != 0) { DPRINTF("Failed to load pool '%s' (%d)\n", spa->spa_name, err); return (EFI_NOT_FOUND); From owner-svn-src-head@freebsd.org Sat Aug 26 23:13:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA4BCDDD2E7; Sat, 26 Aug 2017 23:13:19 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 B93AB8058E; Sat, 26 Aug 2017 23:13:19 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7QNDIue017288; Sat, 26 Aug 2017 23:13:18 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7QNDIKO017286; Sat, 26 Aug 2017 23:13:18 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201708262313.v7QNDIKO017286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 26 Aug 2017 23:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322940 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 322940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 26 Aug 2017 23:13:20 -0000 Author: rlibby Date: Sat Aug 26 23:13:18 2017 New Revision: 322940 URL: https://svnweb.freebsd.org/changeset/base/322940 Log: amd64: drop q suffix from rd[fg]sbase for gas compatibility Reviewed by: kib Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12133 Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Sat Aug 26 23:04:19 2017 (r322939) +++ head/sys/amd64/amd64/cpu_switch.S Sat Aug 26 23:13:18 2017 (r322940) @@ -108,7 +108,7 @@ ENTRY(cpu_switch) movl %fs,%eax cmpl $KUF32SEL,%eax jne 1f - rdfsbaseq %rax + rdfsbase %rax movq %rax,PCB_FSBASE(%r8) 1: movl %gs,%eax cmpl $KUG32SEL,%eax Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Sat Aug 26 23:04:19 2017 (r322939) +++ head/sys/amd64/amd64/exception.S Sat Aug 26 23:13:18 2017 (r322940) @@ -340,10 +340,10 @@ prot_addrf: jz 2f cmpw $KUF32SEL,TF_FS(%rsp) jne 1f - rdfsbaseq %rax + rdfsbase %rax 1: cmpw $KUG32SEL,TF_GS(%rsp) jne 2f - rdgsbaseq %rdx + rdgsbase %rdx 2: swapgs movq PCPU(CURPCB),%rdi testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) @@ -533,7 +533,7 @@ nmi_fromuserspace: jz 2f cmpw $KUF32SEL,TF_FS(%rsp) jne 1f - rdfsbaseq %rax + rdfsbase %rax movq %rax,PCB_FSBASE(%rdi) 1: cmpw $KUG32SEL,TF_GS(%rsp) jne 2f