From owner-svn-src-stable-11@freebsd.org Sun Oct 23 06:24:25 2016 Return-Path: Delivered-To: svn-src-stable-11@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 555BBC1E592; Sun, 23 Oct 2016 06:24:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com [209.85.214.49]) (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 AA1218B8; Sun, 23 Oct 2016 06:24:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f49.google.com with SMTP id e187so85945597itc.1; Sat, 22 Oct 2016 23:24:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=K6Oa8wW/3zfbsbOJ8IsV5Zjr3FCnlaJCH95G01tq2fs=; b=h4HJnN8ZMOp6PdOfuEpZ2RKK/YZjAusfAPgLc8VlT5qNdEx22VGf3DMMgLAc9MuOIl x4m9X09lbaw+FPGi8M/tioz/owlg9ipFTS3W9NjZO3zqIvYkE3FqVpFvrY60H6zi5ONz 1WQhn/6HUsY44x5yidESu2L+6u3QkQPp5ZDz9DirlsAKaJDTpKh5w9y39i1iLSzsNF8+ uHpZJdgdUGCV5282DVAzlQJGq59Yy0ECYRTdV9hBup+yj+7mybo9xc3PFq/5kMM5dOPG yEdpawGbaw/qz6a35LLj43UQUCEEfIQRlJI82ucA6wJBMlmpJU8AyxZ0I5Au1R6Y5wOz DFYA== X-Gm-Message-State: ABUngvdEYLxs8jqE7c2DzT9Z2QYxWH4s5fVCkBV54FIL7ijQ3ZlsGmA3kMgFXCBl8AtHSQ== X-Received: by 10.36.135.203 with SMTP id f194mr6069623ite.2.1477203857815; Sat, 22 Oct 2016 23:24:17 -0700 (PDT) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com. [209.85.214.46]) by smtp.gmail.com with ESMTPSA id u19sm5044087iou.31.2016.10.22.23.24.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Oct 2016 23:24:17 -0700 (PDT) Received: by mail-it0-f46.google.com with SMTP id e187so85945235itc.1; Sat, 22 Oct 2016 23:24:17 -0700 (PDT) X-Received: by 10.107.130.218 with SMTP id m87mr8480956ioi.17.1477203857291; Sat, 22 Oct 2016 23:24:17 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.199 with HTTP; Sat, 22 Oct 2016 23:24:16 -0700 (PDT) In-Reply-To: <20161022213017.d6h2wji75r2huqqv@ivaldir.etoilebsd.net> References: <201610222049.u9MKnirM010685@repo.freebsd.org> <20161022213017.d6h2wji75r2huqqv@ivaldir.etoilebsd.net> From: Conrad Meyer Date: Sat, 22 Oct 2016 23:24:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r307791 - stable/11/usr.sbin/bhyve To: Baptiste Daroussin Cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Oct 2016 06:24:25 -0000 On Sat, Oct 22, 2016 at 2:30 PM, Baptiste Daroussin wrote: > On Sat, Oct 22, 2016 at 11:27:43PM +0200, Ed Schouten wrote: >> 2016-10-22 22:49 GMT+02:00 Baptiste Daroussin : >> > Use accept4 with O_NONBLOCK rather than accept + fcntl >> >> Keep in mind that changes like these do reduce the portability of the >> code. accept4(), SOCK_NONBLOCK, etc. are not part of POSIX. >> > > I entirely forgot that! > > Thanks for the heads up, I'll be carefull On the other hand, Linux and even illumos has them. Best, Conrad From owner-svn-src-stable-11@freebsd.org Mon Oct 24 00:39:05 2016 Return-Path: Delivered-To: svn-src-stable-11@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 E2798C1E846; Mon, 24 Oct 2016 00:39:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2F53644; Mon, 24 Oct 2016 00:39:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9O0d4p2043216; Mon, 24 Oct 2016 00:39:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9O0d48k043215; Mon, 24 Oct 2016 00:39:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610240039.u9O0d48k043215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 24 Oct 2016 00:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307833 - stable/11/usr.bin/elfdump X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 00:39:06 -0000 Author: emaste Date: Mon Oct 24 00:39:04 2016 New Revision: 307833 URL: https://svnweb.freebsd.org/changeset/base/307833 Log: MFC r307520: elfdump: correct DT_AUXILIARY / DT_USED / DT_FILTER definitions r109332 introduced these three as DT_SUNW_*. Update to the correct names already used elsewhere in FreeBSD and the Sun "Linker and Libraries Guide" Modified: stable/11/usr.bin/elfdump/elfdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/elfdump/elfdump.c ============================================================================== --- stable/11/usr.bin/elfdump/elfdump.c Sun Oct 23 20:42:32 2016 (r307832) +++ stable/11/usr.bin/elfdump/elfdump.c Mon Oct 24 00:39:04 2016 (r307833) @@ -240,9 +240,9 @@ d_tags(u_int64_t tag) case 0x6ffffff0: return "DT_GNU_VERSYM"; /* 0x70000000 - 0x7fffffff processor-specific semantics */ case 0x70000000: return "DT_IA_64_PLT_RESERVE"; - case 0x7ffffffd: return "DT_SUNW_AUXILIARY"; - case 0x7ffffffe: return "DT_SUNW_USED"; - case 0x7fffffff: return "DT_SUNW_FILTER"; + case DT_AUXILIARY: return "DT_AUXILIARY"; + case DT_USED: return "DT_USED"; + case DT_FILTER: return "DT_FILTER"; } snprintf(unknown_tag, sizeof(unknown_tag), "ERROR: TAG NOT DEFINED -- tag 0x%jx", (uintmax_t)tag); From owner-svn-src-stable-11@freebsd.org Mon Oct 24 01:14:27 2016 Return-Path: Delivered-To: svn-src-stable-11@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 ECD07C1F240; Mon, 24 Oct 2016 01:14:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE5758AA; Mon, 24 Oct 2016 01:14:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9O1EQK4058040; Mon, 24 Oct 2016 01:14:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9O1EQYK058039; Mon, 24 Oct 2016 01:14:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610240114.u9O1EQYK058039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 24 Oct 2016 01:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307835 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 01:14:28 -0000 Author: emaste Date: Mon Oct 24 01:14:26 2016 New Revision: 307835 URL: https://svnweb.freebsd.org/changeset/base/307835 Log: MFC r307522: makesyscalls.sh: remove trailing space on the "created from" line In r10905 and r10906 makesyscalls was modified to avoid emitting a literal $Id$ string in the generated file, with: gsub("[$]Id: ", "", $0) gsub(" [$]", "", $0) Then r11294 added some functionality and also tried to address the $Id$ problem in a different way, by removing every $: sed -e 's/\$//g ... This rendered the gsub infeffective. The gsub was later updated to track the $Id$ -> $FreeBSD$ switch, even though it did not do anything. Revert the addition of the s/\$//g, and update the gsub to keep the resulting format the same. Modified: stable/11/sys/kern/makesyscalls.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/makesyscalls.sh ============================================================================== --- stable/11/sys/kern/makesyscalls.sh Mon Oct 24 00:46:38 2016 (r307834) +++ stable/11/sys/kern/makesyscalls.sh Mon Oct 24 01:14:26 2016 (r307835) @@ -65,7 +65,6 @@ if [ -n "$2" ]; then fi sed -e ' -s/\$//g :join /\\$/{a\ @@ -147,7 +146,7 @@ s/\$//g printf " * $%s$\n", "FreeBSD" > systrace } NR == 1 { - gsub("[$]FreeBSD: ", "", $0) + gsub("[$]FreeBSD: ", "FreeBSD: ", $0) gsub(" [$]", "", $0) printf " * created from%s\n */\n\n", $0 > syssw From owner-svn-src-stable-11@freebsd.org Mon Oct 24 01:29:48 2016 Return-Path: Delivered-To: svn-src-stable-11@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 0ED2BC1F537; Mon, 24 Oct 2016 01:29:48 +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 B4C4CF00; Mon, 24 Oct 2016 01:29:47 +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 u9O1TkYJ062042; Mon, 24 Oct 2016 01:29:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9O1Tkco062037; Mon, 24 Oct 2016 01:29:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610240129.u9O1Tkco062037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 24 Oct 2016 01:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307837 - in stable/11/sys/cddl/dev/fbt: . arm powerpc x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 01:29:48 -0000 Author: markj Date: Mon Oct 24 01:29:46 2016 New Revision: 307837 URL: https://svnweb.freebsd.org/changeset/base/307837 Log: MFC r306570: Allow tracing of functions prefixed by "__". Modified: stable/11/sys/cddl/dev/fbt/arm/fbt_isa.c stable/11/sys/cddl/dev/fbt/fbt.c stable/11/sys/cddl/dev/fbt/powerpc/fbt_isa.c stable/11/sys/cddl/dev/fbt/x86/fbt_isa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- stable/11/sys/cddl/dev/fbt/arm/fbt_isa.c Mon Oct 24 01:22:01 2016 (r307836) +++ stable/11/sys/cddl/dev/fbt/arm/fbt_isa.c Mon Oct 24 01:29:46 2016 (r307837) @@ -106,9 +106,6 @@ fbt_provide_module_function(linker_file_ return (0); } - if (name[0] == '_' && name[1] == '_') - return (0); - instr = (uint32_t *)symval->value; limit = (uint32_t *)(symval->value + symval->size); Modified: stable/11/sys/cddl/dev/fbt/fbt.c ============================================================================== --- stable/11/sys/cddl/dev/fbt/fbt.c Mon Oct 24 01:22:01 2016 (r307836) +++ stable/11/sys/cddl/dev/fbt/fbt.c Mon Oct 24 01:29:46 2016 (r307837) @@ -126,10 +126,6 @@ fbt_excluded(const char *name) return (1); } - /* Exclude some internal functions */ - if (name[0] == '_' && name[1] == '_') - return (1); - /* * When DTrace is built into the kernel we need to exclude * the FBT functions from instrumentation. Modified: stable/11/sys/cddl/dev/fbt/powerpc/fbt_isa.c ============================================================================== --- stable/11/sys/cddl/dev/fbt/powerpc/fbt_isa.c Mon Oct 24 01:22:01 2016 (r307836) +++ stable/11/sys/cddl/dev/fbt/powerpc/fbt_isa.c Mon Oct 24 01:29:46 2016 (r307837) @@ -138,9 +138,6 @@ fbt_provide_module_function(linker_file_ return (0); } - if (name[0] == '_' && name[1] == '_') - return (0); - instr = (uint32_t *) symval->value; limit = (uint32_t *) (symval->value + symval->size); Modified: stable/11/sys/cddl/dev/fbt/x86/fbt_isa.c ============================================================================== --- stable/11/sys/cddl/dev/fbt/x86/fbt_isa.c Mon Oct 24 01:22:01 2016 (r307836) +++ stable/11/sys/cddl/dev/fbt/x86/fbt_isa.c Mon Oct 24 01:29:46 2016 (r307837) @@ -174,9 +174,6 @@ fbt_provide_module_function(linker_file_ return (0); } - if (name[0] == '_' && name[1] == '_') - return (0); - size = symval->size; instr = (uint8_t *) symval->value; From owner-svn-src-stable-11@freebsd.org Mon Oct 24 11:28:56 2016 Return-Path: Delivered-To: svn-src-stable-11@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 20CF9C1FC6F; Mon, 24 Oct 2016 11:28:56 +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 DA0ADA0; Mon, 24 Oct 2016 11:28:55 +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 u9OBSt6h089946; Mon, 24 Oct 2016 11:28:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9OBSsU9089944; Mon, 24 Oct 2016 11:28:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610241128.u9OBSsU9089944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 24 Oct 2016 11:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307854 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 11:28:56 -0000 Author: kib Date: Mon Oct 24 11:28:54 2016 New Revision: 307854 URL: https://svnweb.freebsd.org/changeset/base/307854 Log: MFC r307499: Export vm_page_xunbusy_maybelocked(). Modified: stable/11/sys/vm/vm_page.c stable/11/sys/vm/vm_page.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Mon Oct 24 11:22:38 2016 (r307853) +++ stable/11/sys/vm/vm_page.c Mon Oct 24 11:28:54 2016 (r307854) @@ -796,7 +796,7 @@ vm_page_xunbusy_locked(vm_page_t m) wakeup(m); } -static void +void vm_page_xunbusy_maybelocked(vm_page_t m) { bool lockacq; Modified: stable/11/sys/vm/vm_page.h ============================================================================== --- stable/11/sys/vm/vm_page.h Mon Oct 24 11:22:38 2016 (r307853) +++ stable/11/sys/vm/vm_page.h Mon Oct 24 11:28:54 2016 (r307854) @@ -496,6 +496,7 @@ boolean_t vm_page_unwire(vm_page_t m, ui void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_wire (vm_page_t); void vm_page_xunbusy_hard(vm_page_t m); +void vm_page_xunbusy_maybelocked(vm_page_t m); void vm_page_set_validclean (vm_page_t, int, int); void vm_page_clear_dirty (vm_page_t, int, int); void vm_page_set_invalid (vm_page_t, int, int); From owner-svn-src-stable-11@freebsd.org Mon Oct 24 11:33:43 2016 Return-Path: Delivered-To: svn-src-stable-11@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 C3390C1FDF1; Mon, 24 Oct 2016 11:33:43 +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 94DBE6B6; Mon, 24 Oct 2016 11:33:43 +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 u9OBXgEx093476; Mon, 24 Oct 2016 11:33:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9OBXg7h093475; Mon, 24 Oct 2016 11:33:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610241133.u9OBXg7h093475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 24 Oct 2016 11:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307855 - stable/11/sys/vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 11:33:43 -0000 Author: kib Date: Mon Oct 24 11:33:42 2016 New Revision: 307855 URL: https://svnweb.freebsd.org/changeset/base/307855 Log: MFC r307501: If vm_fault_hold(9) finds that fs.m is wired, do not free it after a pager error, leave the page to the wire owner. Modified: stable/11/sys/vm/vm_fault.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_fault.c ============================================================================== --- stable/11/sys/vm/vm_fault.c Mon Oct 24 11:28:54 2016 (r307854) +++ stable/11/sys/vm/vm_fault.c Mon Oct 24 11:33:42 2016 (r307855) @@ -722,7 +722,10 @@ vnode_locked: */ if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) { vm_page_lock(fs.m); - vm_page_free(fs.m); + if (fs.m->wire_count == 0) + vm_page_free(fs.m); + else + vm_page_xunbusy_maybelocked(fs.m); vm_page_unlock(fs.m); fs.m = NULL; unlock_and_deallocate(&fs); @@ -742,7 +745,10 @@ vnode_locked: */ if (fs.object != fs.first_object) { vm_page_lock(fs.m); - vm_page_free(fs.m); + if (fs.m->wire_count == 0) + vm_page_free(fs.m); + else + vm_page_xunbusy_maybelocked(fs.m); vm_page_unlock(fs.m); fs.m = NULL; } From owner-svn-src-stable-11@freebsd.org Mon Oct 24 11:47:29 2016 Return-Path: Delivered-To: svn-src-stable-11@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 14503C1F132; Mon, 24 Oct 2016 11:47:29 +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 CB295C99; Mon, 24 Oct 2016 11:47: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 u9OBlRXu097504; Mon, 24 Oct 2016 11:47:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9OBlRce097499; Mon, 24 Oct 2016 11:47:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610241147.u9OBlRce097499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 24 Oct 2016 11:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307856 - in stable/11/sys: amd64/amd64 amd64/include i386/include x86/include x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 11:47:29 -0000 Author: kib Date: Mon Oct 24 11:47:27 2016 New Revision: 307856 URL: https://svnweb.freebsd.org/changeset/base/307856 Log: MFC r306680: Reduce the cost of TLB invalidation on x86 by using per-CPU completion flags. Modified: stable/11/sys/amd64/amd64/mp_machdep.c stable/11/sys/amd64/include/pcpu.h stable/11/sys/i386/include/pcpu.h stable/11/sys/x86/include/x86_smp.h stable/11/sys/x86/x86/mp_x86.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/mp_machdep.c Mon Oct 24 11:33:42 2016 (r307855) +++ stable/11/sys/amd64/amd64/mp_machdep.c Mon Oct 24 11:47:27 2016 (r307856) @@ -409,6 +409,7 @@ void invltlb_invpcid_handler(void) { struct invpcid_descr d; + uint32_t generation; #ifdef COUNT_XINVLTLB_HITS xhits_gbl[PCPU_GET(cpuid)]++; @@ -417,17 +418,20 @@ invltlb_invpcid_handler(void) (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ + generation = smp_tlb_generation; d.pcid = smp_tlb_pmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid; d.pad = 0; d.addr = 0; invpcid(&d, smp_tlb_pmap == kernel_pmap ? INVPCID_CTXGLOB : INVPCID_CTX); - atomic_add_int(&smp_tlb_wait, 1); + PCPU_SET(smp_tlb_done, generation); } void invltlb_pcid_handler(void) { + uint32_t generation; + #ifdef COUNT_XINVLTLB_HITS xhits_gbl[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -435,6 +439,7 @@ invltlb_pcid_handler(void) (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ + generation = smp_tlb_generation; /* Overlap with serialization */ if (smp_tlb_pmap == kernel_pmap) { invltlb_glob(); } else { @@ -450,5 +455,5 @@ invltlb_pcid_handler(void) smp_tlb_pmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid); } } - atomic_add_int(&smp_tlb_wait, 1); + PCPU_SET(smp_tlb_done, generation); } Modified: stable/11/sys/amd64/include/pcpu.h ============================================================================== --- stable/11/sys/amd64/include/pcpu.h Mon Oct 24 11:33:42 2016 (r307855) +++ stable/11/sys/amd64/include/pcpu.h Mon Oct 24 11:47:27 2016 (r307856) @@ -65,7 +65,8 @@ u_int pc_vcpu_id; /* Xen vCPU ID */ \ uint32_t pc_pcid_next; \ uint32_t pc_pcid_gen; \ - char __pad[149] /* be divisor of PAGE_SIZE \ + uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ + char __pad[145] /* be divisor of PAGE_SIZE \ after cache alignment */ #define PC_DBREG_CMD_NONE 0 Modified: stable/11/sys/i386/include/pcpu.h ============================================================================== --- stable/11/sys/i386/include/pcpu.h Mon Oct 24 11:33:42 2016 (r307855) +++ stable/11/sys/i386/include/pcpu.h Mon Oct 24 11:47:27 2016 (r307856) @@ -59,7 +59,8 @@ u_int pc_cmci_mask; /* MCx banks for CMCI */ \ u_int pc_vcpu_id; /* Xen vCPU ID */ \ vm_offset_t pc_qmap_addr; /* KVA for temporary mappings */\ - char __pad[229] + uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ + char __pad[225] #ifdef _KERNEL Modified: stable/11/sys/x86/include/x86_smp.h ============================================================================== --- stable/11/sys/x86/include/x86_smp.h Mon Oct 24 11:33:42 2016 (r307855) +++ stable/11/sys/x86/include/x86_smp.h Mon Oct 24 11:47:27 2016 (r307856) @@ -35,7 +35,7 @@ extern volatile int aps_ready; extern struct mtx ap_boot_mtx; extern int cpu_logical; extern int cpu_cores; -extern volatile int smp_tlb_wait; +extern volatile uint32_t smp_tlb_generation; extern struct pmap *smp_tlb_pmap; extern u_int xhits_gbl[]; extern u_int xhits_pg[]; Modified: stable/11/sys/x86/x86/mp_x86.c ============================================================================== --- stable/11/sys/x86/x86/mp_x86.c Mon Oct 24 11:33:42 2016 (r307855) +++ stable/11/sys/x86/x86/mp_x86.c Mon Oct 24 11:47:27 2016 (r307856) @@ -1308,12 +1308,22 @@ cpususpend_handler(void) void invlcache_handler(void) { + uint32_t generation; + #ifdef COUNT_IPIS (*ipi_invlcache_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ + /* + * Reading the generation here allows greater parallelism + * since wbinvd is a serializing instruction. Without the + * temporary, we'd wait for wbinvd to complete, then the read + * would execute, then the dependent write, whuch must then + * complete before return from interrupt. + */ + generation = smp_tlb_generation; wbinvd(); - atomic_add_int(&smp_tlb_wait, 1); + PCPU_SET(smp_tlb_done, generation); } /* @@ -1371,7 +1381,7 @@ SYSINIT(mp_ipi_intrcnt, SI_SUB_INTR, SI_ /* Variables needed for SMP tlb shootdown. */ static vm_offset_t smp_tlb_addr1, smp_tlb_addr2; pmap_t smp_tlb_pmap; -volatile int smp_tlb_wait; +volatile uint32_t smp_tlb_generation; #ifdef __amd64__ #define read_eflags() read_rflags() @@ -1381,15 +1391,16 @@ static void smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap, vm_offset_t addr1, vm_offset_t addr2) { - int cpu, ncpu, othercpus; - - othercpus = mp_ncpus - 1; /* does not shootdown self */ + cpuset_t other_cpus; + volatile uint32_t *p_cpudone; + uint32_t generation; + int cpu; /* * Check for other cpus. Return if none. */ if (CPU_ISFULLSET(&mask)) { - if (othercpus < 1) + if (mp_ncpus <= 1) return; } else { CPU_CLR(PCPU_GET(cpuid), &mask); @@ -1403,23 +1414,28 @@ smp_targeted_tlb_shootdown(cpuset_t mask smp_tlb_addr1 = addr1; smp_tlb_addr2 = addr2; smp_tlb_pmap = pmap; - smp_tlb_wait = 0; + generation = ++smp_tlb_generation; if (CPU_ISFULLSET(&mask)) { - ncpu = othercpus; ipi_all_but_self(vector); + other_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); } else { - ncpu = 0; + other_cpus = mask; while ((cpu = CPU_FFS(&mask)) != 0) { cpu--; CPU_CLR(cpu, &mask); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, vector); ipi_send_cpu(cpu, vector); - ncpu++; } } - while (smp_tlb_wait < ncpu) - ia32_pause(); + while ((cpu = CPU_FFS(&other_cpus)) != 0) { + cpu--; + CPU_CLR(cpu, &other_cpus); + p_cpudone = &cpuid_to_pcpu[cpu]->pc_smp_tlb_done; + while (*p_cpudone != generation) + ia32_pause(); + } mtx_unlock_spin(&smp_ipi_mtx); } @@ -1477,6 +1493,8 @@ smp_cache_flush(void) void invltlb_handler(void) { + uint32_t generation; + #ifdef COUNT_XINVLTLB_HITS xhits_gbl[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -1484,16 +1502,23 @@ invltlb_handler(void) (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ + /* + * Reading the generation here allows greater parallelism + * since invalidating the TLB is a serializing operation. + */ + generation = smp_tlb_generation; if (smp_tlb_pmap == kernel_pmap) invltlb_glob(); else invltlb(); - atomic_add_int(&smp_tlb_wait, 1); + PCPU_SET(smp_tlb_done, generation); } void invlpg_handler(void) { + uint32_t generation; + #ifdef COUNT_XINVLTLB_HITS xhits_pg[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -1501,14 +1526,16 @@ invlpg_handler(void) (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ + generation = smp_tlb_generation; /* Overlap with serialization */ invlpg(smp_tlb_addr1); - atomic_add_int(&smp_tlb_wait, 1); + PCPU_SET(smp_tlb_done, generation); } void invlrng_handler(void) { - vm_offset_t addr; + vm_offset_t addr, addr2; + uint32_t generation; #ifdef COUNT_XINVLTLB_HITS xhits_rng[PCPU_GET(cpuid)]++; @@ -1518,10 +1545,12 @@ invlrng_handler(void) #endif /* COUNT_IPIS */ addr = smp_tlb_addr1; + addr2 = smp_tlb_addr2; + generation = smp_tlb_generation; /* Overlap with serialization */ do { invlpg(addr); addr += PAGE_SIZE; - } while (addr < smp_tlb_addr2); + } while (addr < addr2); - atomic_add_int(&smp_tlb_wait, 1); + PCPU_SET(smp_tlb_done, generation); } From owner-svn-src-stable-11@freebsd.org Mon Oct 24 17:12:49 2016 Return-Path: Delivered-To: svn-src-stable-11@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 2620DC1E1F5; Mon, 24 Oct 2016 17:12:49 +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 05E811966; Mon, 24 Oct 2016 17:12:49 +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 199BF10AF6E; Mon, 24 Oct 2016 13:12:48 -0400 (EDT) From: John Baldwin To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r307791 - stable/11/usr.sbin/bhyve Date: Mon, 24 Oct 2016 10:11:49 -0700 Message-ID: <18530830.i5Ci9ybOZ6@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201610222049.u9MKnirM010685@repo.freebsd.org> References: <201610222049.u9MKnirM010685@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 24 Oct 2016 13:12:48 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 17:12:49 -0000 On Saturday, October 22, 2016 08:49:44 PM Baptiste Daroussin wrote: > Author: bapt > Date: Sat Oct 22 20:49:44 2016 > New Revision: 307791 > URL: https://svnweb.freebsd.org/changeset/base/307791 > > Log: > MFC r306554: > > Use accept4 with O_NONBLOCK rather than accept + fcntl > > Modified: > stable/11/usr.sbin/bhyve/dbgport.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/usr.sbin/bhyve/dbgport.c > ============================================================================== > --- stable/11/usr.sbin/bhyve/dbgport.c Sat Oct 22 20:49:07 2016 (r307790) > +++ stable/11/usr.sbin/bhyve/dbgport.c Sat Oct 22 20:49:44 2016 (r307791) > @@ -73,10 +73,8 @@ again: > printf("Waiting for connection from gdb\r\n"); > printonce = 1; > } > - conn_fd = accept(listen_fd, NULL, NULL); > - if (conn_fd >= 0) > - fcntl(conn_fd, F_SETFL, O_NONBLOCK); > - else if (errno != EINTR) > + conn_fd = accept4(listen_fd, NULL, NULL, O_NONBLOCK); > + if (conn_fd < 0 && errno != EINTR) This is actually wrong. accept4() uses SOCK_NONBLOCK, not O_NONBLOCK. Can you fix this in HEAD and MFC? -- John Baldwin From owner-svn-src-stable-11@freebsd.org Mon Oct 24 21:31:49 2016 Return-Path: Delivered-To: svn-src-stable-11@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 14EE8C2081A; Mon, 24 Oct 2016 21:31:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0449F15; Mon, 24 Oct 2016 21:31:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9OLVm37022300; Mon, 24 Oct 2016 21:31:48 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9OLVlVX022298; Mon, 24 Oct 2016 21:31:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201610242131.u9OLVlVX022298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 24 Oct 2016 21:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307885 - stable/11/sys/arm/allwinner X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 21:31:49 -0000 Author: manu Date: Mon Oct 24 21:31:47 2016 New Revision: 307885 URL: https://svnweb.freebsd.org/changeset/base/307885 Log: MFC r307379: axp209: Add support for regulators Except for LDO4, all regulators are supported. Modified: stable/11/sys/arm/allwinner/axp209.c stable/11/sys/arm/allwinner/axp209reg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/allwinner/axp209.c ============================================================================== --- stable/11/sys/arm/allwinner/axp209.c Mon Oct 24 21:16:21 2016 (r307884) +++ stable/11/sys/arm/allwinner/axp209.c Mon Oct 24 21:31:47 2016 (r307885) @@ -50,14 +50,92 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include +#include + #include #include "iicbus_if.h" #include "gpio_if.h" +#include "regdev_if.h" + +MALLOC_DEFINE(M_AXP209_REG, "Axp209 regulator", "Axp209 power regulator"); + +struct axp209_regdef { + intptr_t id; + char *name; + uint8_t enable_reg; + uint8_t enable_mask; + uint8_t voltage_reg; + uint8_t voltage_mask; + uint8_t voltage_shift; + int voltage_min; + int voltage_max; + int voltage_step; + int voltage_nstep; +}; + +static struct axp209_regdef axp209_regdefs[] = { + { + .id = AXP209_REG_ID_DCDC2, + .name = "dcdc2", + .enable_reg = AXP209_POWERCTL, + .enable_mask = AXP209_POWERCTL_DCDC2, + .voltage_reg = AXP209_REG_DCDC2_VOLTAGE, + .voltage_mask = 0x3f, + .voltage_min = 700, + .voltage_max = 2275, + .voltage_step = 25, + .voltage_nstep = 64, + }, + { + .id = AXP209_REG_ID_DCDC3, + .name = "dcdc3", + .enable_reg = AXP209_POWERCTL, + .enable_mask = AXP209_POWERCTL_DCDC3, + .voltage_reg = AXP209_REG_DCDC3_VOLTAGE, + .voltage_mask = 0x7f, + .voltage_min = 700, + .voltage_max = 3500, + .voltage_step = 25, + .voltage_nstep = 128, + }, + { + .id = AXP209_REG_ID_LDO2, + .name = "ldo2", + .enable_reg = AXP209_POWERCTL, + .enable_mask = AXP209_POWERCTL_LDO2, + .voltage_reg = AXP209_REG_LDO24_VOLTAGE, + .voltage_mask = 0xf0, + .voltage_shift = 4, + .voltage_min = 1800, + .voltage_max = 3300, + .voltage_step = 100, + .voltage_nstep = 16, + }, + { + .id = AXP209_REG_ID_LDO3, + .name = "ldo3", + .enable_reg = AXP209_POWERCTL, + .enable_mask = AXP209_POWERCTL_LDO3, + .voltage_reg = AXP209_REG_LDO3_VOLTAGE, + .voltage_mask = 0x7f, + .voltage_min = 700, + .voltage_max = 2275, + .voltage_step = 25, + .voltage_nstep = 128, + }, +}; + +struct axp209_reg_sc { + struct regnode *regnode; + device_t base_dev; + struct axp209_regdef *def; + phandle_t xref; + struct regnode_std_param *param; +}; struct axp209_softc { device_t dev; @@ -67,6 +145,10 @@ struct axp209_softc { struct intr_config_hook intr_hook; device_t gpiodev; struct mtx mtx; + + /* Regulators */ + struct axp209_reg_sc **regs; + int nregs; }; /* GPIO3 is different, don't expose it for now */ @@ -125,6 +207,115 @@ axp209_write(device_t dev, uint8_t reg, } static int +axp209_regnode_init(struct regnode *regnode) +{ + return (0); +} + +static int +axp209_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +{ + struct axp209_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + axp209_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (enable) + val |= sc->def->enable_mask; + else + val &= ~sc->def->enable_mask; + axp209_write(sc->base_dev, sc->def->enable_reg, val); + + *udelay = 0; + + return (0); +} + +static void +axp209_regnode_reg_to_voltage(struct axp209_reg_sc *sc, uint8_t val, int *uv) +{ + if (val < sc->def->voltage_nstep) + *uv = sc->def->voltage_min + val * sc->def->voltage_step; + else + *uv = sc->def->voltage_min + + (sc->def->voltage_nstep * sc->def->voltage_step); + *uv *= 1000; +} + +static int +axp209_regnode_voltage_to_reg(struct axp209_reg_sc *sc, int min_uvolt, + int max_uvolt, uint8_t *val) +{ + uint8_t nval; + int nstep, uvolt; + + nval = 0; + uvolt = sc->def->voltage_min * 1000; + + for (nstep = 0; nstep < sc->def->voltage_nstep && uvolt < min_uvolt; + nstep++) { + ++nval; + uvolt += (sc->def->voltage_step * 1000); + } + if (uvolt > max_uvolt) + return (EINVAL); + + *val = nval; + return (0); +} + +static int +axp209_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay) +{ + struct axp209_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step) + return (ENXIO); + + if (axp209_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) + return (ERANGE); + + axp209_write(sc->base_dev, sc->def->voltage_reg, val); + + *udelay = 0; + + return (0); +} + +static int +axp209_regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct axp209_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step) + return (ENXIO); + + axp209_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + axp209_regnode_reg_to_voltage(sc, val & sc->def->voltage_mask, uvolt); + + return (0); +} + +static regnode_method_t axp209_regnode_methods[] = { + /* Regulator interface */ + REGNODEMETHOD(regnode_init, axp209_regnode_init), + REGNODEMETHOD(regnode_enable, axp209_regnode_enable), + REGNODEMETHOD(regnode_set_voltage, axp209_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, axp209_regnode_get_voltage), + REGNODEMETHOD_END +}; +DEFINE_CLASS_1(axp209_regnode, axp209_regnode_class, axp209_regnode_methods, + sizeof(struct axp209_reg_sc), regnode_class); + +static int axp209_sysctl(SYSCTL_HANDLER_ARGS) { device_t dev = arg1; @@ -517,6 +708,63 @@ axp209_get_node(device_t dev, device_t b return (ofw_bus_get_node(dev)); } +static struct axp209_reg_sc * +axp209_reg_attach(device_t dev, phandle_t node, + struct axp209_regdef *def) +{ + struct axp209_reg_sc *reg_sc; + struct regnode_init_def initdef; + struct regnode *regnode; + + memset(&initdef, 0, sizeof(initdef)); + if (regulator_parse_ofw_stdparam(dev, node, &initdef) != 0) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + if (initdef.std_param.min_uvolt == 0) + initdef.std_param.min_uvolt = def->voltage_min * 1000; + if (initdef.std_param.max_uvolt == 0) + initdef.std_param.max_uvolt = def->voltage_max * 1000; + initdef.id = def->id; + initdef.ofw_node = node; + regnode = regnode_create(dev, &axp209_regnode_class, &initdef); + if (regnode == NULL) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + + reg_sc = regnode_get_softc(regnode); + reg_sc->regnode = regnode; + reg_sc->base_dev = dev; + reg_sc->def = def; + reg_sc->xref = OF_xref_from_node(node); + reg_sc->param = regnode_get_stdparam(regnode); + + regnode_register(regnode); + + return (reg_sc); +} + +static int +axp209_regdev_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, + intptr_t *num) +{ + struct axp209_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->nregs; i++) { + if (sc->regs[i] == NULL) + continue; + if (sc->regs[i]->xref == xref) { + *num = sc->regs[i]->def->id; + return (0); + } + } + + return (ENXIO); +} + static void axp209_start(void *pdev) { @@ -654,6 +902,9 @@ static int axp209_attach(device_t dev) { struct axp209_softc *sc; + struct axp209_reg_sc *reg; + phandle_t rnode, child; + int i; sc = device_get_softc(dev); mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); @@ -669,6 +920,29 @@ axp209_attach(device_t dev) if (config_intrhook_establish(&sc->intr_hook) != 0) return (ENOMEM); + sc->nregs = nitems(axp209_regdefs); + sc->regs = malloc(sizeof(struct axp209_reg_sc *) * sc->nregs, + M_AXP209_REG, M_WAITOK | M_ZERO); + + /* Attach known regulators that exist in the DT */ + rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); + if (rnode > 0) { + for (i = 0; i < sc->nregs; i++) { + child = ofw_bus_find_child(rnode, + axp209_regdefs[i].name); + if (child == 0) + continue; + reg = axp209_reg_attach(dev, child, &axp209_regdefs[i]); + if (reg == NULL) { + device_printf(dev, + "cannot attach regulator %s\n", + axp209_regdefs[i].name); + continue; + } + sc->regs[i] = reg; + } + } + sc->gpiodev = gpiobus_attach_bus(dev); return (0); @@ -690,6 +964,9 @@ static device_method_t axp209_methods[] DEVMETHOD(gpio_pin_toggle, axp209_gpio_pin_toggle), DEVMETHOD(gpio_map_gpios, axp209_gpio_map_gpios), + /* Regdev interface */ + DEVMETHOD(regdev_map, axp209_regdev_map), + /* OFW bus interface */ DEVMETHOD(ofw_bus_get_node, axp209_get_node), Modified: stable/11/sys/arm/allwinner/axp209reg.h ============================================================================== --- stable/11/sys/arm/allwinner/axp209reg.h Mon Oct 24 21:16:21 2016 (r307884) +++ stable/11/sys/arm/allwinner/axp209reg.h Mon Oct 24 21:31:47 2016 (r307885) @@ -146,6 +146,19 @@ #define AXP209_GPIO_DATA(x) (1 << (x + 4)) +/* Regulators registers */ +#define AXP209_POWERCTL 0x12 +#define AXP209_POWERCTL_DCDC3 (1 << 1) +#define AXP209_POWERCTL_LDO2 (1 << 2) +#define AXP209_POWERCTL_LDO4 (1 << 3) +#define AXP209_POWERCTL_DCDC2 (1 << 4) +#define AXP209_POWERCTL_LDO3 (1 << 6) + +#define AXP209_REG_DCDC2_VOLTAGE 0x23 +#define AXP209_REG_DCDC3_VOLTAGE 0x27 +#define AXP209_REG_LDO24_VOLTAGE 0x28 +#define AXP209_REG_LDO3_VOLTAGE 0x29 + enum axp209_sensor { AXP209_TEMP, AXP209_ACVOLT, @@ -157,4 +170,15 @@ enum axp209_sensor { AXP209_BATDISCHARGECURRENT, }; +enum axp209_regulators { + AXP209_REG_ID_DCDC2, + AXP209_REG_ID_DCDC3, + AXP209_REG_ID_LDO1, + AXP209_REG_ID_LDO2, + AXP209_REG_ID_LDO3, + /* LDO4 is weird, need to find a correct way to handle it */ + /* AXP209_REG_ID_LDO4, */ + AXP209_REG_ID_LDO5, +}; + #endif /* _AXP209REG_H_ */ From owner-svn-src-stable-11@freebsd.org Tue Oct 25 12:53:16 2016 Return-Path: Delivered-To: svn-src-stable-11@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 6E7BCC2046E; Tue, 25 Oct 2016 12:53:16 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 45A9234E; Tue, 25 Oct 2016 12:53:16 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9PCrF9c074271; Tue, 25 Oct 2016 12:53:15 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PCrFdt074268; Tue, 25 Oct 2016 12:53:15 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201610251253.u9PCrFdt074268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Tue, 25 Oct 2016 12:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307905 - stable/11/sys/netinet X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 12:53:16 -0000 Author: jch Date: Tue Oct 25 12:53:14 2016 New Revision: 307905 URL: https://svnweb.freebsd.org/changeset/base/307905 Log: MFC r307551: Fix a double-free when an inp transitions to INP_TIMEWAIT state after having been dropped. This change enforces in_pcbdrop() logic in tcp_input(): "in_pcbdrop() is used by TCP to mark an inpcb as unused and avoid future packet delivery or event notification when a socket remains open but TCP has closed." PR: 203175 Reported by: Palle Girgensohn, Slawa Olhovchenkov Tested by: Slawa Olhovchenkov Reviewed by: Slawa Olhovchenkov Approved by: gnn, Slawa Olhovchenkov Differential Revision: https://reviews.freebsd.org/D8211 Sponsored by: Verisign, inc Modified: stable/11/sys/netinet/tcp_input.c stable/11/sys/netinet/tcp_timewait.c stable/11/sys/netinet/tcp_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_input.c ============================================================================== --- stable/11/sys/netinet/tcp_input.c Tue Oct 25 10:59:21 2016 (r307904) +++ stable/11/sys/netinet/tcp_input.c Tue Oct 25 12:53:14 2016 (r307905) @@ -914,6 +914,16 @@ findpcb: goto dropwithreset; } INP_WLOCK_ASSERT(inp); + /* + * While waiting for inp lock during the lookup, another thread + * can have dropped the inpcb, in which case we need to loop back + * and try to find a new inpcb to deliver to. + */ + if (inp->inp_flags & INP_DROPPED) { + INP_WUNLOCK(inp); + inp = NULL; + goto findpcb; + } if ((inp->inp_flowtype == M_HASHTYPE_NONE) && (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) && ((inp->inp_socket == NULL) || @@ -974,6 +984,10 @@ relocked: if (in_pcbrele_wlocked(inp)) { inp = NULL; goto findpcb; + } else if (inp->inp_flags & INP_DROPPED) { + INP_WUNLOCK(inp); + inp = NULL; + goto findpcb; } } else ti_locked = TI_RLOCKED; @@ -1033,6 +1047,10 @@ relocked: if (in_pcbrele_wlocked(inp)) { inp = NULL; goto findpcb; + } else if (inp->inp_flags & INP_DROPPED) { + INP_WUNLOCK(inp); + inp = NULL; + goto findpcb; } goto relocked; } else Modified: stable/11/sys/netinet/tcp_timewait.c ============================================================================== --- stable/11/sys/netinet/tcp_timewait.c Tue Oct 25 10:59:21 2016 (r307904) +++ stable/11/sys/netinet/tcp_timewait.c Tue Oct 25 12:53:14 2016 (r307905) @@ -231,6 +231,10 @@ tcp_twstart(struct tcpcb *tp) INP_INFO_RLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); + /* A dropped inp should never transition to TIME_WAIT state. */ + KASSERT((inp->inp_flags & INP_DROPPED) == 0, ("tcp_twstart: " + "(inp->inp_flags & INP_DROPPED) != 0")); + if (V_nolocaltimewait) { int error = 0; #ifdef INET6 Modified: stable/11/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/11/sys/netinet/tcp_usrreq.c Tue Oct 25 10:59:21 2016 (r307904) +++ stable/11/sys/netinet/tcp_usrreq.c Tue Oct 25 12:53:14 2016 (r307905) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef DDB #include @@ -210,10 +211,26 @@ tcp_detach(struct socket *so, struct inp * In all three cases the tcptw should not be freed here. */ if (inp->inp_flags & INP_DROPPED) { - KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " - "INP_DROPPED && tp != NULL")); in_pcbdetach(inp); - in_pcbfree(inp); + if (__predict_true(tp == NULL)) { + in_pcbfree(inp); + } else { + /* + * This case should not happen as in TIMEWAIT + * state the inp should not be destroyed before + * its tcptw. If INVARIANTS is defined, panic. + */ +#ifdef INVARIANTS + panic("%s: Panic before an inp double-free: " + "INP_TIMEWAIT && INP_DROPPED && tp != NULL" + , __func__); +#else + log(LOG_ERR, "%s: Avoid an inp double-free: " + "INP_TIMEWAIT && INP_DROPPED && tp != NULL" + , __func__); +#endif + INP_WUNLOCK(inp); + } } else { in_pcbdetach(inp); INP_WUNLOCK(inp); From owner-svn-src-stable-11@freebsd.org Tue Oct 25 14:52:16 2016 Return-Path: Delivered-To: svn-src-stable-11@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 274F9C21F82; Tue, 25 Oct 2016 14:52:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01838CFB; Tue, 25 Oct 2016 14:52:15 +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 u9PEqFgY021182; Tue, 25 Oct 2016 14:52:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PEqEYS021177; Tue, 25 Oct 2016 14:52:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610251452.u9PEqEYS021177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 25 Oct 2016 14:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307912 - stable/11/contrib/tzdata X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 14:52:16 -0000 Author: bapt Date: Tue Oct 25 14:52:14 2016 New Revision: 307912 URL: https://svnweb.freebsd.org/changeset/base/307912 Log: MFC r307783: Import tzdata 2016h Modified: stable/11/contrib/tzdata/asia stable/11/contrib/tzdata/australasia stable/11/contrib/tzdata/europe stable/11/contrib/tzdata/northamerica Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tzdata/asia ============================================================================== --- stable/11/contrib/tzdata/asia Tue Oct 25 14:42:09 2016 (r307911) +++ stable/11/contrib/tzdata/asia Tue Oct 25 14:52:14 2016 (r307912) @@ -2544,11 +2544,6 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Paul Eggert (2015-03-03): # http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014 # says that the fall 2014 transition was Oct 23 at 24:00. -# For future dates, guess the last Friday in March at 24:00 through -# the first Friday on or after October 21 at 00:00. This is consistent with -# the predictions in today's editions of the following URLs: -# http://www.timeanddate.com/time/change/gaza-strip/gaza -# http://www.timeanddate.com/time/change/west-bank/hebron # From Hannah Kreitem (2016-03-09): # http://www.palestinecabinet.gov.ps/WebSite/ar/ViewDetails?ID=31728 @@ -2558,7 +2553,21 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # # From Paul Eggert (2016-03-12): # Predict spring transitions on March's last Saturday at 01:00 from now on. -# Leave fall predictions alone for now. + +# From Sharef Mustafa (2016-10-19): +# [T]he Palestinian cabinet decision (Mar 8th 2016) published on +# http://www.palestinecabinet.gov.ps/WebSite/Upload/Decree/GOV_17/16032016134830.pdf +# states that summer time will end on Oct 29th at 01:00. +# +# From Tim Parenti (2016-10-19): +# Predict fall transitions on October's last Saturday at 01:00 from now on. +# This is consistent with the 2016 transition as well as our spring +# predictions. +# +# From Paul Eggert (2016-10-19): +# It's also consistent with predictions in the following URLs today: +# http://www.timeanddate.com/time/change/gaza-strip/gaza +# http://www.timeanddate.com/time/change/west-bank/hebron # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2587,9 +2596,10 @@ Rule Palestine 2011 only - Sep 30 0:00 0 Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S Rule Palestine 2012 only - Sep 21 1:00 0 - Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - -Rule Palestine 2014 max - Oct Fri>=21 0:00 0 - +Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 - Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S Rule Palestine 2016 max - Mar lastSat 1:00 1:00 S +Rule Palestine 2016 max - Oct lastSat 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2739,45 +2749,31 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 J # People who live in regions under Tamil control can use [TZ='Asia/Kolkata'], # as that zone has agreed with the Tamil areas since our cutoff date of 1970. -# From K Sethu (2006-04-25): -# I think the abbreviation LKT originated from the world of computers at -# the time of or subsequent to the time zone changes by SL Government -# twice in 1996 and probably SL Government or its standardization -# agencies never declared an abbreviation as a national standard. -# -# I recollect before the recent change the government announcements -# mentioning it as simply changing Sri Lanka Standard Time or Sri Lanka -# Time and no mention was made about the abbreviation. -# -# If we look at Sri Lanka Department of Government's "Official News -# Website of Sri Lanka" ... http://www.news.lk/ we can see that they -# use SLT as abbreviation in time stamp at the beginning of each news -# item.... -# -# Within Sri Lanka I think LKT is well known among computer users and -# administrators. In my opinion SLT may not be a good choice because the -# nation's largest telcom / internet operator Sri Lanka Telcom is well -# known by that abbreviation - simply as SLT (there IP domains are -# slt.lk and sltnet.lk). -# -# But if indeed our government has adopted SLT as standard abbreviation -# (that we have not known so far) then it is better that it be used for -# all computers. - -# From Paul Eggert (2006-04-25): -# One possibility is that we wait for a bit for the dust to settle down -# and then see what people actually say in practice. +# From Sadika Sumanapala (2016-10-19): +# According to http://www.sltime.org (maintained by Measurement Units, +# Standards & Services Department, Sri Lanka) abbreviation for Sri Lanka +# standard time is SLST. +# +# From Paul Eggert (2016-10-18): +# "SLST" seems to be reasonably recent and rarely-used outside time +# zone nerd sources. I searched Google News and found three uses of +# it in the International Business Times of India in February and +# March of this year when discussing cricket match times, but nothing +# since then (though there has been a lot of cricket) and nothing in +# other English-language news sources. Our old abbreviation "LKT" is +# even worse. For now, let's use a numeric abbreviation; we can +# switch to "SLST" if it catches on. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Colombo 5:19:24 - LMT 1880 5:19:32 - MMT 1906 # Moratuwa Mean Time - 5:30 - IST 1942 Jan 5 - 5:30 0:30 IHST 1942 Sep - 5:30 1:00 IST 1945 Oct 16 2:00 - 5:30 - IST 1996 May 25 0:00 - 6:30 - LKT 1996 Oct 26 0:30 - 6:00 - LKT 2006 Apr 15 0:30 - 5:30 - IST + 5:30 - +0530 1942 Jan 5 + 5:30 0:30 +0530/+06 1942 Sep + 5:30 1:00 +0530/+0630 1945 Oct 16 2:00 + 5:30 - +0530 1996 May 25 0:00 + 6:30 - +0630 1996 Oct 26 0:30 + 6:00 - +06 2006 Apr 15 0:30 + 5:30 - +0530 # Syria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Modified: stable/11/contrib/tzdata/australasia ============================================================================== --- stable/11/contrib/tzdata/australasia Tue Oct 25 14:42:09 2016 (r307911) +++ stable/11/contrib/tzdata/australasia Tue Oct 25 14:52:14 2016 (r307912) @@ -350,7 +350,13 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # commencing at 2.00 am on Sunday 1st November, 2015 and ending at # 3.00 am on Sunday 17th January, 2016. -# From Paul Eggert (2015-09-01): +# From Raymond Kumar (2016-10-04): +# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-6th-NOVEMBER,-2016.aspx +# "Fiji's daylight savings will begin on Sunday, 6 November 2016, when +# clocks go forward an hour at 2am to 3am.... Daylight Saving will +# end at 3.00am on Sunday 15th January 2017." + +# From Paul Eggert (2016-10-03): # For now, guess DST from 02:00 the first Sunday in November to # 03:00 the third Sunday in January. Although ad hoc, it matches # transitions since late 2014 and seems more likely to match future Modified: stable/11/contrib/tzdata/europe ============================================================================== --- stable/11/contrib/tzdata/europe Tue Oct 25 14:42:09 2016 (r307911) +++ stable/11/contrib/tzdata/europe Tue Oct 25 14:52:14 2016 (r307912) @@ -1908,7 +1908,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Ma # Amsterdam mean time. # The data entries before 1945 are taken from -# http://www.phys.uu.nl/~vgent/wettijd/wettijd.htm +# http://www.staff.science.uu.nl/~gent0113/idl/idl.htm # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time @@ -3427,22 +3427,24 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # Turkey -# From Amar Devegowda (2007-01-03): -# The time zone rules for Istanbul, Turkey have not been changed for years now. -# ... The latest rules are available at: -# http://www.timeanddate.com/worldclock/timezone.html?n=107 -# From Steffen Thorsen (2007-01-03): -# I have been able to find press records back to 1996 which all say that -# DST started 01:00 local time and end at 02:00 local time. I am not sure -# what happened before that. One example for each year from 1996 to 2001: -# http://newspot.byegm.gov.tr/arsiv/1996/21/N4.htm -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING97/03/97X03X25.TXT -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING98/03/98X03X02.HTM -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING99/10/99X10X26.HTM#%2016 -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2000/03/00X03X06.HTM#%2021 -# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2001/03/23x03x01.HTM#%2027 -# From Paul Eggert (2007-01-03): -# Prefer the above source to Shanks & Pottenger for time stamps after 1990. +# From Kıvanç Yazan (2016-09-25): +# 1) For 1986-2006, DST started at 01:00 local and ended at 02:00 local, with +# no exceptions. +# 2) 1994's lastSun was overridden with Mar 20 ... +# Here are official papers: +# http://www.resmigazete.gov.tr/arsiv/19032.pdf - page 2 for 1986 +# http://www.resmigazete.gov.tr/arsiv/19400.pdf - page 4 for 1987 +# http://www.resmigazete.gov.tr/arsiv/19752.pdf - page 15 for 1988 +# http://www.resmigazete.gov.tr/arsiv/20102.pdf - page 6 for 1989 +# http://www.resmigazete.gov.tr/arsiv/20464.pdf - page 1 for 1990 - 1992 +# http://www.resmigazete.gov.tr/arsiv/21531.pdf - page 15 for 1993 - 1995 +# http://www.resmigazete.gov.tr/arsiv/21879.pdf - page 1 for overriding 1994 +# http://www.resmigazete.gov.tr/arsiv/22588.pdf - page 1 for 1996, 1997 +# http://www.resmigazete.gov.tr/arsiv/23286.pdf - page 10 for 1998 - 2000 +# http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2 - for 2001 +# http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2 - for 2002-2006 +# From Paul Eggert (2016-09-25): +# Prefer the above sources to Shanks & Pottenger for time stamps after 1985. # From Steffen Thorsen (2007-03-09): # Starting 2007 though, it seems that they are adopting EU's 1:00 UTC @@ -3551,10 +3553,10 @@ Rule Turkey 1983 only - Jul 31 0:00 1:00 Rule Turkey 1983 only - Oct 2 0:00 0 - Rule Turkey 1985 only - Apr 20 0:00 1:00 S Rule Turkey 1985 only - Sep 28 0:00 0 - -Rule Turkey 1986 1990 - Mar lastSun 2:00s 1:00 S -Rule Turkey 1986 1990 - Sep lastSun 2:00s 0 - -Rule Turkey 1991 2006 - Mar lastSun 1:00s 1:00 S -Rule Turkey 1991 1995 - Sep lastSun 1:00s 0 - +Rule Turkey 1986 1993 - Mar lastSun 1:00s 1:00 S +Rule Turkey 1986 1995 - Sep lastSun 1:00s 0 - +Rule Turkey 1994 only - Mar 20 1:00s 1:00 S +Rule Turkey 1995 2006 - Mar lastSun 1:00s 1:00 S Rule Turkey 1996 2006 - Oct lastSun 1:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Europe/Istanbul 1:55:52 - LMT 1880 Modified: stable/11/contrib/tzdata/northamerica ============================================================================== --- stable/11/contrib/tzdata/northamerica Tue Oct 25 14:42:09 2016 (r307911) +++ stable/11/contrib/tzdata/northamerica Tue Oct 25 14:52:14 2016 (r307912) @@ -24,8 +24,32 @@ # was the result of his proposals at the Convention of Railroad Trunk Lines # in New York City (1869-10). His 1870 proposal was based on Washington, DC, # but in 1872-05 he moved the proposed origin to Greenwich. -# His proposal was adopted by the railroads on 1883-11-18 at 12:00, -# and the most of the country soon followed suit. + +# From Paul Eggert (2016-09-21): +# Dowd's proposal left many details unresolved, such as where to draw +# lines between time zones. The key individual who made time zones +# work in the US was William Frederick Allen - railway engineer, +# managing editor of the Travelers' Guide, and secretary of the +# General Time Convention, a railway standardization group. Allen +# spent months in dialogs with scientific and railway leaders, +# developed a workable plan to institute time zones, and presented it +# to the General Time Convention on 1883-04-11, saying that his plan +# meant "local time would be practically abolished" - a plus for +# railway scheduling. By the next convention on 1883-10-11 nearly all +# railroads had agreed and it took effect on 1883-11-18 at 12:00. +# That Sunday was called the "day of two noons", as the eastern parts +# of the new zones observed noon twice. Allen witnessed the +# transition in New York City, writing: +# +# I heard the bells of St. Paul's strike on the old time. Four +# minutes later, obedient to the electrical signal from the Naval +# Observatory ... the time-ball made its rapid descent, the chimes +# of old Trinity rang twelve measured strokes, and local time was +# abandoned, probably forever. +# +# Most of the US soon followed suit. See: +# Bartky IR. The adoption of standard time. Technol Cult 1989 Jan;30(1):25-56. +# http://dx.doi.org/10.2307/3105430 # From Paul Eggert (2005-04-16): # That 1883 transition occurred at 12:00 new time, not at 12:00 old time. From owner-svn-src-stable-11@freebsd.org Tue Oct 25 14:56:43 2016 Return-Path: Delivered-To: svn-src-stable-11@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 9BDFFC213A1; Tue, 25 Oct 2016 14:56:43 +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 6B824397; Tue, 25 Oct 2016 14:56:43 +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 u9PEuglW021484; Tue, 25 Oct 2016 14:56:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PEug86021481; Tue, 25 Oct 2016 14:56:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610251456.u9PEug86021481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 25 Oct 2016 14:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307915 - in stable/11: etc/rc.d tools/build/mk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 14:56:43 -0000 Author: bapt Date: Tue Oct 25 14:56:42 2016 New Revision: 307915 URL: https://svnweb.freebsd.org/changeset/base/307915 Log: MFC r307786: Do not install NIS program rc script if WITHOUT_NIS is set PR: 213375 Submitted by: sergey@akhmatov.ru Modified: stable/11/etc/rc.d/Makefile stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.d/Makefile ============================================================================== --- stable/11/etc/rc.d/Makefile Tue Oct 25 14:55:03 2016 (r307914) +++ stable/11/etc/rc.d/Makefile Tue Oct 25 14:56:42 2016 (r307915) @@ -118,14 +118,17 @@ FILES= DAEMON \ ugidfw \ ${_utx} \ var \ - watchdogd \ - ypbind \ + watchdogd + +.if ${MK_NIS} != "no" +FILES+= ypbind \ ypldap \ yppasswdd \ ypserv \ ypset \ ypupdated \ ypxfrd +.endif .if ${MK_ACCT} != "no" FILESGROUPS+= ACCT Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Tue Oct 25 14:55:03 2016 (r307914) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Tue Oct 25 14:56:42 2016 (r307915) @@ -6059,6 +6059,13 @@ OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-N .endif .if ${MK_NIS} == no +OLD_FILES+=etc/rc.d/ypbind +OLD_FILES+=etc/rc.d/ypldap +OLD_FILES+=etc/rc.d/yppasswdd +OLD_FILES+=etc/rc.d/ypserv +OLD_FILES+=etc/rc.d/ypset +OLD_FILES+=etc/rc.d/ypupdated +OLD_FILES+=etc/rc.d/ypxfrd OLD_FILES+=usr/bin/ypcat OLD_FILES+=usr/bin/ypchfn OLD_FILES+=usr/bin/ypchpass From owner-svn-src-stable-11@freebsd.org Tue Oct 25 14:58:50 2016 Return-Path: Delivered-To: svn-src-stable-11@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 E58F6C2146F; Tue, 25 Oct 2016 14:58:50 +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 B26A580B; Tue, 25 Oct 2016 14:58:50 +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 u9PEwnZl021614; Tue, 25 Oct 2016 14:58:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PEwnTV021613; Tue, 25 Oct 2016 14:58:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610251458.u9PEwnTV021613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 25 Oct 2016 14:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307916 - stable/11/sys/boot/efi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 14:58:51 -0000 Author: bapt Date: Tue Oct 25 14:58:49 2016 New Revision: 307916 URL: https://svnweb.freebsd.org/changeset/base/307916 Log: MFC r307787: Fix typo in the COMPILER_VERSION check PR: 213120 Submitted by: Yuta Satoh Modified: stable/11/sys/boot/efi/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/Makefile ============================================================================== --- stable/11/sys/boot/efi/Makefile Tue Oct 25 14:56:42 2016 (r307915) +++ stable/11/sys/boot/efi/Makefile Tue Oct 25 14:58:49 2016 (r307916) @@ -4,7 +4,7 @@ # In-tree GCC does not support __attribute__((ms_abi)), but gcc newer # than 4.5 supports it. -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 404500 +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" .if ${MK_FDT} != "no" @@ -18,6 +18,6 @@ SUBDIR+= fdt SUBDIR+= libefi loader boot1 .endif -.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 404500 +.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 .include From owner-svn-src-stable-11@freebsd.org Tue Oct 25 15:21:21 2016 Return-Path: Delivered-To: svn-src-stable-11@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 6EC15C21E63; Tue, 25 Oct 2016 15:21:21 +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 3D89C108D; Tue, 25 Oct 2016 15:21:21 +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 u9PFLK3a033029; Tue, 25 Oct 2016 15:21:20 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PFLKtw033028; Tue, 25 Oct 2016 15:21:20 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610251521.u9PFLKtw033028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 25 Oct 2016 15:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307919 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 15:21:21 -0000 Author: bapt Date: Tue Oct 25 15:21:20 2016 New Revision: 307919 URL: https://svnweb.freebsd.org/changeset/base/307919 Log: accept4 actually expect SOCK_NONBLOCK and not O_NONBLOCK Reported by: jhb Pointyhat to: bapt Modified: stable/11/usr.sbin/bhyve/dbgport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/dbgport.c ============================================================================== --- stable/11/usr.sbin/bhyve/dbgport.c Tue Oct 25 15:21:08 2016 (r307918) +++ stable/11/usr.sbin/bhyve/dbgport.c Tue Oct 25 15:21:20 2016 (r307919) @@ -73,7 +73,7 @@ again: printf("Waiting for connection from gdb\r\n"); printonce = 1; } - conn_fd = accept4(listen_fd, NULL, NULL, O_NONBLOCK); + conn_fd = accept4(listen_fd, NULL, NULL, SOCK_NONBLOCK); if (conn_fd < 0 && errno != EINTR) perror("accept"); } From owner-svn-src-stable-11@freebsd.org Tue Oct 25 17:14:51 2016 Return-Path: Delivered-To: svn-src-stable-11@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 D5B36C21227; Tue, 25 Oct 2016 17:14:51 +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 A6F8C1793; Tue, 25 Oct 2016 17:14:51 +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 u9PHEo3b076363; Tue, 25 Oct 2016 17:14:50 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PHEoma076362; Tue, 25 Oct 2016 17:14:50 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201610251714.u9PHEoma076362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 25 Oct 2016 17:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307938 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 17:14:51 -0000 Author: glebius Date: Tue Oct 25 17:14:50 2016 New Revision: 307938 URL: https://svnweb.freebsd.org/changeset/base/307938 Log: Merge r307936: The argument validation in r296956 was not enough to close all possible overflows in sysarch(2). Submitted by: Kun Yang Patch by: kib Security: SA-16:15 Modified: stable/11/sys/amd64/amd64/sys_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/sys_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/sys_machdep.c Tue Oct 25 17:13:58 2016 (r307937) +++ stable/11/sys/amd64/amd64/sys_machdep.c Tue Oct 25 17:14:50 2016 (r307938) @@ -608,6 +608,8 @@ amd64_set_ldt(td, uap, descs) largest_ld = uap->start + uap->num; if (largest_ld > max_ldt_segment) largest_ld = max_ldt_segment; + if (largest_ld < uap->start) + return (EINVAL); i = largest_ld - uap->start; mtx_lock(&dt_lock); bzero(&((struct user_segment_descriptor *)(pldt->ldt_base)) @@ -620,7 +622,8 @@ amd64_set_ldt(td, uap, descs) /* verify range of descriptors to modify */ largest_ld = uap->start + uap->num; if (uap->start >= max_ldt_segment || - largest_ld > max_ldt_segment) + largest_ld > max_ldt_segment || + largest_ld < uap->start) return (EINVAL); } From owner-svn-src-stable-11@freebsd.org Tue Oct 25 17:15:34 2016 Return-Path: Delivered-To: svn-src-stable-11@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 2D546C212B7; Tue, 25 Oct 2016 17:15:34 +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 F29741923; Tue, 25 Oct 2016 17:15:33 +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 u9PHFXKT076447; Tue, 25 Oct 2016 17:15:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PHFXSZ076446; Tue, 25 Oct 2016 17:15:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201610251715.u9PHFXSZ076446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 25 Oct 2016 17:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307939 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 17:15:34 -0000 Author: glebius Date: Tue Oct 25 17:15:32 2016 New Revision: 307939 URL: https://svnweb.freebsd.org/changeset/base/307939 Log: Merge r307937: Fix unchecked array reference in the VGA device emulation code. Submitted by: Ilja Van Sprundel Patch by: tychon Security: SA-16:32 Modified: stable/11/usr.sbin/bhyve/vga.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/vga.c ============================================================================== --- stable/11/usr.sbin/bhyve/vga.c Tue Oct 25 17:14:50 2016 (r307938) +++ stable/11/usr.sbin/bhyve/vga.c Tue Oct 25 17:15:32 2016 (r307939) @@ -161,10 +161,10 @@ struct vga_softc { */ struct { uint8_t dac_state; - int dac_rd_index; - int dac_rd_subindex; - int dac_wr_index; - int dac_wr_subindex; + uint8_t dac_rd_index; + uint8_t dac_rd_subindex; + uint8_t dac_wr_index; + uint8_t dac_wr_subindex; uint8_t dac_palette[3 * 256]; uint32_t dac_palette_rgb[256]; } vga_dac; From owner-svn-src-stable-11@freebsd.org Wed Oct 26 07:45:16 2016 Return-Path: Delivered-To: svn-src-stable-11@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 9D20AC22742; Wed, 26 Oct 2016 07:45:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 633FE2AA; Wed, 26 Oct 2016 07:45:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9Q7jFKg010044; Wed, 26 Oct 2016 07:45:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9Q7jFCd010043; Wed, 26 Oct 2016 07:45:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610260745.u9Q7jFCd010043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 26 Oct 2016 07:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307956 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2016 07:45:16 -0000 Author: mav Date: Wed Oct 26 07:45:15 2016 New Revision: 307956 URL: https://svnweb.freebsd.org/changeset/base/307956 Log: MFC r307132: Use copyout() instead of pointing sbuf to user-space buffer. Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Wed Oct 26 05:26:59 2016 (r307955) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Wed Oct 26 07:45:15 2016 (r307956) @@ -2672,13 +2672,13 @@ ses_get_elm_devnames(enc_softc_t *enc, e if (len < 0) return (EINVAL); - sbuf_new(&sb, elmdn->elm_devnames, len, 0); - cam_periph_unlock(enc->periph); + sbuf_new(&sb, NULL, len, SBUF_FIXEDLEN); ses_paths_iter(enc, &enc->enc_cache.elm_map[elmdn->elm_idx], ses_elmdevname_callback, &sb); sbuf_finish(&sb); elmdn->elm_names_len = sbuf_len(&sb); + copyout(sbuf_data(&sb), elmdn->elm_devnames, elmdn->elm_names_len + 1); cam_periph_lock(enc->periph); return (elmdn->elm_names_len > 0 ? 0 : ENODEV); } From owner-svn-src-stable-11@freebsd.org Wed Oct 26 08:39:35 2016 Return-Path: Delivered-To: svn-src-stable-11@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 3655FC21F2E; Wed, 26 Oct 2016 08:39:35 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0549321E; Wed, 26 Oct 2016 08:39:34 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9Q8dYn1029073; Wed, 26 Oct 2016 08:39:34 GMT (envelope-from gahr@FreeBSD.org) Received: (from gahr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9Q8dYSM029072; Wed, 26 Oct 2016 08:39:34 GMT (envelope-from gahr@FreeBSD.org) Message-Id: <201610260839.u9Q8dYSM029072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gahr set sender to gahr@FreeBSD.org using -f From: Pietro Cerutti Date: Wed, 26 Oct 2016 08:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307958 - stable/11/usr.bin/printenv X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2016 08:39:35 -0000 Author: gahr (ports committer) Date: Wed Oct 26 08:39:33 2016 New Revision: 307958 URL: https://svnweb.freebsd.org/changeset/base/307958 Log: MFC r307638: Chase a cornercase in printenv and sync its behaviour with builtin's The cornercase is when printenv is passed a parameter in the form VAR=val, where VAR=val exists in the environment. In this case, printenv would print a spurious newline and returns 0. Approved by: cognet MFC after: 1 week Modified: stable/11/usr.bin/printenv/printenv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/printenv/printenv.c ============================================================================== --- stable/11/usr.bin/printenv/printenv.c Wed Oct 26 07:45:48 2016 (r307957) +++ stable/11/usr.bin/printenv/printenv.c Wed Oct 26 08:39:33 2016 (r307958) @@ -83,8 +83,8 @@ main(int argc, char *argv[]) for (ep = environ; *ep; ep++) if (!memcmp(*ep, *argv, len)) { cp = *ep + len; - if (!*cp || *cp == '=') { - (void)printf("%s\n", *cp ? cp + 1 : cp); + if (*cp == '=') { + (void)printf("%s\n", cp + 1); exit(0); } } From owner-svn-src-stable-11@freebsd.org Wed Oct 26 17:34:34 2016 Return-Path: Delivered-To: svn-src-stable-11@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 7A7B0C2383F; Wed, 26 Oct 2016 17:34:34 +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 4A4A6F85; Wed, 26 Oct 2016 17:34:34 +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 u9QHYXNt036700; Wed, 26 Oct 2016 17:34:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9QHYXAt036699; Wed, 26 Oct 2016 17:34:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201610261734.u9QHYXAt036699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 26 Oct 2016 17:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307970 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2016 17:34:34 -0000 Author: ae Date: Wed Oct 26 17:34:33 2016 New Revision: 307970 URL: https://svnweb.freebsd.org/changeset/base/307970 Log: MFC r307628: Fix `ipfw table lookup` handler to return entry value, but not its index. Modified: stable/11/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_table.c Wed Oct 26 17:07:53 2016 (r307969) +++ stable/11/sys/netpfil/ipfw/ip_fw_table.c Wed Oct 26 17:34:33 2016 (r307970) @@ -1087,6 +1087,7 @@ find_table_entry(struct ip_fw_chain *ch, struct table_config *tc; struct table_algo *ta; struct table_info *kti; + struct table_value *pval; struct namedobj_instance *ni; int error; size_t sz; @@ -1132,7 +1133,10 @@ find_table_entry(struct ip_fw_chain *ch, return (ENOTSUP); error = ta->find_tentry(tc->astate, kti, tent); - + if (error == 0) { + pval = get_table_value(ch, tc, tent->v.kidx); + ipfw_export_table_value_v1(pval, &tent->v.value); + } IPFW_UH_RUNLOCK(ch); return (error); From owner-svn-src-stable-11@freebsd.org Wed Oct 26 17:53:14 2016 Return-Path: Delivered-To: svn-src-stable-11@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 68343C23DE0; Wed, 26 Oct 2016 17:53:14 +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 368EFEE5; Wed, 26 Oct 2016 17:53:14 +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 u9QHrDMA044535; Wed, 26 Oct 2016 17:53:13 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9QHrDWO044532; Wed, 26 Oct 2016 17:53:13 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201610261753.u9QHrDWO044532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 26 Oct 2016 17:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307972 - stable/11/sys/dev/bxe X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2016 17:53:14 -0000 Author: davidcs Date: Wed Oct 26 17:53:12 2016 New Revision: 307972 URL: https://svnweb.freebsd.org/changeset/base/307972 Log: MFC r307578 1. Use taskqueue_create() instead of taskqueue_create_fast() for both fastpath and slowpath taskqueues. 2. Service all transmits in taskqueue threads. 3. additional stats counters for keeping track of - bd availability - tx buf ring not emptied in the fp task queue. These are drained via timeout taskqueue. - tx attempts during link down. Modified: stable/11/sys/dev/bxe/bxe.c stable/11/sys/dev/bxe/bxe.h stable/11/sys/dev/bxe/bxe_stats.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/bxe/bxe.c ============================================================================== --- stable/11/sys/dev/bxe/bxe.c Wed Oct 26 17:37:08 2016 (r307971) +++ stable/11/sys/dev/bxe/bxe.c Wed Oct 26 17:53:12 2016 (r307972) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.81" +#define BXE_DRIVER_VERSION "1.78.89" #include "bxe.h" #include "ecore_sp.h" @@ -489,7 +489,14 @@ static const struct { { STATS_OFFSET32(mbuf_alloc_tpa), 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, { STATS_OFFSET32(tx_queue_full_return), - 4, STATS_FLAGS_FUNC, "tx_queue_full_return"} + 4, STATS_FLAGS_FUNC, "tx_queue_full_return"}, + { STATS_OFFSET32(tx_request_link_down_failures), + 4, STATS_FLAGS_FUNC, "tx_request_link_down_failures"}, + { STATS_OFFSET32(bd_avail_too_less_failures), + 4, STATS_FLAGS_FUNC, "bd_avail_too_less_failures"}, + { STATS_OFFSET32(tx_mq_not_empty), + 4, STATS_FLAGS_FUNC, "tx_mq_not_empty"} + }; static const struct { @@ -602,7 +609,14 @@ static const struct { { Q_STATS_OFFSET32(mbuf_alloc_tpa), 4, "mbuf_alloc_tpa"}, { Q_STATS_OFFSET32(tx_queue_full_return), - 4, "tx_queue_full_return"} + 4, "tx_queue_full_return"}, + { Q_STATS_OFFSET32(tx_request_link_down_failures), + 4, "tx_request_link_down_failures"}, + { Q_STATS_OFFSET32(bd_avail_too_less_failures), + 4, "bd_avail_too_less_failures"}, + { Q_STATS_OFFSET32(tx_mq_not_empty), + 4, "tx_mq_not_empty"} + }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -5599,7 +5613,7 @@ bxe_tx_start(if_t ifp) BXE_FP_TX_UNLOCK(fp); } -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 static int bxe_tx_mq_start_locked(struct bxe_softc *sc, @@ -5621,11 +5635,16 @@ bxe_tx_mq_start_locked(struct bxe_softc return (EINVAL); } - if (!sc->link_vars.link_up || - (if_getdrvflags(ifp) & - (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { - if (m != NULL) - rc = drbr_enqueue(ifp, tx_br, m); + if (m != NULL) { + rc = drbr_enqueue(ifp, tx_br, m); + if (rc != 0) { + fp->eth_q_stats.tx_soft_errors++; + goto bxe_tx_mq_start_locked_exit; + } + } + + if (!sc->link_vars.link_up || !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + fp->eth_q_stats.tx_request_link_down_failures++; goto bxe_tx_mq_start_locked_exit; } @@ -5635,24 +5654,22 @@ bxe_tx_mq_start_locked(struct bxe_softc fp->eth_q_stats.tx_max_drbr_queue_depth = depth; } - if (m == NULL) { - /* no new work, check for pending frames */ - next = drbr_dequeue_drv(ifp, tx_br); - } else if (drbr_needs_enqueue_drv(ifp, tx_br)) { - /* have both new and pending work, maintain packet order */ - rc = drbr_enqueue(ifp, tx_br, m); - if (rc != 0) { - fp->eth_q_stats.tx_soft_errors++; - goto bxe_tx_mq_start_locked_exit; - } - next = drbr_dequeue_drv(ifp, tx_br); - } else { - /* new work only and nothing pending */ - next = m; - } - /* keep adding entries while there are frames to send */ - while (next != NULL) { + while ((next = drbr_peek(ifp, tx_br)) != NULL) { + /* handle any completions if we're running low */ + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) { + /* bxe_txeof will set IFF_DRV_OACTIVE appropriately */ + bxe_txeof(sc, fp); + tx_bd_avail = bxe_tx_avail(sc, fp); + if (tx_bd_avail < (BXE_TSO_MAX_SEGMENTS + 1)) { + fp->eth_q_stats.bd_avail_too_less_failures++; + m_freem(next); + drbr_advance(ifp, tx_br); + rc = ENOBUFS; + break; + } + } /* the mbuf now belongs to us */ fp->eth_q_stats.mbuf_alloc_tx++; @@ -5668,11 +5685,11 @@ bxe_tx_mq_start_locked(struct bxe_softc if (next != NULL) { /* mark the TX queue as full and save the frame */ if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); - /* XXX this may reorder the frame */ - rc = drbr_enqueue(ifp, tx_br, next); + drbr_putback(ifp, tx_br, next); fp->eth_q_stats.mbuf_alloc_tx--; fp->eth_q_stats.tx_frames_deferred++; - } + } else + drbr_advance(ifp, tx_br); /* stop looking for more work */ break; @@ -5684,18 +5701,7 @@ bxe_tx_mq_start_locked(struct bxe_softc /* send a copy of the frame to any BPF listeners */ if_etherbpfmtap(ifp, next); - tx_bd_avail = bxe_tx_avail(sc, fp); - - /* handle any completions if we're running low */ - if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) { - /* bxe_txeof will set IFF_DRV_OACTIVE appropriately */ - bxe_txeof(sc, fp); - if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) { - break; - } - } - - next = drbr_dequeue_drv(ifp, tx_br); + drbr_advance(ifp, tx_br); } /* all TX packets were dequeued and/or the tx ring is full */ @@ -5705,10 +5711,28 @@ bxe_tx_mq_start_locked(struct bxe_softc } bxe_tx_mq_start_locked_exit: + /* If we didn't drain the drbr, enqueue a task in the future to do it. */ + if (!drbr_empty(ifp, tx_br)) { + fp->eth_q_stats.tx_mq_not_empty++; + taskqueue_enqueue_timeout(fp->tq, &fp->tx_timeout_task, 1); + } return (rc); } +static void +bxe_tx_mq_start_deferred(void *arg, + int pending) +{ + struct bxe_fastpath *fp = (struct bxe_fastpath *)arg; + struct bxe_softc *sc = fp->sc; + if_t ifp = sc->ifp; + + BXE_FP_TX_LOCK(fp); + bxe_tx_mq_start_locked(sc, ifp, fp, NULL); + BXE_FP_TX_UNLOCK(fp); +} + /* Multiqueue (TSS) dispatch routine. */ static int bxe_tx_mq_start(struct ifnet *ifp, @@ -5730,8 +5754,10 @@ bxe_tx_mq_start(struct ifnet *ifp, if (BXE_FP_TX_TRYLOCK(fp)) { rc = bxe_tx_mq_start_locked(sc, ifp, fp, m); BXE_FP_TX_UNLOCK(fp); - } else + } else { rc = drbr_enqueue(ifp, fp->tx_br, m); + taskqueue_enqueue(fp->tq, &fp->tx_task); + } return (rc); } @@ -5766,7 +5792,7 @@ bxe_mq_flush(struct ifnet *ifp) if_qflush(ifp); } -#endif /* FreeBSD_version >= 800000 */ +#endif /* FreeBSD_version >= 901504 */ static uint16_t bxe_cid_ilt_lines(struct bxe_softc *sc) @@ -6126,7 +6152,7 @@ bxe_free_fp_buffers(struct bxe_softc *sc for (i = 0; i < sc->num_queues; i++) { fp = &sc->fp[i]; -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 if (fp->tx_br != NULL) { /* just in case bxe_mq_flush() wasn't called */ if (mtx_initialized(&fp->tx_mtx)) { @@ -6953,6 +6979,8 @@ bxe_link_attn(struct bxe_softc *sc) uint32_t pause_enabled = 0; struct host_port_stats *pstats; int cmng_fns; + struct bxe_fastpath *fp; + int i; /* Make sure that we are synced with the current statistics */ bxe_stats_handle(sc, STATS_EVENT_STOP); @@ -6984,6 +7012,12 @@ bxe_link_attn(struct bxe_softc *sc) if (sc->state == BXE_STATE_OPEN) { bxe_stats_handle(sc, STATS_EVENT_LINK_UP); } + + /* Restart tx when the link comes back. */ + FOR_EACH_ETH_QUEUE(sc, i) { + fp = &sc->fp[i]; + taskqueue_enqueue(fp->tq, &fp->tx_task); + } } if (sc->link_vars.link_up && sc->link_vars.line_speed) { @@ -9035,6 +9069,10 @@ bxe_interrupt_detach(struct bxe_softc *s fp = &sc->fp[i]; if (fp->tq) { taskqueue_drain(fp->tq, &fp->tq_task); + taskqueue_drain(fp->tq, &fp->tx_task); + while (taskqueue_cancel_timeout(fp->tq, &fp->tx_timeout_task, + NULL)) + taskqueue_drain_timeout(fp->tq, &fp->tx_timeout_task); taskqueue_free(fp->tq); fp->tq = NULL; } @@ -9067,9 +9105,9 @@ bxe_interrupt_attach(struct bxe_softc *s snprintf(sc->sp_tq_name, sizeof(sc->sp_tq_name), "bxe%d_sp_tq", sc->unit); TASK_INIT(&sc->sp_tq_task, 0, bxe_handle_sp_tq, sc); - sc->sp_tq = taskqueue_create_fast(sc->sp_tq_name, M_NOWAIT, - taskqueue_thread_enqueue, - &sc->sp_tq); + sc->sp_tq = taskqueue_create(sc->sp_tq_name, M_NOWAIT, + taskqueue_thread_enqueue, + &sc->sp_tq); taskqueue_start_threads(&sc->sp_tq, 1, PWAIT, /* lower priority */ "%s", sc->sp_tq_name); @@ -9079,9 +9117,12 @@ bxe_interrupt_attach(struct bxe_softc *s snprintf(fp->tq_name, sizeof(fp->tq_name), "bxe%d_fp%d_tq", sc->unit, i); TASK_INIT(&fp->tq_task, 0, bxe_handle_fp_tq, fp); - fp->tq = taskqueue_create_fast(fp->tq_name, M_NOWAIT, - taskqueue_thread_enqueue, - &fp->tq); + TASK_INIT(&fp->tx_task, 0, bxe_tx_mq_start_deferred, fp); + fp->tq = taskqueue_create(fp->tq_name, M_NOWAIT, + taskqueue_thread_enqueue, + &fp->tq); + TIMEOUT_TASK_INIT(fp->tq, &fp->tx_timeout_task, 0, + bxe_tx_mq_start_deferred, fp); taskqueue_start_threads(&fp->tq, 1, PI_NET, /* higher priority */ "%s", fp->tq_name); } @@ -12114,8 +12155,6 @@ static void bxe_periodic_callout_func(void *xsc) { struct bxe_softc *sc = (struct bxe_softc *)xsc; - struct bxe_fastpath *fp; - uint16_t tx_bd_avail; int i; if (!BXE_CORE_TRYLOCK(sc)) { @@ -12136,49 +12175,8 @@ bxe_periodic_callout_func(void *xsc) BLOGW(sc, "periodic callout exit (state=0x%x)\n", sc->state); BXE_CORE_UNLOCK(sc); return; - } - -#if __FreeBSD_version >= 800000 - - FOR_EACH_QUEUE(sc, i) { - fp = &sc->fp[i]; - - if (BXE_FP_TX_TRYLOCK(fp)) { - if_t ifp = sc->ifp; - /* - * If interface was stopped due to unavailable - * bds, try to process some tx completions - */ - (void) bxe_txeof(sc, fp); - - tx_bd_avail = bxe_tx_avail(sc, fp); - if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { - bxe_tx_mq_start_locked(sc, ifp, fp, NULL); - } - BXE_FP_TX_UNLOCK(fp); - } - } - -#else - - fp = &sc->fp[0]; - if (BXE_FP_TX_TRYLOCK(fp)) { - struct ifnet *ifp = sc->ifnet; - /* - * If interface was stopped due to unavailable - * bds, try to process some tx completions - */ - (void) bxe_txeof(sc, fp); - - tx_bd_avail = bxe_tx_avail(sc, fp); - if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { - bxe_tx_start_locked(sc, ifp, fp); } - - BXE_FP_TX_UNLOCK(fp); - } -#endif /* #if __FreeBSD_version >= 800000 */ /* Check for TX timeouts on any fastpath. */ FOR_EACH_QUEUE(sc, i) { @@ -12656,7 +12654,7 @@ bxe_init_ifnet(struct bxe_softc *sc) if_setioctlfn(ifp, bxe_ioctl); if_setstartfn(ifp, bxe_tx_start); if_setgetcounterfn(ifp, bxe_get_counter); -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 if_settransmitfn(ifp, bxe_tx_mq_start); if_setqflushfn(ifp, bxe_mq_flush); #endif @@ -15699,7 +15697,7 @@ bxe_add_sysctls(struct bxe_softc *sc) static int bxe_alloc_buf_rings(struct bxe_softc *sc) { -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 int i; struct bxe_fastpath *fp; @@ -15720,7 +15718,7 @@ bxe_alloc_buf_rings(struct bxe_softc *sc static void bxe_free_buf_rings(struct bxe_softc *sc) { -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 901504 int i; struct bxe_fastpath *fp; Modified: stable/11/sys/dev/bxe/bxe.h ============================================================================== --- stable/11/sys/dev/bxe/bxe.h Wed Oct 26 17:37:08 2016 (r307971) +++ stable/11/sys/dev/bxe/bxe.h Wed Oct 26 17:53:12 2016 (r307972) @@ -644,6 +644,9 @@ struct bxe_fastpath { struct taskqueue *tq; char tq_name[32]; + struct task tx_task; + struct timeout_task tx_timeout_task; + /* ethernet client ID (each fastpath set of RX/TX/CQE is a client) */ uint8_t cl_id; #define FP_CL_ID(fp) (fp->cl_id) @@ -2300,7 +2303,8 @@ void bxe_dump_mbuf_data(struct bxe_softc extern int bxe_grc_dump(struct bxe_softc *sc); #if __FreeBSD_version >= 800000 -#if __FreeBSD_version >= 1000000 +#if (__FreeBSD_version >= 1001513 && __FreeBSD_version < 1100000) ||\ + __FreeBSD_version >= 1100048 #define BXE_SET_FLOWID(m) M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE) #define BXE_VALID_FLOWID(m) (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) #else Modified: stable/11/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/11/sys/dev/bxe/bxe_stats.h Wed Oct 26 17:37:08 2016 (r307971) +++ stable/11/sys/dev/bxe/bxe_stats.h Wed Oct 26 17:53:12 2016 (r307972) @@ -266,6 +266,10 @@ struct bxe_eth_stats { /* num. of times tx queue full occurred */ uint32_t tx_queue_full_return; + /* debug stats */ + uint32_t tx_request_link_down_failures; + uint32_t bd_avail_too_less_failures; + uint32_t tx_mq_not_empty; }; @@ -372,6 +376,11 @@ struct bxe_eth_q_stats { /* num. of times tx queue full occurred */ uint32_t tx_queue_full_return; + + /* debug stats */ + uint32_t tx_request_link_down_failures; + uint32_t bd_avail_too_less_failures; + uint32_t tx_mq_not_empty; }; struct bxe_eth_stats_old { From owner-svn-src-stable-11@freebsd.org Thu Oct 27 07:54:05 2016 Return-Path: Delivered-To: svn-src-stable-11@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 7BA83C2329C; Thu, 27 Oct 2016 07:54:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52412919; Thu, 27 Oct 2016 07:54:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9R7s4FB067152; Thu, 27 Oct 2016 07:54:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9R7s4b6067149; Thu, 27 Oct 2016 07:54:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610270754.u9R7s4b6067149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Oct 2016 07:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307995 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 07:54:05 -0000 Author: avg Date: Thu Oct 27 07:54:04 2016 New Revision: 307995 URL: https://svnweb.freebsd.org/changeset/base/307995 Log: MFC r306801: implement zfs_vptocnp() using z_parent property Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Oct 27 07:38:07 2016 (r307994) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Oct 27 07:54:04 2016 (r307995) @@ -355,6 +355,8 @@ extern zil_get_data_t zfs_get_data; extern zil_replay_func_t *zfs_replay_vector[TX_MAX_TYPE]; extern int zfsfstype; +extern int zfs_znode_parent_and_name(znode_t *zp, znode_t **dzpp, char *buf); + #endif /* _KERNEL */ extern int zfs_obj_to_path(objset_t *osp, uint64_t obj, char *buf, int len); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Oct 27 07:38:07 2016 (r307994) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Oct 27 07:54:04 2016 (r307995) @@ -5934,8 +5934,19 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) } if (zp->z_id != parent || zfsvfs->z_parent == zfsvfs) { + char name[MAXNAMLEN + 1]; + znode_t *dzp; + size_t len; + + error = zfs_znode_parent_and_name(zp, &dzp, name); + if (error == 0) { + len = strlen(name); + *ap->a_buflen -= len; + bcopy(name, ap->a_buf + *ap->a_buflen, len); + *ap->a_vpp = ZTOV(dzp); + } ZFS_EXIT(zfsvfs); - return (vop_stdvptocnp(ap)); + return (error); } ZFS_EXIT(zfsvfs); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Oct 27 07:38:07 2016 (r307994) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Oct 27 07:54:04 2016 (r307995) @@ -1936,7 +1936,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, mutex_destroy(&zfsvfs->z_hold_mtx[i]); kmem_free(zfsvfs, sizeof (zfsvfs_t)); } - #endif /* _KERNEL */ static int @@ -2192,3 +2191,35 @@ zfs_obj_to_stats(objset_t *osp, uint64_t zfs_release_sa_handle(hdl, db, FTAG); return (error); } + +#ifdef _KERNEL +int +zfs_znode_parent_and_name(znode_t *zp, znode_t **dzpp, char *buf) +{ + zfsvfs_t *zfsvfs = zp->z_zfsvfs; + uint64_t parent; + int is_xattrdir; + int err; + + /* Extended attributes should not be visible as regular files. */ + if ((zp->z_pflags & ZFS_XATTR) != 0) + return (SET_ERROR(EINVAL)); + + err = zfs_obj_to_pobj(zfsvfs->z_os, zp->z_sa_hdl, zfsvfs->z_attr_table, + &parent, &is_xattrdir); + if (err != 0) + return (err); + ASSERT0(is_xattrdir); + + /* No name as this is a root object. */ + if (parent == zp->z_id) + return (SET_ERROR(EINVAL)); + + err = zap_value_search(zfsvfs->z_os, parent, zp->z_id, + ZFS_DIRENT_OBJ(-1ULL), buf); + if (err != 0) + return (err); + err = zfs_zget(zfsvfs, parent, dzpp); + return (err); +} +#endif /* _KERNEL */ From owner-svn-src-stable-11@freebsd.org Thu Oct 27 07:57:26 2016 Return-Path: Delivered-To: svn-src-stable-11@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 585CDC2344F; Thu, 27 Oct 2016 07:57:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 284BBCFB; Thu, 27 Oct 2016 07:57:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9R7vP3P067508; Thu, 27 Oct 2016 07:57:25 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9R7vPvj067507; Thu, 27 Oct 2016 07:57:25 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610270757.u9R7vPvj067507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Oct 2016 07:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307997 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 07:57:26 -0000 Author: avg Date: Thu Oct 27 07:57:25 2016 New Revision: 307997 URL: https://svnweb.freebsd.org/changeset/base/307997 Log: MFC r305539: work around AMD erratum 793 for family 16h, models 00h-0Fh Modified: stable/11/sys/amd64/amd64/initcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/11/sys/amd64/amd64/initcpu.c Thu Oct 27 07:54:10 2016 (r307996) +++ stable/11/sys/amd64/amd64/initcpu.c Thu Oct 27 07:57:25 2016 (r307997) @@ -108,6 +108,20 @@ init_amd(void) wrmsr(0xc001102a, msr); } } + + /* + * Work around Erratum 793: Specific Combination of Writes to Write + * Combined Memory Types and Locked Instructions May Cause Core Hang. + * See Revision Guide for AMD Family 16h Models 00h-0Fh Processors, + * revision 3.04 or later, publication 51810. + */ + if (CPUID_TO_FAMILY(cpu_id) == 0x16 && CPUID_TO_MODEL(cpu_id) <= 0xf) { + if ((cpu_feature2 & CPUID2_HV) == 0) { + msr = rdmsr(0xc0011020); + msr |= (uint64_t)1 << 15; + wrmsr(0xc0011020, msr); + } + } } /* From owner-svn-src-stable-11@freebsd.org Thu Oct 27 09:11:37 2016 Return-Path: Delivered-To: svn-src-stable-11@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 72BB2C2293A; Thu, 27 Oct 2016 09:11:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40A7AEBD; Thu, 27 Oct 2016 09:11:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9R9Ba23098150; Thu, 27 Oct 2016 09:11:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9R9BaJP098149; Thu, 27 Oct 2016 09:11:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610270911.u9R9BaJP098149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Oct 2016 09:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r307999 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 09:11:37 -0000 Author: kib Date: Thu Oct 27 09:11:36 2016 New Revision: 307999 URL: https://svnweb.freebsd.org/changeset/base/307999 Log: MFC r307869: Fix typo. Modified: stable/11/sys/x86/x86/mp_x86.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/mp_x86.c ============================================================================== --- stable/11/sys/x86/x86/mp_x86.c Thu Oct 27 07:57:43 2016 (r307998) +++ stable/11/sys/x86/x86/mp_x86.c Thu Oct 27 09:11:36 2016 (r307999) @@ -1318,7 +1318,7 @@ invlcache_handler(void) * Reading the generation here allows greater parallelism * since wbinvd is a serializing instruction. Without the * temporary, we'd wait for wbinvd to complete, then the read - * would execute, then the dependent write, whuch must then + * would execute, then the dependent write, which must then * complete before return from interrupt. */ generation = smp_tlb_generation; From owner-svn-src-stable-11@freebsd.org Fri Oct 28 03:54:21 2016 Return-Path: Delivered-To: svn-src-stable-11@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 A99F2C2174D; Fri, 28 Oct 2016 03:54:21 +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 86B3EABC; Fri, 28 Oct 2016 03:54:21 +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 u9S3sKa4028319; Fri, 28 Oct 2016 03:54:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9S3sKR0028316; Fri, 28 Oct 2016 03:54:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201610280354.u9S3sKR0028316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 28 Oct 2016 03:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308009 - in stable: 10/sys/kern 10/sys/sys 10/usr.bin/gcore 11/sys/kern 11/sys/sys 11/usr.bin/gcore X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 03:54:21 -0000 Author: jhb Date: Fri Oct 28 03:54:19 2016 New Revision: 308009 URL: https://svnweb.freebsd.org/changeset/base/308009 Log: MFC 303002: Include process IDs in core dumps. When threads were added to the kernel, the pr_pid member of the NT_PRSTATUS note was repurposed to store LWP IDs instead of process IDs. However, the process ID was no longer recorded in core dumps. This change adds a pr_pid field to prpsinfo (NT_PRSINFO). Rather than bumping the prpsinfo version number, note parsers can use the note's payload size to determine if pr_pid is present. Modified: stable/11/sys/kern/imgact_elf.c stable/11/sys/sys/procfs.h stable/11/usr.bin/gcore/elfcore.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/imgact_elf.c stable/10/sys/sys/procfs.h stable/10/usr.bin/gcore/elfcore.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/kern/imgact_elf.c ============================================================================== --- stable/11/sys/kern/imgact_elf.c Fri Oct 28 02:10:07 2016 (r308008) +++ stable/11/sys/kern/imgact_elf.c Fri Oct 28 03:54:19 2016 (r308009) @@ -1873,6 +1873,7 @@ __elfN(note_prpsinfo)(void *arg, struct *cp = ' '; } } + psinfo->pr_pid = p->p_pid; sbuf_bcat(sb, psinfo, sizeof(*psinfo)); free(psinfo, M_TEMP); } Modified: stable/11/sys/sys/procfs.h ============================================================================== --- stable/11/sys/sys/procfs.h Fri Oct 28 02:10:07 2016 (r308008) +++ stable/11/sys/sys/procfs.h Fri Oct 28 03:54:19 2016 (r308009) @@ -49,7 +49,10 @@ typedef struct fpreg fpregset_t; /* * The parenthsized numbers like (1) indicate the minimum version number - * for which each element exists in the structure. + * for which each element exists in the structure. The version number is + * not bumped when adding new fields to the end, only if the meaning of + * an existing field changes. Additional fields are annotated as (1a), + * (1b), etc. to indicate the groupings of additions. */ #define PRSTATUS_VERSION 1 /* Current version of prstatus_t */ @@ -61,7 +64,7 @@ typedef struct prstatus { size_t pr_fpregsetsz; /* sizeof(fpregset_t) (1) */ int pr_osreldate; /* Kernel version (1) */ int pr_cursig; /* Current signal (1) */ - pid_t pr_pid; /* Process ID (1) */ + pid_t pr_pid; /* LWP (Thread) ID (1) */ gregset_t pr_reg; /* General purpose registers (1) */ } prstatus_t; @@ -78,6 +81,7 @@ typedef struct prpsinfo { size_t pr_psinfosz; /* sizeof(prpsinfo_t) (1) */ char pr_fname[PRFNAMESZ+1]; /* Command name, null terminated (1) */ char pr_psargs[PRARGSZ+1]; /* Arguments, null terminated (1) */ + pid_t pr_pid; /* Process ID (1a) */ } prpsinfo_t; typedef struct thrmisc { @@ -104,6 +108,7 @@ typedef struct prpsinfo32 { uint32_t pr_psinfosz; char pr_fname[PRFNAMESZ+1]; char pr_psargs[PRARGSZ+1]; + int32_t pr_pid; } prpsinfo32_t; struct thrmisc32 { Modified: stable/11/usr.bin/gcore/elfcore.c ============================================================================== --- stable/11/usr.bin/gcore/elfcore.c Fri Oct 28 02:10:07 2016 (r308008) +++ stable/11/usr.bin/gcore/elfcore.c Fri Oct 28 03:54:19 2016 (r308009) @@ -586,6 +586,7 @@ elf_note_prpsinfo(void *arg, size_t *siz } else strlcpy(psinfo->pr_psargs, kip.ki_comm, sizeof(psinfo->pr_psargs)); + psinfo->pr_pid = pid; *sizep = sizeof(*psinfo); return (psinfo); From owner-svn-src-stable-11@freebsd.org Fri Oct 28 12:43:50 2016 Return-Path: Delivered-To: svn-src-stable-11@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 A3C8EC2218D; Fri, 28 Oct 2016 12:43:50 +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 5C1F61B8; Fri, 28 Oct 2016 12:43:50 +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 u9SChnkd031384; Fri, 28 Oct 2016 12:43:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9SChnx3031383; Fri, 28 Oct 2016 12:43:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201610281243.u9SChnx3031383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 28 Oct 2016 12:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308032 - stable/11/sys/dev/sound/usb X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 12:43:50 -0000 Author: hselasky Date: Fri Oct 28 12:43:49 2016 New Revision: 308032 URL: https://svnweb.freebsd.org/changeset/base/308032 Log: MFC r307651: Add support for adjusting the hardware buffering delay for USB audio. Requested by: Goran Mekic Modified: stable/11/sys/dev/sound/usb/uaudio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/11/sys/dev/sound/usb/uaudio.c Fri Oct 28 12:36:59 2016 (r308031) +++ stable/11/sys/dev/sound/usb/uaudio.c Fri Oct 28 12:43:49 2016 (r308032) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); static int uaudio_default_rate = 0; /* use rate list */ static int uaudio_default_bits = 32; static int uaudio_default_channels = 0; /* use default */ +static int uaudio_buffer_ms = 8; #ifdef USB_DEBUG static int uaudio_debug = 0; @@ -109,9 +110,32 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def &uaudio_default_bits, 0, "uaudio default sample bits"); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RWTUN, &uaudio_default_channels, 0, "uaudio default sample channels"); + +static int +uaudio_buffer_ms_sysctl(SYSCTL_HANDLER_ARGS) +{ + int err, val; + + val = uaudio_buffer_ms; + err = sysctl_handle_int(oidp, &val, 0, req); + + if (err != 0 || req->newptr == NULL || val == uaudio_buffer_ms) + return (err); + + if (val > 8) + val = 8; + else if (val < 2) + val = 2; + + uaudio_buffer_ms = val; + + return (0); +} +SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT | CTLFLAG_RWTUN, + 0, sizeof(int), uaudio_buffer_ms_sysctl, "I", + "uaudio buffering delay from 2ms to 8ms"); #endif -#define UAUDIO_IRQS (8000 / UAUDIO_NFRAMES) /* interrupts per second */ #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ #define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ #define UAUDIO_RECURSE_LIMIT 255 /* rounds */ @@ -1278,10 +1302,10 @@ uaudio_configure_msg_sub(struct uaudio_s if (fps < 8000) { /* FULL speed USB */ - frames = 8; + frames = uaudio_buffer_ms; } else { /* HIGH speed USB */ - frames = UAUDIO_NFRAMES; + frames = uaudio_buffer_ms * 8; } fps_shift = usbd_xfer_get_fps_shift(chan->xfer[0]); @@ -2158,8 +2182,9 @@ tr_setup: } /* start the SYNC transfer one time per second, if any */ - if (++(ch->intr_counter) >= UAUDIO_IRQS) { - ch->intr_counter = 0; + ch->intr_counter += ch->intr_frames; + if (ch->intr_counter >= ch->frames_per_second) { + ch->intr_counter -= ch->frames_per_second; usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); } From owner-svn-src-stable-11@freebsd.org Fri Oct 28 12:55:15 2016 Return-Path: Delivered-To: svn-src-stable-11@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 889D9C2262A; Fri, 28 Oct 2016 12:55:15 +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 4EFF8C7C; Fri, 28 Oct 2016 12:55:15 +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 u9SCtE4e035341; Fri, 28 Oct 2016 12:55:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9SCtEuU035340; Fri, 28 Oct 2016 12:55:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610281255.u9SCtEuU035340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 28 Oct 2016 12:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308034 - stable/11/sbin/init X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 12:55:15 -0000 Author: kib Date: Fri Oct 28 12:55:14 2016 New Revision: 308034 URL: https://svnweb.freebsd.org/changeset/base/308034 Log: MFC r306807: When making a pause after detecting hard kill of the single-user shell, ensure that we do sleep for at least the specified time, in presence of signals. Modified: stable/11/sbin/init/init.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/init/init.c ============================================================================== --- stable/11/sbin/init/init.c Fri Oct 28 12:46:38 2016 (r308033) +++ stable/11/sbin/init/init.c Fri Oct 28 12:55:14 2016 (r308034) @@ -870,6 +870,7 @@ single_user(void) sigset_t mask; const char *shell; char *argv[2]; + struct timeval tv, tn; #ifdef SECURE struct ttyent *typ; struct passwd *pp; @@ -1002,7 +1003,14 @@ single_user(void) * reboot(8) killed shell? */ warning("single user shell terminated."); - sleep(STALL_TIMEOUT); + gettimeofday(&tv, NULL); + tn = tv; + tv.tv_sec += STALL_TIMEOUT; + while (tv.tv_sec > tn.tv_sec || (tv.tv_sec == + tn.tv_sec && tv.tv_usec > tn.tv_usec)) { + sleep(1); + gettimeofday(&tn, NULL); + } _exit(0); } else { warning("single user shell terminated, restarting"); From owner-svn-src-stable-11@freebsd.org Fri Oct 28 12:56:29 2016 Return-Path: Delivered-To: svn-src-stable-11@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 286A1C226A2; Fri, 28 Oct 2016 12:56:29 +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 EB578DEB; Fri, 28 Oct 2016 12:56: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 u9SCuSSq035432; Fri, 28 Oct 2016 12:56:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9SCuSKC035431; Fri, 28 Oct 2016 12:56:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610281256.u9SCuSKC035431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 28 Oct 2016 12:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308035 - stable/11/sbin/init X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 12:56:29 -0000 Author: kib Date: Fri Oct 28 12:56:27 2016 New Revision: 308035 URL: https://svnweb.freebsd.org/changeset/base/308035 Log: MFC r306808: Add verbosity around failed reboot(2) call. Modified: stable/11/sbin/init/init.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/init/init.c ============================================================================== --- stable/11/sbin/init/init.c Fri Oct 28 12:55:14 2016 (r308034) +++ stable/11/sbin/init/init.c Fri Oct 28 12:56:27 2016 (r308035) @@ -885,8 +885,13 @@ single_user(void) if (Reboot) { /* Instead of going single user, let's reboot the machine */ sync(); - reboot(howto); - _exit(0); + if (reboot(howto) == -1) { + emergency("reboot(%#x) failed, %s", howto, + strerror(errno)); + _exit(1); /* panic and reboot */ + } + warning("reboot(%#x) returned", howto); + _exit(0); /* panic as well */ } shell = get_shell(); From owner-svn-src-stable-11@freebsd.org Fri Oct 28 14:50:24 2016 Return-Path: Delivered-To: svn-src-stable-11@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 964F2C24FB9; Fri, 28 Oct 2016 14:50:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 599F410AD; Fri, 28 Oct 2016 14:50:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9SEoN77080792; Fri, 28 Oct 2016 14:50:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9SEoNnu080790; Fri, 28 Oct 2016 14:50:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610281450.u9SEoNnu080790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 28 Oct 2016 14:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308041 - stable/11/sys/dev/smbus X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 14:50:24 -0000 Author: avg Date: Fri Oct 28 14:50:23 2016 New Revision: 308041 URL: https://svnweb.freebsd.org/changeset/base/308041 Log: MFC r307130: smbus: allow child devices to be added via hints Modified: stable/11/sys/dev/smbus/smbconf.h stable/11/sys/dev/smbus/smbus.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/smbus/smbconf.h ============================================================================== --- stable/11/sys/dev/smbus/smbconf.h Fri Oct 28 14:49:54 2016 (r308040) +++ stable/11/sys/dev/smbus/smbconf.h Fri Oct 28 14:50:23 2016 (r308041) @@ -34,6 +34,10 @@ #define n(flags) (~(flags) & (flags)) +/* Order constants for smbus children. */ +#define SMBUS_ORDER_HINTED 20 +#define SMBUS_ORDER_PNP 40 + /* * How tsleep() is called in smb_request_bus(). */ Modified: stable/11/sys/dev/smbus/smbus.c ============================================================================== --- stable/11/sys/dev/smbus/smbus.c Fri Oct 28 14:49:54 2016 (r308040) +++ stable/11/sys/dev/smbus/smbus.c Fri Oct 28 14:50:23 2016 (r308041) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -41,54 +42,16 @@ __FBSDID("$FreeBSD$"); #include "smbus_if.h" #include "bus_if.h" +struct smbus_ivar +{ + uint8_t addr; +}; /* * Autoconfiguration and support routines for System Management bus */ +static void smbus_probe_device(device_t dev, u_char addr); -/* - * Device methods - */ -static int smbus_probe(device_t); -static int smbus_attach(device_t); -static int smbus_detach(device_t); - -static int smbus_child_location_str(device_t parent, device_t child, - char *buf, size_t buflen); -static int smbus_print_child(device_t parent, device_t child); -static void smbus_probe_device(device_t dev, u_char* addr); -static int smbus_read_ivar(device_t parent, device_t child, int which, - uintptr_t *result); - -static device_method_t smbus_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, smbus_probe), - DEVMETHOD(device_attach, smbus_attach), - DEVMETHOD(device_detach, smbus_detach), - - /* bus interface */ - DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_child_location_str, smbus_child_location_str), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - DEVMETHOD(bus_print_child, smbus_print_child), - DEVMETHOD(bus_read_ivar, smbus_read_ivar), - - DEVMETHOD_END -}; - -driver_t smbus_driver = { - "smbus", - smbus_methods, - sizeof(struct smbus_softc), -}; - -devclass_t smbus_devclass; - -/* - * At 'probe' time, we add all the devices which we know about to the - * bus. The generic attach routine will probe and attach them if they - * are alive. - */ static int smbus_probe(device_t dev) { @@ -107,9 +70,9 @@ smbus_attach(device_t dev) mtx_init(&sc->lock, device_get_nameunit(dev), "smbus", MTX_DEF); bus_generic_probe(dev); for (addr = SMBUS_ADDR_MIN; addr < SMBUS_ADDR_MAX; ++addr) { - sc->addrs[addr] = addr; - smbus_probe_device(dev, &sc->addrs[addr]); + smbus_probe_device(dev, addr); } + bus_enumerate_hinted_children(dev); bus_generic_attach(dev); return (0); @@ -124,6 +87,7 @@ smbus_detach(device_t dev) error = bus_generic_detach(dev); if (error) return (error); + device_delete_children(dev); mtx_destroy(&sc->lock); return (0); @@ -135,34 +99,78 @@ smbus_generic_intr(device_t dev, u_char } static void -smbus_probe_device(device_t dev, u_char* addr) +smbus_probe_device(device_t dev, u_char addr) { device_t child; int error; u_char cmd; u_char buf[2]; + struct smbus_ivar *devi; cmd = 0x01; - error = smbus_trans(dev, *addr, cmd, + error = smbus_trans(dev, addr, cmd, SMB_TRANS_NOCNT | SMB_TRANS_NOREPORT, NULL, 0, buf, 1, NULL); if (error == 0) { if (bootverbose) - device_printf(dev, "Probed address 0x%02x\n", *addr); - child = device_add_child(dev, NULL, -1); - device_set_ivars(child, addr); + device_printf(dev, "Probed address 0x%02x\n", addr); + child = BUS_ADD_CHILD(dev, SMBUS_ORDER_PNP, NULL, -1); + if (child == NULL) + return; + devi = device_get_ivars(child); + devi->addr = addr; + } +} + +static device_t +smbus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + struct smbus_ivar *devi; + device_t child; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (child); + devi = malloc(sizeof(struct smbus_ivar), M_DEVBUF, M_NOWAIT | M_ZERO); + if (devi == NULL) { + device_delete_child(dev, child); + return (NULL); + } + device_set_ivars(child, devi); + return (child); +} + +static void +smbus_hinted_child(device_t bus, const char *dname, int dunit) +{ + struct smbus_ivar *devi; + device_t child; + int addr; + + addr = 0; + resource_int_value(dname, dunit, "addr", &addr); + if (addr > UINT8_MAX) { + device_printf(bus, "ignored incorrect slave address hint 0x%x" + " for %s%d\n", addr, dname, dunit); + return; } + child = BUS_ADD_CHILD(bus, SMBUS_ORDER_HINTED, dname, dunit); + if (child == NULL) + return; + devi = device_get_ivars(child); + devi->addr = addr; } + static int smbus_child_location_str(device_t parent, device_t child, char *buf, size_t buflen) { - unsigned char *addr; + struct smbus_ivar *devi; - addr = device_get_ivars(child); - if (addr) - snprintf(buf, buflen, "addr=0x%x", *addr); + devi = device_get_ivars(child); + if (devi->addr != 0) + snprintf(buf, buflen, "addr=0x%x", devi->addr); else if (buflen) buf[0] = 0; return (0); @@ -171,28 +179,49 @@ smbus_child_location_str(device_t parent static int smbus_print_child(device_t parent, device_t child) { - unsigned char *addr; + struct smbus_ivar *devi; int retval; - addr = device_get_ivars(child); + devi = device_get_ivars(child); retval = bus_print_child_header(parent, child); - if (addr) - retval += printf(" at addr 0x%x", *addr); + if (devi->addr != 0) + retval += printf(" at addr 0x%x", devi->addr); retval += bus_print_child_footer(parent, child); return (retval); } static int -smbus_read_ivar(device_t parent, device_t child, int which, - uintptr_t *result) +smbus_read_ivar(device_t parent, device_t child, int which, uintptr_t *result) +{ + struct smbus_ivar *devi; + + devi = device_get_ivars(child); + switch (which) { + case SMBUS_IVAR_ADDR: + if (devi->addr != 0) + *result = devi->addr; + else + *result = -1; + break; + default: + return (ENOENT); + } + return (0); +} + +static int +smbus_write_ivar(device_t parent, device_t child, int which, uintptr_t value) { - unsigned char *addr; + struct smbus_ivar *devi; - addr = device_get_ivars(child); + devi = device_get_ivars(child); switch (which) { case SMBUS_IVAR_ADDR: - *result = (addr == NULL) ? -1 : *addr; + /* Allow to set but no change the slave address. */ + if (devi->addr != 0) + return (EINVAL); + devi->addr = value; break; default: return (ENOENT); @@ -200,4 +229,47 @@ smbus_read_ivar(device_t parent, device_ return (0); } +static void +smbus_probe_nomatch(device_t bus, device_t child) +{ + struct smbus_ivar *devi = device_get_ivars(child); + + /* + * Ignore (self-identified) devices without a slave address set. + * For example, smb(4). + */ + if (devi->addr != 0) + device_printf(bus, " at addr %#x\n", + devi->addr); +} + +/* + * Device methods + */ +static device_method_t smbus_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, smbus_probe), + DEVMETHOD(device_attach, smbus_attach), + DEVMETHOD(device_detach, smbus_detach), + + /* bus interface */ + DEVMETHOD(bus_add_child, smbus_add_child), + DEVMETHOD(bus_hinted_child, smbus_hinted_child), + DEVMETHOD(bus_probe_nomatch, smbus_probe_nomatch), + DEVMETHOD(bus_child_location_str, smbus_child_location_str), + DEVMETHOD(bus_print_child, smbus_print_child), + DEVMETHOD(bus_read_ivar, smbus_read_ivar), + DEVMETHOD(bus_write_ivar, smbus_write_ivar), + + DEVMETHOD_END +}; + +driver_t smbus_driver = { + "smbus", + smbus_methods, + sizeof(struct smbus_softc), +}; + +devclass_t smbus_devclass; + MODULE_VERSION(smbus, SMBUS_MODVER); From owner-svn-src-stable-11@freebsd.org Fri Oct 28 15:15:29 2016 Return-Path: Delivered-To: svn-src-stable-11@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 16B81C249C1; Fri, 28 Oct 2016 15:15:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D64868EC; Fri, 28 Oct 2016 15:15:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9SFFRvs092637; Fri, 28 Oct 2016 15:15:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9SFFRHj092636; Fri, 28 Oct 2016 15:15:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610281515.u9SFFRHj092636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 28 Oct 2016 15:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308043 - stable/11/include X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 15:15:29 -0000 Author: avg Date: Fri Oct 28 15:15:27 2016 New Revision: 308043 URL: https://svnweb.freebsd.org/changeset/base/308043 Log: MFC r307131: install header files required development with libzfs_core Modified: stable/11/include/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/include/Makefile ============================================================================== --- stable/11/include/Makefile Fri Oct 28 15:02:24 2016 (r308042) +++ stable/11/include/Makefile Fri Oct 28 15:15:27 2016 (r308043) @@ -236,6 +236,17 @@ copies: .PHONY .META cd ${.CURDIR}/../sys/teken; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \ ${DESTDIR}${INCLUDEDIR}/teken +.if ${MK_CDDL} != "no" + cd ${.CURDIR}/../cddl/contrib/opensolaris/lib/libzfs_core/common; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libzfs_core.h \ + ${DESTDIR}${INCLUDEDIR} + cd ${.CURDIR}/../cddl/contrib/opensolaris/lib/libnvpair; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libnvpair.h \ + ${DESTDIR}${INCLUDEDIR} + cd ${.CURDIR}/../sys/cddl/contrib/opensolaris/uts/common/sys; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nvpair.h \ + ${DESTDIR}${INCLUDEDIR}/sys +.endif symlinks: .PHONY .META @${ECHO} "Setting up symlinks to kernel source tree..." From owner-svn-src-stable-11@freebsd.org Fri Oct 28 15:17:54 2016 Return-Path: Delivered-To: svn-src-stable-11@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 749F8C24DB3; Fri, 28 Oct 2016 15:17:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CA95F16; Fri, 28 Oct 2016 15:17:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9SFHrHq092833; Fri, 28 Oct 2016 15:17:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9SFHrph092832; Fri, 28 Oct 2016 15:17:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610281517.u9SFHrph092832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 28 Oct 2016 15:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308045 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 15:17:54 -0000 Author: avg Date: Fri Oct 28 15:17:53 2016 New Revision: 308045 URL: https://svnweb.freebsd.org/changeset/base/308045 Log: MFC r307141: remove a few stray spaces from sys/param.h Modified: stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Fri Oct 28 15:15:51 2016 (r308044) +++ stable/11/sys/sys/param.h Fri Oct 28 15:17:53 2016 (r308045) @@ -44,7 +44,7 @@ #define BSD4_3 1 #define BSD4_4 1 -/* +/* * __FreeBSD_version numbers are documented in the Porter's Handbook. * If you bump the version for any reason, you should update the documentation * there. @@ -241,7 +241,7 @@ * * BKVASIZE - Nominal buffer space per buffer, in bytes. BKVASIZE is the * minimum KVM memory reservation the kernel is willing to make. - * Filesystems can of course request smaller chunks. Actual + * Filesystems can of course request smaller chunks. Actual * backing memory uses a chunk size of a page (PAGE_SIZE). * The default value here can be overridden on a per-architecture * basis by defining it in . This should @@ -250,8 +250,8 @@ * * If you make BKVASIZE too small you risk seriously fragmenting * the buffer KVM map which may slow things down a bit. If you - * make it too big the kernel will not be able to optimally use - * the KVM memory reserved for the buffer cache and will wind + * make it too big the kernel will not be able to optimally use + * the KVM memory reserved for the buffer cache and will wind * up with too-few buffers. * * The default is 16384, roughly 2x the block size used by a @@ -344,7 +344,7 @@ __END_DECLS #define dbtoc(db) /* calculates devblks to pages */ \ ((db + (ctodb(1) - 1)) >> (PAGE_SHIFT - DEV_BSHIFT)) - + #define ctodb(db) /* calculates pages to devblks */ \ ((db) << (PAGE_SHIFT - DEV_BSHIFT)) From owner-svn-src-stable-11@freebsd.org Fri Oct 28 15:20:54 2016 Return-Path: Delivered-To: svn-src-stable-11@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 5EAF1C24F56; Fri, 28 Oct 2016 15:20:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EDE5673; Fri, 28 Oct 2016 15:20:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9SFKrdJ093090; Fri, 28 Oct 2016 15:20:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9SFKroA093089; Fri, 28 Oct 2016 15:20:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610281520.u9SFKroA093089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 28 Oct 2016 15:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308048 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 15:20:54 -0000 Author: avg Date: Fri Oct 28 15:20:53 2016 New Revision: 308048 URL: https://svnweb.freebsd.org/changeset/base/308048 Log: bump __FreeBSD_version for libzfs_core.h Direct commit. Modified: stable/11/sys/sys/param.h Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Fri Oct 28 15:20:43 2016 (r308047) +++ stable/11/sys/sys/param.h Fri Oct 28 15:20:53 2016 (r308048) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100505 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100506 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-11@freebsd.org Fri Oct 28 16:27:59 2016 Return-Path: Delivered-To: svn-src-stable-11@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 95612C24304; Fri, 28 Oct 2016 16:27:59 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3BB2BDCA; Fri, 28 Oct 2016 16:27:59 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9SGRwvN020200; Fri, 28 Oct 2016 16:27:58 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9SGRwQY020199; Fri, 28 Oct 2016 16:27:58 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201610281627.u9SGRwQY020199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Fri, 28 Oct 2016 16:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308053 - stable/11/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 16:27:59 -0000 Author: gnn Date: Fri Oct 28 16:27:58 2016 New Revision: 308053 URL: https://svnweb.freebsd.org/changeset/base/308053 Log: Corrected non-portable reuse of va_list in dt_printf() Submitted by: Graeme Jenkinson Reviewed by: markj Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Fri Oct 28 16:22:45 2016 (r308052) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Fri Oct 28 16:27:58 2016 (r308053) @@ -581,6 +581,7 @@ int dt_printf(dtrace_hdl_t *dtp, FILE *fp, const char *format, ...) { va_list ap; + va_list ap2; int n; #ifndef illumos @@ -605,11 +606,13 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c len = dtp->dt_sprintf_buflen - len; assert(len >= 0); - if ((n = vsnprintf(buf, len, format, ap)) < 0) + va_copy(ap2, ap); + if ((n = vsnprintf(buf, len, format, ap2)) < 0) n = dt_set_errno(dtp, errno); + va_end(ap2); va_end(ap); - + return (n); } @@ -640,11 +643,14 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c dtp->dt_buffered_buf[0] = '\0'; } - if ((needed = vsnprintf(NULL, 0, format, ap)) < 0) { + va_copy(ap2, ap); + if ((needed = vsnprintf(NULL, 0, format, ap2)) < 0) { rval = dt_set_errno(dtp, errno); + va_end(ap2); va_end(ap); return (rval); } + va_end(ap2); if (needed == 0) { va_end(ap); @@ -670,12 +676,15 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c dtp->dt_buffered_size <<= 1; } + va_copy(ap2, ap); if (vsnprintf(&dtp->dt_buffered_buf[dtp->dt_buffered_offs], - avail, format, ap) < 0) { + avail, format, ap2) < 0) { rval = dt_set_errno(dtp, errno); + va_end(ap2); va_end(ap); return (rval); } + va_end(ap2); dtp->dt_buffered_offs += needed; assert(dtp->dt_buffered_buf[dtp->dt_buffered_offs] == '\0'); @@ -683,8 +692,10 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c return (0); } - n = vfprintf(fp, format, ap); + va_copy(ap2, ap); + n = vfprintf(fp, format, ap2); fflush(fp); + va_end(ap2); va_end(ap); if (n < 0) { From owner-svn-src-stable-11@freebsd.org Fri Oct 28 19:45:40 2016 Return-Path: Delivered-To: svn-src-stable-11@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 5C0ABC25E88; Fri, 28 Oct 2016 19:45:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A9C31E7; Fri, 28 Oct 2016 19:45:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9SJjdVB098432; Fri, 28 Oct 2016 19:45:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9SJjdGj098430; Fri, 28 Oct 2016 19:45:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610281945.u9SJjdGj098430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 28 Oct 2016 19:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308062 - in stable/11: sys/dev/pci usr.sbin/pciconf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 19:45:40 -0000 Author: mav Date: Fri Oct 28 19:45:39 2016 New Revision: 308062 URL: https://svnweb.freebsd.org/changeset/base/308062 Log: MFC r307731: Add names for some DASP devices. Modified: stable/11/sys/dev/pci/pci.c stable/11/usr.sbin/pciconf/pciconf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/pci/pci.c ============================================================================== --- stable/11/sys/dev/pci/pci.c Fri Oct 28 18:25:32 2016 (r308061) +++ stable/11/sys/dev/pci/pci.c Fri Oct 28 19:45:39 2016 (r308062) @@ -4607,6 +4607,9 @@ static const struct {PCIC_CRYPTO, PCIS_CRYPTO_ENTERTAIN, 1, "entertainment crypto"}, {PCIC_DASP, -1, 0, "dasp"}, {PCIC_DASP, PCIS_DASP_DPIO, 1, "DPIO module"}, + {PCIC_DASP, PCIS_DASP_PERFCNTRS, 1, "performance counters"}, + {PCIC_DASP, PCIS_DASP_COMM_SYNC, 1, "communication synchronizer"}, + {PCIC_DASP, PCIS_DASP_MGMT_CARD, 1, "signal processing management"}, {0, 0, 0, NULL} }; Modified: stable/11/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/11/usr.sbin/pciconf/pciconf.c Fri Oct 28 18:25:32 2016 (r308061) +++ stable/11/usr.sbin/pciconf/pciconf.c Fri Oct 28 19:45:39 2016 (r308062) @@ -697,6 +697,9 @@ static struct {PCIC_CRYPTO, PCIS_CRYPTO_NETCOMP, "entertainment crypto"}, {PCIC_DASP, -1, "dasp"}, {PCIC_DASP, PCIS_DASP_DPIO, "DPIO module"}, + {PCIC_DASP, PCIS_DASP_PERFCNTRS, "performance counters"}, + {PCIC_DASP, PCIS_DASP_COMM_SYNC, "communication synchronizer"}, + {PCIC_DASP, PCIS_DASP_MGMT_CARD, "signal processing management"}, {0, 0, NULL} }; From owner-svn-src-stable-11@freebsd.org Sat Oct 29 08:40:48 2016 Return-Path: Delivered-To: svn-src-stable-11@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 95744C25D1F; Sat, 29 Oct 2016 08:40:48 +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 4BF14EA; Sat, 29 Oct 2016 08:40:48 +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 u9T8elbS093360; Sat, 29 Oct 2016 08:40:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9T8elBr093359; Sat, 29 Oct 2016 08:40:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610290840.u9T8elBr093359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Oct 2016 08:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308074 - stable/11/sys/cam/ata X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2016 08:40:48 -0000 Author: mav Date: Sat Oct 29 08:40:47 2016 New Revision: 308074 URL: https://svnweb.freebsd.org/changeset/base/308074 Log: MFC r304918: Decode some new ATA commands found in ACS-3. Modified: stable/11/sys/cam/ata/ata_all.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_all.c ============================================================================== --- stable/11/sys/cam/ata/ata_all.c Sat Oct 29 01:24:30 2016 (r308073) +++ stable/11/sys/cam/ata/ata_all.c Sat Oct 29 08:40:47 2016 (r308074) @@ -88,6 +88,7 @@ ata_op_string(struct ata_cmd *cmd) } return "DSM"; case 0x08: return ("DEVICE_RESET"); + case 0x0b: return ("REQUEST_SENSE_DATA_EXT"); case 0x20: return ("READ"); case 0x24: return ("READ48"); case 0x25: return ("READ_DMA48"); @@ -120,6 +121,12 @@ ata_op_string(struct ata_cmd *cmd) case 0x47: return ("READ_LOG_DMA_EXT"); case 0x4a: return ("ZAC_MANAGEMENT_IN"); case 0x51: return ("CONFIGURE_STREAM"); + case 0x57: return ("WRITE_LOG_DMA_EXT"); + case 0x5b: return ("TRUSTED_NON_DATA"); + case 0x5c: return ("TRUSTED_RECEIVE"); + case 0x5d: return ("TRUSTED_RECEIVE_DMA"); + case 0x5e: return ("TRUSTED_SEND"); + case 0x5f: return ("TRUSTED_SEND_DMA"); case 0x60: return ("READ_FPDMA_QUEUED"); case 0x61: return ("WRITE_FPDMA_QUEUED"); case 0x63: @@ -160,9 +167,12 @@ ata_op_string(struct ata_cmd *cmd) } return ("SEP_ATTN"); case 0x70: return ("SEEK"); + case 0x77: return ("SET_DATE_TIME_EXT"); + case 0x78: return ("ACCESSIBLE_MAX_ADDRESS_CONFIGURATION"); case 0x87: return ("CFA_TRANSLATE_SECTOR"); case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC"); case 0x92: return ("DOWNLOAD_MICROCODE"); + case 0x93: return ("DOWNLOAD_MICROCODE_DMA"); case 0x9a: return ("ZAC_MANAGEMENT_OUT"); case 0xa0: return ("PACKET"); case 0xa1: return ("ATAPI_IDENTIFY"); @@ -180,6 +190,7 @@ ata_op_string(struct ata_cmd *cmd) } return ("SMART"); case 0xb1: return ("DEVICE CONFIGURATION"); + case 0xb4: return ("SANITIZE_DEVICE"); case 0xc0: return ("CFA_ERASE"); case 0xc4: return ("READ_MUL"); case 0xc5: return ("WRITE_MUL"); From owner-svn-src-stable-11@freebsd.org Sat Oct 29 08:43:36 2016 Return-Path: Delivered-To: svn-src-stable-11@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 6D2A7C240A5; Sat, 29 Oct 2016 08:43:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 466217D8; Sat, 29 Oct 2016 08:43:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9T8hZSP096870; Sat, 29 Oct 2016 08:43:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9T8hZ5m096866; Sat, 29 Oct 2016 08:43:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610290843.u9T8hZ5m096866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Oct 2016 08:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308076 - in stable/11: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2016 08:43:36 -0000 Author: mav Date: Sat Oct 29 08:43:34 2016 New Revision: 308076 URL: https://svnweb.freebsd.org/changeset/base/308076 Log: MFC r307350: Add LUN options to limit UNMAP and WRITE SAME sizes. CTL itself has no limits on on UNMAP and WRITE SAME sizes. But depending on backends large requests may take too much time. To avoid that new configuration options allow to hint initiator maximal sizes it should not exceed. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl.h stable/11/sys/cam/ctl/ctl_backend.c stable/11/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Oct 29 08:42:43 2016 (r308075) +++ stable/11/sys/cam/ctl/ctl.c Sat Oct 29 08:43:34 2016 (r308076) @@ -9903,6 +9903,7 @@ ctl_inquiry_evpd_block_limits(struct ctl { struct scsi_vpd_block_limits *bl_ptr; struct ctl_lun *lun; + uint64_t ival; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -9941,8 +9942,14 @@ ctl_inquiry_evpd_block_limits(struct ctl if (lun != NULL) { scsi_ulto4b(lun->be_lun->opttxferlen, bl_ptr->opt_txfer_len); if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { - scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); - scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_blk_cnt); + ival = 0xffffffff; + ctl_get_opt_number(&lun->be_lun->options, + "unmap_max_lba", &ival); + scsi_ulto4b(ival, bl_ptr->max_unmap_lba_cnt); + ival = 0xffffffff; + ctl_get_opt_number(&lun->be_lun->options, + "unmap_max_descr", &ival); + scsi_ulto4b(ival, bl_ptr->max_unmap_blk_cnt); if (lun->be_lun->ublockexp != 0) { scsi_ulto4b((1 << lun->be_lun->ublockexp), bl_ptr->opt_unmap_grain); @@ -9956,8 +9963,10 @@ ctl_inquiry_evpd_block_limits(struct ctl scsi_ulto4b(0, bl_ptr->atomic_transfer_length_granularity); scsi_ulto4b(0, bl_ptr->max_atomic_transfer_length_with_atomic_boundary); scsi_ulto4b(0, bl_ptr->max_atomic_boundary_size); + ival = UINT64_MAX; + ctl_get_opt_number(&lun->be_lun->options, "write_same_max_lba", &ival); + scsi_u64to8b(ival, bl_ptr->max_write_same_length); } - scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length); ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; Modified: stable/11/sys/cam/ctl/ctl.h ============================================================================== --- stable/11/sys/cam/ctl/ctl.h Sat Oct 29 08:42:43 2016 (r308075) +++ stable/11/sys/cam/ctl/ctl.h Sat Oct 29 08:43:34 2016 (r308076) @@ -217,6 +217,7 @@ void ctl_update_opts(ctl_options_t *opts struct ctl_be_arg *args); void ctl_free_opts(ctl_options_t *opts); char * ctl_get_opt(ctl_options_t *opts, const char *name); +int ctl_get_opt_number(ctl_options_t *opts, const char *name, uint64_t *num); int ctl_expand_number(const char *buf, uint64_t *num); #endif /* _KERNEL */ Modified: stable/11/sys/cam/ctl/ctl_backend.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend.c Sat Oct 29 08:42:43 2016 (r308075) +++ stable/11/sys/cam/ctl/ctl_backend.c Sat Oct 29 08:43:34 2016 (r308076) @@ -243,3 +243,14 @@ ctl_get_opt(ctl_options_t *opts, const c } return (NULL); } + +int +ctl_get_opt_number(ctl_options_t *opts, const char *name, uint64_t *val) +{ + const char *value; + + value = ctl_get_opt(opts, name); + if (value == NULL) + return (-2); + return (ctl_expand_number(value, val)); +} Modified: stable/11/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/11/usr.sbin/ctladm/ctladm.8 Sat Oct 29 08:42:43 2016 (r308075) +++ stable/11/usr.sbin/ctladm/ctladm.8 Sat Oct 29 08:43:34 2016 (r308076) @@ -35,7 +35,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd September 26, 2015 +.Dd October 15, 2016 .Dt CTLADM 8 .Os .Sh NAME @@ -905,6 +905,13 @@ Specifies nominal form factor of the dev 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". .It Va unmap Set to "on", enables UNMAP support for the LUN, if supported by the backend. +.It Va unmap_max_lba +.It Va unmap_max_descr +Specify maximum allowed number of LBAs and block descriptors per UNMAP +command to report in Block Limits VPD page. +.It Va write_same_max_lba +Specify maximum allowed number of LBAs per WRITE SAME command to report +in Block Limits VPD page. .It Va avail-threshold .It Va used-threshold .It Va pool-avail-threshold From owner-svn-src-stable-11@freebsd.org Sat Oct 29 08:44:11 2016 Return-Path: Delivered-To: svn-src-stable-11@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 68B64C2417C; Sat, 29 Oct 2016 08:44:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1F0A06; Sat, 29 Oct 2016 08:44:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9T8iAFr097142; Sat, 29 Oct 2016 08:44:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9T8iAIk097140; Sat, 29 Oct 2016 08:44:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610290844.u9T8iAIk097140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Oct 2016 08:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308077 - in stable/11: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2016 08:44:11 -0000 Author: mav Date: Sat Oct 29 08:44:09 2016 New Revision: 308077 URL: https://svnweb.freebsd.org/changeset/base/308077 Log: MFC r307374: Add LU option to control reported provisioning type. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Oct 29 08:43:34 2016 (r308076) +++ stable/11/sys/cam/ctl/ctl.c Sat Oct 29 08:44:09 2016 (r308077) @@ -10040,6 +10040,7 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * { struct scsi_vpd_logical_block_prov *lbp_ptr; struct ctl_lun *lun; + const char *value; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -10077,7 +10078,14 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10 | SVPD_LBP_RZ | SVPD_LBP_ANC_SUP; - lbp_ptr->prov_type = SVPD_LBP_THIN; + value = ctl_get_opt(&lun->be_lun->options, "provisioning_type"); + if (value != NULL) { + if (strcmp(value, "resource") == 0) + lbp_ptr->prov_type = SVPD_LBP_RESOURCE; + else if (strcmp(value, "thin") == 0) + lbp_ptr->prov_type = SVPD_LBP_THIN; + } else + lbp_ptr->prov_type = SVPD_LBP_THIN; } ctl_set_success(ctsio); Modified: stable/11/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/11/usr.sbin/ctladm/ctladm.8 Sat Oct 29 08:43:34 2016 (r308076) +++ stable/11/usr.sbin/ctladm/ctladm.8 Sat Oct 29 08:44:09 2016 (r308077) @@ -903,8 +903,14 @@ Specifies medium rotation rate of the de .It Va formfactor Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25", 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". +.It Va provisioning_type +When UNMAP support is enabled, this option specifies provisioning type: +"resource", "thin" or "unknown". +Default value is "thin". +Logical units without UNMAP support are reported as fully provisioned. .It Va unmap -Set to "on", enables UNMAP support for the LUN, if supported by the backend. +Setting to "on" or "off" controls UNMAP support for the logical unit. +Default value is "on" if supported by the backend. .It Va unmap_max_lba .It Va unmap_max_descr Specify maximum allowed number of LBAs and block descriptors per UNMAP From owner-svn-src-stable-11@freebsd.org Sat Oct 29 08:47:24 2016 Return-Path: Delivered-To: svn-src-stable-11@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 A8F32C244AE; Sat, 29 Oct 2016 08:47:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77E07F1C; Sat, 29 Oct 2016 08:47:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9T8lNnc097431; Sat, 29 Oct 2016 08:47:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9T8lNGI097429; Sat, 29 Oct 2016 08:47:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610290847.u9T8lNGI097429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Oct 2016 08:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308080 - in stable/11/sys/cam: ata scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2016 08:47:24 -0000 Author: mav Date: Sat Oct 29 08:47:23 2016 New Revision: 308080 URL: https://svnweb.freebsd.org/changeset/base/308080 Log: MFC r307507, r307509, r307515: Consider device as clean even if SYNCHRONIZE CACHE failed. If device reservation was preempted by other initiator, our sync request will always fail. Without this change CAM tried to sync cache on every following device close, including numerous GEOM tasting opens/closes, causing lots of useless noise in logs. Modified: stable/11/sys/cam/ata/ata_da.c stable/11/sys/cam/scsi/scsi_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Sat Oct 29 08:45:39 2016 (r308079) +++ stable/11/sys/cam/ata/ata_da.c Sat Oct 29 08:47:23 2016 (r308080) @@ -926,8 +926,7 @@ adaclose(struct disk *dp) if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); - else - softc->flags &= ~ADA_FLAG_DIRTY; + softc->flags &= ~ADA_FLAG_DIRTY; xpt_release_ccb(ccb); cam_periph_unhold(periph); } Modified: stable/11/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_da.c Sat Oct 29 08:45:39 2016 (r308079) +++ stable/11/sys/cam/scsi/scsi_da.c Sat Oct 29 08:47:23 2016 (r308080) @@ -1492,8 +1492,7 @@ daclose(struct disk *dp) error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); - if (error == 0) - softc->flags &= ~DA_FLAG_DIRTY; + softc->flags &= ~DA_FLAG_DIRTY; xpt_release_ccb(ccb); } From owner-svn-src-stable-11@freebsd.org Sat Oct 29 08:53:40 2016 Return-Path: Delivered-To: svn-src-stable-11@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 63A02C24831; Sat, 29 Oct 2016 08:53:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32A3E8B6; Sat, 29 Oct 2016 08:53:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9T8rdcU001288; Sat, 29 Oct 2016 08:53:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9T8rcH0001279; Sat, 29 Oct 2016 08:53:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610290853.u9T8rcH0001279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Oct 2016 08:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308082 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2016 08:53:40 -0000 Author: mav Date: Sat Oct 29 08:53:38 2016 New Revision: 308082 URL: https://svnweb.freebsd.org/changeset/base/308082 Log: MFC r306424: MFV r306422: 7254 ztest failed assertion in ztest_dataset_dirobj_verify: dirobjs + 1 == usedobjs dsl_dataset_space is looking at the ds_bp's fill count while dmu_objset_write_ready() is concurrently modifying it. This fix adds an rrwlock to protect the ds_bp. Closes #180 Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Reviewed by: Steve Gonczi Author: Paul Dagnelie Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Oct 29 08:48:01 2016 (r308081) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Oct 29 08:53:38 2016 (r308082) @@ -1489,10 +1489,18 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t * objects may be dirtied in syncing context, but only if they * were already pre-dirtied in open context. */ +#ifdef DEBUG + if (dn->dn_objset->os_dsl_dataset != NULL) { + rrw_enter(&dn->dn_objset->os_dsl_dataset->ds_bp_rwlock, + RW_READER, FTAG); + } ASSERT(!dmu_tx_is_syncing(tx) || BP_IS_HOLE(dn->dn_objset->os_rootbp) || DMU_OBJECT_IS_SPECIAL(dn->dn_object) || dn->dn_objset->os_dsl_dataset == NULL); + if (dn->dn_objset->os_dsl_dataset != NULL) + rrw_exit(&dn->dn_objset->os_dsl_dataset->ds_bp_rwlock, FTAG); +#endif /* * We make this assert for private objects as well, but after we * check if we're already dirty. They are allowed to re-dirty @@ -1517,12 +1525,21 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t * Don't set dirtyctx to SYNC if we're just modifying this as we * initialize the objset. */ - if (dn->dn_dirtyctx == DN_UNDIRTIED && - !BP_IS_HOLE(dn->dn_objset->os_rootbp)) { - dn->dn_dirtyctx = - (dmu_tx_is_syncing(tx) ? DN_DIRTY_SYNC : DN_DIRTY_OPEN); - ASSERT(dn->dn_dirtyctx_firstset == NULL); - dn->dn_dirtyctx_firstset = kmem_alloc(1, KM_SLEEP); + if (dn->dn_dirtyctx == DN_UNDIRTIED) { + if (dn->dn_objset->os_dsl_dataset != NULL) { + rrw_enter(&dn->dn_objset->os_dsl_dataset->ds_bp_rwlock, + RW_READER, FTAG); + } + if (!BP_IS_HOLE(dn->dn_objset->os_rootbp)) { + dn->dn_dirtyctx = (dmu_tx_is_syncing(tx) ? + DN_DIRTY_SYNC : DN_DIRTY_OPEN); + ASSERT(dn->dn_dirtyctx_firstset == NULL); + dn->dn_dirtyctx_firstset = kmem_alloc(1, KM_SLEEP); + } + if (dn->dn_objset->os_dsl_dataset != NULL) { + rrw_exit(&dn->dn_objset->os_dsl_dataset->ds_bp_rwlock, + FTAG); + } } mutex_exit(&dn->dn_mtx); @@ -1567,8 +1584,14 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t * this assertion only if we're not already dirty. */ os = dn->dn_objset; +#ifdef DEBUG + if (dn->dn_objset->os_dsl_dataset != NULL) + rrw_enter(&os->os_dsl_dataset->ds_bp_rwlock, RW_READER, FTAG); ASSERT(!dmu_tx_is_syncing(tx) || DMU_OBJECT_IS_SPECIAL(dn->dn_object) || os->os_dsl_dataset == NULL || BP_IS_HOLE(os->os_rootbp)); + if (dn->dn_objset->os_dsl_dataset != NULL) + rrw_exit(&os->os_dsl_dataset->ds_bp_rwlock, FTAG); +#endif ASSERT(db->db.db_size != 0); dprintf_dbuf(db, "size=%llx\n", (u_longlong_t)db->db.db_size); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Sat Oct 29 08:48:01 2016 (r308081) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Sat Oct 29 08:53:38 2016 (r308082) @@ -489,8 +489,10 @@ dmu_objset_from_ds(dsl_dataset_t *ds, ob mutex_enter(&ds->ds_opening_lock); if (ds->ds_objset == NULL) { objset_t *os; + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); err = dmu_objset_open_impl(dsl_dataset_get_spa(ds), ds, dsl_dataset_get_blkptr(ds), &os); + rrw_exit(&ds->ds_bp_rwlock, FTAG); if (err == 0) { mutex_enter(&ds->ds_lock); @@ -876,9 +878,11 @@ dmu_objset_create_sync(void *arg, dmu_tx doca->doca_cred, tx); VERIFY0(dsl_dataset_hold_obj(pdd->dd_pool, obj, FTAG, &ds)); + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); bp = dsl_dataset_get_blkptr(ds); os = dmu_objset_create_impl(pdd->dd_pool->dp_spa, ds, bp, doca->doca_type, tx); + rrw_exit(&ds->ds_bp_rwlock, FTAG); if (doca->doca_userfunc != NULL) { doca->doca_userfunc(os, doca->doca_userarg, @@ -1051,7 +1055,6 @@ dmu_objset_write_ready(zio_t *zio, arc_b dnode_phys_t *dnp = &os->os_phys->os_meta_dnode; ASSERT(!BP_IS_EMBEDDED(bp)); - ASSERT3P(bp, ==, os->os_rootbp); ASSERT3U(BP_GET_TYPE(bp), ==, DMU_OT_OBJSET); ASSERT0(BP_GET_LEVEL(bp)); @@ -1064,6 +1067,11 @@ dmu_objset_write_ready(zio_t *zio, arc_b bp->blk_fill = 0; for (int i = 0; i < dnp->dn_nblkptr; i++) bp->blk_fill += BP_GET_FILL(&dnp->dn_blkptr[i]); + if (os->os_dsl_dataset != NULL) + rrw_enter(&os->os_dsl_dataset->ds_bp_rwlock, RW_WRITER, FTAG); + *os->os_rootbp = *bp; + if (os->os_dsl_dataset != NULL) + rrw_exit(&os->os_dsl_dataset->ds_bp_rwlock, FTAG); } /* ARGSUSED */ @@ -1083,6 +1091,7 @@ dmu_objset_write_done(zio_t *zio, arc_bu (void) dsl_dataset_block_kill(ds, bp_orig, tx, B_TRUE); dsl_dataset_block_born(ds, bp, tx); } + kmem_free(bp, sizeof (*bp)); } /* called from dsl */ @@ -1096,6 +1105,8 @@ dmu_objset_sync(objset_t *os, zio_t *pio list_t *list; list_t *newlist = NULL; dbuf_dirty_record_t *dr; + blkptr_t *blkptr_copy = kmem_alloc(sizeof (*os->os_rootbp), KM_SLEEP); + *blkptr_copy = *os->os_rootbp; dprintf_ds(os->os_dsl_dataset, "txg=%llu\n", tx->tx_txg); @@ -1123,7 +1134,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio dmu_write_policy(os, NULL, 0, 0, &zp); zio = arc_write(pio, os->os_spa, tx->tx_txg, - os->os_rootbp, os->os_phys_buf, DMU_OS_IS_L2CACHEABLE(os), + blkptr_copy, os->os_phys_buf, DMU_OS_IS_L2CACHEABLE(os), &zp, dmu_objset_write_ready, NULL, NULL, dmu_objset_write_done, os, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Oct 29 08:48:01 2016 (r308081) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Oct 29 08:53:38 2016 (r308082) @@ -1510,10 +1510,12 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t * If we actually created a non-clone, we need to create the * objset in our new dataset. */ + rrw_enter(&newds->ds_bp_rwlock, RW_READER, FTAG); if (BP_IS_HOLE(dsl_dataset_get_blkptr(newds))) { (void) dmu_objset_create_impl(dp->dp_spa, newds, dsl_dataset_get_blkptr(newds), drrb->drr_type, tx); } + rrw_exit(&newds->ds_bp_rwlock, FTAG); drba->drba_cookie->drc_ds = newds; @@ -1656,7 +1658,9 @@ dmu_recv_resume_begin_sync(void *arg, dm dmu_buf_will_dirty(ds->ds_dbuf, tx); dsl_dataset_phys(ds)->ds_flags |= DS_FLAG_INCONSISTENT; + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); ASSERT(!BP_IS_HOLE(dsl_dataset_get_blkptr(ds))); + rrw_exit(&ds->ds_bp_rwlock, FTAG); drba->drba_cookie->drc_ds = ds; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Oct 29 08:48:01 2016 (r308081) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Oct 29 08:53:38 2016 (r308082) @@ -312,6 +312,7 @@ dsl_dataset_evict(void *dbu) mutex_destroy(&ds->ds_opening_lock); mutex_destroy(&ds->ds_sendstream_lock); refcount_destroy(&ds->ds_longholds); + rrw_destroy(&ds->ds_bp_rwlock); kmem_free(ds, sizeof (dsl_dataset_t)); } @@ -441,6 +442,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin mutex_init(&ds->ds_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_opening_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_sendstream_lock, NULL, MUTEX_DEFAULT, NULL); + rrw_init(&ds->ds_bp_rwlock, B_FALSE); refcount_create(&ds->ds_longholds); bplist_create(&ds->ds_pending_deadlist); @@ -831,7 +833,9 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dsl_dataset_phys(origin)->ds_compressed_bytes; dsphys->ds_uncompressed_bytes = dsl_dataset_phys(origin)->ds_uncompressed_bytes; + rrw_enter(&origin->ds_bp_rwlock, RW_READER, FTAG); dsphys->ds_bp = dsl_dataset_phys(origin)->ds_bp; + rrw_exit(&origin->ds_bp_rwlock, FTAG); /* * Inherit flags that describe the dataset's contents @@ -1389,7 +1393,9 @@ dsl_dataset_snapshot_sync_impl(dsl_datas dsphys->ds_uncompressed_bytes = dsl_dataset_phys(ds)->ds_uncompressed_bytes; dsphys->ds_flags = dsl_dataset_phys(ds)->ds_flags; + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); dsphys->ds_bp = dsl_dataset_phys(ds)->ds_bp; + rrw_exit(&ds->ds_bp_rwlock, FTAG); dmu_buf_rele(dbuf, FTAG); for (spa_feature_t f = 0; f < SPA_FEATURES; f++) { @@ -1981,7 +1987,9 @@ dsl_dataset_space(dsl_dataset_t *ds, else *availbytesp = 0; } + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); *usedobjsp = BP_GET_FILL(&dsl_dataset_phys(ds)->ds_bp); + rrw_exit(&ds->ds_bp_rwlock, FTAG); *availobjsp = DN_MAX_OBJECT - *usedobjsp; } @@ -1989,12 +1997,15 @@ boolean_t dsl_dataset_modified_since_snap(dsl_dataset_t *ds, dsl_dataset_t *snap) { dsl_pool_t *dp = ds->ds_dir->dd_pool; + uint64_t birth; ASSERT(dsl_pool_config_held(dp)); if (snap == NULL) return (B_FALSE); - if (dsl_dataset_phys(ds)->ds_bp.blk_birth > - dsl_dataset_phys(snap)->ds_creation_txg) { + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); + birth = dsl_dataset_get_blkptr(ds)->blk_birth; + rrw_exit(&ds->ds_bp_rwlock, FTAG); + if (birth > dsl_dataset_phys(snap)->ds_creation_txg) { objset_t *os, *os_snap; /* * It may be that only the ZIL differs, because it was @@ -3058,11 +3069,15 @@ dsl_dataset_clone_swap_sync_impl(dsl_dat /* swap blkptrs */ { + rrw_enter(&clone->ds_bp_rwlock, RW_WRITER, FTAG); + rrw_enter(&origin_head->ds_bp_rwlock, RW_WRITER, FTAG); blkptr_t tmp; tmp = dsl_dataset_phys(origin_head)->ds_bp; dsl_dataset_phys(origin_head)->ds_bp = dsl_dataset_phys(clone)->ds_bp; dsl_dataset_phys(clone)->ds_bp = tmp; + rrw_exit(&origin_head->ds_bp_rwlock, FTAG); + rrw_exit(&clone->ds_bp_rwlock, FTAG); } /* set dd_*_bytes */ Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Sat Oct 29 08:48:01 2016 (r308081) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Sat Oct 29 08:53:38 2016 (r308082) @@ -246,7 +246,9 @@ dsl_destroy_snapshot_sync_impl(dsl_datas uint64_t obj; ASSERT(RRW_WRITE_HELD(&dp->dp_config_rwlock)); + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); ASSERT3U(dsl_dataset_phys(ds)->ds_bp.blk_birth, <=, tx->tx_txg); + rrw_exit(&ds->ds_bp_rwlock, FTAG); ASSERT(refcount_is_zero(&ds->ds_longholds)); if (defer && @@ -720,7 +722,9 @@ dsl_destroy_head_sync_impl(dsl_dataset_t ASSERT3U(dsl_dataset_phys(ds)->ds_num_children, <=, 1); ASSERT(ds->ds_prev == NULL || dsl_dataset_phys(ds->ds_prev)->ds_next_snap_obj != ds->ds_object); + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); ASSERT3U(dsl_dataset_phys(ds)->ds_bp.blk_birth, <=, tx->tx_txg); + rrw_exit(&ds->ds_bp_rwlock, FTAG); ASSERT(RRW_WRITE_HELD(&dp->dp_config_rwlock)); /* We need to log before removing it from the namespace. */ @@ -812,10 +816,12 @@ dsl_destroy_head_sync_impl(dsl_dataset_t ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) || dsl_dataset_phys(ds)->ds_unique_bytes == used); + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); bptree_add(mos, dp->dp_bptree_obj, &dsl_dataset_phys(ds)->ds_bp, dsl_dataset_phys(ds)->ds_prev_snap_txg, used, comp, uncomp, tx); + rrw_exit(&ds->ds_bp_rwlock, FTAG); dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, -used, -comp, -uncomp, tx); dsl_dir_diduse_space(dp->dp_free_dir, DD_USED_HEAD, Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Oct 29 08:48:01 2016 (r308081) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Oct 29 08:53:38 2016 (r308082) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -493,8 +493,10 @@ dsl_pool_create(spa_t *spa, nvlist_t *zp /* create the root objset */ VERIFY0(dsl_dataset_hold_obj(dp, obj, FTAG, &ds)); + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); os = dmu_objset_create_impl(dp->dp_spa, ds, dsl_dataset_get_blkptr(ds), DMU_OST_ZFS, tx); + rrw_exit(&ds->ds_bp_rwlock, FTAG); #ifdef _KERNEL zfs_create_fs(os, kcred, zplprops, tx); #endif @@ -807,7 +809,9 @@ upgrade_clones_cb(dsl_pool_t *dp, dsl_da * The $ORIGIN can't have any data, or the accounting * will be wrong. */ + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); ASSERT0(dsl_dataset_phys(prev)->ds_bp.blk_birth); + rrw_exit(&ds->ds_bp_rwlock, FTAG); /* The origin doesn't get attached to itself */ if (ds->ds_object == prev->ds_object) { Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sat Oct 29 08:48:01 2016 (r308081) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sat Oct 29 08:53:38 2016 (r308082) @@ -1113,7 +1113,9 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64 * Iterate over the bps in this ds. */ dmu_buf_will_dirty(ds->ds_dbuf, tx); + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); dsl_scan_visit_rootbp(scn, ds, &dsl_dataset_phys(ds)->ds_bp, tx); + rrw_exit(&ds->ds_bp_rwlock, FTAG); char *dsname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); dsl_dataset_name(ds, dsname); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Sat Oct 29 08:48:01 2016 (r308081) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Sat Oct 29 08:53:38 2016 (r308082) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -101,9 +101,14 @@ struct objset { zfs_redundant_metadata_type_t os_redundant_metadata; int os_recordsize; + /* + * Pointer is constant; the blkptr it points to is protected by + * os_dsl_dataset->ds_bp_rwlock + */ + blkptr_t *os_rootbp; + /* no lock needed: */ struct dmu_tx *os_synctx; /* XXX sketchy */ - blkptr_t *os_rootbp; zil_header_t os_zil_header; list_t os_synced_dnodes; uint64_t os_flags; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Sat Oct 29 08:48:01 2016 (r308081) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Sat Oct 29 08:53:38 2016 (r308082) @@ -39,6 +39,7 @@ #include #include #include +#include #include #ifdef __cplusplus @@ -141,6 +142,7 @@ typedef struct dsl_dataset_phys { typedef struct dsl_dataset { dmu_buf_user_t ds_dbu; + rrwlock_t ds_bp_rwlock; /* Protects ds_phys->ds_bp */ /* Immutable: */ struct dsl_dir *ds_dir; From owner-svn-src-stable-11@freebsd.org Sat Oct 29 08:55:15 2016 Return-Path: Delivered-To: svn-src-stable-11@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 0F3F0C24934; Sat, 29 Oct 2016 08:55:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAC60B8D; Sat, 29 Oct 2016 08:55:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9T8tDcT001495; Sat, 29 Oct 2016 08:55:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9T8tDIW001494; Sat, 29 Oct 2016 08:55:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610290855.u9T8tDIW001494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Oct 2016 08:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308084 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2016 08:55:15 -0000 Author: mav Date: Sat Oct 29 08:55:13 2016 New Revision: 308084 URL: https://svnweb.freebsd.org/changeset/base/308084 Log: MFC r306425: MFV r306423: 7402 Create tunable to ignore hole_birth feature Until we can resolve the numerous hole_birth bugs that have cropped up recently, and come up with a way going forwards to protect users from corruption, we should disable the hole_birth feature. Using a tunable allows those who are confident that their data is correct to continue to take advantage of the feature. Closes #188 Reviewed by: Matthew Ahrens Author: Paul Dagnelie Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Sat Oct 29 08:54:18 2016 (r308083) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Sat Oct 29 08:55:13 2016 (r308084) @@ -40,6 +40,11 @@ #include int32_t zfs_pd_bytes_max = 50 * 1024 * 1024; /* 50MB */ +boolean_t send_holes_without_birth_time = B_TRUE; + +SYSCTL_DECL(_vfs_zfs); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, send_holes_without_birth_time, CTLFLAG_RWTUN, + &send_holes_without_birth_time, 0, "Send holes without birth time"); typedef struct prefetch_data { kmutex_t pd_mtx; @@ -254,7 +259,8 @@ traverse_visitbp(traverse_data_t *td, co * * Note that the meta-dnode cannot be reallocated. */ - if ((!td->td_realloc_possible || + if (!send_holes_without_birth_time && + (!td->td_realloc_possible || zb->zb_object == DMU_META_DNODE_OBJECT) && td->td_hole_birth_enabled_txg <= td->td_min_txg) return (0); From owner-svn-src-stable-11@freebsd.org Sat Oct 29 08:55:57 2016 Return-Path: Delivered-To: svn-src-stable-11@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 6B5E2C249C9; Sat, 29 Oct 2016 08:55:57 +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 3B09CCEE; Sat, 29 Oct 2016 08:55:57 +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 u9T8tuIH001574; Sat, 29 Oct 2016 08:55:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9T8turC001573; Sat, 29 Oct 2016 08:55:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610290855.u9T8turC001573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Oct 2016 08:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308085 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2016 08:55:57 -0000 Author: mav Date: Sat Oct 29 08:55:56 2016 New Revision: 308085 URL: https://svnweb.freebsd.org/changeset/base/308085 Log: MFC r306456: Add #ifdef _KERNEL around send_holes_without_birth_time sysctl. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Sat Oct 29 08:55:13 2016 (r308084) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Sat Oct 29 08:55:56 2016 (r308085) @@ -42,9 +42,11 @@ int32_t zfs_pd_bytes_max = 50 * 1024 * 1024; /* 50MB */ boolean_t send_holes_without_birth_time = B_TRUE; +#ifdef _KERNEL SYSCTL_DECL(_vfs_zfs); SYSCTL_UINT(_vfs_zfs, OID_AUTO, send_holes_without_birth_time, CTLFLAG_RWTUN, &send_holes_without_birth_time, 0, "Send holes without birth time"); +#endif typedef struct prefetch_data { kmutex_t pd_mtx; From owner-svn-src-stable-11@freebsd.org Sat Oct 29 14:41:24 2016 Return-Path: Delivered-To: svn-src-stable-11@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 C2F68C26B4D; Sat, 29 Oct 2016 14:41:24 +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 8DD08397; Sat, 29 Oct 2016 14:41:24 +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 u9TEfNER034109; Sat, 29 Oct 2016 14:41:23 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9TEfNg6034102; Sat, 29 Oct 2016 14:41:23 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201610291441.u9TEfNg6034102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sat, 29 Oct 2016 14:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308090 - in stable/11: include lib/libc/stdlib lib/libc/tests/stdlib X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2016 14:41:24 -0000 Author: ed Date: Sat Oct 29 14:41:22 2016 New Revision: 308090 URL: https://svnweb.freebsd.org/changeset/base/308090 Log: MFC r307227 and r307343: Improve typing of POSIX search tree functions. Back in 2015 when I reimplemented these functions to use an AVL tree, I was annoyed by the weakness of the typing of these functions. Both tree nodes and keys are represented by 'void *', meaning that things like the documentation for these functions are an absolute train wreck. To make things worse, users of these functions need to cast the return value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to access the key. Technically speaking such casts violate aliasing rules. I've observed actual breakages as a result of this by enabling features like LTO. I've filed a bug report at the Austin Group. Looking at the way the bug got resolved, they made a pretty good step in the right direction. A new type 'posix_tnode' has been added to correspond to tree nodes. It is still defined as 'void' for source-level compatibility, but in the very far future it could be replaced by a proper structure type containing a key pointer. Modified: stable/11/include/search.h stable/11/lib/libc/stdlib/tdelete.c stable/11/lib/libc/stdlib/tfind.c stable/11/lib/libc/stdlib/tsearch.3 stable/11/lib/libc/stdlib/tsearch.c stable/11/lib/libc/stdlib/twalk.c stable/11/lib/libc/tests/stdlib/tsearch_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/include/search.h ============================================================================== --- stable/11/include/search.h Sat Oct 29 14:09:32 2016 (r308089) +++ stable/11/include/search.h Sat Oct 29 14:41:22 2016 (r308090) @@ -34,16 +34,18 @@ typedef enum { } VISIT; #ifdef _SEARCH_PRIVATE -typedef struct node { - void *key; - struct node *llink, *rlink; - signed char balance; -} node_t; +typedef struct __posix_tnode { + void *key; + struct __posix_tnode *llink, *rlink; + signed char balance; +} posix_tnode; struct que_elem { struct que_elem *next; struct que_elem *prev; }; +#else +typedef void posix_tnode; #endif #if __BSD_VISIBLE @@ -62,12 +64,15 @@ void *lfind(const void *, const void *, void *lsearch(const void *, void *, size_t *, size_t, int (*)(const void *, const void *)); void remque(void *); -void *tdelete(const void * __restrict, void ** __restrict, +void *tdelete(const void * __restrict, posix_tnode ** __restrict, int (*)(const void *, const void *)); -void *tfind(const void *, void * const *, +posix_tnode * + tfind(const void *, posix_tnode * const *, int (*)(const void *, const void *)); -void *tsearch(const void *, void **, int (*)(const void *, const void *)); -void twalk(const void *, void (*)(const void *, VISIT, int)); +posix_tnode * + tsearch(const void *, posix_tnode **, + int (*)(const void *, const void *)); +void twalk(const posix_tnode *, void (*)(const posix_tnode *, VISIT, int)); #if __BSD_VISIBLE int hcreate_r(size_t, struct hsearch_data *); Modified: stable/11/lib/libc/stdlib/tdelete.c ============================================================================== --- stable/11/lib/libc/stdlib/tdelete.c Sat Oct 29 14:09:32 2016 (r308089) +++ stable/11/lib/libc/stdlib/tdelete.c Sat Oct 29 14:41:22 2016 (r308090) @@ -46,9 +46,9 @@ __FBSDID("$FreeBSD$"); * that we won't need to perform any rotations above \ * this point. In this case rotations are always \ * capable of keeping the subtree in balance. Make \ - * this the base node and reset the path. \ + * this the root node and reset the path. \ */ \ - base = leaf; \ + rootp = leaf; \ path_init(&path); \ } \ path_taking_left(&path); \ @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #define GO_RIGHT() do { \ if ((*leaf)->balance == 0 || \ ((*leaf)->balance > 0 && (*leaf)->llink->balance == 0)) { \ - base = leaf; \ + rootp = leaf; \ path_init(&path); \ } \ path_taking_right(&path); \ @@ -67,18 +67,16 @@ __FBSDID("$FreeBSD$"); } while (0) void * -tdelete(const void *restrict key, void **restrict rootp, +tdelete(const void *restrict key, posix_tnode **restrict rootp, int (*compar)(const void *, const void *)) { struct path path; - node_t *root, **base, **leaf, *old, **n, *x, *y, *z; - void *result; + posix_tnode **leaf, *old, **n, *x, *y, *z, *result; int cmp; /* POSIX requires that tdelete() returns NULL if rootp is NULL. */ if (rootp == NULL) return (NULL); - root = *rootp; /* * Find the leaf that needs to be removed. Return if we cannot @@ -86,19 +84,18 @@ tdelete(const void *restrict key, void * * to get to the node, as we will need it to adjust the * balances. */ - result = (void *)1; + result = (posix_tnode *)1; path_init(&path); - base = &root; - leaf = &root; + leaf = rootp; for (;;) { if (*leaf == NULL) return (NULL); cmp = compar(key, (*leaf)->key); if (cmp < 0) { - result = &(*leaf)->key; + result = *leaf; GO_LEFT(); } else if (cmp > 0) { - result = &(*leaf)->key; + result = *leaf; GO_RIGHT(); } else { break; @@ -134,7 +131,7 @@ tdelete(const void *restrict key, void * * and left-left case that only exists when deleting. Hence the * duplication of code. */ - for (n = base; n != leaf;) { + for (n = rootp; n != leaf;) { if (path_took_left(&path)) { x = *n; if (x->balance < 0) { @@ -207,6 +204,5 @@ tdelete(const void *restrict key, void * } /* Return the parent of the old entry. */ - *rootp = root; return (result); } Modified: stable/11/lib/libc/stdlib/tfind.c ============================================================================== --- stable/11/lib/libc/stdlib/tfind.c Sat Oct 29 14:09:32 2016 (r308089) +++ stable/11/lib/libc/stdlib/tfind.c Sat Oct 29 14:41:22 2016 (r308090) @@ -4,8 +4,6 @@ * Tree search generalized from Knuth (6.2.2) Algorithm T just like * the AT&T man page says. * - * The node_t structure is for internal use only, lint doesn't grok it. - * * Written by reading the System V Interface Definition, not the code. * * Totally public domain. @@ -29,11 +27,10 @@ __FBSDID("$FreeBSD$"); * vkey - key to be found * vrootp - address of the tree root */ -void * -tfind(const void *vkey, void * const *vrootp, +posix_tnode * +tfind(const void *vkey, posix_tnode * const *rootp, int (*compar)(const void *, const void *)) { - node_t **rootp = (node_t **)vrootp; if (rootp == NULL) return NULL; Modified: stable/11/lib/libc/stdlib/tsearch.3 ============================================================================== --- stable/11/lib/libc/stdlib/tsearch.3 Sat Oct 29 14:09:32 2016 (r308089) +++ stable/11/lib/libc/stdlib/tsearch.3 Sat Oct 29 14:41:22 2016 (r308090) @@ -27,7 +27,7 @@ .\" OpenBSD: tsearch.3,v 1.2 1998/06/21 22:13:49 millert Exp .\" $FreeBSD$ .\" -.Dd December 6, 2015 +.Dd October 9, 2016 .Dt TSEARCH 3 .Os .Sh NAME @@ -36,13 +36,13 @@ .Sh SYNOPSIS .In search.h .Ft void * -.Fn tdelete "const void * restrict key" "void ** restrict rootp" "int (*compar) (const void *, const void *)" -.Ft void * -.Fn tfind "const void *key" "void * const *rootp" "int (*compar) (const void *, const void *)" -.Ft void * -.Fn tsearch "const void *key" "void **rootp" "int (*compar) (const void *, const void *)" +.Fn tdelete "const void * restrict key" "posix_tnode ** restrict rootp" "int (*compar) (const void *, const void *)" +.Ft posix_tnode * +.Fn tfind "const void *key" "posix_tnode * const *rootp" "int (*compar) (const void *, const void *)" +.Ft posix_tnode * +.Fn tsearch "const void *key" "posix_tnode **rootp" "int (*compar) (const void *, const void *)" .Ft void -.Fn twalk "const void *root" "void (*action) (const void *, VISIT, int)" +.Fn twalk "const posix_tnode *root" "void (*action) (const posix_tnode *, VISIT, int)" .Sh DESCRIPTION The .Fn tdelete , @@ -134,3 +134,18 @@ function returns no value. .Xr bsearch 3 , .Xr hsearch 3 , .Xr lsearch 3 +.Sh STANDARDS +These functions conform to +.St -p1003.1-2008 . +.Pp +The +.Fa posix_tnode +type is not part of +.St -p1003.1-2008 , +but is expected to be standardized by future versions of the standard. +It is defined as +.Fa void +for source-level compatibility. +Using +.Fa posix_tnode +makes distinguishing between nodes and keys easier. Modified: stable/11/lib/libc/stdlib/tsearch.c ============================================================================== --- stable/11/lib/libc/stdlib/tsearch.c Sat Oct 29 14:09:32 2016 (r308089) +++ stable/11/lib/libc/stdlib/tsearch.c Sat Oct 29 14:41:22 2016 (r308090) @@ -32,18 +32,17 @@ __FBSDID("$FreeBSD$"); #include "tsearch_path.h" -void * -tsearch(const void *key, void **rootp, +posix_tnode * +tsearch(const void *key, posix_tnode **rootp, int (*compar)(const void *, const void *)) { struct path path; - node_t *root, **base, **leaf, *result, *n, *x, *y, *z; + posix_tnode **leaf, *result, *n, *x, *y, *z; int cmp; /* POSIX requires that tsearch() returns NULL if rootp is NULL. */ if (rootp == NULL) - return (NULL); - root = *rootp; + return (NULL); /* * Find the leaf where the new key needs to be inserted. Return @@ -52,8 +51,7 @@ tsearch(const void *key, void **rootp, * balances. */ path_init(&path); - base = &root; - leaf = &root; + leaf = rootp; while (*leaf != NULL) { if ((*leaf)->balance != 0) { /* @@ -62,9 +60,9 @@ tsearch(const void *key, void **rootp, * need to perform any rotations above this * point. In this case rotations are always * capable of keeping the subtree in balance. - * Make this the base node and reset the path. + * Make this the root node and reset the path. */ - base = leaf; + rootp = leaf; path_init(&path); } cmp = compar(key, (*leaf)->key); @@ -75,7 +73,7 @@ tsearch(const void *key, void **rootp, path_taking_right(&path); leaf = &(*leaf)->rlink; } else { - return (&(*leaf)->key); + return (*leaf); } } @@ -94,7 +92,7 @@ tsearch(const void *key, void **rootp, * have a balance of zero, meaning that these nodes will not get * out of balance. */ - for (n = *base; n != *leaf;) { + for (n = *rootp; n != *leaf;) { if (path_took_left(&path)) { n->balance += 1; n = n->llink; @@ -106,10 +104,10 @@ tsearch(const void *key, void **rootp, /* * Adjusting the balances may have pushed the balance of the - * base node out of range. Perform a rotation to bring the + * root node out of range. Perform a rotation to bring the * balance back in range. */ - x = *base; + x = *rootp; if (x->balance > 1) { y = x->llink; if (y->balance < 0) { @@ -129,7 +127,7 @@ tsearch(const void *key, void **rootp, z->llink = y; x->llink = z->rlink; z->rlink = x; - *base = z; + *rootp = z; x->balance = z->balance > 0 ? -1 : 0; y->balance = z->balance < 0 ? 1 : 0; @@ -146,7 +144,7 @@ tsearch(const void *key, void **rootp, */ x->llink = y->rlink; y->rlink = x; - *base = y; + *rootp = y; x->balance = 0; y->balance = 0; @@ -165,12 +163,12 @@ tsearch(const void *key, void **rootp, * / \ A B C D * B C */ - node_t *z = y->llink; + posix_tnode *z = y->llink; x->rlink = z->llink; z->llink = x; y->llink = z->rlink; z->rlink = y; - *base = z; + *rootp = z; x->balance = z->balance < 0 ? 1 : 0; y->balance = z->balance > 0 ? -1 : 0; @@ -187,7 +185,7 @@ tsearch(const void *key, void **rootp, */ x->rlink = y->llink; y->llink = x; - *base = y; + *rootp = y; x->balance = 0; y->balance = 0; @@ -195,6 +193,5 @@ tsearch(const void *key, void **rootp, } /* Return the new entry. */ - *rootp = root; - return (&result->key); + return (result); } Modified: stable/11/lib/libc/stdlib/twalk.c ============================================================================== --- stable/11/lib/libc/stdlib/twalk.c Sat Oct 29 14:09:32 2016 (r308089) +++ stable/11/lib/libc/stdlib/twalk.c Sat Oct 29 14:41:22 2016 (r308090) @@ -4,8 +4,6 @@ * Tree search generalized from Knuth (6.2.2) Algorithm T just like * the AT&T man page says. * - * The node_t structure is for internal use only, lint doesn't grok it. - * * Written by reading the System V Interface Definition, not the code. * * Totally public domain. @@ -23,12 +21,11 @@ __FBSDID("$FreeBSD$"); #include #include -typedef void (*cmp_fn_t)(const void *, VISIT, int); +typedef void (*cmp_fn_t)(const posix_tnode *, VISIT, int); /* Walk the nodes of a tree */ static void -trecurse(const node_t *root, /* Root of the tree to be walked */ - cmp_fn_t action, int level) +trecurse(const posix_tnode *root, cmp_fn_t action, int level) { if (root->llink == NULL && root->rlink == NULL) @@ -46,7 +43,7 @@ trecurse(const node_t *root, /* Root of /* Walk the nodes of a tree */ void -twalk(const void *vroot, cmp_fn_t action) /* Root of the tree to be walked */ +twalk(const posix_tnode *vroot, cmp_fn_t action) { if (vroot != NULL && action != NULL) trecurse(vroot, action, 0); Modified: stable/11/lib/libc/tests/stdlib/tsearch_test.c ============================================================================== --- stable/11/lib/libc/tests/stdlib/tsearch_test.c Sat Oct 29 14:09:32 2016 (r308089) +++ stable/11/lib/libc/tests/stdlib/tsearch_test.c Sat Oct 29 14:41:22 2016 (r308090) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); /* Validates the integrity of an AVL tree. */ static inline unsigned int -tnode_assert(const node_t *n) +tnode_assert(const posix_tnode *n) { unsigned int height_left, height_right; int balance; @@ -79,7 +79,7 @@ ATF_TC_BODY(tsearch_test, tc) keys[i] = i; /* Apply random operations on a binary tree and check the results. */ - void *root = NULL; + posix_tnode *root = NULL; bool present[NKEYS] = {}; for (int i = 0; i < NKEYS * 10; ++i) { int key = nrand48(random_state) % NKEYS;