From owner-svn-src-head@freebsd.org Sun Dec 4 01:42:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A44CBC630AD; Sun, 4 Dec 2016 01:42:52 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:190:61f0::4]) by mx1.freebsd.org (Postfix) with ESMTP id 72007125D; Sun, 4 Dec 2016 01:42:52 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from [IPv6:2a02:2450:1023:259:9057:5a9e:da6:b680] (unknown [IPv6:2a02:2450:1023:259:9057:5a9e:da6:b680]) by mail.vx.sk (Postfix) with ESMTPSA id 2F1F0956D8; Sun, 4 Dec 2016 02:42:51 +0100 (CET) Subject: Re: svn commit: r309405 - head/contrib/libarchive/libarchive To: Antoine Brodin References: <201612020930.uB29UDQR031063@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Martin Matuska Message-ID: <24e84be3-8000-9846-3af1-731a0fbaad8e@FreeBSD.org> Date: Sun, 4 Dec 2016 02:42:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 01:42:52 -0000 Looks like older versions of "plexus-archiver" (plugin used by maven) create malformed tar archives with spaced uid/gid fields (PLXCOMP-233). I will fix that quickly or backout the header sanity check for now. On 03.12.2016 22:48, Antoine Brodin wrote: > On Fri, Dec 2, 2016 at 10:30 AM, Martin Matuska wrote:= >> Author: mm >> Date: Fri Dec 2 09:30:13 2016 >> New Revision: 309405 >> URL: https://svnweb.freebsd.org/changeset/base/309405 >> >> Log: >> MFV r309403: >> >> Sync libarchive with vendor. >> >> Vendor bugfixes: >> Fix for heap-buffer-overflow in archive_le16dec() >> Fix for heap-buffer-overflow in uudecode_bidder_bid() >> Reworked fix for compatibility with archives created by Perl Archive= ::Tar >> >> MFC after: 1 week > Hi, > > There are still ports failing to extract (logs are ipv6 only): > http://beefy11.nyi.freebsd.org/data/head-i386-default/p427588_s309451/l= ogs/errors/jakarta-commons-logging-1.2.log > http://beefy11.nyi.freebsd.org/data/head-i386-default/p427588_s309451/l= ogs/errors/activemq-5.14.1.log > http://beefy11.nyi.freebsd.org/data/head-i386-default/p427588_s309451/l= ogs/errors/hadoop2-2.7.2_1.log > > Please request an exp-run before updating libarchive. > > Cheers, > > Antoine From owner-svn-src-head@freebsd.org Sun Dec 4 02:08:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D6BC63D22; Sun, 4 Dec 2016 02:08:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1907135; Sun, 4 Dec 2016 02:08:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB428eUm040311; Sun, 4 Dec 2016 02:08:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB428eF9040310; Sun, 4 Dec 2016 02:08:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612040208.uB428eF9040310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 4 Dec 2016 02:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309521 - head/sys/modules/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 02:08:42 -0000 Author: ngie Date: Sun Dec 4 02:08:40 2016 New Revision: 309521 URL: https://svnweb.freebsd.org/changeset/base/309521 Log: Unbreak "make depend" with sys/modules/ioat by adding opt_ddb.h to SRCS MFC after: 2 weeks Modified: head/sys/modules/ioat/Makefile Modified: head/sys/modules/ioat/Makefile ============================================================================== --- head/sys/modules/ioat/Makefile Sun Dec 4 00:33:07 2016 (r309520) +++ head/sys/modules/ioat/Makefile Sun Dec 4 02:08:40 2016 (r309521) @@ -9,6 +9,7 @@ IOAT_SRC_PATH = ${.CURDIR}/../.. KMOD= ioat SRCS= ioat.c ioat_test.c SRCS+= device_if.h bus_if.h pci_if.h +SRCS+= opt_ddb.h CFLAGS+= -I${IOAT_SRC_PATH} From owner-svn-src-head@freebsd.org Sun Dec 4 02:15:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EED8AC57173; Sun, 4 Dec 2016 02:15:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE53D97D; Sun, 4 Dec 2016 02:15:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB42Fk8f044065; Sun, 4 Dec 2016 02:15:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB42Fkvd044064; Sun, 4 Dec 2016 02:15:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201612040215.uB42Fkvd044064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Dec 2016 02:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309522 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 02:15:48 -0000 Author: jhibbits Date: Sun Dec 4 02:15:46 2016 New Revision: 309522 URL: https://svnweb.freebsd.org/changeset/base/309522 Log: Fix a typo (move parenthesis to correct location in the line). Before this, it would cause the one consumer of this API in powerpc usage (dev/dpaa) to set the PTE WIMG flags to empty instead of --M-, making the cache-enabled buffer portals non-coherent. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Dec 4 02:08:40 2016 (r309521) +++ head/sys/powerpc/booke/pmap.c Sun Dec 4 02:15:46 2016 (r309522) @@ -2967,7 +2967,7 @@ mmu_booke_change_attr(mmu_t mmu, vm_offs for (va = addr; va < addr + sz; va += PAGE_SIZE) { pte = pte_find(mmu, kernel_pmap, va); *pte &= ~(PTE_MAS2_MASK << PTE_MAS2_SHIFT); - *pte |= tlb_calc_wimg(PTE_PA(pte), mode << PTE_MAS2_SHIFT); + *pte |= tlb_calc_wimg(PTE_PA(pte), mode) << PTE_MAS2_SHIFT; tlb0_flush_entry(va); } tlb_miss_unlock(); From owner-svn-src-head@freebsd.org Sun Dec 4 02:21:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92E07C57343; Sun, 4 Dec 2016 02:21:23 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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 5BD74D50; Sun, 4 Dec 2016 02:21:23 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x244.google.com with SMTP id h133so7640170ioe.2; Sat, 03 Dec 2016 18:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=gZWGtrA4WJAhvx/Vha8Rde/crVeafQrSskYAUOBrwj8=; b=k+unfYdspEm3vlzv4+tvTaZNlTjVciIhU6B8vNtGhuOoBAxvGhtPAYlca2G8NEd9VB InRkN+kSK6pKglAxP7ISEu3yQkeGHBVmN50yzrn7/1aHZ2AmfJNFJQ9C8Ziv3WTPtoi6 KccDd6lZ3PR+nIAPBQDox8fCKV18c99X5bAcKu7/v5k3qsU84baeBfOWpkhLJYxVCsAW n1zbbOiOfGPcQT2yI4AbHEl9alEgkr7ddatszz8i2iRzFKMbny71+W3/kcCEbmQOAiJG YEDqDRkwkqVMiJ7sQrlC5WFOVTbbqtvyovqFqMl50ykSb0GKsY8v8GTXjiQcJqCAHVaP IVhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gZWGtrA4WJAhvx/Vha8Rde/crVeafQrSskYAUOBrwj8=; b=aUggsFwAoKwFq/HNRRkm628BRQjmL9pHNZNPpFxGaeeg4CafAL0nUbyWZ1pCKiUUyT o+WotQI/Q2q7w8577s5z/j0++sokXhaFXo/t73FX+yLeBdtDlPLKktTeytXSch9aZPn4 fLJUm55TvvlegSBcszKYq14Egj5ji33EzXNs/1FEW9rBDqAmQE9l2hJf/djnyDV4u30f Vdcpxl7ugPV9TPVcdFbMJvUaAAiDbAN4Q+3jbRawMQfkGmFQR28mKeN7Yhn6D1gPLENh 7KtO4AX/BUuaCT7i9P+yL0q3Xpb6UM5qo6iN1EoxG2CBrPi5bdu81/Pqxe5DMFhzxwRQ BXww== X-Gm-Message-State: AKaTC00BBfga11kaJsSuP2YPj29LsKdaTqy4xjoj8Zazbm9Lq3h5yZMevz0BYP7YRnDBgA== X-Received: by 10.36.125.207 with SMTP id b198mr3472704itc.88.1480818082614; Sat, 03 Dec 2016 18:21:22 -0800 (PST) Received: from zhabar.knownspace (50-80-150-234.client.mchsi.com. [50.80.150.234]) by smtp.gmail.com with ESMTPSA id w192sm3808910itw.3.2016.12.03.18.21.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Dec 2016 18:21:22 -0800 (PST) Date: Sat, 3 Dec 2016 20:21:20 -0600 From: Justin Hibbits To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309522 - head/sys/powerpc/booke Message-ID: <20161203202120.62ce2b57@zhabar.knownspace> In-Reply-To: <201612040215.uB42Fkvd044064@repo.freebsd.org> References: <201612040215.uB42Fkvd044064@repo.freebsd.org> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; powerpc64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 02:21:23 -0000 On Sun, 4 Dec 2016 02:15:46 +0000 (UTC) Justin Hibbits wrote: > Author: jhibbits > Date: Sun Dec 4 02:15:46 2016 > New Revision: 309522 > URL: https://svnweb.freebsd.org/changeset/base/309522 > > Log: > Fix a typo (move parenthesis to correct location in the line). > > Before this, it would cause the one consumer of this API in powerpc > usage (dev/dpaa) to set the PTE WIMG flags to empty instead of --M-, > making the cache-enabled buffer portals non-coherent. Not really, because the buffer portals are in TLB1, not TLB0, so this is effectively a no-op for existing code. From owner-svn-src-head@freebsd.org Sun Dec 4 02:58:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 158CFC66354; Sun, 4 Dec 2016 02:58:15 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D957A1D33; Sun, 4 Dec 2016 02:58:14 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB42wENp060148; Sun, 4 Dec 2016 02:58:14 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB42wEpJ060147; Sun, 4 Dec 2016 02:58:14 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612040258.uB42wEpJ060147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 4 Dec 2016 02:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309523 - head/contrib/libarchive/libarchive X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 02:58:15 -0000 Author: mm Date: Sun Dec 4 02:58:13 2016 New Revision: 309523 URL: https://svnweb.freebsd.org/changeset/base/309523 Log: Relax sanity check of number fields in tar header even more. This fixes reading tar archives created by older versions of plexus-archiver (used by maven-assembly-plugin) that fill uid and gid fields with spaces (PLXCOMP-233). Vendor issue: https://github.com/libarchive/libarchive/issues/832 Reported by: Antoine Brodin MFC after: 1 week Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Dec 4 02:15:46 2016 (r309522) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Dec 4 02:58:13 2016 (r309523) @@ -324,11 +324,7 @@ validate_number_field(const char* p_fiel while (i < i_size && p_field[i] == ' ') { ++i; } - /* Must be at least one octal digit. */ - if (i >= i_size || p_field[i] < '0' || p_field[i] > '7') { - return 0; - } - /* Skip remaining octal digits. */ + /* Skip octal digits. */ while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') { ++i; } From owner-svn-src-head@freebsd.org Sun Dec 4 03:10:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28D8BC668C1; Sun, 4 Dec 2016 03:10:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC9EFC05; Sun, 4 Dec 2016 03:10:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB43AQp7064897; Sun, 4 Dec 2016 03:10:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB43AQw7064896; Sun, 4 Dec 2016 03:10:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612040310.uB43AQw7064896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 4 Dec 2016 03:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309524 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 03:10:27 -0000 Author: pfg Date: Sun Dec 4 03:10:25 2016 New Revision: 309524 URL: https://svnweb.freebsd.org/changeset/base/309524 Log: indent(1): remove unneeded comma. It is not a good practice to start a newline with a comma anyways. Discussed with: bjk Differential Revision: https://reviews.freebsd.org/D8690 Modified: head/usr.bin/indent/indent.1 Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Sun Dec 4 02:58:13 2016 (r309523) +++ head/usr.bin/indent/indent.1 Sun Dec 4 03:10:25 2016 (r309524) @@ -148,7 +148,7 @@ Default: .It Fl badp , nbadp This is vaguely similar to .Fl bad -, except that it only applies to the first set of declarations +except that it only applies to the first set of declarations in a procedure (just after the first `{') and it causes a blank line to be generated even if there are no declarations. The default is From owner-svn-src-head@freebsd.org Sun Dec 4 03:50:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFDB8C632C1; Sun, 4 Dec 2016 03:50:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7398B1C69; Sun, 4 Dec 2016 03:50:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB43ovKu080725; Sun, 4 Dec 2016 03:50:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB43ovXH080724; Sun, 4 Dec 2016 03:50:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201612040350.uB43ovXH080724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 4 Dec 2016 03:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309525 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 03:50:58 -0000 Author: cem Date: Sun Dec 4 03:50:57 2016 New Revision: 309525 URL: https://svnweb.freebsd.org/changeset/base/309525 Log: coredump_phnum_test: Make expected pheader count more flexible Note: this test still requires binutils readelf (from ports) to pass, until a few issues are resolved in elftoolchain. PR: 215019 Reported by: ngie@ Sponsored by: Dell EMC Isilon Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Sun Dec 4 03:10:25 2016 (r309524) +++ head/tests/sys/kern/coredump_phnum_test.sh Sun Dec 4 03:50:57 2016 (r309525) @@ -39,7 +39,7 @@ coredump_phnum_head() } coredump_phnum_body() { - atf_expect_fail "the value parsed doesn't always match the value obtained on the running system; bug # 215019" + atf_expect_fail "elftoolchain (base) readelf doesn't handle extended program header numbers; bug # 215019" # Set up core dumping cat > coredump_phnum_restore_state.sh <<-EOF @@ -65,17 +65,17 @@ EOF # the result of running the helper program and dumping core. The only # important bit is that they're larger than 65535 (UINT16_MAX). readelf -h coredump_phnum_helper.core | \ - atf_check -o "match:65535 \(66169\)" \ + atf_check -o "match:65535 \(66[0-9]{3}\)" \ grep "Number of program headers:" readelf -l coredump_phnum_helper.core | \ - atf_check -o "match:There are 66169 program headers" \ + atf_check -o "match:There are 66[0-9]{3} program headers" \ grep -1 "program headers" readelf -S coredump_phnum_helper.core | \ - atf_check -o "match: 0000000000000001 .* 66169 " \ + atf_check -o "match: 0000000000000001 .* 66[0-9]{3} " \ grep -A1 "^ \[ 0\] " procstat -v coredump_phnum_helper.core | \ - atf_check -o "match:66545" wc -l + atf_check -o "match:66[0-9]{3}" wc -l } coredump_phnum_cleanup() { From owner-svn-src-head@freebsd.org Sun Dec 4 04:04:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0CA1C63869; Sun, 4 Dec 2016 04:04:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 809366E8; Sun, 4 Dec 2016 04:04:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB444vhT088721; Sun, 4 Dec 2016 04:04:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB444vds088720; Sun, 4 Dec 2016 04:04:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201612040404.uB444vds088720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 4 Dec 2016 04:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309526 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 04:04:58 -0000 Author: cem Date: Sun Dec 4 04:04:57 2016 New Revision: 309526 URL: https://svnweb.freebsd.org/changeset/base/309526 Log: ioat(4): Compile on i386 Truncate BUS_SPACE_MAXADDR_40BIT to essentially BUS_SPACE_MAXADDR_32BIT on platforms with 32-bit bus_addr_t (i.e., i386). PR: 215034 Reported by: ngie@ Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sun Dec 4 03:50:57 2016 (r309525) +++ head/sys/dev/ioat/ioat.c Sun Dec 4 04:04:57 2016 (r309526) @@ -486,8 +486,9 @@ ioat3_attach(device_t device) ringsz = sizeof(struct ioat_dma_hw_descriptor) * num_descriptors; error = bus_dma_tag_create(bus_get_dma_tag(ioat->device), - 2 * 1024 * 1024, 0x0, BUS_SPACE_MAXADDR_40BIT, BUS_SPACE_MAXADDR, - NULL, NULL, ringsz, 1, ringsz, 0, NULL, NULL, &ioat->hw_desc_tag); + 2 * 1024 * 1024, 0x0, (bus_addr_t)BUS_SPACE_MAXADDR_40BIT, + BUS_SPACE_MAXADDR, NULL, NULL, ringsz, 1, ringsz, 0, NULL, NULL, + &ioat->hw_desc_tag); if (error != 0) return (error); From owner-svn-src-head@freebsd.org Sun Dec 4 05:46:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2240AC66F95; Sun, 4 Dec 2016 05:46:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DAD3D12C3; Sun, 4 Dec 2016 05:46:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB45kVjQ028587; Sun, 4 Dec 2016 05:46:31 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB45kU2U028585; Sun, 4 Dec 2016 05:46:30 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201612040546.uB45kU2U028585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Sun, 4 Dec 2016 05:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309527 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 05:46:32 -0000 Author: yongari Date: Sun Dec 4 05:46:30 2016 New Revision: 309527 URL: https://svnweb.freebsd.org/changeset/base/309527 Log: Recognize RealTek ALC1150 7.1 channel HD audio codec. Modified: head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Sun Dec 4 04:04:57 2016 (r309526) +++ head/sys/dev/sound/pci/hda/hdac.h Sun Dec 4 05:46:30 2016 (r309527) @@ -368,6 +368,7 @@ #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) #define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) +#define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) /* Motorola */ Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Sun Dec 4 04:04:57 2016 (r309526) +++ head/sys/dev/sound/pci/hda/hdacc.c Sun Dec 4 05:46:30 2016 (r309527) @@ -111,6 +111,7 @@ static const struct { { HDA_CODEC_ALC889, 0, "Realtek ALC889" }, { HDA_CODEC_ALC892, 0, "Realtek ALC892" }, { HDA_CODEC_ALC899, 0, "Realtek ALC899" }, + { HDA_CODEC_ALC1150, 0, "Realtek ALC1150" }, { HDA_CODEC_AD1882, 0, "Analog Devices AD1882" }, { HDA_CODEC_AD1882A, 0, "Analog Devices AD1882A" }, { HDA_CODEC_AD1883, 0, "Analog Devices AD1883" }, From owner-svn-src-head@freebsd.org Sun Dec 4 05:55:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00F24C64269; Sun, 4 Dec 2016 05:55:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C473417D1; Sun, 4 Dec 2016 05:55:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB45tIYJ032393; Sun, 4 Dec 2016 05:55:18 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB45tI5B032392; Sun, 4 Dec 2016 05:55:18 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201612040555.uB45tI5B032392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Sun, 4 Dec 2016 05:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309528 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 05:55:20 -0000 Author: yongari Date: Sun Dec 4 05:55:18 2016 New Revision: 309528 URL: https://svnweb.freebsd.org/changeset/base/309528 Log: Fix too low volume on MSI H170 GAMING M3 board by poking vendor specific COEF. Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Sun Dec 4 05:46:30 2016 (r309527) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Sun Dec 4 05:55:18 2016 (r309528) @@ -739,6 +739,12 @@ hdaa_patch_direct(struct hdaa_devinfo *d hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid, 0xf88, 0xc0)); break; + case HDA_CODEC_ALC1150: + if (subid == 0xd9781462) { + /* Too low volume on MSI H170 GAMING M3. */ + hdaa_write_coef(dev, 0x20, 0x07, 0x7cb); + } + break; } if (subid == APPLE_INTEL_MAC) hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid, From owner-svn-src-head@freebsd.org Sun Dec 4 15:27:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A630C67FFC; Sun, 4 Dec 2016 15:27:40 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 29F56127E; Sun, 4 Dec 2016 15:27:40 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB4FRdsV064053; Sun, 4 Dec 2016 15:27:39 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4FRduc064051; Sun, 4 Dec 2016 15:27:39 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201612041527.uB4FRduc064051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 4 Dec 2016 15:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309531 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 15:27:40 -0000 Author: mmel Date: Sun Dec 4 15:27:39 2016 New Revision: 309531 URL: https://svnweb.freebsd.org/changeset/base/309531 Log: Implement fake pmap_mapdev_attr() for ARMv6. This function is referenced, but never called from DRM2 code. Also, real behavior of pmap_mapdev_attr() in ARM world is unclear as we don't have any additional attribute for a device memory type. MFC after: 2 weeks Modified: head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap.h Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Sun Dec 4 13:56:15 2016 (r309530) +++ head/sys/arm/include/pmap-v6.h Sun Dec 4 15:27:39 2016 (r309531) @@ -166,7 +166,6 @@ extern ttb_entry_t pmap_kern_ttb; /* TT void pmap_bootstrap(vm_offset_t); void pmap_kenter(vm_offset_t, vm_paddr_t); void pmap_kremove(vm_offset_t); -void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); boolean_t pmap_page_is_mapped(vm_page_t); void pmap_tlb_flush(pmap_t, vm_offset_t); Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Sun Dec 4 13:56:15 2016 (r309530) +++ head/sys/arm/include/pmap.h Sun Dec 4 15:27:39 2016 (r309531) @@ -53,6 +53,12 @@ void pmap_page_set_memattr(vm_page_t, vm void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); +static inline void * +pmap_mapdev_attr(vm_paddr_t addr, vm_size_t size, int attr) +{ + panic("%s is not implemented yet!\n", __func__); +} + struct pcb; void pmap_set_pcb_pagedir(pmap_t, struct pcb *); From owner-svn-src-head@freebsd.org Sun Dec 4 15:28:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E577C6608B; Sun, 4 Dec 2016 15:28:31 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 34184141A; Sun, 4 Dec 2016 15:28:31 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB4FSUiL064127; Sun, 4 Dec 2016 15:28:30 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4FSUPM064125; Sun, 4 Dec 2016 15:28:30 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201612041528.uB4FSUPM064125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 4 Dec 2016 15:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309532 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 15:28:31 -0000 Author: mmel Date: Sun Dec 4 15:28:30 2016 New Revision: 309532 URL: https://svnweb.freebsd.org/changeset/base/309532 Log: Add IDs for HDA codecs found on Nvidia Tegra SoCs. MFC after: 2 weeks Modified: head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Sun Dec 4 15:27:39 2016 (r309531) +++ head/sys/dev/sound/pci/hda/hdac.h Sun Dec 4 15:28:30 2016 (r309532) @@ -619,6 +619,10 @@ #define HDA_CODEC_NVIDIAGT440 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0014) #define HDA_CODEC_NVIDIAGTX550 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0015) #define HDA_CODEC_NVIDIAGTX570 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0018) +#define HDA_CODEC_NVIDIATEGRA30 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0020) +#define HDA_CODEC_NVIDIATEGRA114 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0022) +#define HDA_CODEC_NVIDIATEGRA124 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0028) +#define HDA_CODEC_NVIDIATEGRA210 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0029) #define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067) #define HDA_CODEC_NVIDIAMCP73 HDA_CODEC_CONSTRUCT(NVIDIA, 0x8001) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Sun Dec 4 15:27:39 2016 (r309531) +++ head/sys/dev/sound/pci/hda/hdacc.c Sun Dec 4 15:28:30 2016 (r309532) @@ -314,6 +314,10 @@ static const struct { { HDA_CODEC_NVIDIAGT440, 0, "NVIDIA GT440" }, { HDA_CODEC_NVIDIAGTX550, 0, "NVIDIA GTX550" }, { HDA_CODEC_NVIDIAGTX570, 0, "NVIDIA GTX570" }, + { HDA_CODEC_NVIDIATEGRA30, 0, "NVIDIA Tegra30" }, + { HDA_CODEC_NVIDIATEGRA114, 0, "NVIDIA Tegra114" }, + { HDA_CODEC_NVIDIATEGRA124, 0, "NVIDIA Tegra124" }, + { HDA_CODEC_NVIDIATEGRA210, 0, "NVIDIA Tegra210" }, { HDA_CODEC_INTELIP, 0, "Intel Ibex Peak" }, { HDA_CODEC_INTELBL, 0, "Intel Bearlake" }, { HDA_CODEC_INTELCA, 0, "Intel Cantiga" }, From owner-svn-src-head@freebsd.org Sun Dec 4 15:58:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD41C66BBF; Sun, 4 Dec 2016 15:58:35 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1F84F36B; Sun, 4 Dec 2016 15:58:35 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB4FwYxb076173; Sun, 4 Dec 2016 15:58:34 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4FwYQ1076172; Sun, 4 Dec 2016 15:58:34 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612041558.uB4FwYQ1076172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 4 Dec 2016 15:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309534 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 15:58:35 -0000 Author: avos Date: Sun Dec 4 15:58:34 2016 New Revision: 309534 URL: https://svnweb.freebsd.org/changeset/base/309534 Log: Do not try to recreate wlan(4) interface if it already exists. This should fix error messages caused by devd(8) during startup: Starting Network: lo0 wlan0. ... Starting devd. ifconfig: SIOCS80211: Device busy wpa_supplicant already running? (pid=323). MFC after: 2 weeks Modified: head/etc/pccard_ether Modified: head/etc/pccard_ether ============================================================================== --- head/etc/pccard_ether Sun Dec 4 15:55:59 2016 (r309533) +++ head/etc/pccard_ether Sun Dec 4 15:58:34 2016 (r309534) @@ -120,6 +120,9 @@ pccard_ether_restart() pccard_ether_startchildren() { for child in `get_if_var $ifn wlans_IF`; do + if ifexists $child; then + continue + fi /etc/rc.d/netif quietstart $child done } From owner-svn-src-head@freebsd.org Sun Dec 4 16:03:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27941C66EE5; Sun, 4 Dec 2016 16:03:01 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EB5C8D51; Sun, 4 Dec 2016 16:03:00 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB4G30Pn080092; Sun, 4 Dec 2016 16:03:00 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4G30GZ080091; Sun, 4 Dec 2016 16:03:00 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201612041603.uB4G30GZ080091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 4 Dec 2016 16:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309537 - head/sys/dev/extres/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 16:03:01 -0000 Author: mmel Date: Sun Dec 4 16:02:59 2016 New Revision: 309537 URL: https://svnweb.freebsd.org/changeset/base/309537 Log: Clock framework fixes: - The clk_test_freq() (aka CLK_SET_DRYRUN) doesn't change frequency, don't cache it result. - Fix busy condition for clk_set_freq(). MFC after: 3 weeks Modified: head/sys/dev/extres/clk/clk.c Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Sun Dec 4 16:00:25 2016 (r309536) +++ head/sys/dev/extres/clk/clk.c Sun Dec 4 16:02:59 2016 (r309537) @@ -830,9 +830,10 @@ clknode_set_freq(struct clknode *clknode * OR * clock is glitch free and is enabled by calling consumer only */ - if ((clknode->enable_cnt > 1) && - ((clknode->enable_cnt > enablecnt) || - !(clknode->flags & CLK_NODE_GLITCH_FREE))) { + if ((flags & CLK_SET_DRYRUN) == 0 && + clknode->enable_cnt > 1 && + clknode->enable_cnt > enablecnt && + (clknode->flags & CLK_NODE_GLITCH_FREE) == 0) { return (EBUSY); } @@ -856,9 +857,10 @@ clknode_set_freq(struct clknode *clknode if (done) { /* Success - invalidate frequency cache for all children. */ - clknode->freq = freq; - if ((flags & CLK_SET_DRYRUN) == 0) + if ((flags & CLK_SET_DRYRUN) == 0) { + clknode->freq = freq; clknode_refresh_cache(clknode, parent_freq); + } } else if (clknode->parent != NULL) { /* Nothing changed, pass request to parent. */ rv = clknode_set_freq(clknode->parent, freq, flags, enablecnt); From owner-svn-src-head@freebsd.org Sun Dec 4 16:04:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EFD5C66F7F; Sun, 4 Dec 2016 16:04:24 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C3CB9ECF; Sun, 4 Dec 2016 16:04:23 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB4G4MnS080180; Sun, 4 Dec 2016 16:04:22 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4G4MNk080177; Sun, 4 Dec 2016 16:04:22 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201612041604.uB4G4MNk080177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 4 Dec 2016 16:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309538 - head/sys/arm/nvidia/tegra124 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 16:04:24 -0000 Author: mmel Date: Sun Dec 4 16:04:22 2016 New Revision: 309538 URL: https://svnweb.freebsd.org/changeset/base/309538 Log: Fixes for NVIDIA Tegra124 clocks: - EMC clock have standard peripheral clock block. Use it. - Implement full frequency set method for PLLD2. This PLL is used as HDMI pixel clock so we must be able to set it to wide range of frequencies, within 5% tolerance allowed by HDMI specification. Due to this, full state space search (over m, n, p fields) is necessary. MFC after: 3 weeks Modified: head/sys/arm/nvidia/tegra124/tegra124_car.c head/sys/arm/nvidia/tegra124/tegra124_clk_per.c head/sys/arm/nvidia/tegra124/tegra124_clk_pll.c Modified: head/sys/arm/nvidia/tegra124/tegra124_car.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_car.c Sun Dec 4 16:02:59 2016 (r309537) +++ head/sys/arm/nvidia/tegra124/tegra124_car.c Sun Dec 4 16:04:22 2016 (r309538) @@ -189,8 +189,6 @@ PLIST(mux_pll_srcs) = {"osc_div_clk", NU PLIST(mux_plle_src1) = {"osc_div_clk", "pllP_out0"}; PLIST(mux_plle_src) = {"pllE_src1", "pllREFE_out"}; PLIST(mux_plld_out0_plld2_out0) = {"pllD_out0", "pllD2_out0"}; -PLIST(mux_pllmcp_clkm) = {"pllM_out0", "pllC_out0", "pllP_out0", "clk_m", - "pllM_UD", "pllC2_out0", "pllC3_out0", "pllC_UD"}; PLIST(mux_xusb_hs) = {"xusb_ss_div2", "pllU_60"}; PLIST(mux_xusb_ss) = {"pc_xusb_ss", "osc_div_clk"}; @@ -240,7 +238,6 @@ static struct clk_mux_def tegra124_mux_c /* Base peripheral clocks. */ MUX(0, "dsia_mux", mux_plld_out0_plld2_out0, PLLD_BASE, 25, 1), MUX(0, "dsib_mux", mux_plld_out0_plld2_out0, PLLD2_BASE, 25, 1), - MUX(0, "emc_mux", mux_pllmcp_clkm, CLK_SOURCE_EMC, 29, 3), /* USB. */ MUX(TEGRA124_CLK_XUSB_HS_SRC, "xusb_hs", mux_xusb_hs, CLK_SOURCE_XUSB_SS, 25, 1), Modified: head/sys/arm/nvidia/tegra124/tegra124_clk_per.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_clk_per.c Sun Dec 4 16:02:59 2016 (r309537) +++ head/sys/arm/nvidia/tegra124/tegra124_clk_per.c Sun Dec 4 16:04:22 2016 (r309538) @@ -126,6 +126,10 @@ PLIST(mux_m_c_p_a_c2_c3_clkm_c4) = PLIST(mux_m_c_p_clkm_mud_c2_c3) = {"pllM_out0", "pllC_out0", "pllP_out0", "clk_m", "pllM_UD", "pllC2_out0", "pllC3_out0"}; +PLIST(mux_m_c_p_clkm_mud_c2_c3_cud) = + {"pllM_out0", "pllC_out0", "pllP_out0", "clk_m", + "pllM_UD", "pllC2_out0", "pllC3_out0", "pllC_UD"}; + PLIST(mux_m_c2_c_c3_p_N_a) = {"pllM_out0", "pllC2_out0", "pllC_out0", "pllC3_out0", "pllP_out0", NULL, "pllA_out0"}; @@ -260,7 +264,7 @@ static struct pgate_def pgate_def[] = { GATE(I2C2, "i2c2", "pc_i2c2", H(22)), GATE(UARTC, "uartc", "pc_uartc", H(23)), GATE(MIPI_CAL, "mipi_cal", "clk_m", H(24)), - GATE(EMC, "emc", "emc_mux", H(25)), + GATE(EMC, "emc", "pc_emc_2x", H(25)), GATE(USB2, "usb2", "clk_m", H(26)), GATE(USB3, "usb3", "clk_m", H(27)), GATE(VDE, "vde", "pc_vde", H(29)), @@ -356,7 +360,7 @@ static struct pgate_def pgate_def[] = { /* GATE(CAM_MCLK, "CAM_MCLK", "clk_m", X(4)), */ /* GATE(CAM_MCLK2, "CAM_MCLK2", "clk_m", X(5)), */ GATE(I2C6, "i2c6", "pc_i2c6", X(6)), - /* GATE(VIM2_CLK, "vim2_clk", clk_m, X(11)), */ + GATE(VIM2_CLK, "vim2_clk", "clk_m", X(11)), /* GATE(EMC_DLL, "emc_dll", "pc_emc_dll", X(14)), */ GATE(HDMI_AUDIO, "hdmi_audio", "pc_hdmi_audio", X(16)), GATE(CLK72MHZ, "clk72mhz", "pc_clk72mhz", X(17)), @@ -373,17 +377,18 @@ static struct pgate_def pgate_def[] = { #define DCF_HAVE_ENA 0x0200 /* Block with enable bit */ #define DCF_HAVE_DIV 0x0400 /* Block with divider */ -/* Mark block with additional bis / functionality. */ +/* Mark block with additional bits / functionality. */ #define DCF_IS_MASK 0x00FF #define DCF_IS_UART 0x0001 #define DCF_IS_VI 0x0002 #define DCF_IS_HOST1X 0x0003 #define DCF_IS_XUSB_SS 0x0004 #define DCF_IS_EMC_DLL 0x0005 -#define FDS_IS_SATA 0x0006 +#define DCF_IS_SATA 0x0006 #define DCF_IS_VIC 0x0007 #define DCF_IS_AUDIO 0x0008 #define DCF_IS_SOR0 0x0009 +#define DCF_IS_EMC 0x000A /* Basic pheripheral clock */ #define PER_CLK(_id, cn, pl, r, diw, fiw, f) \ @@ -438,7 +443,7 @@ static struct periph_def periph_def[] = CLK_8_1(0, "pc_host1x", mux_p_c2_c_c3_m_N_clkm, CLK_SOURCE_HOST1X, DCF_IS_HOST1X), CLK_8_1(0, "pc_hdmi", mux_p_m_d_a_c_d2_clkm, CLK_SOURCE_HDMI, 0), CLK16_0(0, "pc_i2c2", mux_p_c2_c_c3_m_N_clkm, CLK_SOURCE_I2C2, 0), -/* EMC 8 */ + CLK_8_1(0, "pc_emc_2x", mux_m_c_p_clkm_mud_c2_c3_cud, CLK_SOURCE_EMC, DCF_IS_EMC), CLK16_1(0, "pc_uartc", mux_p_c2_c_c3_m_N_clkm, CLK_SOURCE_UARTC, DCF_IS_UART), CLK_8_1(0, "pc_vi_sensor", mux_m_c2_c_c3_p_N_a, CLK_SOURCE_VI_SENSOR, 0), CLK_8_1(0, "pc_spi4", mux_p_c2_c_c3_m_N_clkm, CLK_SOURCE_SPI4, 0), @@ -476,7 +481,7 @@ static struct periph_def periph_def[] = /* SYS */ CLK_8_1(0, "pc_sor0", mux_p_m_d_a_c_d2_clkm, CLK_SOURCE_SOR0, DCF_IS_SOR0), CLK_8_1(0, "pc_sata_oob", mux_p_N_c_N_m_N_clkm, CLK_SOURCE_SATA_OOB, 0), - CLK_8_1(0, "pc_sata", mux_p_N_c_N_m_N_clkm, CLK_SOURCE_SATA, FDS_IS_SATA), + CLK_8_1(0, "pc_sata", mux_p_N_c_N_m_N_clkm, CLK_SOURCE_SATA, DCF_IS_SATA), CLK_8_1(0, "pc_hda", mux_p_c2_c_c3_m_N_clkm, CLK_SOURCE_HDA, 0), CLK_8_1(TEGRA124_CLK_XUSB_HOST_SRC, "pc_xusb_core_host", mux_clkm_p_c2_c_c3_refre, CLK_SOURCE_XUSB_CORE_HOST, 0), Modified: head/sys/arm/nvidia/tegra124/tegra124_clk_pll.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_clk_pll.c Sun Dec 4 16:02:59 2016 (r309537) +++ head/sys/arm/nvidia/tegra124/tegra124_clk_pll.c Sun Dec 4 16:04:22 2016 (r309538) @@ -713,6 +713,7 @@ pll_set_std(struct pll_sc *sc, uint64_t return (ERANGE); *fout = ((fin / m) * n) /p; + return (0); } @@ -771,7 +772,6 @@ pllc_set_freq(struct pll_sc *sc, uint64_ { uint32_t m, n, p; - p = 2; m = 1; n = (*fout * p * m + fin / 2)/ fin; @@ -779,19 +779,88 @@ pllc_set_freq(struct pll_sc *sc, uint64_ return (pll_set_std( sc, fin, fout, flags, m, n, p)); } +/* + * PLLD2 is used as source for pixel clock for HDMI. + * We must be able to set it frequency very flexibly and + * precisely (within 5% tolerance limit allowed by HDMI specs). + * + * For this reason, it is necessary to search the full state space. + * Fortunately, thanks to early cycle terminations, performance + * is within acceptable limits. + */ +#define PLLD2_PFD_MIN 12000000 /* 12 MHz */ +#define PLLD2_PFD_MAX 38000000 /* 38 MHz */ +#define PLLD2_VCO_MIN 600000000 /* 600 MHz */ +#define PLLD2_VCO_MAX 1200000000 /* 1.2 GHz */ + static int plld2_set_freq(struct pll_sc *sc, uint64_t fin, uint64_t *fout, int flags) { uint32_t m, n, p; + uint32_t best_m, best_n, best_p; + uint64_t vco, pfd; + int64_t err, best_err; + struct mnp_bits *mnp_bits; + struct pdiv_table *tbl; + int p_idx, rv; - p = 2; - m = 1; - n = (*fout * p * m + fin / 2)/ fin; - dprintf("%s: m: %d, n: %d, p: %d\n", __func__, m, n, p); - return (pll_set_std(sc, fin, fout, flags, m, n, p)); -} + mnp_bits = &sc->mnp_bits; + tbl = sc->pdiv_table; + best_err = INT64_MAX; + for (p_idx = 0; tbl[p_idx].divider != 0; p_idx++) { + p = tbl[p_idx].divider; + /* Check constraints */ + vco = *fout * p; + if (vco < PLLD2_VCO_MIN) + continue; + if (vco > PLLD2_VCO_MAX) + break; + + for (m = 1; m < (1 << mnp_bits->m_width); m++) { + n = (*fout * p * m + fin / 2) / fin; + + /* Check constraints */ + if (n == 0) + continue; + if (n >= (1 << mnp_bits->n_width)) + break; + vco = (fin * n) / m; + if (vco > PLLD2_VCO_MAX || vco < PLLD2_VCO_MIN) + continue; + pfd = fin / m; + if (pfd > PLLD2_PFD_MAX || vco < PLLD2_PFD_MIN) + continue; + + /* Constraints passed, save best result */ + err = *fout - vco / p; + if (err < 0) + err = -err; + if (err < best_err) { + best_err = err; + best_p = p; + best_m = m; + best_n = n; + } + if (err == 0) + goto done; + } + } +done: + /* + * HDMI specification allows 5% pixel clock tolerance, + * we will by a slightly stricter + */ + if (best_err > ((*fout * 100) / 4)) + return (ERANGE); + + if (flags & CLK_SET_DRYRUN) + return (0); + rv = pll_set_std(sc, fin, fout, flags, best_m, best_n, best_p); + /* XXXX Panic for rv == ERANGE ? */ + return (rv); +} static int pllrefe_set_freq(struct pll_sc *sc, uint64_t fin, uint64_t *fout, int flags) @@ -883,8 +952,8 @@ tegra124_pll_set_freq(struct clknode *cl struct pll_sc *sc; sc = clknode_get_softc(clknode); - dprintf("%s: Requested freq: %llu, input freq: %llu\n", __func__, - *fout, fin); + dprintf("%s: %s requested freq: %llu, input freq: %llu\n", __func__, + clknode_get_name(clknode), *fout, fin); switch (sc->type) { case PLL_A: rv = plla_set_freq(sc, fin, fout, flags); From owner-svn-src-head@freebsd.org Sun Dec 4 20:45:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F6C5C679C0; Sun, 4 Dec 2016 20:45:00 +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 E4381E05; Sun, 4 Dec 2016 20:44:59 +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 uB4Kixr1093825; Sun, 4 Dec 2016 20:44:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4Kix8l093824; Sun, 4 Dec 2016 20:44:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612042044.uB4Kix8l093824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 4 Dec 2016 20:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309539 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 20:45:00 -0000 Author: kib Date: Sun Dec 4 20:44:58 2016 New Revision: 309539 URL: https://svnweb.freebsd.org/changeset/base/309539 Log: Restructure the code to handle reporting of non-exited processes from wait(2). - Do not acquire the process spinlock if neither WTRAPPED nor WUNTRACED options were passed [1]. - Extract the code to report alive process into a new helper report_alive_proc() and use it for trapped, stopped and continued childrens. Note that the process spinlock is required around the WTRAPPED and WUNTRACED tests, because P_STOPPED_TRACE and P_STOPPED_SIG flags are set before other threads are stopped at the suspension point, and that threads increment p_suspcount while owning only the process spinlock, the process lock is dropped by them. If the spinlock is not taken for tests, the syscall thread might miss both p_suspcount increment and wakeup in wakeup in thread_suspend_switch(). Based on the submission by: mjg [1] Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sun Dec 4 16:04:22 2016 (r309538) +++ head/sys/kern/kern_exit.c Sun Dec 4 20:44:58 2016 (r309539) @@ -1105,6 +1105,38 @@ kern_wait(struct thread *td, pid_t pid, return (ret); } +static void +report_alive_proc(struct thread *td, struct proc *p, siginfo_t *siginfo, + int *status, int options, int si_code) +{ + bool cont; + + PROC_LOCK_ASSERT(p, MA_OWNED); + sx_assert(&proctree_lock, SA_XLOCKED); + MPASS(si_code == CLD_TRAPPED || si_code == CLD_STOPPED || + si_code == CLD_CONTINUED); + + cont = si_code == CLD_CONTINUED; + if ((options & WNOWAIT) == 0) { + if (cont) + p->p_flag &= ~P_CONTINUED; + else + p->p_flag |= P_WAITED; + PROC_LOCK(td->td_proc); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(td->td_proc); + } + sx_xunlock(&proctree_lock); + if (siginfo != NULL) { + siginfo->si_code = si_code; + siginfo->si_status = cont ? SIGCONT : p->p_xsig; + } + if (status != NULL) + *status = cont ? SIGCONT : W_STOPCODE(p->p_xsig); + PROC_UNLOCK(p); + td->td_retval[0] = p->p_pid; +} + int kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *siginfo) @@ -1162,82 +1194,41 @@ loop: } PROC_LOCK_ASSERT(p, MA_OWNED); - PROC_SLOCK(p); + + if ((options & (WTRAPPED | WUNTRACED)) != 0) + PROC_SLOCK(p); if ((options & WTRAPPED) != 0 && (p->p_flag & P_TRACED) != 0 && (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && - (p->p_suspcount == p->p_numthreads) && - ((p->p_flag & P_WAITED) == 0)) { + p->p_suspcount == p->p_numthreads && + (p->p_flag & P_WAITED) == 0) { PROC_SUNLOCK(p); - if ((options & WNOWAIT) == 0) - p->p_flag |= P_WAITED; - sx_xunlock(&proctree_lock); - - if (status != NULL) - *status = W_STOPCODE(p->p_xsig); - if (siginfo != NULL) { - siginfo->si_status = p->p_xsig; - siginfo->si_code = CLD_TRAPPED; - } - if ((options & WNOWAIT) == 0) { - PROC_LOCK(q); - sigqueue_take(p->p_ksi); - PROC_UNLOCK(q); - } - CTR4(KTR_PTRACE, - "wait: returning trapped pid %d status %#x (xstat %d) xthread %d", + "wait: returning trapped pid %d status %#x " + "(xstat %d) xthread %d", p->p_pid, W_STOPCODE(p->p_xsig), p->p_xsig, - p->p_xthread != NULL ? p->p_xthread->td_tid : -1); - PROC_UNLOCK(p); - td->td_retval[0] = pid; + p->p_xthread != NULL ? + p->p_xthread->td_tid : -1); + report_alive_proc(td, p, siginfo, status, options, + CLD_TRAPPED); return (0); - } + } if ((options & WUNTRACED) != 0 && (p->p_flag & P_STOPPED_SIG) != 0 && - (p->p_suspcount == p->p_numthreads) && - ((p->p_flag & P_WAITED) == 0)) { + p->p_suspcount == p->p_numthreads && + (p->p_flag & P_WAITED) == 0) { PROC_SUNLOCK(p); - if ((options & WNOWAIT) == 0) - p->p_flag |= P_WAITED; - sx_xunlock(&proctree_lock); - - if (status != NULL) - *status = W_STOPCODE(p->p_xsig); - if (siginfo != NULL) { - siginfo->si_status = p->p_xsig; - siginfo->si_code = CLD_STOPPED; - } - if ((options & WNOWAIT) == 0) { - PROC_LOCK(q); - sigqueue_take(p->p_ksi); - PROC_UNLOCK(q); - } - - PROC_UNLOCK(p); - td->td_retval[0] = pid; + report_alive_proc(td, p, siginfo, status, options, + CLD_STOPPED); return (0); } - PROC_SUNLOCK(p); + if ((options & (WTRAPPED | WUNTRACED)) != 0) + PROC_SUNLOCK(p); if ((options & WCONTINUED) != 0 && (p->p_flag & P_CONTINUED) != 0) { - sx_xunlock(&proctree_lock); - if ((options & WNOWAIT) == 0) { - p->p_flag &= ~P_CONTINUED; - PROC_LOCK(q); - sigqueue_take(p->p_ksi); - PROC_UNLOCK(q); - } - PROC_UNLOCK(p); - - if (status != NULL) - *status = SIGCONT; - if (siginfo != NULL) { - siginfo->si_status = SIGCONT; - siginfo->si_code = CLD_CONTINUED; - } - td->td_retval[0] = pid; + report_alive_proc(td, p, siginfo, status, options, + CLD_CONTINUED); return (0); } PROC_UNLOCK(p); From owner-svn-src-head@freebsd.org Sun Dec 4 21:13:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D482DC66978; Sun, 4 Dec 2016 21:13:29 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6AB78BEF; Sun, 4 Dec 2016 21:13:29 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB4LDSi1006990; Sun, 4 Dec 2016 21:13:28 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4LDRO2006973; Sun, 4 Dec 2016 21:13:27 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201612042113.uB4LDRO2006973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Sun, 4 Dec 2016 21:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309540 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 21:13:30 -0000 Author: jasone Date: Sun Dec 4 21:13:26 2016 New Revision: 309540 URL: https://svnweb.freebsd.org/changeset/base/309540 Log: Update jemalloc to 4.4.0. Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/arena.h head/contrib/jemalloc/include/jemalloc/internal/chunk.h head/contrib/jemalloc/include/jemalloc/internal/extent.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h head/contrib/jemalloc/include/jemalloc/internal/pages.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/internal/stats.h head/contrib/jemalloc/include/jemalloc/internal/util.h head/contrib/jemalloc/include/jemalloc/internal/valgrind.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/base.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/chunk_dss.c head/contrib/jemalloc/src/extent.c head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/pages.c head/contrib/jemalloc/src/stats.c head/contrib/jemalloc/src/tcache.c head/contrib/jemalloc/src/util.c Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/ChangeLog Sun Dec 4 21:13:26 2016 (r309540) @@ -4,6 +4,33 @@ brevity. Much more detail can be found https://github.com/jemalloc/jemalloc +* 4.4.0 (December 3, 2016) + + New features: + - Add configure support for *-*-linux-android. (@cferris1000, @jasone) + - Add the --disable-syscall configure option, for use on systems that place + security-motivated limitations on syscall(2). (@jasone) + - Add support for Debian GNU/kFreeBSD. (@thesam) + + Optimizations: + - Add extent serial numbers and use them where appropriate as a sort key that + is higher priority than address, so that the allocation policy prefers older + extents. This tends to improve locality (decrease fragmentation) when + memory grows downward. (@jasone) + - Refactor madvise(2) configuration so that MADV_FREE is detected and utilized + on Linux 4.5 and newer. (@jasone) + - Mark partially purged arena chunks as non-huge-page. This improves + interaction with Linux's transparent huge page functionality. (@jasone) + + Bug fixes: + - Fix size class computations for edge conditions involving extremely large + allocations. This regression was first released in 4.0.0. (@jasone, + @ingvarha) + - Remove overly restrictive assertions related to the cactive statistic. This + regression was first released in 4.1.0. (@jasone) + - Implement a more reliable detection scheme for os_unfair_lock on macOS. + (@jszakmeister) + * 4.3.1 (November 7, 2016) Bug fixes: Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/FREEBSD-diffs Sun Dec 4 21:13:26 2016 (r309540) @@ -1,5 +1,5 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index 3d2e721..b361db2 100644 +index d9c8345..9898c3c 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -53,11 +53,23 @@ @@ -47,10 +47,10 @@ index 3d2e721..b361db2 100644 + diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h -index f39ce54..a3ba55d 100644 +index ce4e602..35360b6 100644 --- a/include/jemalloc/internal/arena.h +++ b/include/jemalloc/internal/arena.h -@@ -719,8 +719,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t pageind) +@@ -730,8 +730,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t pageind) JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t * arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind) { @@ -64,7 +64,7 @@ index f39ce54..a3ba55d 100644 } JEMALLOC_ALWAYS_INLINE size_t -@@ -779,8 +784,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t pageind) +@@ -790,8 +795,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t pageind) JEMALLOC_ALWAYS_INLINE const size_t * arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind) { @@ -79,7 +79,7 @@ index f39ce54..a3ba55d 100644 JEMALLOC_ALWAYS_INLINE size_t diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index fdc8fef..56a35a4 100644 +index e7ace7d..d86c61d 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -8,6 +8,9 @@ @@ -144,10 +144,10 @@ index b442d2d..76518db 100644 #endif /* JEMALLOC_H_EXTERNS */ diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt -index 87c8c9b..df576f6 100644 +index c1c6c40..c6395fd 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt -@@ -307,7 +307,6 @@ iralloct_realign +@@ -310,7 +310,6 @@ iralloct_realign isalloc isdalloct isqalloc @@ -335,7 +335,7 @@ index f943891..47d032c 100755 +#include "jemalloc_FreeBSD.h" EOF diff --git a/src/jemalloc.c b/src/jemalloc.c -index 38650ff..f659b55 100644 +index baead66..8a49f26 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -4,6 +4,10 @@ @@ -349,7 +349,7 @@ index 38650ff..f659b55 100644 /* Runtime configuration options. */ const char *je_malloc_conf #ifndef _WIN32 -@@ -2756,6 +2760,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) +@@ -2775,6 +2779,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) */ /******************************************************************************/ /* @@ -457,7 +457,7 @@ index 38650ff..f659b55 100644 * The following functions are used by threading libraries for protection of * malloc during fork(). */ -@@ -2894,4 +2999,11 @@ jemalloc_postfork_child(void) +@@ -2913,4 +3018,11 @@ jemalloc_postfork_child(void) ctl_postfork_child(tsd_tsdn(tsd)); } @@ -516,7 +516,7 @@ index 6333e73..13f8d79 100644 +#endif +} diff --git a/src/util.c b/src/util.c -index 7905267..bee1c77 100644 +index dd8c236..a4ff287 100755 --- a/src/util.c +++ b/src/util.c @@ -67,6 +67,22 @@ wrtmessage(void *cbopaque, const char *s) Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/VERSION Sun Dec 4 21:13:26 2016 (r309540) @@ -1 +1 @@ -4.3.1-0-g0110fa8451af905affd77c3bea0d545fee2251b2 +4.4.0-0-gf1f76357313e7dcad7262f17a48ff0a2e005fcdc Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/doc/jemalloc.3 Sun Dec 4 21:13:26 2016 (r309540) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 11/08/2016 +.\" Date: 12/04/2016 .\" Manual: User Manual -.\" Source: jemalloc 4.3.1-0-g0110fa8451af905affd77c3bea0d545fee2251b2 +.\" Source: jemalloc 4.4.0-0-gf1f76357313e7dcad7262f17a48ff0a2e005fcdc .\" Language: English .\" -.TH "JEMALLOC" "3" "11/08/2016" "jemalloc 4.3.1-0-g0110fa8451af" "User Manual" +.TH "JEMALLOC" "3" "12/04/2016" "jemalloc 4.4.0-0-gf1f76357313e" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 4\&.3\&.1\-0\-g0110fa8451af905affd77c3bea0d545fee2251b2\&. More information can be found at the +This manual describes jemalloc 4\&.4\&.0\-0\-gf1f76357313e7dcad7262f17a48ff0a2e005fcdc\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: @@ -365,7 +365,7 @@ for (i = 0; i < nbins; i++) { mib[2] = i; len = sizeof(bin_size); - mallctlbymib(mib, miblen, &bin_size, &len, NULL, 0); + mallctlbymib(mib, miblen, (void *)&bin_size, &len, NULL, 0); /* Do something with bin_size\&.\&.\&. */ } .fi Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/arena.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/arena.h Sun Dec 4 21:13:26 2016 (r309540) @@ -191,6 +191,14 @@ struct arena_chunk_s { extent_node_t node; /* + * True if memory could be backed by transparent huge pages. This is + * only directly relevant to Linux, since it is the only supported + * platform on which jemalloc interacts with explicit transparent huge + * page controls. + */ + bool hugepage; + + /* * Map of pages within chunk that keeps track of free/large/small. The * first map_bias entries are omitted, since the chunk header does not * need to be tracked in the map. This omission saves a header page @@ -374,10 +382,12 @@ struct arena_s { dss_prec_t dss_prec; - /* Extant arena chunks. */ ql_head(extent_node_t) achunks; + /* Extent serial number generator state. */ + size_t extent_sn_next; + /* * In order to avoid rapid chunk allocation/deallocation when an arena * oscillates right on the cusp of needing a new chunk, cache the most @@ -453,9 +463,9 @@ struct arena_s { * orderings are needed, which is why there are two trees with the same * contents. */ - extent_tree_t chunks_szad_cached; + extent_tree_t chunks_szsnad_cached; extent_tree_t chunks_ad_cached; - extent_tree_t chunks_szad_retained; + extent_tree_t chunks_szsnad_retained; extent_tree_t chunks_ad_retained; malloc_mutex_t chunks_mtx; @@ -522,13 +532,13 @@ void arena_chunk_cache_maybe_remove(aren extent_node_t *arena_node_alloc(tsdn_t *tsdn, arena_t *arena); void arena_node_dalloc(tsdn_t *tsdn, arena_t *arena, extent_node_t *node); void *arena_chunk_alloc_huge(tsdn_t *tsdn, arena_t *arena, size_t usize, - size_t alignment, bool *zero); + size_t alignment, size_t *sn, bool *zero); void arena_chunk_dalloc_huge(tsdn_t *tsdn, arena_t *arena, void *chunk, - size_t usize); + size_t usize, size_t sn); void arena_chunk_ralloc_huge_similar(tsdn_t *tsdn, arena_t *arena, void *chunk, size_t oldsize, size_t usize); void arena_chunk_ralloc_huge_shrink(tsdn_t *tsdn, arena_t *arena, - void *chunk, size_t oldsize, size_t usize); + void *chunk, size_t oldsize, size_t usize, size_t sn); bool arena_chunk_ralloc_huge_expand(tsdn_t *tsdn, arena_t *arena, void *chunk, size_t oldsize, size_t usize, bool *zero); ssize_t arena_lg_dirty_mult_get(tsdn_t *tsdn, arena_t *arena); @@ -601,6 +611,7 @@ void arena_stats_merge(tsdn_t *tsdn, are unsigned arena_nthreads_get(arena_t *arena, bool internal); void arena_nthreads_inc(arena_t *arena, bool internal); void arena_nthreads_dec(arena_t *arena, bool internal); +size_t arena_extent_sn_next(arena_t *arena); arena_t *arena_new(tsdn_t *tsdn, unsigned ind); void arena_boot(void); void arena_prefork0(tsdn_t *tsdn, arena_t *arena); Modified: head/contrib/jemalloc/include/jemalloc/internal/chunk.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/chunk.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/chunk.h Sun Dec 4 21:13:26 2016 (r309540) @@ -58,15 +58,16 @@ void chunk_deregister(const void *chunk, void *chunk_alloc_base(size_t size); void *chunk_alloc_cache(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks, void *new_addr, size_t size, size_t alignment, - bool *zero, bool *commit, bool dalloc_node); + size_t *sn, bool *zero, bool *commit, bool dalloc_node); void *chunk_alloc_wrapper(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks, void *new_addr, size_t size, size_t alignment, - bool *zero, bool *commit); + size_t *sn, bool *zero, bool *commit); void chunk_dalloc_cache(tsdn_t *tsdn, arena_t *arena, - chunk_hooks_t *chunk_hooks, void *chunk, size_t size, bool committed); -void chunk_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena, - chunk_hooks_t *chunk_hooks, void *chunk, size_t size, bool zeroed, + chunk_hooks_t *chunk_hooks, void *chunk, size_t size, size_t sn, bool committed); +void chunk_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena, + chunk_hooks_t *chunk_hooks, void *chunk, size_t size, size_t sn, + bool zeroed, bool committed); bool chunk_purge_wrapper(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks, void *chunk, size_t size, size_t offset, size_t length); Modified: head/contrib/jemalloc/include/jemalloc/internal/extent.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/extent.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/extent.h Sun Dec 4 21:13:26 2016 (r309540) @@ -19,6 +19,20 @@ struct extent_node_s { size_t en_size; /* + * Serial number (potentially non-unique). + * + * In principle serial numbers can wrap around on 32-bit systems if + * JEMALLOC_MUNMAP is defined, but as long as comparison functions fall + * back on address comparison for equal serial numbers, stable (if + * imperfect) ordering is maintained. + * + * Serial numbers may not be unique even in the absence of wrap-around, + * e.g. when splitting an extent and assigning the same serial number to + * both resulting adjacent extents. + */ + size_t en_sn; + + /* * The zeroed flag is used by chunk recycling code to track whether * memory is zero-filled. */ @@ -45,8 +59,8 @@ struct extent_node_s { qr(extent_node_t) cc_link; union { - /* Linkage for the size/address-ordered tree. */ - rb_node(extent_node_t) szad_link; + /* Linkage for the size/sn/address-ordered tree. */ + rb_node(extent_node_t) szsnad_link; /* Linkage for arena's achunks, huge, and node_cache lists. */ ql_elm(extent_node_t) ql_link; @@ -61,7 +75,7 @@ typedef rb_tree(extent_node_t) extent_tr /******************************************************************************/ #ifdef JEMALLOC_H_EXTERNS -rb_proto(, extent_tree_szad_, extent_tree_t, extent_node_t) +rb_proto(, extent_tree_szsnad_, extent_tree_t, extent_node_t) rb_proto(, extent_tree_ad_, extent_tree_t, extent_node_t) @@ -73,6 +87,7 @@ rb_proto(, extent_tree_ad_, extent_tree_ arena_t *extent_node_arena_get(const extent_node_t *node); void *extent_node_addr_get(const extent_node_t *node); size_t extent_node_size_get(const extent_node_t *node); +size_t extent_node_sn_get(const extent_node_t *node); bool extent_node_zeroed_get(const extent_node_t *node); bool extent_node_committed_get(const extent_node_t *node); bool extent_node_achunk_get(const extent_node_t *node); @@ -80,12 +95,13 @@ prof_tctx_t *extent_node_prof_tctx_get(c void extent_node_arena_set(extent_node_t *node, arena_t *arena); void extent_node_addr_set(extent_node_t *node, void *addr); void extent_node_size_set(extent_node_t *node, size_t size); +void extent_node_sn_set(extent_node_t *node, size_t sn); void extent_node_zeroed_set(extent_node_t *node, bool zeroed); void extent_node_committed_set(extent_node_t *node, bool committed); void extent_node_achunk_set(extent_node_t *node, bool achunk); void extent_node_prof_tctx_set(extent_node_t *node, prof_tctx_t *tctx); void extent_node_init(extent_node_t *node, arena_t *arena, void *addr, - size_t size, bool zeroed, bool committed); + size_t size, size_t sn, bool zeroed, bool committed); void extent_node_dirty_linkage_init(extent_node_t *node); void extent_node_dirty_insert(extent_node_t *node, arena_runs_dirty_link_t *runs_dirty, extent_node_t *chunks_dirty); @@ -114,6 +130,13 @@ extent_node_size_get(const extent_node_t return (node->en_size); } +JEMALLOC_INLINE size_t +extent_node_sn_get(const extent_node_t *node) +{ + + return (node->en_sn); +} + JEMALLOC_INLINE bool extent_node_zeroed_get(const extent_node_t *node) { @@ -165,6 +188,13 @@ extent_node_size_set(extent_node_t *node } JEMALLOC_INLINE void +extent_node_sn_set(extent_node_t *node, size_t sn) +{ + + node->en_sn = sn; +} + +JEMALLOC_INLINE void extent_node_zeroed_set(extent_node_t *node, bool zeroed) { @@ -194,12 +224,13 @@ extent_node_prof_tctx_set(extent_node_t JEMALLOC_INLINE void extent_node_init(extent_node_t *node, arena_t *arena, void *addr, size_t size, - bool zeroed, bool committed) + size_t sn, bool zeroed, bool committed) { extent_node_arena_set(node, arena); extent_node_addr_set(node, addr); extent_node_size_set(node, size); + extent_node_sn_set(node, sn); extent_node_zeroed_set(node, zeroed); extent_node_committed_set(node, committed); extent_node_achunk_set(node, false); Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Sun Dec 4 21:13:26 2016 (r309540) @@ -334,7 +334,7 @@ typedef unsigned szind_t; /* Return the nearest aligned address at or below a. */ #define ALIGNMENT_ADDR2BASE(a, alignment) \ - ((void *)((uintptr_t)(a) & (-(alignment)))) + ((void *)((uintptr_t)(a) & ((~(alignment)) + 1))) /* Return the offset between a and the nearest aligned address at or below a. */ #define ALIGNMENT_ADDR2OFFSET(a, alignment) \ @@ -342,7 +342,7 @@ typedef unsigned szind_t; /* Return the smallest alignment multiple that is >= s. */ #define ALIGNMENT_CEILING(s, alignment) \ - (((s) + (alignment - 1)) & (-(alignment))) + (((s) + (alignment - 1)) & ((~(alignment)) + 1)) /* Declare a variable-length array. */ #if __STDC_VERSION__ < 199901L Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h Sun Dec 4 21:13:26 2016 (r309540) @@ -57,11 +57,6 @@ #define JEMALLOC_HAVE_BUILTIN_CLZ /* - * Defined if madvise(2) is available. - */ -#define JEMALLOC_HAVE_MADVISE - -/* * Defined if os_unfair_lock_*() functions are available, as provided by Darwin. */ /* #undef JEMALLOC_OS_UNFAIR_LOCK */ @@ -72,8 +67,8 @@ */ /* #undef JEMALLOC_OSSPIN */ -/* Defined if syscall(2) is available. */ -#define JEMALLOC_HAVE_SYSCALL +/* Defined if syscall(2) is usable. */ +#define JEMALLOC_USE_SYSCALL /* * Defined if secure_getenv(3) is available. @@ -85,6 +80,9 @@ */ #define JEMALLOC_HAVE_ISSETUGID +/* Defined if pthread_atfork(3) is available. */ +#define JEMALLOC_HAVE_PTHREAD_ATFORK + /* * Defined if clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is available. */ @@ -253,18 +251,26 @@ #define JEMALLOC_SYSCTL_VM_OVERCOMMIT /* #undef JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY */ +/* Defined if madvise(2) is available. */ +#define JEMALLOC_HAVE_MADVISE + /* * Methods for purging unused pages differ between operating systems. * - * madvise(..., MADV_DONTNEED) : On Linux, this immediately discards pages, - * such that new pages will be demand-zeroed if - * the address region is later touched. - * madvise(..., MADV_FREE) : On FreeBSD and Darwin, this marks pages as being - * unused, such that they will be discarded rather - * than swapped out. + * madvise(..., MADV_FREE) : This marks pages as being unused, such that they + * will be discarded rather than swapped out. + * madvise(..., MADV_DONTNEED) : This immediately discards pages, such that + * new pages will be demand-zeroed if the + * address region is later touched. */ -/* #undef JEMALLOC_PURGE_MADVISE_DONTNEED */ #define JEMALLOC_PURGE_MADVISE_FREE +#define JEMALLOC_PURGE_MADVISE_DONTNEED + +/* + * Defined if transparent huge pages are supported via the MADV_[NO]HUGEPAGE + * arguments to madvise(2). + */ +/* #undef JEMALLOC_THP */ /* Define if operating system has alloca.h header. */ /* #undef JEMALLOC_HAS_ALLOCA_H */ Modified: head/contrib/jemalloc/include/jemalloc/internal/pages.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/pages.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/pages.h Sun Dec 4 21:13:26 2016 (r309540) @@ -16,6 +16,8 @@ void *pages_trim(void *addr, size_t allo bool pages_commit(void *addr, size_t size); bool pages_decommit(void *addr, size_t size); bool pages_purge(void *addr, size_t size); +bool pages_huge(void *addr, size_t size); +bool pages_nohuge(void *addr, size_t size); void pages_boot(void); #endif /* JEMALLOC_H_EXTERNS */ Modified: head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h Sun Dec 4 21:13:26 2016 (r309540) @@ -36,6 +36,7 @@ #define arena_decay_time_set JEMALLOC_N(arena_decay_time_set) #define arena_dss_prec_get JEMALLOC_N(arena_dss_prec_get) #define arena_dss_prec_set JEMALLOC_N(arena_dss_prec_set) +#define arena_extent_sn_next JEMALLOC_N(arena_extent_sn_next) #define arena_get JEMALLOC_N(arena_get) #define arena_ichoose JEMALLOC_N(arena_ichoose) #define arena_init JEMALLOC_N(arena_init) @@ -218,6 +219,8 @@ #define extent_node_prof_tctx_set JEMALLOC_N(extent_node_prof_tctx_set) #define extent_node_size_get JEMALLOC_N(extent_node_size_get) #define extent_node_size_set JEMALLOC_N(extent_node_size_set) +#define extent_node_sn_get JEMALLOC_N(extent_node_sn_get) +#define extent_node_sn_set JEMALLOC_N(extent_node_sn_set) #define extent_node_zeroed_get JEMALLOC_N(extent_node_zeroed_get) #define extent_node_zeroed_set JEMALLOC_N(extent_node_zeroed_set) #define extent_tree_ad_destroy JEMALLOC_N(extent_tree_ad_destroy) @@ -239,25 +242,25 @@ #define extent_tree_ad_reverse_iter_recurse JEMALLOC_N(extent_tree_ad_reverse_iter_recurse) #define extent_tree_ad_reverse_iter_start JEMALLOC_N(extent_tree_ad_reverse_iter_start) #define extent_tree_ad_search JEMALLOC_N(extent_tree_ad_search) -#define extent_tree_szad_destroy JEMALLOC_N(extent_tree_szad_destroy) -#define extent_tree_szad_destroy_recurse JEMALLOC_N(extent_tree_szad_destroy_recurse) -#define extent_tree_szad_empty JEMALLOC_N(extent_tree_szad_empty) -#define extent_tree_szad_first JEMALLOC_N(extent_tree_szad_first) -#define extent_tree_szad_insert JEMALLOC_N(extent_tree_szad_insert) -#define extent_tree_szad_iter JEMALLOC_N(extent_tree_szad_iter) -#define extent_tree_szad_iter_recurse JEMALLOC_N(extent_tree_szad_iter_recurse) -#define extent_tree_szad_iter_start JEMALLOC_N(extent_tree_szad_iter_start) -#define extent_tree_szad_last JEMALLOC_N(extent_tree_szad_last) -#define extent_tree_szad_new JEMALLOC_N(extent_tree_szad_new) -#define extent_tree_szad_next JEMALLOC_N(extent_tree_szad_next) -#define extent_tree_szad_nsearch JEMALLOC_N(extent_tree_szad_nsearch) -#define extent_tree_szad_prev JEMALLOC_N(extent_tree_szad_prev) -#define extent_tree_szad_psearch JEMALLOC_N(extent_tree_szad_psearch) -#define extent_tree_szad_remove JEMALLOC_N(extent_tree_szad_remove) -#define extent_tree_szad_reverse_iter JEMALLOC_N(extent_tree_szad_reverse_iter) -#define extent_tree_szad_reverse_iter_recurse JEMALLOC_N(extent_tree_szad_reverse_iter_recurse) -#define extent_tree_szad_reverse_iter_start JEMALLOC_N(extent_tree_szad_reverse_iter_start) -#define extent_tree_szad_search JEMALLOC_N(extent_tree_szad_search) +#define extent_tree_szsnad_destroy JEMALLOC_N(extent_tree_szsnad_destroy) +#define extent_tree_szsnad_destroy_recurse JEMALLOC_N(extent_tree_szsnad_destroy_recurse) +#define extent_tree_szsnad_empty JEMALLOC_N(extent_tree_szsnad_empty) +#define extent_tree_szsnad_first JEMALLOC_N(extent_tree_szsnad_first) +#define extent_tree_szsnad_insert JEMALLOC_N(extent_tree_szsnad_insert) +#define extent_tree_szsnad_iter JEMALLOC_N(extent_tree_szsnad_iter) +#define extent_tree_szsnad_iter_recurse JEMALLOC_N(extent_tree_szsnad_iter_recurse) +#define extent_tree_szsnad_iter_start JEMALLOC_N(extent_tree_szsnad_iter_start) +#define extent_tree_szsnad_last JEMALLOC_N(extent_tree_szsnad_last) +#define extent_tree_szsnad_new JEMALLOC_N(extent_tree_szsnad_new) +#define extent_tree_szsnad_next JEMALLOC_N(extent_tree_szsnad_next) +#define extent_tree_szsnad_nsearch JEMALLOC_N(extent_tree_szsnad_nsearch) +#define extent_tree_szsnad_prev JEMALLOC_N(extent_tree_szsnad_prev) +#define extent_tree_szsnad_psearch JEMALLOC_N(extent_tree_szsnad_psearch) +#define extent_tree_szsnad_remove JEMALLOC_N(extent_tree_szsnad_remove) +#define extent_tree_szsnad_reverse_iter JEMALLOC_N(extent_tree_szsnad_reverse_iter) +#define extent_tree_szsnad_reverse_iter_recurse JEMALLOC_N(extent_tree_szsnad_reverse_iter_recurse) +#define extent_tree_szsnad_reverse_iter_start JEMALLOC_N(extent_tree_szsnad_reverse_iter_start) +#define extent_tree_szsnad_search JEMALLOC_N(extent_tree_szsnad_search) #define ffs_llu JEMALLOC_N(ffs_llu) #define ffs_lu JEMALLOC_N(ffs_lu) #define ffs_u JEMALLOC_N(ffs_u) @@ -393,7 +396,9 @@ #define pages_boot JEMALLOC_N(pages_boot) #define pages_commit JEMALLOC_N(pages_commit) #define pages_decommit JEMALLOC_N(pages_decommit) +#define pages_huge JEMALLOC_N(pages_huge) #define pages_map JEMALLOC_N(pages_map) +#define pages_nohuge JEMALLOC_N(pages_nohuge) #define pages_purge JEMALLOC_N(pages_purge) #define pages_trim JEMALLOC_N(pages_trim) #define pages_unmap JEMALLOC_N(pages_unmap) Modified: head/contrib/jemalloc/include/jemalloc/internal/stats.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/stats.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/stats.h Sun Dec 4 21:13:26 2016 (r309540) @@ -175,25 +175,21 @@ stats_cactive_get(void) JEMALLOC_INLINE void stats_cactive_add(size_t size) { - UNUSED size_t cactive; assert(size > 0); assert((size & chunksize_mask) == 0); - cactive = atomic_add_z(&stats_cactive, size); - assert(cactive - size < cactive); + atomic_add_z(&stats_cactive, size); } JEMALLOC_INLINE void stats_cactive_sub(size_t size) { - UNUSED size_t cactive; assert(size > 0); assert((size & chunksize_mask) == 0); - cactive = atomic_sub_z(&stats_cactive, size); - assert(cactive + size > cactive); + atomic_sub_z(&stats_cactive, size); } #endif Modified: head/contrib/jemalloc/include/jemalloc/internal/util.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/util.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/util.h Sun Dec 4 21:13:26 2016 (r309540) @@ -41,8 +41,12 @@ #define MALLOC_PRINTF_BUFSIZE 4096 /* Junk fill patterns. */ -#define JEMALLOC_ALLOC_JUNK ((uint8_t)0xa5) -#define JEMALLOC_FREE_JUNK ((uint8_t)0x5a) +#ifndef JEMALLOC_ALLOC_JUNK +# define JEMALLOC_ALLOC_JUNK ((uint8_t)0xa5) +#endif +#ifndef JEMALLOC_FREE_JUNK +# define JEMALLOC_FREE_JUNK ((uint8_t)0x5a) +#endif /* * Wrap a cpp argument that contains commas such that it isn't broken up into Modified: head/contrib/jemalloc/include/jemalloc/internal/valgrind.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/valgrind.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/internal/valgrind.h Sun Dec 4 21:13:26 2016 (r309540) @@ -36,13 +36,25 @@ zero); \ } \ } while (0) -#define JEMALLOC_VALGRIND_REALLOC(maybe_moved, tsdn, ptr, usize, \ - ptr_maybe_null, old_ptr, old_usize, old_rzsize, old_ptr_maybe_null, \ - zero) do { \ +#define JEMALLOC_VALGRIND_REALLOC_MOVED_no(ptr, old_ptr) \ + (false) +#define JEMALLOC_VALGRIND_REALLOC_MOVED_maybe(ptr, old_ptr) \ + ((ptr) != (old_ptr)) +#define JEMALLOC_VALGRIND_REALLOC_PTR_NULL_no(ptr) \ + (false) +#define JEMALLOC_VALGRIND_REALLOC_PTR_NULL_maybe(ptr) \ + (ptr == NULL) +#define JEMALLOC_VALGRIND_REALLOC_OLD_PTR_NULL_no(old_ptr) \ + (false) +#define JEMALLOC_VALGRIND_REALLOC_OLD_PTR_NULL_maybe(old_ptr) \ + (old_ptr == NULL) +#define JEMALLOC_VALGRIND_REALLOC(moved, tsdn, ptr, usize, ptr_null, \ + old_ptr, old_usize, old_rzsize, old_ptr_null, zero) do { \ if (unlikely(in_valgrind)) { \ size_t rzsize = p2rz(tsdn, ptr); \ \ - if (!maybe_moved || ptr == old_ptr) { \ + if (!JEMALLOC_VALGRIND_REALLOC_MOVED_##moved(ptr, \ + old_ptr)) { \ VALGRIND_RESIZEINPLACE_BLOCK(ptr, old_usize, \ usize, rzsize); \ if (zero && old_usize < usize) { \ @@ -51,11 +63,13 @@ old_usize), usize - old_usize); \ } \ } else { \ - if (!old_ptr_maybe_null || old_ptr != NULL) { \ + if (!JEMALLOC_VALGRIND_REALLOC_OLD_PTR_NULL_## \ + old_ptr_null(old_ptr)) { \ valgrind_freelike_block(old_ptr, \ old_rzsize); \ } \ - if (!ptr_maybe_null || ptr != NULL) { \ + if (!JEMALLOC_VALGRIND_REALLOC_PTR_NULL_## \ + ptr_null(ptr)) { \ size_t copy_size = (old_usize < usize) \ ? old_usize : usize; \ size_t tail_size = usize - copy_size; \ Modified: head/contrib/jemalloc/include/jemalloc/jemalloc.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc.h Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/include/jemalloc/jemalloc.h Sun Dec 4 21:13:26 2016 (r309540) @@ -87,12 +87,12 @@ extern "C" { #include #include -#define JEMALLOC_VERSION "4.3.1-0-g0110fa8451af905affd77c3bea0d545fee2251b2" +#define JEMALLOC_VERSION "4.4.0-0-gf1f76357313e7dcad7262f17a48ff0a2e005fcdc" #define JEMALLOC_VERSION_MAJOR 4 -#define JEMALLOC_VERSION_MINOR 3 -#define JEMALLOC_VERSION_BUGFIX 1 +#define JEMALLOC_VERSION_MINOR 4 +#define JEMALLOC_VERSION_BUGFIX 0 #define JEMALLOC_VERSION_NREV 0 -#define JEMALLOC_VERSION_GID "0110fa8451af905affd77c3bea0d545fee2251b2" +#define JEMALLOC_VERSION_GID "f1f76357313e7dcad7262f17a48ff0a2e005fcdc" # define MALLOCX_LG_ALIGN(la) ((int)(la)) # if LG_SIZEOF_PTR == 2 Modified: head/contrib/jemalloc/src/arena.c ============================================================================== --- head/contrib/jemalloc/src/arena.c Sun Dec 4 20:44:58 2016 (r309539) +++ head/contrib/jemalloc/src/arena.c Sun Dec 4 21:13:26 2016 (r309540) @@ -38,8 +38,8 @@ static void arena_run_dalloc(tsdn_t *tsd bool dirty, bool cleaned, bool decommitted); static void arena_dalloc_bin_run(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, arena_bin_t *bin); -static void arena_bin_lower_run(arena_t *arena, arena_chunk_t *chunk, - arena_run_t *run, arena_bin_t *bin); +static void arena_bin_lower_run(arena_t *arena, arena_run_t *run, + arena_bin_t *bin); /******************************************************************************/ @@ -55,8 +55,31 @@ arena_miscelm_size_get(const arena_chunk return (arena_mapbits_size_decode(mapbits)); } +JEMALLOC_INLINE_C const extent_node_t * +arena_miscelm_extent_get(const arena_chunk_map_misc_t *miscelm) +{ + arena_chunk_t *chunk; + + chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(miscelm); + return (&chunk->node); +} + +JEMALLOC_INLINE_C int +arena_sn_comp(const arena_chunk_map_misc_t *a, const arena_chunk_map_misc_t *b) +{ + size_t a_sn, b_sn; + + assert(a != NULL); + assert(b != NULL); + + a_sn = extent_node_sn_get(arena_miscelm_extent_get(a)); + b_sn = extent_node_sn_get(arena_miscelm_extent_get(b)); + + return ((a_sn > b_sn) - (a_sn < b_sn)); +} + JEMALLOC_INLINE_C int -arena_run_addr_comp(const arena_chunk_map_misc_t *a, +arena_ad_comp(const arena_chunk_map_misc_t *a, const arena_chunk_map_misc_t *b) { uintptr_t a_miscelm = (uintptr_t)a; @@ -68,9 +91,26 @@ arena_run_addr_comp(const arena_chunk_ma return ((a_miscelm > b_miscelm) - (a_miscelm < b_miscelm)); } +JEMALLOC_INLINE_C int +arena_snad_comp(const arena_chunk_map_misc_t *a, + const arena_chunk_map_misc_t *b) +{ + int ret; + + assert(a != NULL); + assert(b != NULL); + + ret = arena_sn_comp(a, b); + if (ret != 0) + return (ret); + + ret = arena_ad_comp(a, b); + return (ret); +} + /* Generate pairing heap functions. */ ph_gen(static UNUSED, arena_run_heap_, arena_run_heap_t, arena_chunk_map_misc_t, - ph_link, arena_run_addr_comp) + ph_link, arena_snad_comp) #ifdef JEMALLOC_JET #undef run_quantize_floor @@ -529,7 +569,7 @@ arena_chunk_init_spare(arena_t *arena) static bool arena_chunk_register(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk, - bool zero) + size_t sn, bool zero) { /* @@ -538,7 +578,7 @@ arena_chunk_register(tsdn_t *tsdn, arena * of runs is tracked individually, and upon chunk deallocation the * entire chunk is in a consistent commit state. */ - extent_node_init(&chunk->node, arena, chunk, chunksize, zero, true); + extent_node_init(&chunk->node, arena, chunk, chunksize, sn, zero, true); extent_node_achunk_set(&chunk->node, true); return (chunk_register(tsdn, chunk, &chunk->node)); } @@ -548,28 +588,30 @@ arena_chunk_alloc_internal_hard(tsdn_t * chunk_hooks_t *chunk_hooks, bool *zero, bool *commit) { arena_chunk_t *chunk; + size_t sn; malloc_mutex_unlock(tsdn, &arena->lock); chunk = (arena_chunk_t *)chunk_alloc_wrapper(tsdn, arena, chunk_hooks, - NULL, chunksize, chunksize, zero, commit); + NULL, chunksize, chunksize, &sn, zero, commit); if (chunk != NULL && !*commit) { /* Commit header. */ if (chunk_hooks->commit(chunk, chunksize, 0, map_bias << LG_PAGE, arena->ind)) { chunk_dalloc_wrapper(tsdn, arena, chunk_hooks, - (void *)chunk, chunksize, *zero, *commit); + (void *)chunk, chunksize, sn, *zero, *commit); chunk = NULL; } } - if (chunk != NULL && arena_chunk_register(tsdn, arena, chunk, *zero)) { + if (chunk != NULL && arena_chunk_register(tsdn, arena, chunk, sn, + *zero)) { if (!*commit) { /* Undo commit of header. */ chunk_hooks->decommit(chunk, chunksize, 0, map_bias << LG_PAGE, arena->ind); } chunk_dalloc_wrapper(tsdn, arena, chunk_hooks, (void *)chunk, - chunksize, *zero, *commit); + chunksize, sn, *zero, *commit); chunk = NULL; } @@ -583,13 +625,14 @@ arena_chunk_alloc_internal(tsdn_t *tsdn, { arena_chunk_t *chunk; chunk_hooks_t chunk_hooks = CHUNK_HOOKS_INITIALIZER; + size_t sn; chunk = chunk_alloc_cache(tsdn, arena, &chunk_hooks, NULL, chunksize, - chunksize, zero, commit, true); + chunksize, &sn, zero, commit, true); if (chunk != NULL) { - if (arena_chunk_register(tsdn, arena, chunk, *zero)) { + if (arena_chunk_register(tsdn, arena, chunk, sn, *zero)) { chunk_dalloc_cache(tsdn, arena, &chunk_hooks, chunk, - chunksize, true); + chunksize, sn, true); return (NULL); } } @@ -621,6 +664,8 @@ arena_chunk_init_hard(tsdn_t *tsdn, aren if (chunk == NULL) return (NULL); + chunk->hugepage = true; + /* * Initialize the map to contain one maximal free untouched run. Mark * the pages as zeroed if arena_chunk_alloc_internal() returned a zeroed @@ -684,11 +729,14 @@ arena_chunk_alloc(tsdn_t *tsdn, arena_t static void arena_chunk_discard(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk) { + size_t sn, hugepage; bool committed; chunk_hooks_t chunk_hooks = CHUNK_HOOKS_INITIALIZER; chunk_deregister(chunk, &chunk->node); + sn = extent_node_sn_get(&chunk->node); + hugepage = chunk->hugepage; committed = (arena_mapbits_decommitted_get(chunk, map_bias) == 0); if (!committed) { /* @@ -701,9 +749,17 @@ arena_chunk_discard(tsdn_t *tsdn, arena_ chunk_hooks.decommit(chunk, chunksize, 0, map_bias << LG_PAGE, arena->ind); } + if (!hugepage) { + /* + * Convert chunk back to the default state, so that all + * subsequent chunk allocations start out with chunks that can + * be backed by transparent huge pages. + */ + pages_huge(chunk, chunksize); + } chunk_dalloc_cache(tsdn, arena, &chunk_hooks, (void *)chunk, chunksize, - committed); + sn, committed); if (config_stats) { arena->stats.mapped -= chunksize; @@ -859,14 +915,14 @@ arena_node_dalloc(tsdn_t *tsdn, arena_t static void * arena_chunk_alloc_huge_hard(tsdn_t *tsdn, arena_t *arena, - chunk_hooks_t *chunk_hooks, size_t usize, size_t alignment, bool *zero, - size_t csize) + chunk_hooks_t *chunk_hooks, size_t usize, size_t alignment, size_t *sn, + bool *zero, size_t csize) { void *ret; bool commit = true; ret = chunk_alloc_wrapper(tsdn, arena, chunk_hooks, NULL, csize, - alignment, zero, &commit); + alignment, sn, zero, &commit); if (ret == NULL) { /* Revert optimistic stats updates. */ malloc_mutex_lock(tsdn, &arena->lock); @@ -883,7 +939,7 @@ arena_chunk_alloc_huge_hard(tsdn_t *tsdn void * arena_chunk_alloc_huge(tsdn_t *tsdn, arena_t *arena, size_t usize, - size_t alignment, bool *zero) + size_t alignment, size_t *sn, bool *zero) { void *ret; chunk_hooks_t chunk_hooks = CHUNK_HOOKS_INITIALIZER; @@ -900,18 +956,19 @@ arena_chunk_alloc_huge(tsdn_t *tsdn, are arena_nactive_add(arena, usize >> LG_PAGE); ret = chunk_alloc_cache(tsdn, arena, &chunk_hooks, NULL, csize, - alignment, zero, &commit, true); + alignment, sn, zero, &commit, true); malloc_mutex_unlock(tsdn, &arena->lock); if (ret == NULL) { ret = arena_chunk_alloc_huge_hard(tsdn, arena, &chunk_hooks, - usize, alignment, zero, csize); + usize, alignment, sn, zero, csize); } return (ret); } void -arena_chunk_dalloc_huge(tsdn_t *tsdn, arena_t *arena, void *chunk, size_t usize) +arena_chunk_dalloc_huge(tsdn_t *tsdn, arena_t *arena, void *chunk, size_t usize, + size_t sn) { chunk_hooks_t chunk_hooks = CHUNK_HOOKS_INITIALIZER; size_t csize; @@ -924,7 +981,7 @@ arena_chunk_dalloc_huge(tsdn_t *tsdn, ar } arena_nactive_sub(arena, usize >> LG_PAGE); - chunk_dalloc_cache(tsdn, arena, &chunk_hooks, chunk, csize, true); + chunk_dalloc_cache(tsdn, arena, &chunk_hooks, chunk, csize, sn, true); malloc_mutex_unlock(tsdn, &arena->lock); } @@ -948,7 +1005,7 @@ arena_chunk_ralloc_huge_similar(tsdn_t * void arena_chunk_ralloc_huge_shrink(tsdn_t *tsdn, arena_t *arena, void *chunk, - size_t oldsize, size_t usize) + size_t oldsize, size_t usize, size_t sn) { size_t udiff = oldsize - usize; size_t cdiff = CHUNK_CEILING(oldsize) - CHUNK_CEILING(usize); @@ -967,7 +1024,7 @@ arena_chunk_ralloc_huge_shrink(tsdn_t *t CHUNK_CEILING(usize)); chunk_dalloc_cache(tsdn, arena, &chunk_hooks, nchunk, cdiff, - true); + sn, true); } malloc_mutex_unlock(tsdn, &arena->lock); } @@ -975,13 +1032,13 @@ arena_chunk_ralloc_huge_shrink(tsdn_t *t static bool arena_chunk_ralloc_huge_expand_hard(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks, void *chunk, size_t oldsize, size_t usize, - bool *zero, void *nchunk, size_t udiff, size_t cdiff) + size_t *sn, bool *zero, void *nchunk, size_t udiff, size_t cdiff) { bool err; bool commit = true; err = (chunk_alloc_wrapper(tsdn, arena, chunk_hooks, nchunk, cdiff, - chunksize, zero, &commit) == NULL); + chunksize, sn, zero, &commit) == NULL); if (err) { /* Revert optimistic stats updates. */ malloc_mutex_lock(tsdn, &arena->lock); @@ -995,7 +1052,7 @@ arena_chunk_ralloc_huge_expand_hard(tsdn } else if (chunk_hooks->merge(chunk, CHUNK_CEILING(oldsize), nchunk, cdiff, true, arena->ind)) { chunk_dalloc_wrapper(tsdn, arena, chunk_hooks, nchunk, cdiff, - *zero, true); + *sn, *zero, true); err = true; } return (err); @@ -1010,6 +1067,7 @@ arena_chunk_ralloc_huge_expand(tsdn_t *t void *nchunk = (void *)((uintptr_t)chunk + CHUNK_CEILING(oldsize)); size_t udiff = usize - oldsize; size_t cdiff = CHUNK_CEILING(usize) - CHUNK_CEILING(oldsize); + size_t sn; bool commit = true; malloc_mutex_lock(tsdn, &arena->lock); @@ -1022,16 +1080,16 @@ arena_chunk_ralloc_huge_expand(tsdn_t *t arena_nactive_add(arena, udiff >> LG_PAGE); err = (chunk_alloc_cache(tsdn, arena, &chunk_hooks, nchunk, cdiff, - chunksize, zero, &commit, true) == NULL); + chunksize, &sn, zero, &commit, true) == NULL); malloc_mutex_unlock(tsdn, &arena->lock); if (err) { err = arena_chunk_ralloc_huge_expand_hard(tsdn, arena, - &chunk_hooks, chunk, oldsize, usize, zero, nchunk, udiff, - cdiff); + &chunk_hooks, chunk, oldsize, usize, &sn, zero, nchunk, + udiff, cdiff); } else if (chunk_hooks.merge(chunk, CHUNK_CEILING(oldsize), nchunk, cdiff, true, arena->ind)) { chunk_dalloc_wrapper(tsdn, arena, &chunk_hooks, nchunk, cdiff, - *zero, true); + sn, *zero, true); err = true; } @@ -1519,6 +1577,7 @@ arena_stash_dirty(tsdn_t *tsdn, arena_t if (rdelm == &chunkselm->rd) { extent_node_t *chunkselm_next; + size_t sn; bool zero, commit; UNUSED void *chunk; @@ -1536,8 +1595,8 @@ arena_stash_dirty(tsdn_t *tsdn, arena_t commit = false; chunk = chunk_alloc_cache(tsdn, arena, chunk_hooks, extent_node_addr_get(chunkselm), - extent_node_size_get(chunkselm), chunksize, &zero, - &commit, false); + extent_node_size_get(chunkselm), chunksize, &sn, + &zero, &commit, false); assert(chunk == extent_node_addr_get(chunkselm)); assert(zero == extent_node_zeroed_get(chunkselm)); extent_node_dirty_insert(chunkselm, purge_runs_sentinel, @@ -1634,6 +1693,17 @@ arena_purge_stashed(tsdn_t *tsdn, arena_ run_size = arena_mapbits_large_size_get(chunk, pageind); npages = run_size >> LG_PAGE; + /* + * If this is the first run purged within chunk, mark + * the chunk as non-huge. This will prevent all use of *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Dec 4 21:40:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 231E4C6721F; Sun, 4 Dec 2016 21:40:51 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F1F2C18E9; Sun, 4 Dec 2016 21:40:50 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB4Leo5A018078; Sun, 4 Dec 2016 21:40:50 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4LeooK018076; Sun, 4 Dec 2016 21:40:50 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612042140.uB4LeooK018076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 4 Dec 2016 21:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309541 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 21:40:51 -0000 Author: avos Date: Sun Dec 4 21:40:49 2016 New Revision: 309541 URL: https://svnweb.freebsd.org/changeset/base/309541 Log: rsu: fix RSSI reporting, partially revert r288414. - Append RCR_APP_PHYSTS bit after firmware loading - otherwise firmware will reset the register and this modification will be lost. (without it Rx PHY descriptor section will contain garbage). - Check if R92S_RXDW0_PHYST bit is set (like it is done in rtwn(4)) - even if infosz is non-zero the section may not contain anything useful. - In case, if descriptor is absent (A-MPDU?) use last calibrated RSSI (rtwn(4) uses RSSI from the previous (sub)frame; probably, this approach should be used here too). Tested with Asus USB-N10, STA mode. Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sun Dec 4 21:13:26 2016 (r309540) +++ head/sys/dev/usb/wlan/if_rsu.c Sun Dec 4 21:40:49 2016 (r309541) @@ -24,7 +24,6 @@ __FBSDID("$FreeBSD$"); * TODO: * o h/w crypto * o hostap / ibss / mesh - * o sensible RSSI levels * o power-save operation */ @@ -216,9 +215,7 @@ static void rsu_event_survey(struct rsu_ static void rsu_event_join_bss(struct rsu_softc *, uint8_t *, int); static void rsu_rx_event(struct rsu_softc *, uint8_t, uint8_t *, int); static void rsu_rx_multi_event(struct rsu_softc *, uint8_t *, int); -#if 0 static int8_t rsu_get_rssi(struct rsu_softc *, int, void *); -#endif static struct mbuf * rsu_rx_copy_to_mbuf(struct rsu_softc *, struct r92s_rx_stat *, int); static struct ieee80211_node * rsu_rx_frame(struct rsu_softc *, struct mbuf *, @@ -1806,7 +1803,6 @@ rsu_rx_multi_event(struct rsu_softc *sc, } } -#if 0 static int8_t rsu_get_rssi(struct rsu_softc *sc, int rate, void *physt) { @@ -1827,7 +1823,6 @@ rsu_get_rssi(struct rsu_softc *sc, int r } return (rssi); } -#endif static struct mbuf * rsu_rx_copy_to_mbuf(struct rsu_softc *sc, struct r92s_rx_stat *stat, @@ -1886,13 +1881,13 @@ rsu_rx_frame(struct rsu_softc *sc, struc rate = MS(rxdw3, R92S_RXDW3_RATE); infosz = MS(rxdw0, R92S_RXDW0_INFOSZ) * 8; -#if 0 /* Get RSSI from PHY status descriptor if present. */ - if (infosz != 0) + if (infosz != 0 && (rxdw0 & R92S_RXDW0_PHYST)) *rssi_p = rsu_get_rssi(sc, rate, &stat[1]); - else -#endif - *rssi_p = 0; + else { + /* Cheat and get the last calibrated RSSI */ + *rssi_p = rsu_hwrssi_to_rssi(sc, sc->sc_currssi); + } if (ieee80211_radiotap_active(ic)) { struct rsu_rx_radiotap_header *tap = &sc->sc_rxtap; @@ -1920,11 +1915,8 @@ rsu_rx_frame(struct rsu_softc *sc, struc /* Bit 7 set means HT MCS instead of rate. */ tap->wr_rate = 0x80 | (rate - 12); } -#if 0 - tap->wr_dbm_antsignal = *rssi; -#endif - /* XXX not nice */ - tap->wr_dbm_antsignal = rsu_hwrssi_to_rssi(sc, sc->sc_currssi); + + tap->wr_dbm_antsignal = *rssi_p; tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq); tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags); }; @@ -2075,9 +2067,6 @@ tr_setup: m->m_next = NULL; ni = rsu_rx_frame(sc, m, &rssi); - - /* Cheat and get the last calibrated RSSI */ - rssi = rsu_hwrssi_to_rssi(sc, sc->sc_currssi); RSU_UNLOCK(sc); if (ni != NULL) { @@ -2988,9 +2977,6 @@ rsu_init(struct rsu_softc *sc) /* Enable Rx TCP checksum offload. */ rsu_write_4(sc, R92S_RCR, rsu_read_4(sc, R92S_RCR) | 0x04000000); - /* Append PHY status. */ - rsu_write_4(sc, R92S_RCR, - rsu_read_4(sc, R92S_RCR) | 0x02000000); rsu_write_4(sc, R92S_CR, rsu_read_4(sc, R92S_CR) & ~0xff000000); @@ -3026,6 +3012,10 @@ rsu_init(struct rsu_softc *sc) goto fail; } + /* Append PHY status. */ + rsu_write_4(sc, R92S_RCR, + rsu_read_4(sc, R92S_RCR) | 0x02000000); + /* Setup multicast filter (must be done after firmware loading). */ rsu_set_multi(sc); Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sun Dec 4 21:13:26 2016 (r309540) +++ head/sys/dev/usb/wlan/if_rsureg.h Sun Dec 4 21:40:49 2016 (r309541) @@ -510,6 +510,7 @@ struct r92s_rx_stat { #define R92S_RXDW0_QOS 0x00800000 #define R92S_RXDW0_SHIFT_M 0x03000000 #define R92S_RXDW0_SHIFT_S 24 +#define R92S_RXDW0_PHYST 0x04000000 #define R92S_RXDW0_DECRYPTED 0x08000000 uint32_t rxdw1; From owner-svn-src-head@freebsd.org Sun Dec 4 21:45:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36A5DC67513; Sun, 4 Dec 2016 21:45:05 +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 163D11D3D; Sun, 4 Dec 2016 21:45:05 +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 7E13210AA59; Sun, 4 Dec 2016 16:45:02 -0500 (EST) From: John Baldwin To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309476 - head/include Date: Sat, 03 Dec 2016 14:15:14 -0800 Message-ID: <2724530.RObcHE23iL@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201612030529.uB35TCal025016@repo.freebsd.org> References: <201612030529.uB35TCal025016@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); Sun, 04 Dec 2016 16:45:02 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 21:45:05 -0000 On Saturday, December 03, 2016 05:29:12 AM Bryan Drewery wrote: > Author: bdrewery > Date: Sat Dec 3 05:29:12 2016 > New Revision: 309476 > URL: https://svnweb.freebsd.org/changeset/base/309476 > > Log: > Create the /usr/lib/include symlink as relative. > > This ugly code is done to avoid assuming LIBDIR is 2 components > deep. > > Reported by: jhb Thanks! For other folks: this broke the ability to use a DESTDIR installworld as a --sysroot with a cross-compiler since the cross-compiler would follow the /usr/include symlink in /usr/lib/include in the sysroot to the host's /usr/include and end up using the host's headers. -- John Baldwin From owner-svn-src-head@freebsd.org Sun Dec 4 21:45:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26E23C67536; Sun, 4 Dec 2016 21:45:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 052871D6B; Sun, 4 Dec 2016 21:45:09 +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 AAC5F10AA28; Sun, 4 Dec 2016 16:45:00 -0500 (EST) From: John Baldwin To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309531 - head/sys/arm/include Date: Sun, 04 Dec 2016 13:43:54 -0800 Message-ID: <1605461.LLfnXX4YB2@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201612041527.uB4FRduc064051@repo.freebsd.org> References: <201612041527.uB4FRduc064051@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); Sun, 04 Dec 2016 16:45:00 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 21:45:10 -0000 On Sunday, December 04, 2016 03:27:39 PM Michal Meloun wrote: > Author: mmel > Date: Sun Dec 4 15:27:39 2016 > New Revision: 309531 > URL: https://svnweb.freebsd.org/changeset/base/309531 > > Log: > Implement fake pmap_mapdev_attr() for ARMv6. > This function is referenced, but never called from DRM2 code. Also, > real behavior of pmap_mapdev_attr() in ARM world is unclear as we don't > have any additional attribute for a device memory type. You have VM_MEMATTR constants on ARM though. Some devices might want a WB mapping (e.g. for a prefetchable memory BAR) rather than UC. -- John Baldwin From owner-svn-src-head@freebsd.org Sun Dec 4 22:55:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C89D8C67896 for ; Sun, 4 Dec 2016 22:55:23 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADF15841 for ; Sun, 4 Dec 2016 22:55:23 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: bcdb6b86-ba74-11e6-9f67-d3961ed5a660 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id bcdb6b86-ba74-11e6-9f67-d3961ed5a660; Sun, 04 Dec 2016 22:55:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uB4MtErJ012125; Sun, 4 Dec 2016 15:55:14 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480892114.1889.243.camel@freebsd.org> Subject: Re: svn commit: r309531 - head/sys/arm/include From: Ian Lepore To: John Baldwin , Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 04 Dec 2016 15:55:14 -0700 In-Reply-To: <1605461.LLfnXX4YB2@ralph.baldwin.cx> References: <201612041527.uB4FRduc064051@repo.freebsd.org> <1605461.LLfnXX4YB2@ralph.baldwin.cx> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 22:55:23 -0000 On Sun, 2016-12-04 at 13:43 -0800, John Baldwin wrote: > On Sunday, December 04, 2016 03:27:39 PM Michal Meloun wrote: > > > > Author: mmel > > Date: Sun Dec  4 15:27:39 2016 > > New Revision: 309531 > > URL: https://svnweb.freebsd.org/changeset/base/309531 > > > > Log: > >   Implement fake pmap_mapdev_attr() for ARMv6. > >   This function is referenced, but never called from DRM2 code. > > Also, > >   real behavior of pmap_mapdev_attr() in ARM world is unclear as we > > don't > >   have any additional attribute for a device memory type. > You have VM_MEMATTR constants on ARM though.  Some devices might want > a > WB mapping (e.g. for a prefetchable memory BAR) rather than UC. > On ARM, 'DEVICE' memory is its own type/attribute and it can't usefully be changed (if you were to change it, it would no longer be device memory, it would be some other type).  If this function is being used to map main memory just because that memory happens to be used in some device driver, then that's a usage model that just doesn't map usefully to arm memory semantics. -- Ian From owner-svn-src-head@freebsd.org Sun Dec 4 23:24:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5A5FC6710C; Sun, 4 Dec 2016 23:24:01 +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 8479F1862; Sun, 4 Dec 2016 23:24:01 +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 uB4NO0cE059634; Sun, 4 Dec 2016 23:24:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB4NNxrW059619; Sun, 4 Dec 2016 23:23:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612042323.uB4NNxrW059619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 4 Dec 2016 23:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309544 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 23:24:01 -0000 Author: bapt Date: Sun Dec 4 23:23:59 2016 New Revision: 309544 URL: https://svnweb.freebsd.org/changeset/base/309544 Log: Import tzdata 2016j MFC after: 2 days Modified: head/contrib/tzdata/CONTRIBUTING head/contrib/tzdata/Makefile head/contrib/tzdata/NEWS head/contrib/tzdata/README head/contrib/tzdata/Theory head/contrib/tzdata/africa head/contrib/tzdata/asia head/contrib/tzdata/europe head/contrib/tzdata/version head/contrib/tzdata/zone.tab head/contrib/tzdata/zone1970.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/CONTRIBUTING ============================================================================== --- head/contrib/tzdata/CONTRIBUTING Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/CONTRIBUTING Sun Dec 4 23:23:59 2016 (r309544) @@ -18,10 +18,10 @@ data should contain commentary citing re justification. Please submit changes against either the latest release in - or the master branch of the experimental -Git repository. If you use Git the following workflow may be helpful: + or the master branch of the development +repository. If you use Git the following workflow may be helpful: - * Copy the experimental repository. + * Copy the development repository. git clone https://github.com/eggert/tz.git cd tz Modified: head/contrib/tzdata/Makefile ============================================================================== --- head/contrib/tzdata/Makefile Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/Makefile Sun Dec 4 23:23:59 2016 (r309544) @@ -542,7 +542,8 @@ force_tzs: $(TZS_NEW) cp $(TZS_NEW) $(TZS) libtz.a: $(LIBOBJS) - $(AR) ru $@ $(LIBOBJS) + rm -f $@ + $(AR) -rc $@ $(LIBOBJS) $(RANLIB) $@ date: $(DATEOBJS) Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/NEWS Sun Dec 4 23:23:59 2016 (r309544) @@ -1,5 +1,46 @@ News for the tz database +Release 2016j - 2016-11-22 23:17:13 -0800 + + Briefly: Saratov, Russia moves from +03 to +04 on 2016-12-04. + + Changes to future time stamps + + Saratov, Russia switches from +03 to +04 on 2016-12-04 at 02:00. + This hives off a new zone Europe/Saratov from Europe/Volgograd. + (Thanks to Yuri Konotopov and Stepan Golosunov.) + + Changes to past time stamps + + The new zone Asia/Atyrau for AtyraÅ« Region, Kazakhstan, is like + Asia/Aqtau except it switched from +04/+05 to +05/+06 in spring + 1999, not fall 1994. (Thanks to Stepan Golosunov.) + + Changes to past time zone abbreviations + + Asia/Gaza and Asia/Hebron now use "EEST", not "EET", to denote + summer time before 1948. The old use of "EET" was a typo. + + Changes to code + + zic no longer mishandles file systems that lack hard links, fixing + bugs introduced in 2016g. (Problems reported by Tom Lane.) + Also, when the destination already contains symbolic links, zic + should now work better on systems where the 'link' system call + does not follow symbolic links. + + Changes to documentation and commentary + + tz-link.htm now documents the relationship between release version + numbers and development-repository commit tags. (Suggested by + Paul Koning.) + + The 'Theory' file now documents UT. + + iso3166.tab now accents "Curaçao", and commentary now mentions + the names "Cabo Verde" and "Czechia". (Thanks to Jiří BoháÄ.) + + Release 2016i - 2016-11-01 23:19:52 -0700 Briefly: Cyprus split into two time zones on 2016-10-30, and Tonga @@ -212,7 +253,7 @@ Release 2016g - 2016-09-13 08:56:38 -070 23 commits and some working-file changes have been made since release 2016g, the version number is now something like '2016g-23-g50556e3-dirty' instead of the misleading '2016g'. - Official releases uses the same version number format as before, + Tagged releases use the same version number format as before, e.g., '2016g'. To support the more-accurate version number, its specification has moved from a line in the Makefile to a new source file 'version'. Modified: head/contrib/tzdata/README ============================================================================== --- head/contrib/tzdata/README Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/README Sun Dec 4 23:23:59 2016 (r309544) @@ -10,24 +10,9 @@ locations around the globe. It is updat changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules. -Here is a recipe for acquiring, building, installing, and testing the -tz distribution on a GNU/Linux or similar host. - -To acquire the distribution, run the following shell commands: - - mkdir tz - cd tz - wget --retr-symlinks 'ftp://ftp.iana.org/tz/tz*-latest.tar.gz' - gzip -dc tzcode-latest.tar.gz | tar -xf - - gzip -dc tzdata-latest.tar.gz | tar -xf - - -Alternatively, the following shell commands acquire the same -distribution, with extra data useful for regression testing: - - wget --retr-symlinks 'ftp://ftp.iana.org/tz/tzdb-latest.tar.lz' - lzip -dc tzdb-latest.tar.lz | tar -xf - - -Be sure to read the comments in "Makefile" and make any changes needed +See or the +file tz-link.htm for how to acquire the code and data. Once acquired, +read the comments in the file 'Makefile' and make any changes needed to make things right for your system, especially if you are using some platform other than GNU/Linux. Then run the following commands, substituting your desired installation directory for "$HOME/tzdir": @@ -60,10 +45,6 @@ Thanks in particular to Arthur David Ols maintainer, to whom the time zone community owes the greatest debt of all. None of them are responsible for remaining errors. -Look in for updated versions of these files. - -Please send comments or information to tz@iana.org. - ----- This file is in the public domain, so clarified as of 2009-05-17 by Modified: head/contrib/tzdata/Theory ============================================================================== --- head/contrib/tzdata/Theory Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/Theory Sun Dec 4 23:23:59 2016 (r309544) @@ -8,6 +8,7 @@ Theory and pragmatics of the tz code and Time zone abbreviations Accuracy of the tz database Time and date functions + Interface stability Calendrical issues Time and time zones on Mars @@ -342,12 +343,24 @@ Errors in the tz database arise from man non-hour-based system at night. * Early clocks were less reliable, and data entries do not represent - this unreliability. + clock error. - * As for leap seconds, civil time was not based on atomic time before - 1972, and we don't know the history of earth's rotation accurately - enough to map SI seconds to historical solar time to more than - about one-hour accuracy. See: Morrison LV, Stephenson FR. + * The tz database assumes Universal Time (UT) as an origin, even + though UT is not standardized for older time stamps. In the tz + database commentary, UT denotes a family of time standards that + includes Coordinated Universal Time (UTC) along with other variants + such as UT1 and GMT, with days starting at midnight. Although UT + equals UTC for modern time stamps, UTC was not defined until 1960, + so commentary uses the more-general abbreviation UT for time stamps + that might predate 1960. Since UT, UT1, etc. disagree slightly, + and since pre-1972 UTC seconds varied in length, interpretation of + older time stamps can be problematic when subsecond accuracy is + needed. + + * Civil time was not based on atomic time before 1972, and we don't + know the history of earth's rotation accurately enough to map SI + seconds to historical solar time to more than about one-hour + accuracy. See: Morrison LV, Stephenson FR. Historical values of the Earth's clock error Delta T and the calculation of eclipses. J Hist Astron. 2004;35:327-36 ; @@ -601,10 +614,14 @@ The tz code and data supply the followin * The format of the country code file, documented in iso3166.tab. -When these interfaces are changed, an effort is made to preserve -backward compatibility. For example, tz data files typically do not -rely on recently-added zic features, so that users can run older zic -versions to process newer data files. + * The version number of the code and data, as the first line of + the text file 'version' in each release. + +Interface changes in a release attempt to preserve compatibility with +recent releases. For example, tz data files typically do not rely on +recently-added zic features, so that users can run older zic versions +to process newer data files. The tz-link.htm file describes how +releases are tagged and distributed. Interfaces not listed above are less stable. For example, users should not rely on particular UT offsets or abbreviations for time Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/africa Sun Dec 4 23:23:59 2016 (r309544) @@ -119,7 +119,7 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 M # Cameroon # See Africa/Lagos. -# Cape Verde +# Cape Verde / Cabo Verde # # Shanks gives 1907 for the transition to CVT. # Perhaps the 1911-05-26 Portuguese decree Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/asia Sun Dec 4 23:23:59 2016 (r309544) @@ -1583,12 +1583,12 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # was "blended" with the Central zone. Therefore, Kazakhstan now has # two time zones, and difference between them is one hour. The zone # closer to UTC is the former Western zone (probably still called the -# same), encompassing four provinces in the west: Aqtobe, Atyrau, -# Mangghystau, and West Kazakhstan. The other zone encompasses +# same), encompassing four provinces in the west: Aqtöbe, AtyraÅ«, +# MangghystaÅ«, and West Kazakhstan. The other zone encompasses # everything else.... I guess that would make Kazakhstan time zones # de jure UTC+5 and UTC+6 respectively. -# From Stepan Golosunov (2016-03-27) ([*] means see later comments below): +# From Stepan Golosunov (2016-03-27): # Review of the linked documents from http://adilet.zan.kz/ # produced the following data for post-1991 Kazakhstan: # @@ -1634,7 +1634,7 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # # This implies that on 1991-03-31 Asia/Oral remained on +04/+05 while # the rest of Kazakhstan switched from +06/+07 to +05/06 or from +05/06 -# to +04/+05. It's unclear how Kzyl-Orda oblast moved into the fifth +# to +04/+05. It's unclear how Qyzylorda oblast moved into the fifth # time belt. (By switching from +04/+05 to +05/+06 on 1991-09-29?) ... # # 1. Act of the Cabinet of Ministers of the Republic of Kazakhstan @@ -1647,25 +1647,25 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # on the whole territory of Kazakhstan 1 hour forward on 1992-01-19 at # 2:00, specified DST rules. It acknowledged that Kazakhstan was # located in the fourth and the fifth time belts and specified the -# border between them to be located east of Kustanay and Aktyubinsk -# oblasts (notably including Turgai and Kzyl-Orda oblasts into the fifth +# border between them to be located east of Qostanay and Aktyubinsk +# oblasts (notably including Turgai and Qyzylorda oblasts into the fifth # time belt). # # This means switch on 1992-01-19 at 2:00 from +04/+05 to +05/+06 for -# Asia/Aqtau, Asia/Aqtobe, Asia/Oral, Atyrau and Kustanay oblasts; from -# +05/+06 to +06/+07 for Asia/Almaty and Asia/Qyzylorda (and Arkalyk) [*].... +# Asia/Aqtau, Asia/Aqtobe, Asia/Oral, AtyraÅ« and Qostanay oblasts; from +# +05/+06 to +06/+07 for Asia/Almaty and Asia/Qyzylorda (and Arkalyk).... # # 2. Act of the Cabinet of Ministers of the Republic of Kazakhstan # from 1992-03-27 No. 284 # http://adilet.zan.kz/rus/docs/P920000284_ -# cancels extra hour ("decree time") for Uralsk and Kzyl-Orda oblasts +# cancels extra hour ("decree time") for Uralsk and Qyzylorda oblasts # since the last Sunday of March 1992, while keeping them in the fourth # and the fifth time belts respectively. # # 3. Order of the Prime Minister of the Republic of Kazakhstan # from 1994-09-23 No. 384 # http://adilet.zan.kz/rus/docs/R940000384_ -# cancels the extra hour ("decree time") on the territory of Mangystau +# cancels the extra hour ("decree time") on the territory of MangghystaÅ« # oblast since the last Sunday of September 1994 (saying that time on # the territory would correspond to the third time belt as a # result).... @@ -1679,14 +1679,11 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # 5. Act of the Government of the Republic of Kazakhstan # from 1999-03-26 No. 305 # http://adilet.zan.kz/rus/docs/P990000305_ -# cancels the extra hour ("decree time") for Atyrau oblast since the +# cancels the extra hour ("decree time") for AtyraÅ« oblast since the # last Sunday of March 1999 while retaining the oblast in the fourth # time belt. # -# This means change from +05/+06 to +04/+05. -# -# There is no zone for Atyrau currently (listed under Asia/Aqtau in -# zone1970.tab).[*] +# This means change from +05/+06 to +04/+05.... # # 6. Act of the Government of the Republic of Kazakhstan # from 2000-11-23 No. 1749 @@ -1696,10 +1693,10 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # The only changes I noticed are in definition of the border between the # fourth and the fifth time belts. They account for changes in spelling # and administrative division (splitting of Turgai oblast in 1997 -# probably changed time in territories incorporated into Kostanay oblast -# (including Arkalyk) from +06/+07 to +05/+06) and move Kyzylorda oblast +# probably changed time in territories incorporated into Qostanay oblast +# (including Arkalyk) from +06/+07 to +05/+06) and move Qyzylorda oblast # from being in the fifth time belt and not using decree time into the -# fourth time belt (no change in practice).[*] +# fourth time belt (no change in practice). # # 7. Act of the Government of the Republic of Kazakhstan # from 2003-12-29 No. 1342 @@ -1709,7 +1706,7 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # 8. Act of the Government of the Republic of Kazakhstan # from 2004-07-20 No. 775 # http://adilet.zan.kz/rus/archive/docs/P040000775_/20.07.2004 -# modified the 2000-11-23 act to move Kostanay and Kyzylorda oblasts into +# modified the 2000-11-23 act to move Qostanay and Qyzylorda oblasts into # the fifth time belt and add Aktobe oblast to the list of regions not # using extra hour ("decree time"), leaving Kazakhstan with only 2 time # zones (+04/+05 and +06/+07). The changes were to be implemented @@ -1721,14 +1718,14 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # http://adilet.zan.kz/rus/docs/P040001059_ # modified the 2000-11-23 act to remove exceptions from the "decree time" # (leaving Kazakhstan in +05/+06 and +06/+07 zones), amended the -# 2004-07-20 act to implement changes for Atyrau, West Kazakhstan, -# Kostanay, Kyzylorda and Mangystau oblasts by not moving clocks -# during the 2014 transition to "winter" time. +# 2004-07-20 act to implement changes for AtyraÅ«, West Kazakhstan, +# Qostanay, Qyzylorda and MangghystaÅ« oblasts by not moving clocks +# during the 2004 transition to "winter" time. # -# This means transition from +04/+05 to +05/+06 for Atyrau oblast (no +# This means transition from +04/+05 to +05/+06 for AtyraÅ« oblast (no # zone currently), Asia/Oral, Asia/Aqtau and transition from +05/+06 to -# +06/+07 for Kostanay oblast (Kostanay and Arkalyk, no zones currently) -# and Asia/Qyzylorda on 2004-10-31 at 3:00....[*] +# +06/+07 for Qostanay oblast (Qostanay and Arkalyk, no zones currently) +# and Asia/Qyzylorda on 2004-10-31 at 3:00.... # # 10. Act of the Government of the Republic of Kazakhstan # from 2005-03-15 No. 231 @@ -1744,14 +1741,9 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # Kazakh 1992-01-13 act appears to provide the same rules and 1992-03-27 # act was to be enacted on the last Sunday of March 1992. -# From Paul Eggert (2016-04-15): -# The tables below should reflect Stepan Golosunov's remarks above, -# except for the items marked "[*]" which I haven't gotten to yet. -# It looks like we will need new zones Asia/Atyrau and Asia/Qostanay -# to handle changes from 1992 through 2004 that we did not previously -# know about. +# From Paul Eggert (2016-11-07): +# The tables below reflect Golosunov's remarks, with exceptions as noted. -# # Zone NAME GMTOFF RULES FORMAT [UNTIL] # # Almaty (formerly Alma-Ata), representing most locations in Kazakhstan @@ -1764,6 +1756,8 @@ Zone Asia/Almaty 5:07:48 - LMT 1924 May 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s 6:00 - +06 # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) +# This currently includes Qostanay (aka Kostanay, Kustanay) (KZ-KUS); +# see comments below. Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -1775,7 +1769,21 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 M 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s 6:00 - +06 -# Aqtobe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) +# The following zone is like Asia/Qyzylorda except for being one +# hour earlier from 1991-09-29 to 1992-03-29. The 1991/2 rules for +# Qostenay are unclear partly because of the 1997 Turgai +# reorganization, so this zone is commented out for now. +#Zone Asia/Qostanay 4:14:20 - LMT 1924 May 2 +# 4:00 - +04 1930 Jun 21 +# 5:00 - +05 1981 Apr 1 +# 5:00 1:00 +06 1981 Oct 1 +# 6:00 - +06 1982 Apr 1 +# 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s +# 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s +# 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s +# 6:00 - +06 +# +# Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -1785,14 +1793,11 @@ Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s 5:00 - +05 -# Qostanay (KZ-KUS) - -# Mangghystau (KZ-MAN) +# MangghystaÅ« (KZ-MAN) # Aqtau was not founded until 1963, but it represents an inhabited region, # so include time stamps before 1963. Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 - 5:00 - +05 1963 5:00 - +05 1981 Oct 1 6:00 - +06 1982 Apr 1 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s @@ -1800,7 +1805,17 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 5:00 RussiaAsia +05/+06 1994 Sep 25 2:00s 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s 5:00 - +05 - +# AtyraÅ« (KZ-ATY) is like MangghystaÅ« except it switched from +# +04/+05 to +05/+06 in spring 1999, not fall 1994. +Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2 + 4:00 - +04 1930 Jun 21 + 5:00 - +05 1981 Oct 1 + 6:00 - +06 1982 Apr 1 + 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s + 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s + 5:00 RussiaAsia +05/+06 1999 Mar 28 2:00s + 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s + 5:00 - +05 # West Kazakhstan (KZ-ZAP) # From Paul Eggert (2016-03-18): # The 1989 transition is from USSR act No. 227 (1989-03-14). @@ -2616,7 +2631,7 @@ Rule Palestine 2016 max - Oct lastSat 1: # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct - 2:00 Zion EET 1948 May 15 + 2:00 Zion EET/EEST 1948 May 15 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 @@ -2629,7 +2644,7 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct 2:00 Palestine EE%sT Zone Asia/Hebron 2:20:23 - LMT 1900 Oct - 2:00 Zion EET 1948 May 15 + 2:00 Zion EET/EEST 1948 May 15 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/europe Sun Dec 4 23:23:59 2016 (r309544) @@ -901,7 +901,7 @@ Zone Europe/Sofia 1:33:16 - LMT 1880 # Cyprus # Please see the 'asia' file for Asia/Nicosia. -# Czech Republic +# Czech Republic / Czechia # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Czech 1945 only - Apr 8 2:00s 1:00 S Rule Czech 1945 only - Nov 18 2:00s 0 - @@ -2601,10 +2601,9 @@ Zone Europe/Astrakhan 3:12:12 - LMT 192 3:00 - +03 2016 Mar 27 2:00s 4:00 - +04 -# From Paul Eggert (2016-03-18): +# From Paul Eggert (2016-11-11): # Europe/Volgograd covers: # 34 RU-VGG Volgograd Oblast -# 64 RU-SAR Saratov Oblast # The 1988 transition is from USSR act No. 5 (1988-01-04). Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3 @@ -2617,6 +2616,27 @@ Zone Europe/Volgograd 2:57:40 - LMT 192 4:00 - +04 2014 Oct 26 2:00s 3:00 - +03 +# From Paul Eggert (2016-11-11): +# Europe/Saratov covers: +# 64 RU-SAR Saratov Oblast + +# From Yuri Konotopov (2016-11-11): +# Dec 4, 2016 02:00 UTC+3.... Saratov Region's local time will be ... UTC+4. +# From Stepan Golosunov (2016-11-11): +# ... Byalokoz listed Saratov on 03:04:18. +# From Stepan Golosunov (2016-11-22): +# http://publication.pravo.gov.ru/Document/View/0001201611220031 + +Zone Europe/Saratov 3:04:18 - LMT 1919 Jul 1 0:00u + 3:00 - +03 1930 Jun 21 + 4:00 Russia +04/+05 1988 Mar 27 2:00s + 3:00 Russia +03/+04 1991 Mar 31 2:00s + 4:00 - +04 1992 Mar 29 2:00s + 3:00 Russia +03/+04 2011 Mar 27 2:00s + 4:00 - +04 2014 Oct 26 2:00s + 3:00 - +03 2016 Dec 4 2:00s + 4:00 - +04 + # From Paul Eggert (2016-03-18): # Europe/Kirov covers: # 43 RU-KIR Kirov Oblast Modified: head/contrib/tzdata/version ============================================================================== --- head/contrib/tzdata/version Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/version Sun Dec 4 23:23:59 2016 (r309544) @@ -1 +1 @@ -2016i +2016j Modified: head/contrib/tzdata/zone.tab ============================================================================== --- head/contrib/tzdata/zone.tab Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/zone.tab Sun Dec 4 23:23:59 2016 (r309544) @@ -239,7 +239,8 @@ KY +1918-08123 America/Cayman KZ +4315+07657 Asia/Almaty Kazakhstan (most areas) KZ +4448+06528 Asia/Qyzylorda Qyzylorda/Kyzylorda/Kzyl-Orda KZ +5017+05710 Asia/Aqtobe Aqtobe/Aktobe -KZ +4431+05016 Asia/Aqtau Atyrau/Atirau/Gur'yev, Mangghystau/Mankistau +KZ +4431+05016 Asia/Aqtau Mangghystau/Mankistau +KZ +4707+05156 Asia/Atyrau Atyrau/Atirau/Gur'yev KZ +5113+05121 Asia/Oral West Kazakhstan LA +1758+10236 Asia/Vientiane LB +3353+03530 Asia/Beirut @@ -330,14 +331,15 @@ RS +4450+02030 Europe/Belgrade RU +5443+02030 Europe/Kaliningrad MSK-01 - Kaliningrad RU +554521+0373704 Europe/Moscow MSK+00 - Moscow area RU +4457+03406 Europe/Simferopol MSK+00 - Crimea -RU +4844+04425 Europe/Volgograd MSK+00 - Volgograd, Saratov +RU +4844+04425 Europe/Volgograd MSK+00 - Volgograd RU +5836+04939 Europe/Kirov MSK+00 - Kirov RU +4621+04803 Europe/Astrakhan MSK+01 - Astrakhan -RU +5312+05009 Europe/Samara MSK+01 - Samara, Udmurtia +RU +5134+04602 Europe/Saratov MSK+01 - Saratov RU +5420+04824 Europe/Ulyanovsk MSK+01 - Ulyanovsk +RU +5312+05009 Europe/Samara MSK+01 - Samara, Udmurtia RU +5651+06036 Asia/Yekaterinburg MSK+02 - Urals RU +5500+07324 Asia/Omsk MSK+03 - Omsk -RU +5502+08255 Asia/Novosibirsk MSK+03 - Novosibirsk +RU +5502+08255 Asia/Novosibirsk MSK+04 - Novosibirsk RU +5322+08345 Asia/Barnaul MSK+04 - Altai RU +5630+08458 Asia/Tomsk MSK+04 - Tomsk RU +5345+08707 Asia/Novokuznetsk MSK+04 - Kemerovo Modified: head/contrib/tzdata/zone1970.tab ============================================================================== --- head/contrib/tzdata/zone1970.tab Sun Dec 4 23:19:30 2016 (r309543) +++ head/contrib/tzdata/zone1970.tab Sun Dec 4 23:23:59 2016 (r309544) @@ -211,8 +211,9 @@ KP +3901+12545 Asia/Pyongyang KR +3733+12658 Asia/Seoul KZ +4315+07657 Asia/Almaty Kazakhstan (most areas) KZ +4448+06528 Asia/Qyzylorda Qyzylorda/Kyzylorda/Kzyl-Orda -KZ +5017+05710 Asia/Aqtobe Aqtobe/Aktobe -KZ +4431+05016 Asia/Aqtau Atyrau/Atirau/Gur'yev, Mangghystau/Mankistau +KZ +5017+05710 Asia/Aqtobe Aqtöbe/Aktobe +KZ +4431+05016 Asia/Aqtau MangghystaÅ«/Mankistau +KZ +4707+05156 Asia/Atyrau AtyraÅ«/Atirau/Gur'yev KZ +5113+05121 Asia/Oral West Kazakhstan LB +3353+03530 Asia/Beirut LK +0656+07951 Asia/Colombo @@ -288,14 +289,15 @@ RS,BA,HR,ME,MK,SI +4450+02030 Europe/Bel RU +5443+02030 Europe/Kaliningrad MSK-01 - Kaliningrad RU +554521+0373704 Europe/Moscow MSK+00 - Moscow area RU +4457+03406 Europe/Simferopol MSK+00 - Crimea -RU +4844+04425 Europe/Volgograd MSK+00 - Volgograd, Saratov +RU +4844+04425 Europe/Volgograd MSK+00 - Volgograd RU +5836+04939 Europe/Kirov MSK+00 - Kirov RU +4621+04803 Europe/Astrakhan MSK+01 - Astrakhan -RU +5312+05009 Europe/Samara MSK+01 - Samara, Udmurtia +RU +5134+04602 Europe/Saratov MSK+01 - Saratov RU +5420+04824 Europe/Ulyanovsk MSK+01 - Ulyanovsk +RU +5312+05009 Europe/Samara MSK+01 - Samara, Udmurtia RU +5651+06036 Asia/Yekaterinburg MSK+02 - Urals RU +5500+07324 Asia/Omsk MSK+03 - Omsk -RU +5502+08255 Asia/Novosibirsk MSK+03 - Novosibirsk +RU +5502+08255 Asia/Novosibirsk MSK+04 - Novosibirsk RU +5322+08345 Asia/Barnaul MSK+04 - Altai RU +5630+08458 Asia/Tomsk MSK+04 - Tomsk RU +5345+08707 Asia/Novokuznetsk MSK+04 - Kemerovo From owner-svn-src-head@freebsd.org Mon Dec 5 01:46:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6C99C67179; Mon, 5 Dec 2016 01:46:46 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B654F2A6; Mon, 5 Dec 2016 01:46:46 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB51kjl6017071; Mon, 5 Dec 2016 01:46:45 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB51kjvc017070; Mon, 5 Dec 2016 01:46:45 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201612050146.uB51kjvc017070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 5 Dec 2016 01:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309545 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 01:46:47 -0000 Author: kevlo Date: Mon Dec 5 01:46:45 2016 New Revision: 309545 URL: https://svnweb.freebsd.org/changeset/base/309545 Log: Add Edimax EW-7622UMN to the list of devices supported by rsu(4). Modified: head/share/man/man4/rsu.4 Modified: head/share/man/man4/rsu.4 ============================================================================== --- head/share/man/man4/rsu.4 Sun Dec 4 23:23:59 2016 (r309544) +++ head/share/man/man4/rsu.4 Mon Dec 5 01:46:45 2016 (r309545) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd October 15, 2015 +.Dd December 5, 2016 .Dt RSU 4 .Os .Sh NAME @@ -113,6 +113,7 @@ wireless network adapters, including: .It Belkin F7D1101 v1 .It D-Link DWA-131 A1 .It EDUP EP-MS150N(W) +.It Edimax EW-7622UMN .It Hercules HWGUn-54 .It Hercules HWNUm-300 .It Planex GW-USNano From owner-svn-src-head@freebsd.org Mon Dec 5 02:27:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E047FC67CCB; Mon, 5 Dec 2016 02:27:51 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFD42164D; Mon, 5 Dec 2016 02:27:51 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB52RoMn033026; Mon, 5 Dec 2016 02:27:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB52RoEn033025; Mon, 5 Dec 2016 02:27:50 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201612050227.uB52RoEn033025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 5 Dec 2016 02:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309546 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 02:27:52 -0000 Author: jhibbits Date: Mon Dec 5 02:27:50 2016 New Revision: 309546 URL: https://svnweb.freebsd.org/changeset/base/309546 Log: Use trunc_page() instead of rolling my own in pmap_track_page() Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Dec 5 01:46:45 2016 (r309545) +++ head/sys/powerpc/booke/pmap.c Mon Dec 5 02:27:50 2016 (r309546) @@ -3483,7 +3483,7 @@ pmap_track_page(pmap_t pmap, vm_offset_t vm_page_t page; struct pv_entry *pve; - va &= ~PAGE_MASK; + va = trunc_page(va); pa = pmap_kextract(va); rw_wlock(&pvh_global_lock); From owner-svn-src-head@freebsd.org Mon Dec 5 03:11:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64326C669FB; Mon, 5 Dec 2016 03:11:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E096128E; Mon, 5 Dec 2016 03:11:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB53BqhR051524; Mon, 5 Dec 2016 03:11:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB53BqaN051523; Mon, 5 Dec 2016 03:11:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201612050311.uB53BqaN051523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 5 Dec 2016 03:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309547 - head/contrib/elftoolchain/readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 03:11:53 -0000 Author: cem Date: Mon Dec 5 03:11:52 2016 New Revision: 309547 URL: https://svnweb.freebsd.org/changeset/base/309547 Log: readelf(1): Add support for extended program header numbers Add support for extended program header numbers to elftoolchain 'readelf -h'. Reviewed by: emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8702 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Mon Dec 5 02:27:50 2016 (r309546) +++ head/contrib/elftoolchain/readelf/readelf.c Mon Dec 5 03:11:52 2016 (r309547) @@ -2112,7 +2112,7 @@ dwarf_reg(unsigned int mach, unsigned in static void dump_ehdr(struct readelf *re) { - size_t shnum, shstrndx; + size_t phnum, shnum, shstrndx; int i; printf("ELF Header:\n"); @@ -2174,7 +2174,13 @@ dump_ehdr(struct readelf *re) re->ehdr.e_phentsize); /* e_phnum. */ - printf("%-37s%u\n", " Number of program headers:", re->ehdr.e_phnum); + printf("%-37s%u", " Number of program headers:", re->ehdr.e_phnum); + if (re->ehdr.e_phnum == PN_XNUM) { + /* Extended program header numbering is in use. */ + if (elf_getphnum(re->elf, &phnum)) + printf(" (%zu)", phnum); + } + putchar('\n'); /* e_shentsize. */ printf("%-37s%u (bytes)\n", " Size of section headers:", From owner-svn-src-head@freebsd.org Mon Dec 5 08:36:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42BC9C6622E; Mon, 5 Dec 2016 08:36:16 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id BBF21358; Mon, 5 Dec 2016 08:36:15 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: by lath.rinet.ru (Postfix, from userid 222) id 926E2717; Mon, 5 Dec 2016 11:36:07 +0300 (MSK) Date: Mon, 5 Dec 2016 11:36:07 +0300 From: Oleg Bulyzhin To: Sepherosa Ziehau Cc: Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309372 - head/sys/sys Message-ID: <20161205083607.GA38771@lath.RINET.ru> References: <201612012108.uB1L8g19026075@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 08:36:16 -0000 On Fri, Dec 02, 2016 at 04:11:32PM +0800, Sepherosa Ziehau wrote: > peek_clear_sc is added to address the issue you mentioned. IMHO, this > commit weakens the proper assertion. I would say this check: #ifdef DEBUG_BUFRING int i; for (i = br->br_cons_head; i != br->br_prod_head; i = ((i + 1) & br->br_cons_mask)) if(br->br_ring[i] == buf) panic("buf=%p already enqueue at %d prod=%d cons=%d", buf, i, br->br_prod_tail, br->br_cons_tail); #endif can't be relied upon: 1) it does not synchronize with anything, neither consumers nor producers. So you can read inconsistent data. For example, you are storing NULL in buf_ring_peek_clear_sc() but there is no guarantee you will see it here. 2) it's not covered by critical section so thread running this check can be preempted. Consider the following scenario: a) thread is running this check and gets preempted by other producer before i != br->br_prod_head check. b) other producer moves br->br_prod_head forward. c) if we are unlucky we can spin forever. Current buf_ring implementation has insufficient memory ordering constraints. I've tried to fix acq/rel usage here: https://reviews.freebsd.org/D8637 but didn't get any review yet. > > On Fri, Dec 2, 2016 at 5:08 AM, Ryan Stone wrote: > > Author: rstone > > Date: Thu Dec 1 21:08:42 2016 > > New Revision: 309372 > > URL: https://svnweb.freebsd.org/changeset/base/309372 > > > > Log: > > Fix a false positive in a buf_ring assert > > > > buf_ring contains an assert that checks whether an item being > > enqueued already exists on the ring. There is a subtle bug in > > this assert. An item can be returned by a peek() function and > > freed, and then the consumer thread can be preempted before > > calling advance(). If this happens the item appears to still be > > on the queue, but another thread may allocate the item from the > > free pool and wind up trying to enqueue it again, causing the > > assert to trigger incorrectly. > > > > Fix this by skipping the head of the consumer's portion of the > > ring, as this index is what will be returned by peek(). > > > > Sponsored by: Dell EMC Isilon > > MFC After: 1 week > > Differential Revision: https://reviews.freebsd.org/D8685 > > Reviewed by: hselasky > > > > Modified: > > head/sys/sys/buf_ring.h > > > > Modified: head/sys/sys/buf_ring.h > > ============================================================================== > > --- head/sys/sys/buf_ring.h Thu Dec 1 20:36:48 2016 (r309371) > > +++ head/sys/sys/buf_ring.h Thu Dec 1 21:08:42 2016 (r309372) > > @@ -67,11 +67,13 @@ buf_ring_enqueue(struct buf_ring *br, vo > > uint32_t prod_head, prod_next, cons_tail; > > #ifdef DEBUG_BUFRING > > int i; > > - for (i = br->br_cons_head; i != br->br_prod_head; > > - i = ((i + 1) & br->br_cons_mask)) > > - if(br->br_ring[i] == buf) > > - panic("buf=%p already enqueue at %d prod=%d cons=%d", > > - buf, i, br->br_prod_tail, br->br_cons_tail); > > + if (br->br_cons_head != br->br_prod_head) { > > + for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != br->br_prod_head; > > + i = ((i + 1) & br->br_cons_mask)) > > + if(br->br_ring[i] == buf) > > + panic("buf=%p already enqueue at %d prod=%d cons=%d", > > + buf, i, br->br_prod_tail, br->br_cons_tail); > > + } > > #endif > > critical_enter(); > > do { > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > > > -- > Tomorrow Will Never Die -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ From owner-svn-src-head@freebsd.org Mon Dec 5 11:26:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62468C68624; Mon, 5 Dec 2016 11:26:25 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id F28E13A4; Mon, 5 Dec 2016 11:26:24 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (5ec15438.skybroadband.com [94.193.84.56]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 1C42CD8506; Mon, 5 Dec 2016 11:24:18 +0000 (UTC) Date: Mon, 5 Dec 2016 11:25:46 +0000 From: Andrew Turner To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309531 - head/sys/arm/include Message-ID: <20161205112546.2b212de2@zapp> In-Reply-To: <201612041527.uB4FRduc064051@repo.freebsd.org> References: <201612041527.uB4FRduc064051@repo.freebsd.org> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 11:26:25 -0000 On Sun, 4 Dec 2016 15:27:39 +0000 (UTC) Michal Meloun wrote: > Author: mmel > Date: Sun Dec 4 15:27:39 2016 > New Revision: 309531 > URL: https://svnweb.freebsd.org/changeset/base/309531 > > Log: > Implement fake pmap_mapdev_attr() for ARMv6. > This function is referenced, but never called from DRM2 code. Also, > real behavior of pmap_mapdev_attr() in ARM world is unclear as we > don't have any additional attribute for a device memory type. > > MFC after: 2 weeks > > Modified: > head/sys/arm/include/pmap-v6.h > head/sys/arm/include/pmap.h > > Modified: head/sys/arm/include/pmap-v6.h > ============================================================================== > --- head/sys/arm/include/pmap-v6.h Sun Dec 4 13:56:15 > 2016 (r309530) +++ head/sys/arm/include/pmap-v6.h Sun > Dec 4 15:27:39 2016 (r309531) @@ -166,7 +166,6 @@ extern > ttb_entry_t pmap_kern_ttb; /* TT void > pmap_bootstrap(vm_offset_t); void pmap_kenter(vm_offset_t, > vm_paddr_t); void pmap_kremove(vm_offset_t); > -void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); > boolean_t pmap_page_is_mapped(vm_page_t); > > void pmap_tlb_flush(pmap_t, vm_offset_t); > > Modified: head/sys/arm/include/pmap.h > ============================================================================== > --- head/sys/arm/include/pmap.h Sun Dec 4 13:56:15 > 2016 (r309530) +++ head/sys/arm/include/pmap.h Sun Dec > 4 15:27:39 2016 (r309531) @@ -53,6 +53,12 @@ void > pmap_page_set_memattr(vm_page_t, vm void *pmap_mapdev(vm_paddr_t, > vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); > > +static inline void * > +pmap_mapdev_attr(vm_paddr_t addr, vm_size_t size, int attr) > +{ > + panic("%s is not implemented yet!\n", __func__); > +} > + > struct pcb; > void pmap_set_pcb_pagedir(pmap_t, struct pcb *); > > This broke building the cloudabi module: ===> cloudabi (all) cc -target arm-gnueabi-freebsd12.0 --sysroot=/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew/head-git/tmp -B/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew /head-git/tmp/usr/bin -O -pipe -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /scratch/tmp/andrew/obj/arm.arm/scratch/tmp/and rew/head-git/sys/GENERIC/opt_global.h -I. -I/scratch/tmp/andrew/head-git/sys -fno-common -g -funwind-tables -I/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew/ head-git/sys/GENERIC -march=armv7a -MD -MF.depend.cloudabi_vdso.o -MTcloudabi_vdso.o -ffreestanding -fwrapv -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs - Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -f diagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wn o-error-pointer-sign -Wno-error-shift-negative-value -mno-movt -mfpu=none -std=iso9899:1999 -c /scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/c loudabi/cloudabi_vdso.c -o cloudabi_vdso.o In file included from /scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/cloudabi/cloudabi_vdso.c:35: In file included from /scratch/tmp/andrew/head-git/sys/vm/pmap.h:90: ./machine/pmap.h:59:2: error: implicit declaration of function 'panic' is invalid in C99 [-Werror,-Wimplicit-function-declaration] panic("%s is not implemented yet!\n", __func__); ^ ./machine/pmap.h:60:1: error: control reaches end of non-void function [-Werror,-Wreturn-type] } ^ In file included from /scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/cloudabi/cloudabi_vdso.c:38: In file included from /scratch/tmp/andrew/head-git/sys/vm/vm_page.h:345: /scratch/tmp/andrew/head-git/sys/sys/systm.h:196:6: error: conflicting types for 'panic' void panic(const char *, ...) __dead2 __printflike(1, 2); ^ ./machine/pmap.h:59:2: note: previous implicit declaration is here panic("%s is not implemented yet!\n", __func__); ^ 3 errors generated. *** Error code 1 Andrew From owner-svn-src-head@freebsd.org Mon Dec 5 11:40:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7E64C688E3; Mon, 5 Dec 2016 11:40:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7E0D60; Mon, 5 Dec 2016 11:40:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB5Beswp059468; Mon, 5 Dec 2016 11:40:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB5BesEo059467; Mon, 5 Dec 2016 11:40:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201612051140.uB5BesEo059467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 5 Dec 2016 11:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309549 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 11:40:56 -0000 Author: andrew Date: Mon Dec 5 11:40:54 2016 New Revision: 309549 URL: https://svnweb.freebsd.org/changeset/base/309549 Log: Remove an unneeded header. It was used when we had an arm64 specific GIC driver, however with INTRNG this has been merged into a common arm driver. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Deleted: head/sys/arm64/arm64/gic.h From owner-svn-src-head@freebsd.org Mon Dec 5 11:41:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 218CEC68911; Mon, 5 Dec 2016 11:41:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5845E89; Mon, 5 Dec 2016 11:41:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB5BfALP060176; Mon, 5 Dec 2016 11:41:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB5Bf9El060174; Mon, 5 Dec 2016 11:41:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612051141.uB5Bf9El060174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 5 Dec 2016 11:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309550 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 11:41:11 -0000 Author: kib Date: Mon Dec 5 11:41:09 2016 New Revision: 309550 URL: https://svnweb.freebsd.org/changeset/base/309550 Log: Rename fast taskqueues used by DMAR to avoid naming conflict of the sleepable and spin mutexes created by the queues. Reported and tested by: hps Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_fault.c head/sys/x86/iommu/intel_qi.c Modified: head/sys/x86/iommu/intel_fault.c ============================================================================== --- head/sys/x86/iommu/intel_fault.c Mon Dec 5 11:40:54 2016 (r309549) +++ head/sys/x86/iommu/intel_fault.c Mon Dec 5 11:41:09 2016 (r309550) @@ -271,7 +271,7 @@ dmar_init_fault_log(struct dmar_unit *un M_DEVBUF, M_WAITOK | M_ZERO); TASK_INIT(&unit->fault_task, 0, dmar_fault_task, unit); - unit->fault_taskqueue = taskqueue_create_fast("dmar", M_WAITOK, + unit->fault_taskqueue = taskqueue_create_fast("dmarff", M_WAITOK, taskqueue_thread_enqueue, &unit->fault_taskqueue); taskqueue_start_threads(&unit->fault_taskqueue, 1, PI_AV, "dmar%d fault taskq", unit->unit); Modified: head/sys/x86/iommu/intel_qi.c ============================================================================== --- head/sys/x86/iommu/intel_qi.c Mon Dec 5 11:40:54 2016 (r309549) +++ head/sys/x86/iommu/intel_qi.c Mon Dec 5 11:41:09 2016 (r309550) @@ -378,7 +378,7 @@ dmar_init_qi(struct dmar_unit *unit) TAILQ_INIT(&unit->tlb_flush_entries); TASK_INIT(&unit->qi_task, 0, dmar_qi_task, unit); - unit->qi_taskqueue = taskqueue_create_fast("dmar", M_WAITOK, + unit->qi_taskqueue = taskqueue_create_fast("dmarqf", M_WAITOK, taskqueue_thread_enqueue, &unit->qi_taskqueue); taskqueue_start_threads(&unit->qi_taskqueue, 1, PI_AV, "dmar%d qi taskq", unit->unit); From owner-svn-src-head@freebsd.org Mon Dec 5 11:42:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14090C68A78; Mon, 5 Dec 2016 11:42:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0F641161; Mon, 5 Dec 2016 11:42:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB5BgAgM060979; Mon, 5 Dec 2016 11:42:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB5BgA1W060978; Mon, 5 Dec 2016 11:42:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612051142.uB5BgA1W060978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 5 Dec 2016 11:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309551 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 11:42:11 -0000 Author: kib Date: Mon Dec 5 11:42:09 2016 New Revision: 309551 URL: https://svnweb.freebsd.org/changeset/base/309551 Log: Release DMAR table after using it. Reported and tested by: hps Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_drv.c Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Mon Dec 5 11:41:09 2016 (r309550) +++ head/sys/x86/iommu/intel_drv.c Mon Dec 5 11:42:09 2016 (r309551) @@ -109,6 +109,7 @@ dmar_iterate_tbl(dmar_iter_t iter, void if (!iter(dmarh, arg)) break; } + AcpiPutTable((ACPI_TABLE_HEADER *)dmartbl); } struct find_iter_args { @@ -184,6 +185,7 @@ dmar_identify(driver_t *driver, device_t (unsigned)dmartbl->Flags, "\020\001INTR_REMAP\002X2APIC_OPT_OUT"); } + AcpiPutTable((ACPI_TABLE_HEADER *)dmartbl); dmar_iterate_tbl(dmar_count_iter, NULL); if (dmar_devcnt == 0) From owner-svn-src-head@freebsd.org Mon Dec 5 13:23:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E836C664DC; Mon, 5 Dec 2016 13:23:23 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 25B15988; Mon, 5 Dec 2016 13:23:23 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB5DNMN7001276; Mon, 5 Dec 2016 13:23:22 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB5DNM3H001275; Mon, 5 Dec 2016 13:23:22 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201612051323.uB5DNM3H001275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Mon, 5 Dec 2016 13:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309552 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 13:23:23 -0000 Author: sevan (doc committer) Date: Mon Dec 5 13:23:22 2016 New Revision: 309552 URL: https://svnweb.freebsd.org/changeset/base/309552 Log: Fix error in the example section Adjust formatting highlighted by igor. PR: 214683 Submitted by: Anindya Mukherjee Reviewed by: jilles Approved by: bcr (mentor) MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D8591 Modified: head/usr.bin/systat/systat.1 Modified: head/usr.bin/systat/systat.1 ============================================================================== --- head/usr.bin/systat/systat.1 Mon Dec 5 11:42:09 2016 (r309551) +++ head/usr.bin/systat/systat.1 Mon Dec 5 13:23:22 2016 (r309552) @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd November 10, 2016 +.Dd December 5, 2016 .Dt SYSTAT 1 .Os .Sh NAME @@ -112,19 +112,22 @@ The specifies the screen refresh time interval in seconds. Time interval can be fractional. .It Ar display-commands -A list of commands specific for this display. These commands can also -be entered interactively and are described for each display separately -below. If the command of the display requires an argument or arguments, -it is possible to specify them as separate command line argument. To finish -display commands it is possible to use double dash at the end -of the list. For example: +A list of commands specific to this display. +These commands can also be entered interactively and are described for +each display separately below. +If the command requires arguments, they can be specified as separate +command line arguments. +A command line argument +.Fl - +will finish display commands. +For example: .Pp .Dl Nm Fl ifstat Fl match Ar bge0,em1 Fl pps .Pp This will display statistics of packets per second for network interfaces named as bge0 and em1. .Pp -.Dl Nm Fl iostat Fl numeric Fl - Ar 2.1 +.Dl Nm Fl iostat Fl numbers Fl - Ar 2.1 .Pp This will display all IO statistics in a numeric format and the information will be refreshed each 2.1 seconds. From owner-svn-src-head@freebsd.org Mon Dec 5 15:55:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A26C67A97; Mon, 5 Dec 2016 15:55:52 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 655BFFDF; Mon, 5 Dec 2016 15:55:52 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB5FtpOh063662; Mon, 5 Dec 2016 15:55:51 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB5FtpGS063661; Mon, 5 Dec 2016 15:55:51 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201612051555.uB5FtpGS063661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 5 Dec 2016 15:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309553 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 15:55:52 -0000 Author: mmel Date: Mon Dec 5 15:55:51 2016 New Revision: 309553 URL: https://svnweb.freebsd.org/changeset/base/309553 Log: Fix build breakage caused by r309531. Reported by: andrew MFC after: 2 weeks X-MFC with: r309531 Modified: head/sys/arm/include/pmap.h Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Mon Dec 5 13:23:22 2016 (r309552) +++ head/sys/arm/include/pmap.h Mon Dec 5 15:55:51 2016 (r309553) @@ -30,6 +30,7 @@ #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ +#include #if __ARM_ARCH >= 6 #include #else From owner-svn-src-head@freebsd.org Mon Dec 5 16:06:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 693C0C67FC2; Mon, 5 Dec 2016 16:06:34 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wj0-x244.google.com (mail-wj0-x244.google.com [IPv6:2a00:1450:400c:c01::244]) (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 0484216BA; Mon, 5 Dec 2016 16:06:33 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wj0-x244.google.com with SMTP id kp2so40041041wjc.0; Mon, 05 Dec 2016 08:06:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:reply-to:subject:references:to:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=j37TXx7dREFBFH8He4RSNtF+Y2ymyN7d80Ul9AhhMAo=; b=gBtk7vT29UnaCs3YU29XU4MacJGJ8YEogevRof9trpeQziPABa9WAGYpTyGbmdqtIO UOJl0beJyqeO3ebtw3PUi0TWUAvkoQ5IbRvn4SEowxYOsAS+a3XCT2G3yJfdv1PhyT/y qpq+/LbLRhUe0NMUK5QNUY58xpEGoFO4B6JA/64xQqhNUS6uWuAej6pkd5Y3MzIQdOpG xmrXvrSnQl/yojzvA3QYRnRcK/9qkduZwtDFBwlhAKDWQJgR19GXJQlJygRb2PHdcJaG apy4UxXHD6ZH05QjwKSzqFyvq5hkU4jMl/dq3BwHzckgMgjI2tKBuzZSvHsPS8fX2Zug veIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:reply-to:subject:references:to:cc :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=j37TXx7dREFBFH8He4RSNtF+Y2ymyN7d80Ul9AhhMAo=; b=YpBatdz5Nqd5T3ekgCxDPMabkjamlIM7kajPgu167/7Npsody5BRhKYZYnDzhhJ80Q PEppRrl/m2sPQf419FXaUUJUqzTHURroNPg1zTPqW5pVI1lC/9tvUyHp92d1jFjMaiqc IS7bBZtHG07cIoOzGF1OX9J/yD089oy/hFG1S04DGejJm7y/l/D5mRkymIWSIhkFGT2Y gmXhW3+jUXvJIbLhIbFpED1N9kbEu3mDDvmU9K8KjacsDybfMVcKvdr4mke1GYFiYxop bVpq7386r6MQe57K1ve8eaV4pYIETtnh2NARJaeTefu1otFWh6G8BTZNAozBnhFlTtf0 q1Pg== X-Gm-Message-State: AKaTC00f5j7/8TRVrc3hmdoLItqi+4Q+aANrd+27X+nr+wcWza81FHLi/EWXZnPir0lrMg== X-Received: by 10.194.94.39 with SMTP id cz7mr26661829wjb.204.1480953992043; Mon, 05 Dec 2016 08:06:32 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id f3sm816333wmf.10.2016.12.05.08.06.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2016 08:06:31 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r309531 - head/sys/arm/include References: <201612041527.uB4FRduc064051@repo.freebsd.org> <20161205112546.2b212de2@zapp> To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <283ab7ec-8c06-b092-7059-637ddc22b7d4@freebsd.org> Date: Mon, 5 Dec 2016 17:06:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161205112546.2b212de2@zapp> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 16:06:34 -0000 Fixed in r309553. Sorry for breakage and thanks for report. Michal On 05.12.2016 12:25, Andrew Turner wrote: > On Sun, 4 Dec 2016 15:27:39 +0000 (UTC) > Michal Meloun wrote: > >> Author: mmel >> Date: Sun Dec 4 15:27:39 2016 >> New Revision: 309531 >> URL: https://svnweb.freebsd.org/changeset/base/309531 >> >> Log: >> Implement fake pmap_mapdev_attr() for ARMv6. >> This function is referenced, but never called from DRM2 code. Also, >> real behavior of pmap_mapdev_attr() in ARM world is unclear as we >> don't have any additional attribute for a device memory type. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/arm/include/pmap-v6.h >> head/sys/arm/include/pmap.h >> >> Modified: head/sys/arm/include/pmap-v6.h >> ============================================================================== >> --- head/sys/arm/include/pmap-v6.h Sun Dec 4 13:56:15 >> 2016 (r309530) +++ head/sys/arm/include/pmap-v6.h Sun >> Dec 4 15:27:39 2016 (r309531) @@ -166,7 +166,6 @@ extern >> ttb_entry_t pmap_kern_ttb; /* TT void >> pmap_bootstrap(vm_offset_t); void pmap_kenter(vm_offset_t, >> vm_paddr_t); void pmap_kremove(vm_offset_t); >> -void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); >> boolean_t pmap_page_is_mapped(vm_page_t); >> >> void pmap_tlb_flush(pmap_t, vm_offset_t); >> >> Modified: head/sys/arm/include/pmap.h >> ============================================================================== >> --- head/sys/arm/include/pmap.h Sun Dec 4 13:56:15 >> 2016 (r309530) +++ head/sys/arm/include/pmap.h Sun Dec >> 4 15:27:39 2016 (r309531) @@ -53,6 +53,12 @@ void >> pmap_page_set_memattr(vm_page_t, vm void *pmap_mapdev(vm_paddr_t, >> vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); >> >> +static inline void * >> +pmap_mapdev_attr(vm_paddr_t addr, vm_size_t size, int attr) >> +{ >> + panic("%s is not implemented yet!\n", __func__); >> +} >> + >> struct pcb; >> void pmap_set_pcb_pagedir(pmap_t, struct pcb *); >> >> > This broke building the cloudabi module: > > ===> cloudabi (all) > cc -target arm-gnueabi-freebsd12.0 --sysroot=/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew/head-git/tmp -B/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew > /head-git/tmp/usr/bin -O -pipe -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /scratch/tmp/andrew/obj/arm.arm/scratch/tmp/and > rew/head-git/sys/GENERIC/opt_global.h -I. -I/scratch/tmp/andrew/head-git/sys -fno-common -g -funwind-tables -I/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew/ > head-git/sys/GENERIC -march=armv7a -MD -MF.depend.cloudabi_vdso.o -MTcloudabi_vdso.o -ffreestanding -fwrapv -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs - > Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -f > diagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wn > o-error-pointer-sign -Wno-error-shift-negative-value -mno-movt -mfpu=none -std=iso9899:1999 -c /scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/c > loudabi/cloudabi_vdso.c -o cloudabi_vdso.o > In file included from /scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/cloudabi/cloudabi_vdso.c:35: > In file included from /scratch/tmp/andrew/head-git/sys/vm/pmap.h:90: > ./machine/pmap.h:59:2: error: implicit declaration of function 'panic' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > panic("%s is not implemented yet!\n", __func__); > ^ > ./machine/pmap.h:60:1: error: control reaches end of non-void function [-Werror,-Wreturn-type] > } > ^ > In file included from /scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/cloudabi/cloudabi_vdso.c:38: > In file included from /scratch/tmp/andrew/head-git/sys/vm/vm_page.h:345: > /scratch/tmp/andrew/head-git/sys/sys/systm.h:196:6: error: conflicting types for 'panic' > void panic(const char *, ...) __dead2 __printflike(1, 2); > ^ > ./machine/pmap.h:59:2: note: previous implicit declaration is here > panic("%s is not implemented yet!\n", __func__); > ^ > 3 errors generated. > *** Error code 1 > > Andrew From owner-svn-src-head@freebsd.org Mon Dec 5 17:21:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A83C68875; Mon, 5 Dec 2016 17:21:06 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D1FC1228; Mon, 5 Dec 2016 17:21:06 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB5HL58x098359; Mon, 5 Dec 2016 17:21:05 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB5HL48d098345; Mon, 5 Dec 2016 17:21:04 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201612051721.uB5HL48d098345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 5 Dec 2016 17:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309554 - head/tools/regression/sockets/unix_cmsg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 17:21:06 -0000 Author: sobomax Date: Mon Dec 5 17:21:04 2016 New Revision: 309554 URL: https://svnweb.freebsd.org/changeset/base/309554 Log: Refactor the regression test code by splitting huge monolithic C file into smaller pieces that are hopefully easier to understand and extend. This is to pave the ground for adding few more socket timestamp formats that I am working on here. No functional changes (I hope). Added: head/tools/regression/sockets/unix_cmsg/t_bintime.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_bintime.h (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_cmsg_len.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_cmsg_len.h (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_cmsgcred.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_cmsgcred.h (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_cmsgcred_sockcred.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_cmsgcred_sockcred.h (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_generic.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_generic.h (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_peercred.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_peercred.h (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_sockcred.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_sockcred.h (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_timeval.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/t_timeval.h (contents, props changed) head/tools/regression/sockets/unix_cmsg/uc_common.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/uc_common.h (contents, props changed) Modified: head/tools/regression/sockets/unix_cmsg/Makefile head/tools/regression/sockets/unix_cmsg/unix_cmsg.c Modified: head/tools/regression/sockets/unix_cmsg/Makefile ============================================================================== --- head/tools/regression/sockets/unix_cmsg/Makefile Mon Dec 5 15:55:51 2016 (r309553) +++ head/tools/regression/sockets/unix_cmsg/Makefile Mon Dec 5 17:21:04 2016 (r309554) @@ -1,6 +1,10 @@ # $FreeBSD$ PROG= unix_cmsg +SRCS= unix_cmsg.c t_bintime.h t_bintime.c uc_common.h uc_common.c \ + t_generic.h t_generic.c t_peercred.h t_peercred.c t_timeval.h \ + t_timeval.c t_cmsgcred.h t_cmsgcred.c t_sockcred.h t_sockcred.c \ + t_cmsgcred_sockcred.h t_cmsgcred_sockcred.c t_cmsg_len.h t_cmsg_len.c MAN= WARNS?= 3 Added: head/tools/regression/sockets/unix_cmsg/t_bintime.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_bintime.c Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,156 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "t_bintime.h" +#include "t_generic.h" +#include "uc_common.h" + +static int +check_scm_bintime(struct cmsghdr *cmsghdr) +{ + const struct bintime *bt; + + if (uc_check_cmsghdr(cmsghdr, SCM_BINTIME, sizeof(struct bintime)) < 0) + return (-1); + + bt = (struct bintime *)CMSG_DATA(cmsghdr); + + uc_dbgmsg("bintime.sec %"PRIdMAX", bintime.frac %"PRIu64, + (intmax_t)bt->sec, bt->frac); + + return (0); +} + +static int +t_bintime_client(int fd) +{ + struct msghdr msghdr; + struct iovec iov[1]; + void *cmsg_data; + size_t cmsg_size; + int rv; + + if (uc_sync_recv() < 0) + return (-2); + + rv = -2; + + cmsg_size = CMSG_SPACE(sizeof(struct bintime)); + cmsg_data = malloc(cmsg_size); + if (cmsg_data == NULL) { + uc_logmsg("malloc"); + goto done; + } + uc_msghdr_init_client(&msghdr, iov, cmsg_data, cmsg_size, + SCM_BINTIME, sizeof(struct bintime)); + + if (uc_socket_connect(fd) < 0) + goto done; + + if (uc_message_sendn(fd, &msghdr) < 0) + goto done; + + rv = 0; +done: + free(cmsg_data); + return (rv); +} + +static int +t_bintime_server(int fd1) +{ + struct msghdr msghdr; + struct iovec iov[1]; + struct cmsghdr *cmsghdr; + void *cmsg_data; + size_t cmsg_size; + u_int i; + int fd2, rv; + + if (uc_sync_send() < 0) + return (-2); + + fd2 = -1; + rv = -2; + + cmsg_size = CMSG_SPACE(sizeof(struct bintime)); + cmsg_data = malloc(cmsg_size); + if (cmsg_data == NULL) { + uc_logmsg("malloc"); + goto done; + } + + if (uc_cfg.sock_type == SOCK_STREAM) { + fd2 = uc_socket_accept(fd1); + if (fd2 < 0) + goto done; + } else + fd2 = fd1; + + rv = -1; + for (i = 1; i <= uc_cfg.ipc_msg.msg_num; ++i) { + uc_dbgmsg("message #%u", i); + + uc_msghdr_init_server(&msghdr, iov, cmsg_data, cmsg_size); + if (uc_message_recv(fd2, &msghdr) < 0) { + rv = -2; + break; + } + + if (uc_check_msghdr(&msghdr, sizeof(*cmsghdr)) < 0) + break; + + cmsghdr = CMSG_FIRSTHDR(&msghdr); + if (check_scm_bintime(cmsghdr) < 0) + break; + } + if (i > uc_cfg.ipc_msg.msg_num) + rv = 0; +done: + free(cmsg_data); + if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) + if (uc_socket_close(fd2) < 0) + rv = -2; + return (rv); +} + +int +t_bintime(void) +{ + return (t_generic(t_bintime_client, t_bintime_server)); +} Added: head/tools/regression/sockets/unix_cmsg/t_bintime.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_bintime.h Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,30 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * Copyright (c) 2016 Maksym Sobolyev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +int t_bintime(void); Added: head/tools/regression/sockets/unix_cmsg/t_cmsg_len.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_cmsg_len.c Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "uc_common.h" +#include "t_generic.h" +#include "t_cmsg_len.h" + +#ifndef __LP64__ +static int +t_cmsg_len_client(int fd) +{ + struct msghdr msghdr; + struct iovec iov[1]; + struct cmsghdr *cmsghdr; + void *cmsg_data; + size_t size, cmsg_size; + socklen_t socklen; + int rv; + + if (uc_sync_recv() < 0) + return (-2); + + rv = -2; + + cmsg_size = CMSG_SPACE(sizeof(struct cmsgcred)); + cmsg_data = malloc(cmsg_size); + if (cmsg_data == NULL) { + uc_logmsg("malloc"); + goto done; + } + uc_msghdr_init_client(&msghdr, iov, cmsg_data, cmsg_size, + SCM_CREDS, sizeof(struct cmsgcred)); + cmsghdr = CMSG_FIRSTHDR(&msghdr); + + if (uc_socket_connect(fd) < 0) + goto done; + + size = msghdr.msg_iov != NULL ? msghdr.msg_iov->iov_len : 0; + rv = -1; + for (socklen = 0; socklen < CMSG_LEN(0); ++socklen) { + cmsghdr->cmsg_len = socklen; + uc_dbgmsg("send: data size %zu", size); + uc_dbgmsg("send: msghdr.msg_controllen %u", + (u_int)msghdr.msg_controllen); + uc_dbgmsg("send: cmsghdr.cmsg_len %u", + (u_int)cmsghdr->cmsg_len); + if (sendmsg(fd, &msghdr, 0) < 0) { + uc_dbgmsg("sendmsg(2) failed: %s; retrying", + strerror(errno)); + continue; + } + uc_logmsgx("sent message with cmsghdr.cmsg_len %u < %u", + (u_int)cmsghdr->cmsg_len, (u_int)CMSG_LEN(0)); + break; + } + if (socklen == CMSG_LEN(0)) + rv = 0; + + if (uc_sync_send() < 0) { + rv = -2; + goto done; + } +done: + free(cmsg_data); + return (rv); +} + +static int +t_cmsg_len_server(int fd1) +{ + int fd2, rv; + + if (uc_sync_send() < 0) + return (-2); + + rv = -2; + + if (uc_cfg.sock_type == SOCK_STREAM) { + fd2 = uc_socket_accept(fd1); + if (fd2 < 0) + goto done; + } else + fd2 = fd1; + + if (uc_sync_recv() < 0) + goto done; + + rv = 0; +done: + if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) + if (uc_socket_close(fd2) < 0) + rv = -2; + return (rv); +} + +int +t_cmsg_len(void) +{ + return (t_generic(t_cmsg_len_client, t_cmsg_len_server)); +} +#endif Added: head/tools/regression/sockets/unix_cmsg/t_cmsg_len.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_cmsg_len.h Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * Copyright (c) 2016 Maksym Sobolyev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LP64__ +int t_cmsg_len(void); +#endif Added: head/tools/regression/sockets/unix_cmsg/t_cmsgcred.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_cmsgcred.c Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include "uc_common.h" +#include "t_generic.h" +#include "t_cmsgcred.h" + +int +t_cmsgcred_client(int fd) +{ + struct msghdr msghdr; + struct iovec iov[1]; + void *cmsg_data; + size_t cmsg_size; + int rv; + + if (uc_sync_recv() < 0) + return (-2); + + rv = -2; + + cmsg_size = CMSG_SPACE(sizeof(struct cmsgcred)); + cmsg_data = malloc(cmsg_size); + if (cmsg_data == NULL) { + uc_logmsg("malloc"); + goto done; + } + uc_msghdr_init_client(&msghdr, iov, cmsg_data, cmsg_size, + SCM_CREDS, sizeof(struct cmsgcred)); + + if (uc_socket_connect(fd) < 0) + goto done; + + if (uc_message_sendn(fd, &msghdr) < 0) + goto done; + + rv = 0; +done: + free(cmsg_data); + return (rv); +} + +static int +t_cmsgcred_server(int fd1) +{ + struct msghdr msghdr; + struct iovec iov[1]; + struct cmsghdr *cmsghdr; + void *cmsg_data; + size_t cmsg_size; + u_int i; + int fd2, rv; + + if (uc_sync_send() < 0) + return (-2); + + fd2 = -1; + rv = -2; + + cmsg_size = CMSG_SPACE(sizeof(struct cmsgcred)); + cmsg_data = malloc(cmsg_size); + if (cmsg_data == NULL) { + uc_logmsg("malloc"); + goto done; + } + + if (uc_cfg.sock_type == SOCK_STREAM) { + fd2 = uc_socket_accept(fd1); + if (fd2 < 0) + goto done; + } else + fd2 = fd1; + + rv = -1; + for (i = 1; i <= uc_cfg.ipc_msg.msg_num; ++i) { + uc_dbgmsg("message #%u", i); + + uc_msghdr_init_server(&msghdr, iov, cmsg_data, cmsg_size); + if (uc_message_recv(fd2, &msghdr) < 0) { + rv = -2; + break; + } + + if (uc_check_msghdr(&msghdr, sizeof(*cmsghdr)) < 0) + break; + + cmsghdr = CMSG_FIRSTHDR(&msghdr); + if (uc_check_scm_creds_cmsgcred(cmsghdr) < 0) + break; + } + if (i > uc_cfg.ipc_msg.msg_num) + rv = 0; +done: + free(cmsg_data); + if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) + if (uc_socket_close(fd2) < 0) + rv = -2; + return (rv); +} + +int +t_cmsgcred(void) +{ + return (t_generic(t_cmsgcred_client, t_cmsgcred_server)); +} Added: head/tools/regression/sockets/unix_cmsg/t_cmsgcred.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_cmsgcred.h Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,30 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +int t_cmsgcred_client(int fd); +int t_cmsgcred(void); Added: head/tools/regression/sockets/unix_cmsg/t_cmsgcred_sockcred.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_cmsgcred_sockcred.c Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include "uc_common.h" +#include "t_generic.h" +#include "t_cmsgcred.h" +#include "t_cmsgcred_sockcred.h" + +static int +t_cmsgcred_sockcred_server(int fd1) +{ + struct msghdr msghdr; + struct iovec iov[1]; + struct cmsghdr *cmsghdr; + void *cmsg_data, *cmsg1_data, *cmsg2_data; + size_t cmsg_size, cmsg1_size, cmsg2_size; + u_int i; + int fd2, rv, val; + + fd2 = -1; + rv = -2; + + cmsg1_size = CMSG_SPACE(SOCKCREDSIZE(uc_cfg.proc_cred.gid_num)); + cmsg2_size = CMSG_SPACE(sizeof(struct cmsgcred)); + cmsg1_data = malloc(cmsg1_size); + cmsg2_data = malloc(cmsg2_size); + if (cmsg1_data == NULL || cmsg2_data == NULL) { + uc_logmsg("malloc"); + goto done; + } + + uc_dbgmsg("setting LOCAL_CREDS"); + val = 1; + if (setsockopt(fd1, 0, LOCAL_CREDS, &val, sizeof(val)) < 0) { + uc_logmsg("setsockopt(LOCAL_CREDS)"); + goto done; + } + + if (uc_sync_send() < 0) + goto done; + + if (uc_cfg.sock_type == SOCK_STREAM) { + fd2 = uc_socket_accept(fd1); + if (fd2 < 0) + goto done; + } else + fd2 = fd1; + + cmsg_data = cmsg1_data; + cmsg_size = cmsg1_size; + rv = -1; + for (i = 1; i <= uc_cfg.ipc_msg.msg_num; ++i) { + uc_dbgmsg("message #%u", i); + + uc_msghdr_init_server(&msghdr, iov, cmsg_data, cmsg_size); + if (uc_message_recv(fd2, &msghdr) < 0) { + rv = -2; + break; + } + + if (uc_check_msghdr(&msghdr, sizeof(*cmsghdr)) < 0) + break; + + cmsghdr = CMSG_FIRSTHDR(&msghdr); + if (i == 1 || uc_cfg.sock_type == SOCK_DGRAM) { + if (uc_check_scm_creds_sockcred(cmsghdr) < 0) + break; + } else { + if (uc_check_scm_creds_cmsgcred(cmsghdr) < 0) + break; + } + + cmsg_data = cmsg2_data; + cmsg_size = cmsg2_size; + } + if (i > uc_cfg.ipc_msg.msg_num) + rv = 0; +done: + free(cmsg1_data); + free(cmsg2_data); + if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) + if (uc_socket_close(fd2) < 0) + rv = -2; + return (rv); +} + +int +t_cmsgcred_sockcred(void) +{ + return (t_generic(t_cmsgcred_client, t_cmsgcred_sockcred_server)); +} Added: head/tools/regression/sockets/unix_cmsg/t_cmsgcred_sockcred.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_cmsgcred_sockcred.h Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,30 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * Copyright (c) 2016 Maksym Sobolyev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +int t_cmsgcred_sockcred(void); Added: head/tools/regression/sockets/unix_cmsg/t_generic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_generic.c Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include "uc_common.h" +#include "t_generic.h" + +int +t_generic(int (*client_func)(int), int (*server_func)(int)) +{ + int fd, rv, rv_client; + + switch (uc_client_fork()) { + case 0: + fd = uc_socket_create(); + if (fd < 0) + rv = -2; + else { + rv = client_func(fd); + if (uc_socket_close(fd) < 0) + rv = -2; + } + uc_client_exit(rv); + break; + case 1: + fd = uc_socket_create(); + if (fd < 0) + rv = -2; + else { + rv = server_func(fd); + rv_client = uc_client_wait(); + if (rv == 0 || (rv == -2 && rv_client != 0)) + rv = rv_client; + if (uc_socket_close(fd) < 0) + rv = -2; + } + break; + default: + rv = -2; + } + return (rv); +} Added: head/tools/regression/sockets/unix_cmsg/t_generic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_generic.h Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,30 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * Copyright (c) 2016 Maksym Sobolyev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +int t_generic(int (*client_func)(int), int (*server_func)(int)); Added: head/tools/regression/sockets/unix_cmsg/t_peercred.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_peercred.c Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "uc_common.h" +#include "t_generic.h" +#include "t_peercred.h" + +static int +check_xucred(const struct xucred *xucred, socklen_t len) +{ + int rc; + + if (len != sizeof(*xucred)) { + uc_logmsgx("option value size %zu != %zu", + (size_t)len, sizeof(*xucred)); + return (-1); + } + + uc_dbgmsg("xucred.cr_version %u", xucred->cr_version); + uc_dbgmsg("xucred.cr_uid %lu", (u_long)xucred->cr_uid); + uc_dbgmsg("xucred.cr_ngroups %d", xucred->cr_ngroups); + + rc = 0; + + if (xucred->cr_version != XUCRED_VERSION) { + uc_logmsgx("xucred.cr_version %u != %d", + xucred->cr_version, XUCRED_VERSION); + rc = -1; + } + if (xucred->cr_uid != uc_cfg.proc_cred.euid) { + uc_logmsgx("xucred.cr_uid %lu != %lu (EUID)", + (u_long)xucred->cr_uid, (u_long)uc_cfg.proc_cred.euid); + rc = -1; + } + if (xucred->cr_ngroups == 0) { + uc_logmsgx("xucred.cr_ngroups == 0"); + rc = -1; + } + if (xucred->cr_ngroups < 0) { + uc_logmsgx("xucred.cr_ngroups < 0"); + rc = -1; + } + if (xucred->cr_ngroups > XU_NGROUPS) { + uc_logmsgx("xucred.cr_ngroups %hu > %u (max)", + xucred->cr_ngroups, XU_NGROUPS); + rc = -1; + } + if (xucred->cr_groups[0] != uc_cfg.proc_cred.egid) { + uc_logmsgx("xucred.cr_groups[0] %lu != %lu (EGID)", + (u_long)xucred->cr_groups[0], (u_long)uc_cfg.proc_cred.egid); + rc = -1; + } + if (uc_check_groups("xucred.cr_groups", xucred->cr_groups, + "xucred.cr_ngroups", xucred->cr_ngroups, false) < 0) + rc = -1; + return (rc); +} + +static int +t_peercred_client(int fd) +{ + struct xucred xucred; + socklen_t len; + + if (uc_sync_recv() < 0) + return (-1); + + if (uc_socket_connect(fd) < 0) + return (-1); + + len = sizeof(xucred); + if (getsockopt(fd, 0, LOCAL_PEERCRED, &xucred, &len) < 0) { + uc_logmsg("getsockopt(LOCAL_PEERCRED)"); + return (-1); + } + + if (check_xucred(&xucred, len) < 0) + return (-1); + + return (0); +} + +static int +t_peercred_server(int fd1) +{ + struct xucred xucred; + socklen_t len; + int fd2, rv; + + if (uc_sync_send() < 0) + return (-2); + + fd2 = uc_socket_accept(fd1); + if (fd2 < 0) + return (-2); + + len = sizeof(xucred); + if (getsockopt(fd2, 0, LOCAL_PEERCRED, &xucred, &len) < 0) { + uc_logmsg("getsockopt(LOCAL_PEERCRED)"); + rv = -2; + goto done; + } + + if (check_xucred(&xucred, len) < 0) { + rv = -1; + goto done; + } + + rv = 0; +done: + if (uc_socket_close(fd2) < 0) + rv = -2; + return (rv); +} + +int +t_peercred(void) +{ + return (t_generic(t_peercred_client, t_peercred_server)); +} Added: head/tools/regression/sockets/unix_cmsg/t_peercred.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/t_peercred.h Mon Dec 5 17:21:04 2016 (r309554) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2005 Andrey Simonenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Dec 5 19:11:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC805C67BC5; Mon, 5 Dec 2016 19:11:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D0A615AC; Mon, 5 Dec 2016 19:11:01 +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 8B01510A998; Mon, 5 Dec 2016 14:11:00 -0500 (EST) From: John Baldwin To: Ian Lepore Cc: Michal Meloun , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309531 - head/sys/arm/include Date: Mon, 05 Dec 2016 08:38:43 -0800 Message-ID: <1919253.AMxT3OP8Q2@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <1480892114.1889.243.camel@freebsd.org> References: <201612041527.uB4FRduc064051@repo.freebsd.org> <1605461.LLfnXX4YB2@ralph.baldwin.cx> <1480892114.1889.243.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 05 Dec 2016 14:11:00 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 19:11:01 -0000 On Sunday, December 04, 2016 03:55:14 PM Ian Lepore wrote: > On Sun, 2016-12-04 at 13:43 -0800, John Baldwin wrote: > > On Sunday, December 04, 2016 03:27:39 PM Michal Meloun wrote: > > > > > > Author: mmel > > > Date: Sun Dec 4 15:27:39 2016 > > > New Revision: 309531 > > > URL: https://svnweb.freebsd.org/changeset/base/309531 > > > > > > Log: > > > Implement fake pmap_mapdev_attr() for ARMv6. > > > This function is referenced, but never called from DRM2 code. > > > Also, > > > real behavior of pmap_mapdev_attr() in ARM world is unclear as we > > > don't > > > have any additional attribute for a device memory type. > > You have VM_MEMATTR constants on ARM though. Some devices might want > > a > > WB mapping (e.g. for a prefetchable memory BAR) rather than UC. > > > > On ARM, 'DEVICE' memory is its own type/attribute and it can't usefully > be changed (if you were to change it, it would no longer be device > memory, it would be some other type). If this function is being used > to map main memory just because that memory happens to be used in some > device driver, then that's a usage model that just doesn't map usefully > to arm memory semantics. Ah, no. It is used for things like BARs, etc. It is fine if devices are always mapped uncacheable. The requests for write-combining are performance hints, but devices should still function correctly. For example, on i386 without PAT we will map WC requests to UC. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Dec 5 21:52:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B07FC68764; Mon, 5 Dec 2016 21:52:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEFDA1A6E; Mon, 5 Dec 2016 21:52:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB5LqBbQ009525; Mon, 5 Dec 2016 21:52:11 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB5LqBPm009524; Mon, 5 Dec 2016 21:52:11 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201612052152.uB5LqBPm009524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 5 Dec 2016 21:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309563 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 21:52:12 -0000 Author: kp Date: Mon Dec 5 21:52:10 2016 New Revision: 309563 URL: https://svnweb.freebsd.org/changeset/base/309563 Log: pflog: Correctly initialise subrulenr subrulenr is considered unset if it's set to -1, not if it's set to 1. See contrib/tcpdump/print-pflog.c pflog_print() for a user. This caused incorrect pflog output (tcpdump -n -e -ttt -i pflog0): rule 0..16777216(match) instead of the correct output of rule 0/0(match) PR: 214832 Submitted by: andywhite@gmail.com Modified: head/sys/netpfil/pf/if_pflog.c Modified: head/sys/netpfil/pf/if_pflog.c ============================================================================== --- head/sys/netpfil/pf/if_pflog.c Mon Dec 5 21:24:38 2016 (r309562) +++ head/sys/netpfil/pf/if_pflog.c Mon Dec 5 21:52:10 2016 (r309563) @@ -221,7 +221,7 @@ pflog_packet(struct pfi_kif *kif, struct if (am == NULL) { hdr.rulenr = htonl(rm->nr); - hdr.subrulenr = 1; + hdr.subrulenr = -1; } else { hdr.rulenr = htonl(am->nr); hdr.subrulenr = htonl(rm->nr); From owner-svn-src-head@freebsd.org Mon Dec 5 22:36:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B41DBC68B8A; Mon, 5 Dec 2016 22:36:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E93E1922; Mon, 5 Dec 2016 22:36:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB5MaPFg025683; Mon, 5 Dec 2016 22:36:25 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB5MaPbo025682; Mon, 5 Dec 2016 22:36:25 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201612052236.uB5MaPbo025682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 5 Dec 2016 22:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309566 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 22:36:26 -0000 Author: rmacklem Date: Mon Dec 5 22:36:25 2016 New Revision: 309566 URL: https://svnweb.freebsd.org/changeset/base/309566 Log: Fix the NFSv4.1 server for Open reclaim after a reboot. The NFSv4.1 server failed to update the nfs-stablerestart file for a client when the client was issued its first Open. As such, recovery of Opens after a server reboot failed with NFSERR_NOGRACE. This patch fixes this. It also changes the code so that it malloc()'s the 1024 byte array instead of allocating it on the kernel stack for both NFSv4.0 and NFSv4.1. Note that this bug only affected NFSv4.1 and only when clients attempted to reclaim Opens after a server reboot. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Mon Dec 5 22:26:48 2016 (r309565) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Mon Dec 5 22:36:25 2016 (r309566) @@ -2501,6 +2501,8 @@ nfsrv_openctrl(struct nfsrv_descript *nd struct nfsclient *clp; int error = 0, haslock = 0, ret, delegate = 1, writedeleg = 1; int readonly = 0, cbret = 1, getfhret = 0; + int gotstate = 0, len = 0; + u_char *clidp = NULL; if ((new_stp->ls_flags & NFSLCK_SHAREBITS) == NFSLCK_READACCESS) readonly = 1; @@ -2519,6 +2521,7 @@ nfsrv_openctrl(struct nfsrv_descript *nd goto out; } + clidp = malloc(NFSV4_OPAQUELIMIT, M_TEMP, M_WAITOK); tryagain: MALLOC(new_lfp, struct nfslockfile *, sizeof (struct nfslockfile), M_NFSDLOCKFILE, M_WAITOK); @@ -3181,6 +3184,16 @@ tryagain: nfsrv_openpluslock++; nfsrv_delegatecnt++; } + /* + * Since NFSv4.1 never does an OpenConfirm, the first + * open state will be acquired here. + */ + if (!(clp->lc_flags & LCL_STAMPEDSTABLE)) { + clp->lc_flags |= LCL_STAMPEDSTABLE; + len = clp->lc_idlen; + NFSBCOPY(clp->lc_id, clidp, len); + gotstate = 1; + } } else { *rflagsp |= NFSV4OPEN_RESULTCONFIRM; new_stp->ls_flags = NFSLCK_NEEDSCONFIRM; @@ -3217,7 +3230,17 @@ tryagain: if (new_deleg) FREE((caddr_t)new_deleg, M_NFSDSTATE); + /* + * If the NFSv4.1 client just acquired its first open, write a timestamp + * to the stable storage file. + */ + if (gotstate != 0) { + nfsrv_writestable(clidp, len, NFSNST_NEWSTATE, p); + nfsrv_backupstable(); + } + out: + free(clidp, M_TEMP); NFSEXITCODE2(error, nd); return (error); } @@ -3234,7 +3257,7 @@ nfsrv_openupdate(vnode_t vp, struct nfss struct nfslockfile *lfp; u_int32_t bits; int error = 0, gotstate = 0, len = 0; - u_char client[NFSV4_OPAQUELIMIT]; + u_char *clidp = NULL; /* * Check for restart conditions (client and server). @@ -3244,6 +3267,7 @@ nfsrv_openupdate(vnode_t vp, struct nfss if (error) goto out; + clidp = malloc(NFSV4_OPAQUELIMIT, M_TEMP, M_WAITOK); NFSLOCKSTATE(); /* * Get the open structure via clientid and stateid. @@ -3322,7 +3346,7 @@ nfsrv_openupdate(vnode_t vp, struct nfss if (!(clp->lc_flags & LCL_STAMPEDSTABLE)) { clp->lc_flags |= LCL_STAMPEDSTABLE; len = clp->lc_idlen; - NFSBCOPY(clp->lc_id, client, len); + NFSBCOPY(clp->lc_id, clidp, len); gotstate = 1; } NFSUNLOCKSTATE(); @@ -3369,11 +3393,12 @@ nfsrv_openupdate(vnode_t vp, struct nfss * to the stable storage file. */ if (gotstate != 0) { - nfsrv_writestable(client, len, NFSNST_NEWSTATE, p); + nfsrv_writestable(clidp, len, NFSNST_NEWSTATE, p); nfsrv_backupstable(); } out: + free(clidp, M_TEMP); NFSEXITCODE2(error, nd); return (error); } From owner-svn-src-head@freebsd.org Tue Dec 6 00:01:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1359EC69A1E; Tue, 6 Dec 2016 00:01:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D64341F6A; Tue, 6 Dec 2016 00:01:54 +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 uB601sA6061750; Tue, 6 Dec 2016 00:01:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB601rmn061747; Tue, 6 Dec 2016 00:01:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612060001.uB601rmn061747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Dec 2016 00:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309581 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 00:01:55 -0000 Author: jhb Date: Tue Dec 6 00:01:53 2016 New Revision: 309581 URL: https://svnweb.freebsd.org/changeset/base/309581 Log: Document support for Terminator 6 adapters in cxgbe(4) and cxgbev(4). Approved by: np MFC after: 3 days Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D8716 Modified: head/share/man/man4/Makefile head/share/man/man4/cxgbe.4 head/share/man/man4/cxgbev.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Dec 5 23:55:53 2016 (r309580) +++ head/share/man/man4/Makefile Tue Dec 6 00:01:53 2016 (r309581) @@ -607,11 +607,21 @@ MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=cxgb.4 if_cxgb.4 MLINKS+=cxgbe.4 if_cxgbe.4 \ + cxgbe.4 vcxgbe.4 \ + cxgbe.4 if_vcxgbe.4 \ cxgbe.4 cxl.4 \ - cxgbe.4 if_cxl.4 + cxgbe.4 if_cxl.4 \ + cxgbe.4 vcxl.4 \ + cxgbe.4 if_vcxl.4 \ + cxgbe.4 cc.4 \ + cxgbe.4 if_cc.4 \ + cxgbe.4 vcc.4 \ + cxgbe.4 if_vcc.4 MLINKS+=cxgbev.4 if_cxgbev.4 \ cxgbev.4 cxlv.4 \ - cxgbev.4 if_cxlv.4 + cxgbev.4 if_cxlv.4 \ + cxgbev.4 ccv.4 \ + cxgbev.4 if_ccv.4 MLINKS+=dc.4 if_dc.4 MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Mon Dec 5 23:55:53 2016 (r309580) +++ head/share/man/man4/cxgbe.4 Tue Dec 6 00:01:53 2016 (r309581) @@ -36,7 +36,7 @@ .Os .Sh NAME .Nm cxgbe -.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet adapter driver" +.Nd "Chelsio T4-, T5-, and T6-based 100Gb, 40Gb, 25Gb, 10Gb, and 1Gb Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -51,13 +51,14 @@ module at boot time, place the following .Bd -literal -offset indent t4fw_cfg_load="YES" t5fw_cfg_load="YES" +t6fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCI Express Ethernet adapters based on -the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). +the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs (T4, T5, and T6). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -66,17 +67,46 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp -Note that ports of T5 cards are named cxl and attach to a t5nex parent device -(in contrast to ports named cxgbe that attach to a t4nex parent for a T4 card). -Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards. -The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and -dev.cxgbe for T4 cards. +The +.Nm +driver uses different names for devices based on the associated ASIC: +.Bl -column -offset indent "ASIC" "Port Name" "Parent Device" +.It Sy ASIC Ta Sy Port Name Ta Sy Parent Device Ta Sy Virtual Interface +.It T4 Ta cxgbe Ta t4nex Ta vcxgbe +.It T5 Ta cxl Ta t5nex Ta vcxl +.It T6 Ta cc Ta t6nex Ta vcc +.El +.Pp +Loader tunables with the hw.cxgbe prefix apply to all cards. +The driver provides sysctl MIBs for both ports and parent devices using +the names above. +For example, a T5 adapter will provide port MIBs under dev.cxl and +adapter-wide MIBs under dev.t5nex. +References to sysctl MIBs in the remainder of this page will use +dev. for port MIBs and dev. for adapter-wide MIBs. .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports 100Gb and 25Gb Ethernet adapters based on the T6 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T6225-CR +.It +Chelsio T6225-SO-CR +.It +Chelsio T62100-LP-CR +.It +Chelsio T62100-SO-CR +.It +Chelsio T62100-CR +.El +.Pp +The +.Nm driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC: .Pp .Bl -bullet -compact @@ -139,11 +169,11 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width indent .It Va hw.cxgbe.ntxq10g -The number of tx queues to use for a 10Gb or 40Gb port. +The number of tx queues to use for a 10Gb or higher-speed port. The default is 16 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq10g -The number of rx queues to use for a 10Gb or 40Gb port. +The number of rx queues to use for a 10Gb or higher-speed port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.ntxq1g @@ -155,11 +185,11 @@ The number of rx queues to use for a 1Gb The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq10g -The number of TOE tx queues to use for a 10Gb or 40Gb port. +The number of TOE tx queues to use for a 10Gb or higher-speed port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldrxq10g -The number of TOE rx queues to use for a 10Gb or 40Gb port. +The number of TOE rx queues to use for a 10Gb or higher-speed port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq1g @@ -174,8 +204,8 @@ The number of virtual interfaces (VIs) c Each virtual interface creates a separate network interface. The first virtual interface on each port is required and represents the primary network interface on the port. -Additional virtual interfaces on a port are named vcxgbe (T4) or -vcxl (T5) and only use a single rx and tx queue. +Additional virtual interfaces on a port are named using the Virtual Interface +name from the table above. Additional virtual interfaces use a single pair of queues for rx and tx as well an additional pair of queues for TOE rx and tx. The default is 1. @@ -187,7 +217,7 @@ by default (all values are in microsecon value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the -dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. +dev..X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -196,7 +226,7 @@ and the index selects a value from this The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the -dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. +dev..X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq @@ -208,7 +238,7 @@ See .Xr ifnet 9 . The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbe.X.qsize_txq sysctl or dev.cxl.X.qsize_txq sysctl. +dev..X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq @@ -216,7 +246,7 @@ The size, in number of entries, of the d rx queue. The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbe.X.qsize_rxq or dev.cxl.X.qsize_rxq sysctl. +dev..X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types @@ -261,7 +291,7 @@ reaches a high threshold, 0 prohibits th The default is 3 (both rx_pause and tx_pause = 1). This tunable establishes the default PAUSE settings for all ports. Settings can be displayed and controlled on a per-port basis via the -dev.cxgbe.X.pause_settings (dev.cxl.X.pause_settings for T5 cards) sysctl. +dev..X.pause_settings sysctl. .It Va hw.cxgbe.buffer_packing Allow the hardware to deliver multiple frames in the same receive buffer opportunistically. @@ -290,8 +320,8 @@ A configuration file contains a recipe f hardware resources on the card. This tunable is for specialized applications only and should not be used in normal operation. -The configuration profile currently in use is available in the dev.t4nex.X.cf -and dev.t4nex.X.cfcsum (dev.t5nex for T5 cards) sysctls. +The configuration profile currently in use is available in the dev..X.cf +and dev..X.cfcsum sysctls. .It Va hw.cxgbe.linkcaps_allowed .It Va hw.cxgbe.niccaps_allowed .It Va hw.cxgbe.toecaps_allowed @@ -305,7 +335,7 @@ capability. This tunable is for specialized applications only and should not be used in normal operation. The capabilities for which hardware resources have been reserved are listed in -dev.t4nex.X.*caps or dev.t5nex.X.*caps sysctls. +dev..X.*caps sysctls. .El .Sh SUPPORT For general information and support, @@ -332,6 +362,10 @@ Support for T5 cards first appeared in .Fx 9.2 and .Fx 10.0 . +Support for T6 cards first appeared in +.Fx 11.1 +and +.Fx 12.0 . .Sh AUTHORS .An -nosplit The Modified: head/share/man/man4/cxgbev.4 ============================================================================== --- head/share/man/man4/cxgbev.4 Mon Dec 5 23:55:53 2016 (r309580) +++ head/share/man/man4/cxgbev.4 Tue Dec 6 00:01:53 2016 (r309581) @@ -36,7 +36,7 @@ .Os .Sh NAME .Nm cxgbev -.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet VF driver" +.Nd "Chelsio T4-, T5-, and T6-based 100Gb, 40Gb, 25Gb, 10Gb, and 1Gb Ethernet VF driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,7 +56,8 @@ if_cxgbev_load="YES" The .Nm driver provides support for Virtual Functions on PCI Express Ethernet adapters -based on the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). +based on the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs +(T4, T5, and T6). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -65,18 +66,49 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp -Note that ports of T5 VFs are named cxlv and attach to a t5vf parent device -(in contrast to ports named cxgbev that attach to a t4vf parent for a T4 VF). -Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 VFs. -The Physical Function driver for T4 and T5 adapters shares these tunables. -The sysctl MIBs are at dev.t5vf and dev.cxlv for T5 cards and at dev.t4vf and -dev.cxgbev for T4 cards. +The +.Nm +driver uses different names for devices based on the associated ASIC: +.Bl -column -offset indent "ASIC" "Port Name" +.It Sy ASIC Ta Sy Port Name Ta Sy Parent Device +.It T4 Ta cxgbev Ta t4vf +.It T5 Ta cxlv Ta t5vf +.It T6 Ta ccv Ta t6vf +.El +.Pp +Loader tunables with the hw.cxgbe prefix apply to VFs from all cards. +The Physical Function driver for Chelsio Terminator adapters shares these +tunables. +The driver provides sysctl MIBs for both ports and parent devices using +the names above. +For example, a T5 VF will provide port MIBs under dev.cxlv and +parent device MIBs under dev.t5vf. +References to sysctl MIBs in the remainder of this page will use +dev. for port MIBs and dev. for parent device MIBs. .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports Virtual Functions on 100Gb and 25Gb Ethernet adapters +based on the T6 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T6225-CR +.It +Chelsio T6225-SO-CR +.It +Chelsio T62100-LP-CR +.It +Chelsio T62100-SO-CR +.It +Chelsio T62100-CR +.El +.Pp +The +.Nm driver supports Virtual Functions on 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC: .Pp @@ -141,11 +173,11 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width indent .It Va hw.cxgbe.ntxq10g -The number of tx queues to use for a 10Gb or 40Gb port. +The number of tx queues to use for a 10Gb or higher-speed port. The default is 16 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq10g -The number of rx queues to use for a 10Gb or 40Gb port. +The number of rx queues to use for a 10Gb or higher-speed port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.ntxq1g @@ -164,7 +196,7 @@ by default (all values are in microsecon value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the -dev.cxgbev.X.holdoff_tmr_idx or dev.cxlv.X.holdoff_tmr_idx sysctl. +dev..X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -173,7 +205,7 @@ and the index selects a value from this The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the -dev.cxgbev.X.holdoff_pktc_idx or dev.cxlv.X.holdoff_pktc_idx sysctl. +dev..X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq @@ -185,7 +217,7 @@ See .Xr ifnet 9 . The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbev.X.qsize_txq sysctl or dev.cxlv.X.qsize_txq sysctl. +dev..X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq @@ -193,7 +225,7 @@ The size, in number of entries, of the d rx queue. The default value is 1024. Different interfaces can be assigned different values via the -dev.cxgbev.X.qsize_rxq or dev.cxlv.X.qsize_rxq sysctl. +dev..X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types @@ -279,6 +311,8 @@ email all the specific information relat The .Nm device driver first appeared in +.Fx 11.1 +and .Fx 12.0 . .Sh AUTHORS .An -nosplit From owner-svn-src-head@freebsd.org Tue Dec 6 00:05:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CF20C69AB4; Tue, 6 Dec 2016 00:05:40 +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 11E883A4; Tue, 6 Dec 2016 00:05:39 +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 uB605ddc062646; Tue, 6 Dec 2016 00:05:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB605dL9062644; Tue, 6 Dec 2016 00:05:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612060005.uB605dL9062644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Dec 2016 00:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309582 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 00:05:40 -0000 Author: jhb Date: Tue Dec 6 00:05:38 2016 New Revision: 309582 URL: https://svnweb.freebsd.org/changeset/base/309582 Log: Bump Dd for addition of T6. Pointy hat to: jhb Modified: head/share/man/man4/cxgbe.4 head/share/man/man4/cxgbev.4 Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Tue Dec 6 00:01:53 2016 (r309581) +++ head/share/man/man4/cxgbe.4 Tue Dec 6 00:05:38 2016 (r309582) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2014, Chelsio Inc +.\" Copyright (c) 2011-2016, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2015 +.Dd December 5, 2016 .Dt CXGBE 4 .Os .Sh NAME Modified: head/share/man/man4/cxgbev.4 ============================================================================== --- head/share/man/man4/cxgbev.4 Tue Dec 6 00:01:53 2016 (r309581) +++ head/share/man/man4/cxgbev.4 Tue Dec 6 00:05:38 2016 (r309582) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2016 +.Dd December 5, 2016 .Dt CXGBEV 4 .Os .Sh NAME From owner-svn-src-head@freebsd.org Tue Dec 6 00:13:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 419FCC69D2B; Tue, 6 Dec 2016 00:13:50 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 10AF7E90; Tue, 6 Dec 2016 00:13:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB60Dnoa066804; Tue, 6 Dec 2016 00:13:49 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB60Dncp066802; Tue, 6 Dec 2016 00:13:49 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612060013.uB60Dncp066802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 6 Dec 2016 00:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309586 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 00:13:50 -0000 Author: avos Date: Tue Dec 6 00:13:49 2016 New Revision: 309586 URL: https://svnweb.freebsd.org/changeset/base/309586 Log: rsu: add hardware crypto support (WEP, TKIP and CCMP). This change includes firmware commands for key setup + some additional checking via CAMREAD / CAMWRITE registers. Nothing (except rsu_delete_key() for pairwise keys) is deferred; to ensure that things are done in order rsu_set_key() will wait until key deletion task will be finished. Tested with Asus USB-N10 (all ciphers). Differences from initial (reviewed) patch: - Pause AC queues before disassociation - since CMD_DISCONNECT clears crypto state all pending frames must be processed / dropped before it. - Check sc_running flag before trying to set static keys. - Clear key index from bitmap even when firmware command fails (it will be invalidated via CAMWRITE anyway). Reviewed by: adrian, kevlo Tested by: kevlo Differential Revision: https://reviews.freebsd.org/D8706 Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Tue Dec 6 00:12:09 2016 (r309585) +++ head/sys/dev/usb/wlan/if_rsu.c Tue Dec 6 00:13:49 2016 (r309586) @@ -22,8 +22,8 @@ __FBSDID("$FreeBSD$"); * Driver for Realtek RTL8188SU/RTL8191SU/RTL8192SU. * * TODO: - * o h/w crypto - * o hostap / ibss / mesh + * o tx a-mpdu + * o monitor / hostap / ibss / mesh * o power-save operation */ @@ -102,6 +102,7 @@ TUNABLE_INT("hw.usb.rsu.enable_11n", &rs #define RSU_DEBUG_FW 0x00000100 #define RSU_DEBUG_FWDBG 0x00000200 #define RSU_DEBUG_AMPDU 0x00000400 +#define RSU_DEBUG_KEY 0x00000800 static const STRUCT_USB_HOST_ID rsu_devs[] = { #define RSU_HT_NOT_SUPPORTED 0 @@ -202,10 +203,25 @@ static int rsu_fw_cmd(struct rsu_softc * static void rsu_calib_task(void *, int); static void rsu_tx_task(void *, int); static int rsu_newstate(struct ieee80211vap *, enum ieee80211_state, int); -#ifdef notyet -static void rsu_set_key(struct rsu_softc *, const struct ieee80211_key *); -static void rsu_delete_key(struct rsu_softc *, const struct ieee80211_key *); -#endif +static int rsu_key_alloc(struct ieee80211vap *, struct ieee80211_key *, + ieee80211_keyix *, ieee80211_keyix *); +static int rsu_process_key(struct ieee80211vap *, + const struct ieee80211_key *, int); +static int rsu_key_set(struct ieee80211vap *, + const struct ieee80211_key *); +static int rsu_key_delete(struct ieee80211vap *, + const struct ieee80211_key *); +static int rsu_cam_read(struct rsu_softc *, uint8_t, uint32_t *); +static void rsu_cam_write(struct rsu_softc *, uint8_t, uint32_t); +static int rsu_key_check(struct rsu_softc *, ieee80211_keyix, int); +static uint8_t rsu_crypto_mode(struct rsu_softc *, u_int, int); +static int rsu_set_key_group(struct rsu_softc *, + const struct ieee80211_key *); +static int rsu_set_key_pair(struct rsu_softc *, + const struct ieee80211_key *); +static int rsu_reinit_static_keys(struct rsu_softc *); +static int rsu_delete_key(struct rsu_softc *sc, ieee80211_keyix); +static void rsu_delete_key_pair_cb(void *, int); static int rsu_site_survey(struct rsu_softc *, struct ieee80211_scan_ssid *); static int rsu_join_bss(struct rsu_softc *, struct ieee80211_node *); @@ -437,8 +453,10 @@ rsu_attach(device_t self) mtx_init(&sc->sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, MTX_DEF); + RSU_DELKEY_BMAP_LOCK_INIT(sc); TIMEOUT_TASK_INIT(taskqueue_thread, &sc->calib_task, 0, rsu_calib_task, sc); + TASK_INIT(&sc->del_key_task, 0, rsu_delete_key_pair_cb, sc); TASK_INIT(&sc->tx_task, 0, rsu_tx_task, sc); mbufq_init(&sc->sc_snd, ifqmaxlen); @@ -524,6 +542,11 @@ rsu_attach(device_t self) IEEE80211_C_SHSLOT | /* Short slot time supported. */ IEEE80211_C_WPA; /* WPA/RSN. */ + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP | + IEEE80211_CRYPTO_TKIP | + IEEE80211_CRYPTO_AES_CCM; + /* Check if HT support is present. */ if (sc->sc_ht) { device_printf(sc->sc_dev, "%s: enabling 11n\n", __func__); @@ -608,8 +631,10 @@ rsu_detach(device_t self) ieee80211_ifdetach(ic); taskqueue_drain_timeout(taskqueue_thread, &sc->calib_task); + taskqueue_drain(taskqueue_thread, &sc->del_key_task); taskqueue_drain(taskqueue_thread, &sc->tx_task); + RSU_DELKEY_BMAP_LOCK_DESTROY(sc); mtx_destroy(&sc->sc_mtx); return (0); @@ -662,6 +687,9 @@ rsu_vap_create(struct ieee80211com *ic, /* override state transition machine */ uvp->newstate = vap->iv_newstate; vap->iv_newstate = rsu_newstate; + vap->iv_key_alloc = rsu_key_alloc; + vap->iv_key_set = rsu_key_set; + vap->iv_key_delete = rsu_key_delete; /* Limits from the r92su driver */ vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_16; @@ -1335,12 +1363,20 @@ rsu_newstate(struct ieee80211vap *vap, e RSU_LOCK(sc); /* Stop calibration. */ sc->sc_calibrating = 0; + + /* Pause Tx for AC queues. */ + rsu_write_1(sc, R92S_TXPAUSE, R92S_TXPAUSE_AC); + usb_pause_mtx(&sc->sc_mtx, USB_MS_TO_TICKS(10)); + RSU_UNLOCK(sc); taskqueue_drain_timeout(taskqueue_thread, &sc->calib_task); taskqueue_drain(taskqueue_thread, &sc->tx_task); - /* Disassociate from our current BSS. */ RSU_LOCK(sc); + /* Disassociate from our current BSS. */ rsu_disconnect(sc); + /* Reinstall static keys. */ + if (sc->sc_running) + rsu_reinit_static_keys(sc); } else RSU_LOCK(sc); switch (nstate) { @@ -1358,6 +1394,9 @@ rsu_newstate(struct ieee80211vap *vap, e } break; case IEEE80211_S_RUN: + /* Flush all AC queues. */ + rsu_write_1(sc, R92S_TXPAUSE, 0); + ni = ieee80211_ref_node(vap->iv_bss); rs = &ni->ni_rates; /* Indicate highest supported rate. */ @@ -1380,46 +1419,365 @@ rsu_newstate(struct ieee80211vap *vap, e return (uvp->newstate(vap, nstate, arg)); } -#ifdef notyet +static int +rsu_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k, + ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) +{ + struct rsu_softc *sc = vap->iv_ic->ic_softc; + int is_checked = 0; + + if (&vap->iv_nw_keys[0] <= k && + k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) { + *keyix = k - vap->iv_nw_keys; + } else { + if (vap->iv_opmode != IEEE80211_M_STA) { + *keyix = 0; + /* TODO: obtain keyix from node id */ + is_checked = 1; + k->wk_flags |= IEEE80211_KEY_SWCRYPT; + } else + *keyix = R92S_MACID_BSS; + } + + if (!is_checked) { + RSU_LOCK(sc); + if (isset(sc->keys_bmap, *keyix)) { + device_printf(sc->sc_dev, + "%s: key slot %d is already used!\n", + __func__, *keyix); + RSU_UNLOCK(sc); + return (0); + } + setbit(sc->keys_bmap, *keyix); + RSU_UNLOCK(sc); + } + + *rxkeyix = *keyix; + + return (1); +} + +static int +rsu_process_key(struct ieee80211vap *vap, const struct ieee80211_key *k, + int set) +{ + struct rsu_softc *sc = vap->iv_ic->ic_softc; + int ret; + + if (k->wk_flags & IEEE80211_KEY_SWCRYPT) { + /* Not for us. */ + return (1); + } + + /* Handle group keys. */ + if (&vap->iv_nw_keys[0] <= k && + k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) { + KASSERT(k->wk_keyix < nitems(sc->group_keys), + ("keyix %d > %d\n", k->wk_keyix, nitems(sc->group_keys))); + + RSU_LOCK(sc); + sc->group_keys[k->wk_keyix] = (set ? k : NULL); + if (!sc->sc_running) { + /* Static keys will be set during device startup. */ + RSU_UNLOCK(sc); + return (1); + } + + if (set) + ret = rsu_set_key_group(sc, k); + else + ret = rsu_delete_key(sc, k->wk_keyix); + RSU_UNLOCK(sc); + + return (!ret); + } + + if (set) { + /* wait for pending key removal */ + taskqueue_drain(taskqueue_thread, &sc->del_key_task); + + RSU_LOCK(sc); + ret = rsu_set_key_pair(sc, k); + RSU_UNLOCK(sc); + } else { + RSU_DELKEY_BMAP_LOCK(sc); + setbit(sc->free_keys_bmap, k->wk_keyix); + RSU_DELKEY_BMAP_UNLOCK(sc); + + /* workaround ieee80211_node_delucastkey() locking */ + taskqueue_enqueue(taskqueue_thread, &sc->del_key_task); + ret = 0; /* fake success */ + } + + return (!ret); +} + +static int +rsu_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + return (rsu_process_key(vap, k, 1)); +} + +static int +rsu_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + return (rsu_process_key(vap, k, 0)); +} + +static int +rsu_cam_read(struct rsu_softc *sc, uint8_t addr, uint32_t *val) +{ + int ntries; + + rsu_write_4(sc, R92S_CAMCMD, + R92S_CAMCMD_POLLING | SM(R92S_CAMCMD_ADDR, addr)); + for (ntries = 0; ntries < 10; ntries++) { + if (!(rsu_read_4(sc, R92S_CAMCMD) & R92S_CAMCMD_POLLING)) + break; + + usb_pause_mtx(&sc->sc_mtx, USB_MS_TO_TICKS(1)); + } + if (ntries == 10) { + device_printf(sc->sc_dev, + "%s: cannot read CAM entry at address %02X\n", + __func__, addr); + return (ETIMEDOUT); + } + + *val = rsu_read_4(sc, R92S_CAMREAD); + + return (0); +} + static void -rsu_set_key(struct rsu_softc *sc, const struct ieee80211_key *k) +rsu_cam_write(struct rsu_softc *sc, uint8_t addr, uint32_t data) { - struct r92s_fw_cmd_set_key key; - memset(&key, 0, sizeof(key)); - /* Map net80211 cipher to HW crypto algorithm. */ - switch (k->wk_cipher->ic_cipher) { + rsu_write_4(sc, R92S_CAMWRITE, data); + rsu_write_4(sc, R92S_CAMCMD, + R92S_CAMCMD_POLLING | R92S_CAMCMD_WRITE | + SM(R92S_CAMCMD_ADDR, addr)); +} + +static int +rsu_key_check(struct rsu_softc *sc, ieee80211_keyix keyix, int is_valid) +{ + uint32_t val; + int error, ntries; + + for (ntries = 0; ntries < 20; ntries++) { + usb_pause_mtx(&sc->sc_mtx, USB_MS_TO_TICKS(1)); + + error = rsu_cam_read(sc, R92S_CAM_CTL0(keyix), &val); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: cannot check key status!\n", __func__); + return (error); + } + if (((val & R92S_CAM_VALID) == 0) ^ is_valid) + break; + } + if (ntries == 20) { + device_printf(sc->sc_dev, + "%s: key %d is %s marked as valid, rejecting request\n", + __func__, keyix, is_valid ? "not" : "still"); + return (EIO); + } + + return (0); +} + +/* + * Map net80211 cipher to RTL8712 security mode. + */ +static uint8_t +rsu_crypto_mode(struct rsu_softc *sc, u_int cipher, int keylen) +{ + switch (cipher) { case IEEE80211_CIPHER_WEP: - if (k->wk_keylen < 8) - key.algo = R92S_KEY_ALGO_WEP40; - else - key.algo = R92S_KEY_ALGO_WEP104; - break; + return keylen < 8 ? R92S_KEY_ALGO_WEP40 : R92S_KEY_ALGO_WEP104; case IEEE80211_CIPHER_TKIP: - key.algo = R92S_KEY_ALGO_TKIP; - break; + return R92S_KEY_ALGO_TKIP; case IEEE80211_CIPHER_AES_CCM: - key.algo = R92S_KEY_ALGO_AES; - break; + return R92S_KEY_ALGO_AES; default: - return; + device_printf(sc->sc_dev, "unknown cipher %d\n", cipher); + return R92S_KEY_ALGO_INVALID; } - key.id = k->wk_keyix; +} + +static int +rsu_set_key_group(struct rsu_softc *sc, const struct ieee80211_key *k) +{ + struct r92s_fw_cmd_set_key key; + uint8_t algo; + int error; + + RSU_ASSERT_LOCKED(sc); + + /* Map net80211 cipher to HW crypto algorithm. */ + algo = rsu_crypto_mode(sc, k->wk_cipher->ic_cipher, k->wk_keylen); + if (algo == R92S_KEY_ALGO_INVALID) + return (EINVAL); + + memset(&key, 0, sizeof(key)); + key.algo = algo; + key.cam_id = k->wk_keyix; key.grpkey = (k->wk_flags & IEEE80211_KEY_GROUP) != 0; memcpy(key.key, k->wk_key, MIN(k->wk_keylen, sizeof(key.key))); - (void)rsu_fw_cmd(sc, R92S_CMD_SET_KEY, &key, sizeof(key)); + + RSU_DPRINTF(sc, RSU_DEBUG_KEY | RSU_DEBUG_FWCMD, + "%s: keyix %u, group %u, algo %u/%u, flags %04X, len %u, " + "macaddr %s\n", __func__, key.cam_id, key.grpkey, + k->wk_cipher->ic_cipher, key.algo, k->wk_flags, k->wk_keylen, + ether_sprintf(k->wk_macaddr)); + + error = rsu_fw_cmd(sc, R92S_CMD_SET_KEY, &key, sizeof(key)); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: cannot send firmware command, error %d\n", + __func__, error); + return (error); + } + + return (rsu_key_check(sc, k->wk_keyix, 1)); } -static void -rsu_delete_key(struct rsu_softc *sc, const struct ieee80211_key *k) +static int +rsu_set_key_pair(struct rsu_softc *sc, const struct ieee80211_key *k) +{ + struct r92s_fw_cmd_set_key_mac key; + uint8_t algo; + int error; + + RSU_ASSERT_LOCKED(sc); + + if (!sc->sc_running) + return (ESHUTDOWN); + + /* Map net80211 cipher to HW crypto algorithm. */ + algo = rsu_crypto_mode(sc, k->wk_cipher->ic_cipher, k->wk_keylen); + if (algo == R92S_KEY_ALGO_INVALID) + return (EINVAL); + + memset(&key, 0, sizeof(key)); + key.algo = algo; + memcpy(key.macaddr, k->wk_macaddr, sizeof(key.macaddr)); + memcpy(key.key, k->wk_key, MIN(k->wk_keylen, sizeof(key.key))); + + RSU_DPRINTF(sc, RSU_DEBUG_KEY | RSU_DEBUG_FWCMD, + "%s: keyix %u, algo %u/%u, flags %04X, len %u, macaddr %s\n", + __func__, k->wk_keyix, k->wk_cipher->ic_cipher, key.algo, + k->wk_flags, k->wk_keylen, ether_sprintf(key.macaddr)); + + error = rsu_fw_cmd(sc, R92S_CMD_SET_STA_KEY, &key, sizeof(key)); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: cannot send firmware command, error %d\n", + __func__, error); + return (error); + } + + return (rsu_key_check(sc, k->wk_keyix, 1)); +} + +static int +rsu_reinit_static_keys(struct rsu_softc *sc) +{ + int i, error; + + for (i = 0; i < nitems(sc->group_keys); i++) { + if (sc->group_keys[i] != NULL) { + error = rsu_set_key_group(sc, sc->group_keys[i]); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: failed to set static key %d, " + "error %d\n", __func__, i, error); + return (error); + } + } + } + + return (0); +} + +static int +rsu_delete_key(struct rsu_softc *sc, ieee80211_keyix keyix) { struct r92s_fw_cmd_set_key key; + uint32_t val; + int error; + + RSU_ASSERT_LOCKED(sc); + + if (!sc->sc_running) + return (0); + + /* check if it was automatically removed by firmware */ + error = rsu_cam_read(sc, R92S_CAM_CTL0(keyix), &val); + if (error == 0 && (val & R92S_CAM_VALID) == 0) { + RSU_DPRINTF(sc, RSU_DEBUG_KEY, + "%s: key %u does not exist\n", __func__, keyix); + clrbit(sc->keys_bmap, keyix); + return (0); + } memset(&key, 0, sizeof(key)); - key.id = k->wk_keyix; - (void)rsu_fw_cmd(sc, R92S_CMD_SET_KEY, &key, sizeof(key)); + key.cam_id = keyix; + + RSU_DPRINTF(sc, RSU_DEBUG_KEY | RSU_DEBUG_FWCMD, + "%s: removing key %u\n", __func__, key.cam_id); + + error = rsu_fw_cmd(sc, R92S_CMD_SET_KEY, &key, sizeof(key)); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: cannot send firmware command, error %d\n", + __func__, error); + goto finish; + } + + usb_pause_mtx(&sc->sc_mtx, USB_MS_TO_TICKS(5)); + + /* + * Clear 'valid' bit manually (cannot be done via firmware command). + * Used for key check + when firmware command cannot be sent. + */ +finish: + rsu_cam_write(sc, R92S_CAM_CTL0(keyix), 0); + + clrbit(sc->keys_bmap, keyix); + + return (rsu_key_check(sc, keyix, 0)); +} + +static void +rsu_delete_key_pair_cb(void *arg, int pending __unused) +{ + struct rsu_softc *sc = arg; + int i; + + RSU_DELKEY_BMAP_LOCK(sc); + for (i = IEEE80211_WEP_NKID; i < R92S_CAM_ENTRY_LIMIT; i++) { + if (isset(sc->free_keys_bmap, i)) { + RSU_DELKEY_BMAP_UNLOCK(sc); + + RSU_LOCK(sc); + RSU_DPRINTF(sc, RSU_DEBUG_KEY, + "%s: calling rsu_delete_key() with keyix = %d\n", + __func__, i); + (void) rsu_delete_key(sc, i); + RSU_UNLOCK(sc); + + RSU_DELKEY_BMAP_LOCK(sc); + clrbit(sc->free_keys_bmap, i); + + /* bmap can be changed */ + i = IEEE80211_WEP_NKID - 1; + continue; + } + } + RSU_DELKEY_BMAP_UNLOCK(sc); } -#endif static int rsu_site_survey(struct rsu_softc *sc, struct ieee80211_scan_ssid *ssid) @@ -1834,9 +2192,10 @@ rsu_rx_copy_to_mbuf(struct rsu_softc *sc int pktlen; rxdw0 = le32toh(stat->rxdw0); - if (__predict_false(rxdw0 & R92S_RXDW0_CRCERR)) { + if (__predict_false(rxdw0 & (R92S_RXDW0_CRCERR | R92S_RXDW0_ICVERR))) { RSU_DPRINTF(sc, RSU_DEBUG_RX, - "%s: RX flags error (CRC)\n", __func__); + "%s: RX flags error (%s)\n", __func__, + rxdw0 & R92S_RXDW0_CRCERR ? "CRC" : "ICV"); goto fail; } @@ -1871,7 +2230,7 @@ rsu_rx_frame(struct rsu_softc *sc, struc struct ieee80211_frame_min *wh; struct r92s_rx_stat *stat; uint32_t rxdw0, rxdw3; - uint8_t rate; + uint8_t cipher, rate; int infosz; stat = mtod(m, struct r92s_rx_stat *); @@ -1879,6 +2238,7 @@ rsu_rx_frame(struct rsu_softc *sc, struc rxdw3 = le32toh(stat->rxdw3); rate = MS(rxdw3, R92S_RXDW3_RATE); + cipher = MS(rxdw0, R92S_RXDW0_CIPHER); infosz = MS(rxdw0, R92S_RXDW0_INFOSZ) * 8; /* Get RSSI from PHY status descriptor if present. */ @@ -1930,6 +2290,10 @@ rsu_rx_frame(struct rsu_softc *sc, struc /* Drop descriptor. */ m_adj(m, sizeof(*stat) + infosz); wh = mtod(m, struct ieee80211_frame_min *); + if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && + cipher != R92S_KEY_ALGO_NONE) { + m->m_flags |= M_WEP; + } RSU_DPRINTF(sc, RSU_DEBUG_RX, "%s: Rx frame len %d, rate %d, infosz %d\n", @@ -2225,7 +2589,7 @@ rsu_tx_start(struct rsu_softc *sc, struc struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; struct r92s_tx_desc *txd; - uint8_t type; + uint8_t type, cipher; int prio = 0; uint8_t which; int hasqos; @@ -2298,8 +2662,7 @@ rsu_tx_start(struct rsu_softc *sc, struc SM(R92S_TXDW1_MACID, R92S_MACID_BSS) | SM(R92S_TXDW1_QSEL, qid)); if (!hasqos) txd->txdw1 |= htole32(R92S_TXDW1_NONQOS); -#ifdef notyet - if (k != NULL) { + if (k != NULL && !(k->wk_flags & IEEE80211_KEY_SWENCRYPT)) { switch (k->wk_cipher->ic_cipher) { case IEEE80211_CIPHER_WEP: cipher = R92S_TXDW1_CIPHER_WEP; @@ -2315,9 +2678,8 @@ rsu_tx_start(struct rsu_softc *sc, struc } txd->txdw1 |= htole32( SM(R92S_TXDW1_CIPHER, cipher) | - SM(R92S_TXDW1_KEYIDX, k->k_id)); + SM(R92S_TXDW1_KEYIDX, k->wk_keyix)); } -#endif /* XXX todo: set AGGEN bit if appropriate? */ txd->txdw2 |= htole32(R92S_TXDW2_BK); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) @@ -3021,12 +3383,16 @@ rsu_init(struct rsu_softc *sc) /* Set PS mode fully active */ error = rsu_set_fw_power_state(sc, RSU_PWR_ACTIVE); - if (error != 0) { device_printf(sc->sc_dev, "could not set PS mode\n"); goto fail; } + /* Install static keys (if any). */ + error = rsu_reinit_static_keys(sc); + if (error != 0) + goto fail; + sc->sc_extra_scan = 0; usbd_transfer_start(sc->sc_xfer[RSU_BULK_RX]); @@ -3054,6 +3420,13 @@ rsu_stop(struct rsu_softc *sc) /* Power off adapter. */ rsu_power_off(sc); + /* + * CAM is not accessible after shutdown; + * all entries are marked (by firmware?) as invalid. + */ + memset(sc->free_keys_bmap, 0, sizeof(sc->free_keys_bmap)); + memset(sc->keys_bmap, 0, sizeof(sc->keys_bmap)); + for (i = 0; i < RSU_N_TRANSFER; i++) usbd_transfer_stop(sc->sc_xfer[i]); Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Tue Dec 6 00:12:09 2016 (r309585) +++ head/sys/dev/usb/wlan/if_rsureg.h Tue Dec 6 00:13:49 2016 (r309586) @@ -43,6 +43,7 @@ #define R92S_CMDCTRL 0x0040 #define R92S_CR (R92S_CMDCTRL + 0x000) +#define R92S_TXPAUSE (R92S_CMDCTRL + 0x002) #define R92S_TCR (R92S_CMDCTRL + 0x004) #define R92S_RCR (R92S_CMDCTRL + 0x008) @@ -55,6 +56,11 @@ #define R92S_GPIO_IO_SEL (R92S_GP + 0x00e) #define R92S_MAC_PINMUX_CTRL (R92S_GP + 0x011) +#define R92S_SECURITY 0x0240 +#define R92S_CAMCMD (R92S_SECURITY + 0x000) +#define R92S_CAMWRITE (R92S_SECURITY + 0x004) +#define R92S_CAMREAD (R92S_SECURITY + 0x008) + #define R92S_IOCMD_CTRL 0x0370 #define R92S_IOCMD_DATA 0x0374 @@ -105,6 +111,24 @@ /* Bits for R92S_CR. */ #define R92S_CR_TXDMA_EN 0x10 +/* Bits for R92S_TXPAUSE. */ +#define R92S_TXPAUSE_VO 0x01 +#define R92S_TXPAUSE_VI 0x02 +#define R92S_TXPAUSE_BE 0x04 +#define R92S_TXPAUSE_BK 0x08 +#define R92S_TXPAUSE_MGT 0x10 +#define R92S_TXPAUSE_HIGH 0x20 +#define R92S_TXPAUSE_HCCA 0x40 + +/* Shortcuts. */ +#define R92S_TXPAUSE_AC \ + (R92S_TXPAUSE_VO | R92S_TXPAUSE_VI | \ + R92S_TXPAUSE_BE | R92S_TXPAUSE_BK) + +#define R92S_TXPAUSE_ALL \ + (R92S_TXPAUSE_AC | R92S_TXPAUSE_MGT | \ + R92S_TXPAUSE_HIGH | R92S_TXPAUSE_HCCA | 0x80) + /* Bits for R92S_TCR. */ #define R92S_TCR_IMEM_CODE_DONE 0x01 #define R92S_TCR_IMEM_CHK_RPT 0x02 @@ -126,6 +150,32 @@ #define R92S_GPIOSEL_GPIO_WLANDBG 3 #define R92S_GPIOMUX_EN 0x08 +/* Bits for R92S_CAMCMD. */ +#define R92S_CAMCMD_ADDR_M 0x000000ff +#define R92S_CAMCMD_ADDR_S 0 +#define R92S_CAMCMD_READ 0x00000000 +#define R92S_CAMCMD_WRITE 0x00010000 +#define R92S_CAMCMD_POLLING 0x80000000 + +/* + * CAM entries. + */ +#define R92S_CAM_ENTRY_LIMIT 32 +#define R92S_CAM_ENTRY_BYTES howmany(R92S_CAM_ENTRY_LIMIT, NBBY) + +#define R92S_CAM_CTL0(entry) ((entry) * 8 + 0) +#define R92S_CAM_CTL1(entry) ((entry) * 8 + 1) +#define R92S_CAM_KEY(entry, i) ((entry) * 8 + 2 + (i)) + +/* Bits for R92S_CAM_CTL0(i). */ +#define R92S_CAM_KEYID_M 0x00000003 +#define R92S_CAM_KEYID_S 0 +#define R92S_CAM_ALGO_M 0x0000001c +#define R92S_CAM_ALGO_S 2 +#define R92S_CAM_VALID 0x00008000 +#define R92S_CAM_MACLO_M 0xffff0000 +#define R92S_CAM_MACLO_S 16 + /* Bits for R92S_IOCMD_CTRL. */ #define R92S_IOCMD_CLASS_M 0xff000000 #define R92S_IOCMD_CLASS_S 24 @@ -391,10 +441,18 @@ struct r92s_fw_cmd_set_key { #define R92S_KEY_ALGO_TKIP_MMIC 3 #define R92S_KEY_ALGO_AES 4 #define R92S_KEY_ALGO_WEP104 5 +#define R92S_KEY_ALGO_INVALID 0xff /* for rsu_crypto_mode() only */ - uint8_t id; + uint8_t cam_id; uint8_t grpkey; - uint8_t key[16]; + uint8_t key[IEEE80211_KEYBUF_SIZE]; +} __packed; + +/* Structure for R92S_CMD_SET_STA_KEY. */ +struct r92s_fw_cmd_set_key_mac { + uint8_t macaddr[IEEE80211_ADDR_LEN]; + uint8_t algo; + uint8_t key[IEEE80211_KEYBUF_SIZE]; } __packed; /* Structures for R92S_EVENT_SURVEY/R92S_CMD_JOIN_BSS. */ @@ -497,7 +555,7 @@ struct r92s_event_join_bss { struct ndis_wlan_bssid_ex bss; } __packed; -#define R92S_MACID_BSS 5 +#define R92S_MACID_BSS 5 /* XXX hardcoded somewhere */ /* Rx MAC descriptor. */ struct r92s_rx_stat { @@ -505,8 +563,11 @@ struct r92s_rx_stat { #define R92S_RXDW0_PKTLEN_M 0x00003fff #define R92S_RXDW0_PKTLEN_S 0 #define R92S_RXDW0_CRCERR 0x00004000 +#define R92S_RXDW0_ICVERR 0x00008000 #define R92S_RXDW0_INFOSZ_M 0x000f0000 #define R92S_RXDW0_INFOSZ_S 16 +#define R92S_RXDW0_CIPHER_M 0x00700000 +#define R92S_RXDW0_CIPHER_S 20 #define R92S_RXDW0_QOS 0x00800000 #define R92S_RXDW0_SHIFT_M 0x03000000 #define R92S_RXDW0_SHIFT_S 24 @@ -581,6 +642,7 @@ struct r92s_tx_desc { #define R92S_TXDW1_KEYIDX_S 17 #define R92S_TXDW1_CIPHER_M 0x00c00000 #define R92S_TXDW1_CIPHER_S 22 +#define R92S_TXDW1_CIPHER_NONE 0 #define R92S_TXDW1_CIPHER_WEP 1 #define R92S_TXDW1_CIPHER_TKIP 2 #define R92S_TXDW1_CIPHER_AES 3 @@ -728,6 +790,13 @@ struct rsu_vap { #define RSU_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define RSU_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) +#define RSU_DELKEY_BMAP_LOCK_INIT(_sc) \ + mtx_init(&(_sc)->free_keys_bmap_mtx, "bmap lock", NULL, MTX_DEF) +#define RSU_DELKEY_BMAP_LOCK(_sc) mtx_lock(&(_sc)->free_keys_bmap_mtx) +#define RSU_DELKEY_BMAP_UNLOCK(_sc) mtx_unlock(&(_sc)->free_keys_bmap_mtx) +#define RSU_DELKEY_BMAP_LOCK_DESTROY(_sc) \ + mtx_destroy(&(_sc)->free_keys_bmap_mtx) + struct rsu_softc { struct ieee80211com sc_ic; struct mbufq sc_snd; @@ -762,6 +831,13 @@ struct rsu_softc { STAILQ_HEAD(, rsu_data) sc_tx_inactive; STAILQ_HEAD(, rsu_data) sc_tx_pending[RSU_N_TRANSFER]; + struct task del_key_task; + uint8_t keys_bmap[R92S_CAM_ENTRY_BYTES]; + const struct ieee80211_key *group_keys[IEEE80211_WEP_NKID]; + + struct mtx free_keys_bmap_mtx; + uint8_t free_keys_bmap[R92S_CAM_ENTRY_BYTES]; + union { struct rsu_rx_radiotap_header th; uint8_t pad[64]; From owner-svn-src-head@freebsd.org Tue Dec 6 00:36:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26C29C594D4; Tue, 6 Dec 2016 00:36:04 +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 D0E631B2E; Tue, 6 Dec 2016 00:36:03 +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 uB60a30v074934; Tue, 6 Dec 2016 00:36:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB60a3FU074933; Tue, 6 Dec 2016 00:36:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612060036.uB60a3FU074933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Dec 2016 00:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309588 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 00:36:04 -0000 Author: jhb Date: Tue Dec 6 00:36:02 2016 New Revision: 309588 URL: https://svnweb.freebsd.org/changeset/base/309588 Log: Don't attach to Host-PCI bridges with a bad bus number. If the bus number assigned to a Host-PCI bridge doesn't match the first bus number in the associated producer range from _CRS, print a warning and fail to attach rather than panicking due to an assertion failure. At least one single-socket Dell machine leaves a "ghost" Host-PCI bridge device in the ACPI namespace that seems to correspond to the I/O hub in the second socket of a two-socket machine. However, the BIOS doesn't configure the settings for this "ghost" bridge correctly, nor does it have any PCI devices behind it. Tested by: royger MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_pcib_acpi.c Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Tue Dec 6 00:35:20 2016 (r309587) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Tue Dec 6 00:36:02 2016 (r309588) @@ -488,10 +488,17 @@ acpi_pcib_acpi_attach(device_t dev) pci_domain_release_bus(sc->ap_segment, dev, rid, bus_res); } } else { -#ifdef INVARIANTS - if (first_decoded_bus(sc, &start) == 0) - KASSERT(start == sc->ap_bus, ("bus number mismatch")); -#endif + /* + * Require the bus number from _BBN to match the start of any + * decoded range. + */ + if (first_decoded_bus(sc, &start) == 0 && sc->ap_bus != start) { + device_printf(dev, + "bus number %d does not match start of decoded range %ju\n", + sc->ap_bus, (uintmax_t)start); + pcib_host_res_free(dev, &sc->ap_host_res); + return (ENXIO); + } } #else /* @@ -514,6 +521,9 @@ acpi_pcib_acpi_attach(device_t dev) if (device_add_child(dev, "pci", -1) == NULL) { device_printf(device_get_parent(dev), "couldn't attach pci bus\n"); +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + pcib_host_res_free(dev, &sc->ap_host_res); +#endif return (ENXIO); } return (bus_generic_attach(dev)); From owner-svn-src-head@freebsd.org Tue Dec 6 00:39:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 585FAC595C7; Tue, 6 Dec 2016 00:39:03 +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 276A61D1B; Tue, 6 Dec 2016 00:39:03 +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 uB60d2Es075151; Tue, 6 Dec 2016 00:39:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB60d0eE075130; Tue, 6 Dec 2016 00:39:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612060039.uB60d0eE075130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Dec 2016 00:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309589 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 00:39:03 -0000 Author: jhb Date: Tue Dec 6 00:39:00 2016 New Revision: 309589 URL: https://svnweb.freebsd.org/changeset/base/309589 Log: Rework syscall structure lookups. Avoid always using an O(n^2) loop over known syscall structures with strcmp() on each system call. Instead, use a per-ABI cache indexed by the system call number. The first 1024 system calls (which should cover all of the normal system calls in currently-supported ABIs) use a flat array indexed by the system call number to find system call structure. For other system calls, a linked list of structures storing an integer to structure mapping is stored in the ABI. The linked list isn't very smart, but it should only be used by buggy applications invoking unknown system calls. This also fixes handling of unknown system calls which currently trigger a NULL pointer dereference. Reviewed by: kib MFC after: 2 weeks Modified: head/usr.bin/truss/aarch64-cloudabi64.c head/usr.bin/truss/aarch64-freebsd.c head/usr.bin/truss/amd64-cloudabi64.c head/usr.bin/truss/amd64-freebsd.c head/usr.bin/truss/amd64-freebsd32.c head/usr.bin/truss/amd64-linux.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-freebsd.c head/usr.bin/truss/i386-freebsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/mips-freebsd.c head/usr.bin/truss/powerpc-freebsd.c head/usr.bin/truss/powerpc64-freebsd.c head/usr.bin/truss/powerpc64-freebsd32.c head/usr.bin/truss/setup.c head/usr.bin/truss/sparc64-freebsd.c head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c head/usr.bin/truss/truss.h Modified: head/usr.bin/truss/aarch64-cloudabi64.c ============================================================================== --- head/usr.bin/truss/aarch64-cloudabi64.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/aarch64-cloudabi64.c Tue Dec 6 00:39:00 2016 (r309589) @@ -80,7 +80,9 @@ static struct procabi aarch64_cloudabi64 "CloudABI ELF64", SYSDECODE_ABI_CLOUDABI64, aarch64_cloudabi64_fetch_args, - aarch64_cloudabi64_fetch_retval + aarch64_cloudabi64_fetch_retval, + STAILQ_HEAD_INITIALIZER(aarch64_cloudabi64.extra_syscalls), + { NULL } }; PROCABI(aarch64_cloudabi64); Modified: head/usr.bin/truss/aarch64-freebsd.c ============================================================================== --- head/usr.bin/truss/aarch64-freebsd.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/aarch64-freebsd.c Tue Dec 6 00:39:00 2016 (r309589) @@ -102,7 +102,9 @@ static struct procabi aarch64_freebsd = "FreeBSD ELF64", SYSDECODE_ABI_FREEBSD, aarch64_fetch_args, - aarch64_fetch_retval + aarch64_fetch_retval, + STAILQ_HEAD_INITIALIZER(aarch64_freebsd.extra_syscalls), + { NULL } }; PROCABI(aarch64_freebsd); Modified: head/usr.bin/truss/amd64-cloudabi64.c ============================================================================== --- head/usr.bin/truss/amd64-cloudabi64.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/amd64-cloudabi64.c Tue Dec 6 00:39:00 2016 (r309589) @@ -89,7 +89,9 @@ static struct procabi amd64_cloudabi64 = "CloudABI ELF64", SYSDECODE_ABI_CLOUDABI64, amd64_cloudabi64_fetch_args, - amd64_cloudabi64_fetch_retval + amd64_cloudabi64_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_cloudabi64.extra_syscalls), + { NULL } }; PROCABI(amd64_cloudabi64); Modified: head/usr.bin/truss/amd64-freebsd.c ============================================================================== --- head/usr.bin/truss/amd64-freebsd.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/amd64-freebsd.c Tue Dec 6 00:39:00 2016 (r309589) @@ -124,7 +124,9 @@ static struct procabi amd64_freebsd = { "FreeBSD ELF64", SYSDECODE_ABI_FREEBSD, amd64_fetch_args, - amd64_fetch_retval + amd64_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_freebsd.extra_syscalls), + { NULL } }; PROCABI(amd64_freebsd); Modified: head/usr.bin/truss/amd64-freebsd32.c ============================================================================== --- head/usr.bin/truss/amd64-freebsd32.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/amd64-freebsd32.c Tue Dec 6 00:39:00 2016 (r309589) @@ -120,7 +120,9 @@ static struct procabi amd64_freebsd32 = "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD32, amd64_freebsd32_fetch_args, - amd64_freebsd32_fetch_retval + amd64_freebsd32_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_freebsd32.extra_syscalls), + { NULL } }; PROCABI(amd64_freebsd32); @@ -129,7 +131,9 @@ static struct procabi amd64_freebsd32_ao "FreeBSD a.out", SYSDECODE_ABI_FREEBSD32, amd64_freebsd32_fetch_args, - amd64_freebsd32_fetch_retval + amd64_freebsd32_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_freebsd32.extra_syscalls), + { NULL } }; PROCABI(amd64_freebsd32_aout); Modified: head/usr.bin/truss/amd64-linux.c ============================================================================== --- head/usr.bin/truss/amd64-linux.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/amd64-linux.c Tue Dec 6 00:39:00 2016 (r309589) @@ -99,7 +99,9 @@ static struct procabi amd64_linux = { "Linux ELF64", SYSDECODE_ABI_LINUX, amd64_linux_fetch_args, - amd64_linux_fetch_retval + amd64_linux_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_linux.extra_syscalls), + { NULL } }; PROCABI(amd64_linux); Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/amd64-linux32.c Tue Dec 6 00:39:00 2016 (r309589) @@ -109,7 +109,9 @@ static struct procabi amd64_linux32 = { "Linux ELF32", SYSDECODE_ABI_LINUX32, amd64_linux32_fetch_args, - amd64_linux32_fetch_retval + amd64_linux32_fetch_retval, + STAILQ_HEAD_INITIALIZER(amd64_linux32.extra_syscalls), + { NULL } }; PROCABI(amd64_linux32); Modified: head/usr.bin/truss/arm-freebsd.c ============================================================================== --- head/usr.bin/truss/arm-freebsd.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/arm-freebsd.c Tue Dec 6 00:39:00 2016 (r309589) @@ -131,7 +131,9 @@ static struct procabi arm_freebsd = { "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD, arm_fetch_args, - arm_fetch_retval + arm_fetch_retval, + STAILQ_HEAD_INITIALIZER(arm_freebsd.extra_syscalls), + { NULL } }; PROCABI(arm_freebsd); Modified: head/usr.bin/truss/i386-freebsd.c ============================================================================== --- head/usr.bin/truss/i386-freebsd.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/i386-freebsd.c Tue Dec 6 00:39:00 2016 (r309589) @@ -113,7 +113,9 @@ static struct procabi i386_freebsd = { "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD, i386_fetch_args, - i386_fetch_retval + i386_fetch_retval, + STAILQ_HEAD_INITIALIZER(i386_freebsd.extra_syscalls), + { NULL } }; PROCABI(i386_freebsd); @@ -122,7 +124,9 @@ static struct procabi i386_freebsd_aout "FreeBSD a.out", SYSDECODE_ABI_FREEBSD, i386_fetch_args, - i386_fetch_retval + i386_fetch_retval, + STAILQ_HEAD_INITIALIZER(i386_freebsd_aout.extra_syscalls), + { NULL } }; PROCABI(i386_freebsd_aout); Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/i386-linux.c Tue Dec 6 00:39:00 2016 (r309589) @@ -106,7 +106,9 @@ static struct procabi i386_linux = { "Linux ELF", SYSDECODE_ABI_LINUX, i386_linux_fetch_args, - i386_linux_fetch_retval + i386_linux_fetch_retval, + STAILQ_HEAD_INITIALIZER(i386_linux.extra_syscalls), + { NULL } }; PROCABI(i386_linux); Modified: head/usr.bin/truss/mips-freebsd.c ============================================================================== --- head/usr.bin/truss/mips-freebsd.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/mips-freebsd.c Tue Dec 6 00:39:00 2016 (r309589) @@ -134,7 +134,9 @@ static struct procabi mips_freebsd = { #endif SYSDECODE_ABI_FREEBSD, mips_fetch_args, - mips_fetch_retval + mips_fetch_retval, + STAILQ_HEAD_INITIALIZER(mips_freebsd.extra_syscalls), + { NULL } }; PROCABI(mips_freebsd); Modified: head/usr.bin/truss/powerpc-freebsd.c ============================================================================== --- head/usr.bin/truss/powerpc-freebsd.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/powerpc-freebsd.c Tue Dec 6 00:39:00 2016 (r309589) @@ -115,7 +115,9 @@ static struct procabi powerpc_freebsd = "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD, powerpc_fetch_args, - powerpc_fetch_retval + powerpc_fetch_retval, + STAILQ_HEAD_INITIALIZER(powerpc_freebsd.extra_syscalls), + { NULL } }; PROCABI(powerpc_freebsd); Modified: head/usr.bin/truss/powerpc64-freebsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-freebsd.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/powerpc64-freebsd.c Tue Dec 6 00:39:00 2016 (r309589) @@ -111,7 +111,9 @@ static struct procabi powerpc64_freebsd "FreeBSD ELF64", SYSDECODE_ABI_FREEBSD, powerpc64_fetch_args, - powerpc64_fetch_retval + powerpc64_fetch_retval, + STAILQ_HEAD_INITIALIZER(powerpc64_freebsd.extra_syscalls), + { NULL } }; PROCABI(powerpc64_freebsd); Modified: head/usr.bin/truss/powerpc64-freebsd32.c ============================================================================== --- head/usr.bin/truss/powerpc64-freebsd32.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/powerpc64-freebsd32.c Tue Dec 6 00:39:00 2016 (r309589) @@ -120,7 +120,9 @@ static struct procabi powerpc64_freebsd3 "FreeBSD ELF32", SYSDECODE_ABI_FREEBSD32, powerpc64_freebsd32_fetch_args, - powerpc64_freebsd32_fetch_retval + powerpc64_freebsd32_fetch_retval, + STAILQ_HEAD_INITIALIZER(powerpc64_freebsd32.extra_syscalls), + { NULL } }; PROCABI(powerpc64_freebsd32); Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/setup.c Tue Dec 6 00:39:00 2016 (r309589) @@ -344,7 +344,7 @@ alloc_syscall(struct threadinfo *t, stru assert(t->in_syscall == 0); assert(t->cs.number == 0); - assert(t->cs.name == NULL); + assert(t->cs.sc == NULL); assert(t->cs.nargs == 0); for (i = 0; i < nitems(t->cs.s_args); i++) assert(t->cs.s_args[i] == NULL); @@ -378,12 +378,11 @@ enter_syscall(struct trussinfo *info, st return; } - t->cs.name = sysdecode_syscallname(t->proc->abi->abi, t->cs.number); - if (t->cs.name == NULL) + sc = get_syscall(t, t->cs.number, narg); + if (sc->unknown) fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n", t->proc->abi->type, t->cs.number); - sc = get_syscall(t->cs.name, narg); t->cs.nargs = sc->nargs; assert(sc->nargs <= nitems(t->cs.s_args)); @@ -396,25 +395,22 @@ enter_syscall(struct trussinfo *info, st * now. This doesn't currently support arguments that are * passed in *and* out, however. */ - if (t->cs.name != NULL) { #if DEBUG - fprintf(stderr, "syscall %s(", t->cs.name); + fprintf(stderr, "syscall %s(", sc->name); #endif - for (i = 0; i < t->cs.nargs; i++) { + for (i = 0; i < t->cs.nargs; i++) { #if DEBUG - fprintf(stderr, "0x%lx%s", sc ? - t->cs.args[sc->args[i].offset] : t->cs.args[i], - i < (t->cs.nargs - 1) ? "," : ""); + fprintf(stderr, "0x%lx%s", t->cs.args[sc->args[i].offset], + i < (t->cs.nargs - 1) ? "," : ""); #endif - if (!(sc->args[i].type & OUT)) { - t->cs.s_args[i] = print_arg(&sc->args[i], - t->cs.args, 0, info); - } + if (!(sc->args[i].type & OUT)) { + t->cs.s_args[i] = print_arg(&sc->args[i], + t->cs.args, 0, info); } + } #if DEBUG - fprintf(stderr, ")\n"); + fprintf(stderr, ")\n"); #endif - } clock_gettime(CLOCK_REALTIME, &t->before); } Modified: head/usr.bin/truss/sparc64-freebsd.c ============================================================================== --- head/usr.bin/truss/sparc64-freebsd.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/sparc64-freebsd.c Tue Dec 6 00:39:00 2016 (r309589) @@ -118,7 +118,9 @@ static struct procabi sparc64_freebsd = "FreeBSD ELF64", SYSDECODE_ABI_FREEBSD, sparc64_fetch_args, - sparc64_fetch_retval + sparc64_fetch_retval, + STAILQ_HEAD_INITIALIZER(sparc64_freebsd.extra_syscalls), + { NULL } }; PROCABI(sparc64_freebsd); Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/syscall.h Tue Dec 6 00:39:00 2016 (r309589) @@ -72,9 +72,10 @@ struct syscall { struct timespec time; /* Time spent for this call */ int ncalls; /* Number of calls */ int nerror; /* Number of calls that returned with error */ + bool unknown; /* Unknown system call */ }; -struct syscall *get_syscall(const char *, int nargs); +struct syscall *get_syscall(struct threadinfo *, u_int, u_int); char *print_arg(struct syscall_args *, unsigned long*, long *, struct trussinfo *); /* Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/syscalls.c Tue Dec 6 00:39:00 2016 (r309589) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -819,21 +820,66 @@ init_syscalls(void) for (sc = decoded_syscalls; sc->name != NULL; sc++) STAILQ_INSERT_HEAD(&syscalls, sc, entries); } + +static struct syscall * +find_syscall(struct procabi *abi, u_int number) +{ + struct extra_syscall *es; + + if (number < nitems(abi->syscalls)) + return (abi->syscalls[number]); + STAILQ_FOREACH(es, &abi->extra_syscalls, entries) { + if (es->number == number) + return (es->sc); + } + return (NULL); +} + +static void +add_syscall(struct procabi *abi, u_int number, struct syscall *sc) +{ + struct extra_syscall *es; + + if (number < nitems(abi->syscalls)) { + assert(abi->syscalls[number] == NULL); + abi->syscalls[number] = sc; + } else { + es = malloc(sizeof(*es)); + es->sc = sc; + es->number = number; + STAILQ_INSERT_TAIL(&abi->extra_syscalls, es, entries); + } +} + /* * If/when the list gets big, it might be desirable to do it * as a hash table or binary search. */ struct syscall * -get_syscall(const char *name, int nargs) +get_syscall(struct threadinfo *t, u_int number, u_int nargs) { struct syscall *sc; - int i; + const char *name; + char *new_name; + u_int i; - if (name == NULL) - return (NULL); - STAILQ_FOREACH(sc, &syscalls, entries) - if (strcmp(name, sc->name) == 0) + sc = find_syscall(t->proc->abi, number); + if (sc != NULL) + return (sc); + + name = sysdecode_syscallname(t->proc->abi->abi, number); + if (name == NULL) { + asprintf(&new_name, "#%d", number); + name = new_name; + } else + new_name = NULL; + STAILQ_FOREACH(sc, &syscalls, entries) { + if (strcmp(name, sc->name) == 0) { + add_syscall(t->proc->abi, number, sc); + free(new_name); return (sc); + } + } /* It is unknown. Add it into the list. */ #if DEBUG @@ -842,7 +888,9 @@ get_syscall(const char *name, int nargs) #endif sc = calloc(1, sizeof(struct syscall)); - sc->name = strdup(name); + sc->name = name; + if (new_name != NULL) + sc->unknown = true; sc->ret_type = 1; sc->nargs = nargs; for (i = 0; i < nargs; i++) { @@ -851,6 +899,7 @@ get_syscall(const char *name, int nargs) sc->args[i].type = LongHex; } STAILQ_INSERT_HEAD(&syscalls, sc, entries); + add_syscall(t->proc->abi, number, sc); return (sc); } @@ -1866,7 +1915,7 @@ print_syscall(struct trussinfo *trussinf t = trussinfo->curthread; - name = t->cs.name; + name = t->cs.sc->name; nargs = t->cs.nargs; s_args = t->cs.s_args; Modified: head/usr.bin/truss/truss.h ============================================================================== --- head/usr.bin/truss/truss.h Tue Dec 6 00:36:02 2016 (r309588) +++ head/usr.bin/truss/truss.h Tue Dec 6 00:39:00 2016 (r309589) @@ -38,13 +38,29 @@ #define DISPLAYTIDS 0x00000080 struct procinfo; +struct syscall; struct trussinfo; +/* + * The lookup of normal system calls are optimized by using a fixed + * array for the first 1024 system calls that can be indexed directly. + * Unknown system calls with other IDs are stored in a linked list. + */ +#define SYSCALL_NORMAL_COUNT 1024 + +struct extra_syscall { + STAILQ_ENTRY(extra_syscall) entries; + struct syscall *sc; + u_int number; +}; + struct procabi { const char *type; enum sysdecode_abi abi; int (*fetch_args)(struct trussinfo *, u_int); int (*fetch_retval)(struct trussinfo *, long *, int *); + STAILQ_HEAD(, extra_syscall) extra_syscalls; + struct syscall *syscalls[SYSCALL_NORMAL_COUNT]; }; #define PROCABI(abi) DATA_SET(procabi, abi) @@ -64,10 +80,9 @@ struct procabi { */ struct current_syscall { struct syscall *sc; - const char *name; - int number; - unsigned long args[10]; + unsigned int number; unsigned int nargs; + unsigned long args[10]; char *s_args[10]; /* the printable arguments */ }; From owner-svn-src-head@freebsd.org Tue Dec 6 01:04:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD5A3C59F8B; Tue, 6 Dec 2016 01:04:32 +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 90A75E48; Tue, 6 Dec 2016 01:04:32 +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 655BD10AA28; Mon, 5 Dec 2016 20:04:31 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309589 - head/usr.bin/truss Date: Mon, 05 Dec 2016 16:42:15 -0800 Message-ID: <18568727.ZCvfzOzSEO@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201612060039.uB60d0eE075130@repo.freebsd.org> References: <201612060039.uB60d0eE075130@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, 05 Dec 2016 20:04:31 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 01:04:32 -0000 On Tuesday, December 06, 2016 12:39:00 AM John Baldwin wrote: > Author: jhb > Date: Tue Dec 6 00:39:00 2016 > New Revision: 309589 > URL: https://svnweb.freebsd.org/changeset/base/309589 > > Log: > Rework syscall structure lookups. > > Avoid always using an O(n^2) loop over known syscall structures with > strcmp() on each system call. Instead, use a per-ABI cache indexed by > the system call number. The first 1024 system calls (which should cover > all of the normal system calls in currently-supported ABIs) use a flat array > indexed by the system call number to find system call structure. For other > system calls, a linked list of structures storing an integer to structure > mapping is stored in the ABI. The linked list isn't very smart, but it > should only be used by buggy applications invoking unknown system calls. > > This also fixes handling of unknown system calls which currently trigger > a NULL pointer dereference. > > Reviewed by: kib > MFC after: 2 weeks I of course forgot: Differential Revision: https://reviews.freebsd.org/D8639 The table + linked-list could perhaps be replaced by a hash table, but I don't quite feel like writing a new hash table from scratch. One option would be to make truss a C++ program and use unordered_map<>. We could then turn the procabi thing into a class which might look a bit nicer (and use constructors to initialize the hash table instead of the inline STAILQ_HEAD_INITIALIZER). -- John Baldwin From owner-svn-src-head@freebsd.org Tue Dec 6 01:35:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D734CC66B39; Tue, 6 Dec 2016 01:35:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9FB351CCE; Tue, 6 Dec 2016 01:35:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB61ZTw0098624; Tue, 6 Dec 2016 01:35:29 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB61ZRx5098601; Tue, 6 Dec 2016 01:35:27 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612060135.uB61ZRx5098601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 6 Dec 2016 01:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309590 - in head: contrib/libarchive/cat/test contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 01:35:30 -0000 Author: mm Date: Tue Dec 6 01:35:27 2016 New Revision: 309590 URL: https://svnweb.freebsd.org/changeset/base/309590 Log: MFV r309587: Sync libarchive with vendor. Vendor bugfixes: libarchive #831: Spelling fixes libarchive #832: Relax sanity checks of number fields in tar header even more OSS-Fuzz #16: Fix possible hang in uudecode_filter_read() OSS-Fuzz #220: Reject an 'ar' filename table larger than 1GB or a filename larger than 1MB. MFC after: 1 week Added: head/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.c - copied unchanged from r309587, vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.c head/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.tar.uu - copied unchanged from r309587, vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.tar.uu Modified: head/contrib/libarchive/cat/test/main.c head/contrib/libarchive/cpio/test/main.c head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c head/contrib/libarchive/libarchive/archive_read_support_format_ar.c head/contrib/libarchive/libarchive/archive_read_support_format_cab.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_string.c head/contrib/libarchive/libarchive/archive_string.h head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c head/contrib/libarchive/libarchive/archive_write_set_format_cpio.c head/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c head/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c head/contrib/libarchive/libarchive/archive_write_set_format_zip.c head/contrib/libarchive/libarchive/test/main.c head/contrib/libarchive/libarchive/test/test_archive_cmdline.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/cat/test/main.c ============================================================================== --- head/contrib/libarchive/cat/test/main.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/cat/test/main.c Tue Dec 6 01:35:27 2016 (r309590) @@ -520,7 +520,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (0); /* Standard: return 0 for end-of-string. */ cnt = utf8_count[ch]; - /* Invalide sequence or there are not plenty bytes. */ + /* Invalid sequence or there are not plenty bytes. */ if (n < (size_t)cnt) return (-1); @@ -559,7 +559,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (-1); } - /* The code point larger than 0x10FFFF is not leagal + /* The code point larger than 0x10FFFF is not legal * Unicode values. */ if (wc > 0x10FFFF) return (-1); Modified: head/contrib/libarchive/cpio/test/main.c ============================================================================== --- head/contrib/libarchive/cpio/test/main.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/cpio/test/main.c Tue Dec 6 01:35:27 2016 (r309590) @@ -521,7 +521,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (0); /* Standard: return 0 for end-of-string. */ cnt = utf8_count[ch]; - /* Invalide sequence or there are not plenty bytes. */ + /* Invalid sequence or there are not plenty bytes. */ if (n < (size_t)cnt) return (-1); @@ -560,7 +560,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (-1); } - /* The code point larger than 0x10FFFF is not leagal + /* The code point larger than 0x10FFFF is not legal * Unicode values. */ if (wc > 0x10FFFF) return (-1); Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Dec 6 01:35:27 2016 (r309590) @@ -690,7 +690,7 @@ translate_acl(struct archive_read_disk * #ifdef ACL_TYPE_NFS4 if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { /* - * acl_get_entry_type_np() falis with non-NFSv4 ACLs + * acl_get_entry_type_np() fails with non-NFSv4 ACLs */ if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) { archive_set_error(&a->archive, errno, "Failed " @@ -1194,7 +1194,7 @@ setup_sparse_fiemap(struct archive_read_ if (r < 0) { /* When something error happens, it is better we * should return ARCHIVE_OK because an earlier - * version(<2.6.28) cannot perfom FS_IOC_FIEMAP. */ + * version(<2.6.28) cannot perform FS_IOC_FIEMAP. */ goto exit_setup_sparse_fiemap; } if (fm->fm_mapped_extents == 0) { @@ -1354,7 +1354,7 @@ setup_sparse(struct archive_read_disk *a goto exit_setup_sparse; } if (off_s == 0 && off_e == size) - break;/* This is not spase. */ + break;/* This is not sparse. */ archive_entry_sparse_add_entry(entry, off_s, off_e - off_s); off_s = off_e; Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Tue Dec 6 01:35:27 2016 (r309590) @@ -511,6 +511,13 @@ read_more: } llen = len; if ((nl == 0) && (uudecode->state != ST_UUEND)) { + if (total == 0 && ravail <= 0) { + /* There is nothing more to read, fail */ + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Missing format data"); + return (ARCHIVE_FATAL); + } /* * Save remaining data which does not contain * NL('\n','\r'). @@ -567,7 +574,7 @@ read_more: "Insufficient compressed data"); return (ARCHIVE_FATAL); } - /* Get length of undecoded bytes of curent line. */ + /* Get length of undecoded bytes of current line. */ l = UUDECODE(*b++); body--; if (l > body) { Modified: head/contrib/libarchive/libarchive/archive_read_support_format_ar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_ar.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_read_support_format_ar.c Tue Dec 6 01:35:27 2016 (r309590) @@ -260,7 +260,7 @@ _ar_read_header(struct archive_read *a, archive_entry_set_filetype(entry, AE_IFREG); /* Get the size of the filename table. */ number = ar_atol10(h + AR_size_offset, AR_size_size); - if (number > SIZE_MAX) { + if (number > SIZE_MAX || number > 1024 * 1024 * 1024) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Filename table too large"); return (ARCHIVE_FATAL); @@ -342,16 +342,19 @@ _ar_read_header(struct archive_read *a, /* Parse the size of the name, adjust the file size. */ number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3); - bsd_name_length = (size_t)number; - /* Guard against the filename + trailing NUL - * overflowing a size_t and against the filename size - * being larger than the entire entry. */ - if (number > (uint64_t)(bsd_name_length + 1) - || (int64_t)bsd_name_length > ar->entry_bytes_remaining) { + /* Sanity check the filename length: + * = Must be <= SIZE_MAX - 1 + * = Must be <= 1MB + * = Cannot be bigger than the entire entry + */ + if (number > SIZE_MAX - 1 + || number > 1024 * 1024 + || (int64_t)number > ar->entry_bytes_remaining) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Bad input file size"); return (ARCHIVE_FATAL); } + bsd_name_length = (size_t)number; ar->entry_bytes_remaining -= bsd_name_length; /* Adjust file size reported to client. */ archive_entry_set_size(entry, ar->entry_bytes_remaining); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Dec 6 01:35:27 2016 (r309590) @@ -67,7 +67,7 @@ struct lzx_dec { /* The length how many bytes we can copy decoded code from * the window. */ int copy_len; - /* Translation reversal for x86 proccessor CALL byte sequence(E8). + /* Translation reversal for x86 processor CALL byte sequence(E8). * This is used for LZX only. */ uint32_t translation_size; char translation; @@ -1555,7 +1555,7 @@ cab_read_ahead_cfdata_deflate(struct arc /* * Note: I suspect there is a bug in makecab.exe because, in rare * case, compressed bytes are still remaining regardless we have - * gotten all uncompressed bytes, which size is recoded in CFDATA, + * gotten all uncompressed bytes, which size is recorded in CFDATA, * as much as we need, and we have to use the garbage so as to * correctly compute the sum of CFDATA accordingly. */ @@ -1742,7 +1742,7 @@ cab_read_ahead_cfdata_lzx(struct archive } /* - * Translation reversal of x86 proccessor CALL byte sequence(E8). + * Translation reversal of x86 processor CALL byte sequence(E8). */ lzx_translation(&cab->xstrm, cab->uncompressed_buffer, cfdata->uncompressed_size, @@ -2271,7 +2271,7 @@ static int lzx_br_fillup(struct lzx_stream *strm, struct lzx_br *br) { /* - * x86 proccessor family can read misaligned data without an access error. + * x86 processor family can read misaligned data without an access error. */ int n = CACHE_BITS - br->cache_avail; Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Tue Dec 6 01:35:27 2016 (r309590) @@ -299,14 +299,21 @@ archive_read_format_tar_cleanup(struct a * * This has to be pretty lenient in order to accomodate the enormous * variety of tar writers in the world: - * = POSIX ustar requires octal values with leading zeros and - * specific termination on fields + * = POSIX (IEEE Std 1003.1-1988) ustar requires octal values with leading + * zeros and allows fields to be terminated with space or null characters * = Many writers use different termination (in particular, libarchive * omits terminator bytes to squeeze one or two more digits) * = Many writers pad with space and omit leading zeros * = GNU tar and star write base-256 values if numbers are too * big to be represented in octal * + * Examples of specific tar headers that we should support: + * = Perl Archive::Tar terminates uid, gid, devminor and devmajor with two + * null bytes, pads size with spaces and other numeric fields with zeroes + * = plexus-archiver prior to 2.6.3 (before switching to commons-compress) + * may have uid and gid fields filled with spaces without any octal digits + * at all and pads all numeric fields with spaces + * * This should tolerate all variants in use. It will reject a field * where the writer just left garbage after a trailing NUL. */ Modified: head/contrib/libarchive/libarchive/archive_string.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_string.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_string.c Tue Dec 6 01:35:27 2016 (r309590) @@ -2298,7 +2298,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (0); /* Standard: return 0 for end-of-string. */ cnt = utf8_count[ch]; - /* Invalide sequence or there are not plenty bytes. */ + /* Invalid sequence or there are not plenty bytes. */ if ((int)n < cnt) { cnt = (int)n; for (i = 1; i < cnt; i++) { @@ -2379,7 +2379,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch goto invalid_sequence; } - /* The code point larger than 0x10FFFF is not leagal + /* The code point larger than 0x10FFFF is not legal * Unicode values. */ if (wc > UNICODE_MAX) goto invalid_sequence; @@ -2397,7 +2397,7 @@ utf8_to_unicode(uint32_t *pwc, const cha int cnt; cnt = _utf8_to_unicode(pwc, s, n); - /* Any of Surrogate pair is not leagal Unicode values. */ + /* Any of Surrogate pair is not legal Unicode values. */ if (cnt == 3 && IS_SURROGATE_PAIR_LA(*pwc)) return (-3); return (cnt); @@ -2458,7 +2458,7 @@ invalid_sequence: /* * Convert a Unicode code point to a single UTF-8 sequence. * - * NOTE:This function does not check if the Unicode is leagal or not. + * NOTE:This function does not check if the Unicode is legal or not. * Please you definitely check it before calling this. */ static size_t @@ -2554,7 +2554,7 @@ utf16_to_unicode(uint32_t *pwc, const ch * Surrogate pair values(0xd800 through 0xdfff) are only * used by UTF-16, so, after above culculation, the code * must not be surrogate values, and Unicode has no codes - * larger than 0x10ffff. Thus, those are not leagal Unicode + * larger than 0x10ffff. Thus, those are not legal Unicode * values. */ if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) { Modified: head/contrib/libarchive/libarchive/archive_string.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_string.h Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_string.h Tue Dec 6 01:35:27 2016 (r309590) @@ -115,13 +115,13 @@ archive_string_conversion_set_opt(struct /* Copy one archive_string to another in locale conversion. - * Return -1 if conversion failes. */ + * Return -1 if conversion fails. */ int archive_strncpy_l(struct archive_string *, const void *, size_t, struct archive_string_conv *); /* Copy one archive_string to another in locale conversion. - * Return -1 if conversion failes. */ + * Return -1 if conversion fails. */ int archive_strncat_l(struct archive_string *, const void *, size_t, struct archive_string_conv *); Modified: head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c Tue Dec 6 01:35:27 2016 (r309590) @@ -205,7 +205,7 @@ struct _7zip { /* * The list of the file entries which has its contents is used to * manage struct file objects. - * We use 'next' a menber of struct file to chain. + * We use 'next' (a member of struct file) to chain. */ struct { struct file *first; Modified: head/contrib/libarchive/libarchive/archive_write_set_format_cpio.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_cpio.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_write_set_format_cpio.c Tue Dec 6 01:35:27 2016 (r309590) @@ -289,7 +289,7 @@ write_header(struct archive_write *a, st sconv = get_sconv(a); #if defined(_WIN32) && !defined(__CYGWIN__) - /* Make sure the path separators in pahtname, hardlink and symlink + /* Make sure the path separators in pathname, hardlink and symlink * are all slash '/', not the Windows path separator '\'. */ entry_main = __la_win_entry_in_posix_pathseparator(entry); if (entry_main == NULL) { Modified: head/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c Tue Dec 6 01:35:27 2016 (r309590) @@ -232,7 +232,7 @@ write_header(struct archive_write *a, st sconv = get_sconv(a); #if defined(_WIN32) && !defined(__CYGWIN__) - /* Make sure the path separators in pahtname, hardlink and symlink + /* Make sure the path separators in pathname, hardlink and symlink * are all slash '/', not the Windows path separator '\'. */ entry_main = __la_win_entry_in_posix_pathseparator(entry); if (entry_main == NULL) { Modified: head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c Tue Dec 6 01:35:27 2016 (r309590) @@ -119,9 +119,9 @@ static const char template_header[] = { '0','0','0','0','0','0', '0','\0', /* gid, null termination: 8 bytes */ '0','0','0','0','0','0', '0','\0', - /* size, space termation: 12 bytes */ + /* size, space termination: 12 bytes */ '0','0','0','0','0','0','0','0','0','0','0', '\0', - /* mtime, space termation: 12 bytes */ + /* mtime, space termination: 12 bytes */ '0','0','0','0','0','0','0','0','0','0','0', '\0', /* Initial checksum value: 8 spaces */ ' ',' ',' ',' ',' ',' ',' ',' ', @@ -368,7 +368,7 @@ archive_write_gnutar_header(struct archi } #if defined(_WIN32) && !defined(__CYGWIN__) - /* Make sure the path separators in pahtname, hardlink and symlink + /* Make sure the path separators in pathname, hardlink and symlink * are all slash '/', not the Windows path separator '\'. */ entry_main = __la_win_entry_in_posix_pathseparator(entry); if (entry_main == NULL) { Modified: head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c Tue Dec 6 01:35:27 2016 (r309590) @@ -1840,9 +1840,9 @@ mtree_entry_setup_filenames(struct archi len = strlen(p); /* - * Add "./" prefiex. + * Add "./" prefix. * NOTE: If the pathname does not have a path separator, we have - * to add "./" to the head of the pathename because mtree reader + * to add "./" to the head of the pathname because mtree reader * will suppose that it is v1(a.k.a classic) mtree format and * change the directory unexpectedly and so it will make a wrong * path. Modified: head/contrib/libarchive/libarchive/archive_write_set_format_pax.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Tue Dec 6 01:35:27 2016 (r309590) @@ -709,7 +709,7 @@ archive_write_pax_header(struct archive_ /* Copy entry so we can modify it as needed. */ #if defined(_WIN32) && !defined(__CYGWIN__) - /* Make sure the path separators in pahtname, hardlink and symlink + /* Make sure the path separators in pathname, hardlink and symlink * are all slash '/', not the Windows path separator '\'. */ entry_main = __la_win_entry_in_posix_pathseparator(entry_original); if (entry_main == entry_original) Modified: head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Tue Dec 6 01:35:27 2016 (r309590) @@ -114,9 +114,9 @@ static const char template_header[] = { '0','0','0','0','0','0', ' ','\0', /* gid, space-null termination: 8 bytes */ '0','0','0','0','0','0', ' ','\0', - /* size, space termation: 12 bytes */ + /* size, space termination: 12 bytes */ '0','0','0','0','0','0','0','0','0','0','0', ' ', - /* mtime, space termation: 12 bytes */ + /* mtime, space termination: 12 bytes */ '0','0','0','0','0','0','0','0','0','0','0', ' ', /* Initial checksum value: 8 spaces */ ' ',' ',' ',' ',' ',' ',' ',' ', @@ -336,7 +336,7 @@ archive_write_ustar_header(struct archiv } #if defined(_WIN32) && !defined(__CYGWIN__) - /* Make sure the path separators in pahtname, hardlink and symlink + /* Make sure the path separators in pathname, hardlink and symlink * are all slash '/', not the Windows path separator '\'. */ entry_main = __la_win_entry_in_posix_pathseparator(entry); if (entry_main == NULL) { Modified: head/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c Tue Dec 6 01:35:27 2016 (r309590) @@ -98,9 +98,9 @@ static const char template_header[] = { '0','0','0','0','0','0', ' ','\0', /* gid, space-null termination: 8 bytes */ '0','0','0','0','0','0', ' ','\0', - /* size, space termation: 12 bytes */ + /* size, space termination: 12 bytes */ '0','0','0','0','0','0','0','0','0','0','0', ' ', - /* mtime, space termation: 12 bytes */ + /* mtime, space termination: 12 bytes */ '0','0','0','0','0','0','0','0','0','0','0', ' ', /* Initial checksum value: 8 spaces */ ' ',' ',' ',' ',' ',' ',' ',' ', @@ -314,7 +314,7 @@ archive_write_v7tar_header(struct archiv } #if defined(_WIN32) && !defined(__CYGWIN__) - /* Make sure the path separators in pahtname, hardlink and symlink + /* Make sure the path separators in pathname, hardlink and symlink * are all slash '/', not the Windows path separator '\'. */ entry_main = __la_win_entry_in_posix_pathseparator(entry); if (entry_main == NULL) { Modified: head/contrib/libarchive/libarchive/archive_write_set_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_zip.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/archive_write_set_format_zip.c Tue Dec 6 01:35:27 2016 (r309590) @@ -592,7 +592,7 @@ archive_write_zip_header(struct archive_ #if defined(_WIN32) && !defined(__CYGWIN__) - /* Make sure the path separators in pahtname, hardlink and symlink + /* Make sure the path separators in pathname, hardlink and symlink * are all slash '/', not the Windows path separator '\'. */ zip->entry = __la_win_entry_in_posix_pathseparator(entry); if (zip->entry == entry) Modified: head/contrib/libarchive/libarchive/test/main.c ============================================================================== --- head/contrib/libarchive/libarchive/test/main.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/test/main.c Tue Dec 6 01:35:27 2016 (r309590) @@ -519,7 +519,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (0); /* Standard: return 0 for end-of-string. */ cnt = utf8_count[ch]; - /* Invalide sequence or there are not plenty bytes. */ + /* Invalid sequence or there are not plenty bytes. */ if (n < (size_t)cnt) return (-1); @@ -558,7 +558,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (-1); } - /* The code point larger than 0x10FFFF is not leagal + /* The code point larger than 0x10FFFF is not legal * Unicode values. */ if (wc > 0x10FFFF) return (-1); Modified: head/contrib/libarchive/libarchive/test/test_archive_cmdline.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_archive_cmdline.c Tue Dec 6 00:39:00 2016 (r309589) +++ head/contrib/libarchive/libarchive/test/test_archive_cmdline.c Tue Dec 6 01:35:27 2016 (r309590) @@ -66,7 +66,7 @@ DEFINE_TEST(test_archive_cmdline) assertEqualString("gzip", cl->argv[0]); assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); - /* A command line includes space characer. */ + /* A command line includes space character. */ assert((cl = __archive_cmdline_allocate()) != NULL); if (cl == NULL) return; @@ -78,7 +78,7 @@ DEFINE_TEST(test_archive_cmdline) assertEqualString("gzip ", cl->argv[0]); assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); - /* A command line includes space characer: pattern 2.*/ + /* A command line includes space character: pattern 2.*/ assert((cl = __archive_cmdline_allocate()) != NULL); if (cl == NULL) return; @@ -90,7 +90,7 @@ DEFINE_TEST(test_archive_cmdline) assertEqualString("gzip x", cl->argv[0]); assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); - /* A command line includes space characer: pattern 3.*/ + /* A command line includes space character: pattern 3.*/ assert((cl = __archive_cmdline_allocate()) != NULL); if (cl == NULL) return; @@ -103,7 +103,7 @@ DEFINE_TEST(test_archive_cmdline) assertEqualString("gzip x s ", cl->argv[0]); assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); - /* A command line includes space characer: pattern 4.*/ + /* A command line includes space character: pattern 4.*/ assert((cl = __archive_cmdline_allocate()) != NULL); if (cl == NULL) return; Copied: head/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.c (from r309587, vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.c Tue Dec 6 01:35:27 2016 (r309590, copy of r309587, vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.c) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2016 Martin Matuska + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD"); + +/* + * Verify our ability to read sample files created by plexus-archiver version + * 2.6.2 and lower (project switched to Apache Commons Compress with 2.6.3). + * + * These files may have tar entries with uid and gid header fields filled with + * spaces without any octal digit. + */ + +DEFINE_TEST(test_compat_plexus_archiver_tar) +{ + char name[] = "test_compat_plexus_archiver_tar.tar"; + struct archive_entry *ae; + struct archive *a; + int r; + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + extract_reference_file(name); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, + 10240)); + + /* Read first entry. */ + assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae)); + if (r != ARCHIVE_OK) { + archive_read_free(a); + return; + } + assertEqualString("commons-logging-1.2/NOTICE.txt", + archive_entry_pathname(ae)); + assertEqualInt(1404583896, archive_entry_mtime(ae)); + assertEqualInt(0100664, archive_entry_mode(ae)); + assertEqualInt(0, archive_entry_uid(ae)); + assertEqualInt(0, archive_entry_gid(ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} Copied: head/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.tar.uu (from r309587, vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.tar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.tar.uu Tue Dec 6 01:35:27 2016 (r309590, copy of r309587, vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.tar.uu) @@ -0,0 +1,49 @@ +begin 644 test_compat_plexus_archiver_tar.tar +M8V]M;6]N Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F338BC67E5E; Tue, 6 Dec 2016 03:18:34 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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 BD26F181A; Tue, 6 Dec 2016 03:18:34 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x244.google.com with SMTP id r94so3902978ioe.1; Mon, 05 Dec 2016 19:18:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nS71D1BrdDoZXrCdv96LFeiY2+g0wKz7S5v9PJBFW40=; b=VlxE5icM/JZQaLrP7utanjHZh9VYq91f87JOaCIsnnbalD8Yrtae2RGOdCZn/kQ0mz iTrrD69qWuueEYcWTvtmTWvr63zxU+kOBOGAAMpW+RX7/gyR3DyoRB8Tx4cgoT7CaBKC c3PQJGetbUowYMUfqPPTe56Fh/bqLy8UHb6QIrptV9dgRqda3mbaIANrSz0wgkVme7HE GqOM08NQvUma4aaqF9B1FuXxMVqTCcrlNfdeKh8yoHqfSNv9g8lIEGeLB2nlitiAK0Lo dtstYYIPHDbwATBKrPK13SLAB+1EYPK5N2Ff7ZnV4CjwyIUKbXoArp2c+A5XWh94Wlwn S3KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nS71D1BrdDoZXrCdv96LFeiY2+g0wKz7S5v9PJBFW40=; b=lXdBItvuKT9KvwCvS1VvsqYObCu2EQ+vs273HzbNHOos2o9alSZJMxUKDbuf2xxuM+ A32LQoRsXHY4P5yzMj/yoFqhP36xd13aBDcd49+H9wudXR/pFdrsRj2PeshccE0d66yS 1O2i5psfo0L4fVTVDrLr/50vczEjNiE4YgD7FfBitrcKorCU5oGSsIj+qzRRCrsp0m3J EcO6r+mGAgkUJJNgh4eo4UyIZ7SPd1hzd5311KxT7llGJ9oONXkdOywG9Wya6DXif8Vp 3Pm0fR16HyJa5lv7Rc2QL13pCajmx7u/Rui7sdvqkofVmwGrRMsUTgqAUsRime7Aj/OR D44w== X-Gm-Message-State: AKaTC00GChz4MPgA2MFgZqIf8e0rfdnhNzPOWG/NSwjy9pQdexUykidWAbBxdmYEWURvCwXIOEndR321CosxTA== X-Received: by 10.107.19.164 with SMTP id 36mr53717511iot.155.1480994314078; Mon, 05 Dec 2016 19:18:34 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.175.133 with HTTP; Mon, 5 Dec 2016 19:18:13 -0800 (PST) In-Reply-To: <201612051555.uB5FtpGS063661@repo.freebsd.org> References: <201612051555.uB5FtpGS063661@repo.freebsd.org> From: Ed Maste Date: Mon, 5 Dec 2016 22:18:13 -0500 X-Google-Sender-Auth: 0yKkSSvGBh-GPmEB6p2ZHwLqD1M Message-ID: Subject: Re: svn commit: r309553 - head/sys/arm/include To: Michal Meloun Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 03:18:35 -0000 On 5 December 2016 at 10:55, Michal Meloun wrote: > Author: mmel > Date: Mon Dec 5 15:55:51 2016 > New Revision: 309553 > URL: https://svnweb.freebsd.org/changeset/base/309553 > > Log: > Fix build breakage caused by r309531. > > Reported by: andrew > MFC after: 2 weeks > X-MFC with: r309531 It appears this breaks armv6 buildworld: In file included from /tank/emaste/src/freebsd-staging/lib/libkvm/kvm.c:48: In file included from /tank/emaste/obj/arm.armv6/tank/emaste/src/freebsd-staging/tmp/usr/include/sys/user.h:52: In file included from /tank/emaste/obj/arm.armv6/tank/emaste/src/freebsd-staging/tmp/usr/include/vm/pmap.h:90: In file included from /tank/emaste/obj/arm.armv6/tank/emaste/src/freebsd-staging/tmp/usr/include/machine/pmap.h:33: /tank/emaste/obj/arm.armv6/tank/emaste/src/freebsd-staging/tmp/usr/include/sys/systm.h:178:5: error: declaration of built-in function 'setjmp' requires inclusion of the header [-Werror,-Wbuiltin-requires-header] int setjmp(struct _jmp_buf *) __returns_twice; ^ ... From owner-svn-src-head@freebsd.org Tue Dec 6 04:13:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4801C692B4; Tue, 6 Dec 2016 04:13:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96AA015E8; Tue, 6 Dec 2016 04:13:04 +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 uB64D3OO063403; Tue, 6 Dec 2016 04:13:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB64D3ji063394; Tue, 6 Dec 2016 04:13:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612060413.uB64D3ji063394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 04:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309591 - in head/lib: libproc librtld_db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:13:04 -0000 Author: markj Date: Tue Dec 6 04:13:02 2016 New Revision: 309591 URL: https://svnweb.freebsd.org/changeset/base/309591 Log: Fix style bugs and remove trailing whitespace in libproc and librtld_db. MFC after: 1 week Modified: head/lib/libproc/_libproc.h head/lib/libproc/libproc.h head/lib/libproc/proc_bkpt.c head/lib/libproc/proc_create.c head/lib/libproc/proc_regs.c head/lib/libproc/proc_rtld.c head/lib/libproc/proc_util.c head/lib/librtld_db/rtld_db.c head/lib/librtld_db/rtld_db.h Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Tue Dec 6 01:35:27 2016 (r309590) +++ head/lib/libproc/_libproc.h Tue Dec 6 04:13:02 2016 (r309591) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef __LIBPROC_H_ +#define __LIBPROC_H_ + #include #include @@ -58,3 +61,5 @@ struct proc_handle { #define DPRINTF(...) do { } while (0) #define DPRINTFX(...) do { } while (0) #endif + +#endif /* __LIBPROC_H_ */ Modified: head/lib/libproc/libproc.h ============================================================================== --- head/lib/libproc/libproc.h Tue Dec 6 01:35:27 2016 (r309590) +++ head/lib/libproc/libproc.h Tue Dec 6 04:13:02 2016 (r309591) @@ -158,4 +158,4 @@ int proc_regset(struct proc_handle *, pr __END_DECLS -#endif /* !_LIBPROC_H_ */ +#endif /* _LIBPROC_H_ */ Modified: head/lib/libproc/proc_bkpt.c ============================================================================== --- head/lib/libproc/proc_bkpt.c Tue Dec 6 01:35:27 2016 (r309590) +++ head/lib/libproc/proc_bkpt.c Tue Dec 6 04:13:02 2016 (r309591) @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ #include __FBSDID("$FreeBSD$"); @@ -33,13 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include + #include "_libproc.h" #if defined(__aarch64__) @@ -130,8 +130,8 @@ proc_bkptset(struct proc_handle *phdl, u piod.piod_addr = &instr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { - DPRINTF("ERROR: couldn't read instruction at address 0x%" - PRIuPTR, address); + DPRINTF("ERROR: couldn't read instruction at address 0x%jx", + (uintmax_t)address); ret = -1; goto done; } @@ -146,8 +146,8 @@ proc_bkptset(struct proc_handle *phdl, u piod.piod_addr = &instr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { - DPRINTF("ERROR: couldn't write instruction at address 0x%" - PRIuPTR, address); + DPRINTF("ERROR: couldn't write instruction at address 0x%jx", + (uintmax_t)address); ret = -1; goto done; } @@ -194,15 +194,15 @@ proc_bkptdel(struct proc_handle *phdl, u piod.piod_addr = &instr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { - DPRINTF("ERROR: couldn't write instruction at address 0x%" - PRIuPTR, address); + DPRINTF("ERROR: couldn't write instruction at address 0x%jx", + (uintmax_t)address); ret = -1; } if (stopped) /* Restart the process if we had to stop it. */ proc_continue(phdl); - + return (ret); } Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Tue Dec 6 01:35:27 2016 (r309590) +++ head/lib/libproc/proc_create.c Tue Dec 6 04:13:02 2016 (r309591) @@ -22,10 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include Modified: head/lib/libproc/proc_regs.c ============================================================================== --- head/lib/libproc/proc_regs.c Tue Dec 6 01:35:27 2016 (r309590) +++ head/lib/libproc/proc_regs.c Tue Dec 6 04:13:02 2016 (r309591) @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ #include __FBSDID("$FreeBSD$"); @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include "_libproc.h" int Modified: head/lib/libproc/proc_rtld.c ============================================================================== --- head/lib/libproc/proc_rtld.c Tue Dec 6 01:35:27 2016 (r309590) +++ head/lib/libproc/proc_rtld.c Tue Dec 6 04:13:02 2016 (r309591) @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ #include __FBSDID("$FreeBSD$"); @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include "libproc.h" + #include "_libproc.h" static int Modified: head/lib/libproc/proc_util.c ============================================================================== --- head/lib/libproc/proc_util.c Tue Dec 6 01:35:27 2016 (r309590) +++ head/lib/libproc/proc_util.c Tue Dec 6 04:13:02 2016 (r309591) @@ -2,7 +2,7 @@ * Copyright (c) 2010 The FreeBSD Foundation * Copyright (c) 2008 John Birrell (jb@freebsd.org) * All rights reserved. - * + * * Portions of this software were developed by Rui Paulo under sponsorship * from the FreeBSD Foundation. * @@ -26,18 +26,21 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include + #include #include #include #include #include + #include "_libproc.h" int @@ -58,13 +61,15 @@ proc_clearflags(struct proc_handle *phdl int proc_continue(struct proc_handle *phdl) { - int pending = 0; + int pending; if (phdl == NULL) return (-1); if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP) pending = WSTOPSIG(phdl->wstat); + else + pending = 0; if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t)1, pending) != 0) return (-1); @@ -104,7 +109,7 @@ proc_getflags(struct proc_handle *phdl) if (phdl == NULL) return (-1); - return(phdl->flags); + return (phdl->flags); } int Modified: head/lib/librtld_db/rtld_db.c ============================================================================== --- head/lib/librtld_db/rtld_db.c Tue Dec 6 01:35:27 2016 (r309590) +++ head/lib/librtld_db/rtld_db.c Tue Dec 6 04:13:02 2016 (r309591) @@ -1,37 +1,36 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include -#include #include #include @@ -165,7 +164,7 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_ite DPRINTF("%s\n", __func__); - if ((kves = kinfo_getvmmap(proc_getpid(rdap->rda_php), &cnt)) == NULL) { + if ((kves = kinfo_getvmmap(proc_getpid(rdap->rda_php), &cnt)) == NULL) { warn("ERROR: kinfo_getvmmap() failed"); return (RD_ERR); } Modified: head/lib/librtld_db/rtld_db.h ============================================================================== --- head/lib/librtld_db/rtld_db.h Tue Dec 6 01:35:27 2016 (r309590) +++ head/lib/librtld_db/rtld_db.h Tue Dec 6 04:13:02 2016 (r309591) @@ -1,33 +1,33 @@ -/* - * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - * +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * * This software was developed by Rui Paulo under sponsorship from the - * FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ - */ + */ #ifndef _RTLD_DB_H_ #define _RTLD_DB_H_ From owner-svn-src-head@freebsd.org Tue Dec 6 04:14:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B28AFC69328; Tue, 6 Dec 2016 04:14:21 +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 751E8176A; Tue, 6 Dec 2016 04:14:21 +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 uB64EKBT063503; Tue, 6 Dec 2016 04:14:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB64EKRm063498; Tue, 6 Dec 2016 04:14:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612060414.uB64EKRm063498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 04:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309592 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:14:21 -0000 Author: markj Date: Tue Dec 6 04:14:20 2016 New Revision: 309592 URL: https://svnweb.freebsd.org/changeset/base/309592 Log: libproc: Make proc_getpid() an accessor for struct proc_handle. This allows librtld_db to fetch the PID from a handle without calling into libproc. Together with r303531, this means that librtld_db no longer references symbols from libproc. Modified: head/lib/libproc/_libproc.h head/lib/libproc/libproc.h head/lib/libproc/proc_create.c head/lib/libproc/proc_sym.c head/lib/libproc/proc_util.c Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Tue Dec 6 04:13:02 2016 (r309591) +++ head/lib/libproc/_libproc.h Tue Dec 6 04:14:20 2016 (r309592) @@ -39,7 +39,7 @@ struct procstat; struct proc_handle { - pid_t pid; /* Process ID. */ + struct proc_handle_public public; /* Public fields. */ int flags; /* Process flags. */ int status; /* Process status (PS_*). */ int wstat; /* Process wait status. */ Modified: head/lib/libproc/libproc.h ============================================================================== --- head/lib/libproc/libproc.h Tue Dec 6 04:13:02 2016 (r309591) +++ head/lib/libproc/libproc.h Tue Dec 6 04:14:20 2016 (r309592) @@ -116,6 +116,12 @@ typedef struct lwpstatus { #define PR_MODEL_ILP32 1 #define PR_MODEL_LP64 2 +struct proc_handle_public { + pid_t pid; +}; + +#define proc_getpid(phdl) (((struct proc_handle_public *)(phdl))->pid) + /* Function prototype definitions. */ __BEGIN_DECLS @@ -140,7 +146,6 @@ struct ctf_file *proc_name2ctf(struct pr int proc_setflags(struct proc_handle *, int); int proc_state(struct proc_handle *); int proc_getmodel(struct proc_handle *); -pid_t proc_getpid(struct proc_handle *); int proc_wstatus(struct proc_handle *); int proc_getwstat(struct proc_handle *); char * proc_signame(int, char *, size_t); Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Tue Dec 6 04:13:02 2016 (r309591) +++ head/lib/libproc/proc_create.c Tue Dec 6 04:14:20 2016 (r309592) @@ -79,7 +79,7 @@ proc_init(pid_t pid, int flags, int stat goto out; memset(phdl, 0, sizeof(*phdl)); - phdl->pid = pid; + phdl->public.pid = pid; phdl->flags = flags; phdl->status = status; phdl->procstat = procstat_open_sysctl(); @@ -140,7 +140,7 @@ proc_attach(pid_t pid, int flags, struct if (error != 0) goto out; - if (ptrace(PT_ATTACH, phdl->pid, 0, 0) != 0) { + if (ptrace(PT_ATTACH, proc_getpid(phdl), 0, 0) != 0) { error = errno; DPRINTF("ERROR: cannot ptrace child process %d", pid); goto out; Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Tue Dec 6 04:13:02 2016 (r309591) +++ head/lib/libproc/proc_sym.c Tue Dec 6 04:14:20 2016 (r309592) @@ -208,7 +208,7 @@ proc_addr2map(struct proc_handle *p, uin * it ourselves. */ if (p->nobjs == 0) { - if ((kves = kinfo_getvmmap(p->pid, &cnt)) == NULL) + if ((kves = kinfo_getvmmap(proc_getpid(p), &cnt)) == NULL) return (NULL); for (i = 0; i < (size_t)cnt; i++) { kve = kves + i; Modified: head/lib/libproc/proc_util.c ============================================================================== --- head/lib/libproc/proc_util.c Tue Dec 6 04:13:02 2016 (r309591) +++ head/lib/libproc/proc_util.c Tue Dec 6 04:14:20 2016 (r309592) @@ -70,7 +70,8 @@ proc_continue(struct proc_handle *phdl) pending = WSTOPSIG(phdl->wstat); else pending = 0; - if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t)1, pending) != 0) + if (ptrace(PT_CONTINUE, proc_getpid(phdl), (caddr_t)(uintptr_t)1, + pending) != 0) return (-1); phdl->status = PS_RUN; @@ -82,20 +83,22 @@ int proc_detach(struct proc_handle *phdl, int reason) { int status; + pid_t pid; if (phdl == NULL) return (EINVAL); if (reason == PRELEASE_KILL) { - kill(phdl->pid, SIGKILL); + kill(proc_getpid(phdl), SIGKILL); return (0); } - if (ptrace(PT_DETACH, phdl->pid, 0, 0) != 0 && errno == ESRCH) + pid = proc_getpid(phdl); + if (ptrace(PT_DETACH, pid, 0, 0) != 0 && errno == ESRCH) return (0); if (errno == EBUSY) { - kill(phdl->pid, SIGSTOP); - waitpid(phdl->pid, &status, WUNTRACED); - ptrace(PT_DETACH, phdl->pid, 0, 0); - kill(phdl->pid, SIGCONT); + kill(pid, SIGSTOP); + waitpid(pid, &status, WUNTRACED); + ptrace(PT_DETACH, pid, 0, 0); + kill(pid, SIGCONT); return (0); } @@ -134,16 +137,6 @@ proc_state(struct proc_handle *phdl) return (phdl->status); } -pid_t -proc_getpid(struct proc_handle *phdl) -{ - - if (phdl == NULL) - return (-1); - - return (phdl->pid); -} - int proc_getmodel(struct proc_handle *phdl) { @@ -161,7 +154,7 @@ proc_wstatus(struct proc_handle *phdl) if (phdl == NULL) return (-1); - if (waitpid(phdl->pid, &status, WUNTRACED) < 0) { + if (waitpid(proc_getpid(phdl), &status, WUNTRACED) < 0) { if (errno != EINTR) DPRINTF("waitpid"); return (-1); @@ -206,7 +199,7 @@ proc_read(struct proc_handle *phdl, void piod.piod_addr = (void *)buf; piod.piod_offs = (void *)addr; - if (ptrace(PT_IO, phdl->pid, (caddr_t)&piod, 0) < 0) + if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) return (-1); return (piod.piod_len); } @@ -220,7 +213,7 @@ proc_getlwpstatus(struct proc_handle *ph if (phdl == NULL) return (NULL); - if (ptrace(PT_LWPINFO, phdl->pid, (caddr_t)&lwpinfo, + if (ptrace(PT_LWPINFO, proc_getpid(phdl), (caddr_t)&lwpinfo, sizeof(lwpinfo)) < 0) return (NULL); siginfo = &lwpinfo.pl_siginfo; From owner-svn-src-head@freebsd.org Tue Dec 6 04:18:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB062C69521; Tue, 6 Dec 2016 04:18:10 +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 AA4F51B8F; Tue, 6 Dec 2016 04:18:10 +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 uB64I9ga063691; Tue, 6 Dec 2016 04:18:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB64I9LQ063687; Tue, 6 Dec 2016 04:18:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612060418.uB64I9LQ063687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 04:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309593 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:18:11 -0000 Author: markj Date: Tue Dec 6 04:18:09 2016 New Revision: 309593 URL: https://svnweb.freebsd.org/changeset/base/309593 Log: libproc: Improve .gnu_debuglink support. As of r278658 libproc looks for debug files under /usr/lib/debug and will use them if available. This change fleshes out that support a bit further: - Check for a .gnu_debuglink section and use the file name specified there if one is present. - Validate external debug files with the CRC in the .gnu_debuglink section so as to avoid using stale or corrupt debug files. - Search for debug files in the directory containing the referencing object or in the .debug subdirectory, as GDB does. Added: head/lib/libproc/crc32.c (contents, props changed) head/lib/libproc/crc32.h (contents, props changed) Modified: head/lib/libproc/Makefile head/lib/libproc/proc_sym.c Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Tue Dec 6 04:14:20 2016 (r309592) +++ head/lib/libproc/Makefile Tue Dec 6 04:18:09 2016 (r309593) @@ -5,7 +5,8 @@ PACKAGE=lib${LIB} LIB= proc -SRCS= proc_bkpt.c \ +SRCS= crc32.c \ + proc_bkpt.c \ proc_create.c \ proc_regs.c \ proc_sym.c \ Added: head/lib/libproc/crc32.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libproc/crc32.c Tue Dec 6 04:18:09 2016 (r309593) @@ -0,0 +1,57 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +uint32_t crc32_tab[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; Added: head/lib/libproc/crc32.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libproc/crc32.h Tue Dec 6 04:18:09 2016 (r309593) @@ -0,0 +1,28 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + * + * $FreeBSD$ + */ + +#ifndef _CRC32_H_ +#define _CRC32_H_ + +#include /* uint32_t */ +#include /* size_t */ + +extern uint32_t crc32_tab[]; + +static __inline uint32_t +crc32(const void *buf, size_t size) +{ + const uint8_t *p = buf; + uint32_t crc; + + crc = ~0U; + while (size--) + crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + return (crc ^ ~0U); +} + +#endif /* !_CRC32_H_ */ Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Tue Dec 6 04:14:20 2016 (r309592) +++ head/lib/libproc/proc_sym.c Tue Dec 6 04:18:09 2016 (r309593) @@ -51,8 +51,11 @@ __FBSDID("$FreeBSD$"); #endif #include +#include "crc32.h" #include "_libproc.h" +#define PATH_DEBUG_DIR "/usr/lib/debug" + #ifdef NO_CTF typedef struct ctf_file ctf_file_t; #endif @@ -63,6 +66,22 @@ extern char *__cxa_demangle(const char * static void proc_rdl2prmap(rd_loadobj_t *, prmap_t *); +static int +crc32_file(int fd, uint32_t *crc) +{ + uint8_t buf[PAGE_SIZE], *p; + size_t n; + + *crc = ~0; + while ((n = read(fd, buf, sizeof(buf))) > 0) { + p = &buf[0]; + while (n-- > 0) + *crc = crc32_tab[(*crc ^ *p++) & 0xff] ^ (*crc >> 8); + } + *crc = ~*crc; + return (n); +} + static void demangle(const char *symbol, char *buf, size_t len) { @@ -83,18 +102,150 @@ fail: } static int -find_dbg_obj(const char *path) +open_debug_file(char *path, const char *debugfile, uint32_t crc) { + size_t n; + uint32_t compcrc; int fd; - char dbg_path[PATH_MAX]; - snprintf(dbg_path, sizeof(dbg_path), - "/usr/lib/debug/%s.debug", path); - fd = open(dbg_path, O_RDONLY); - if (fd >= 0) + fd = -1; + if ((n = strlcat(path, "/", PATH_MAX)) >= PATH_MAX) return (fd); - else - return (open(path, O_RDONLY)); + if (strlcat(path, debugfile, PATH_MAX) >= PATH_MAX) + goto out; + if ((fd = open(path, O_RDONLY | O_CLOEXEC)) < 0) + goto out; + if (crc32_file(fd, &compcrc) != 0 || crc != compcrc) { + DPRINTFX("ERROR: CRC32 mismatch for %s", path); + (void)close(fd); + fd = -1; + } +out: + path[n] = '\0'; + return (fd); +} + +/* + * Obtain an ELF descriptor for the specified mapped object. If a GNU debuglink + * section is present, a descriptor for the corresponding debug file is + * returned. + */ +static int +open_object(prmap_t *map, Elf **elfp, int *fdp) +{ + char path[PATH_MAX]; + GElf_Shdr shdr; + Elf *e, *e2; + Elf_Data *data; + Elf_Scn *scn; + const char *debugfile, *scnname; + size_t ndx; + uint32_t crc; + int fd, fd2; + + if ((fd = open(map->pr_mapname, O_RDONLY | O_CLOEXEC)) < 0) { + DPRINTF("ERROR: open %s failed", map->pr_mapname); + return (-1); + } + if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { + DPRINTFX("ERROR: elf_begin() failed: %s", elf_errmsg(-1)); + goto err; + } + + scn = NULL; + while ((scn = elf_nextscn(e, scn)) != NULL) { + if (gelf_getshdr(scn, &shdr) != &shdr) { + DPRINTFX("ERROR: gelf_getshdr failed: %s", + elf_errmsg(-1)); + goto err; + } + if (shdr.sh_type != SHT_PROGBITS) + continue; + if (elf_getshdrstrndx(e, &ndx) != 0) { + DPRINTFX("ERROR: elf_getshdrstrndx failed: %s", + elf_errmsg(-1)); + goto err; + } + if ((scnname = elf_strptr(e, ndx, shdr.sh_name)) == NULL) + continue; + + if (strcmp(scnname, ".gnu_debuglink") == 0) + break; + } + if (scn == NULL) + goto internal; + + if ((data = elf_getdata(scn, NULL)) == NULL) { + DPRINTFX("ERROR: elf_getdata failed: %s", elf_errmsg(-1)); + goto err; + } + + /* + * The data contains a null-terminated file name followed by a 4-byte + * CRC. + */ + if (data->d_size < sizeof(crc) + 1) { + DPRINTFX("ERROR: debuglink section is too small (%zd bytes)", + data->d_size); + goto internal; + } + if (strnlen(data->d_buf, data->d_size) >= data->d_size - sizeof(crc)) { + DPRINTFX("ERROR: no null-terminator in gnu_debuglink section"); + goto internal; + } + + debugfile = data->d_buf; + memcpy(&crc, (char *)data->d_buf + data->d_size - sizeof(crc), + sizeof(crc)); + + /* + * Search for the debug file using the algorithm described in the gdb + * documentation: + * - look in the directory containing the object, + * - look in the subdirectory ".debug" of the directory containing the + * object, + * - look in the global debug directories (currently /usr/lib/debug). + */ + (void)strlcpy(path, map->pr_mapname, sizeof(path)); + (void)dirname(path); + + if ((fd2 = open_debug_file(path, debugfile, crc)) >= 0) + goto external; + + if (strlcat(path, "/.debug", sizeof(path)) < sizeof(path) && + (fd2 = open_debug_file(path, debugfile, crc)) >= 0) + goto external; + + (void)snprintf(path, sizeof(path), PATH_DEBUG_DIR); + if (strlcat(path, map->pr_mapname, sizeof(path)) < sizeof(path)) { + (void)dirname(path); + if ((fd2 = open_debug_file(path, debugfile, crc)) >= 0) + goto external; + } + +internal: + /* We didn't find a debug file, just return the object's descriptor. */ + *elfp = e; + *fdp = fd; + return (0); + +external: + if ((e2 = elf_begin(fd2, ELF_C_READ, NULL)) == NULL) { + DPRINTFX("ERROR: elf_begin failed: %s", elf_errmsg(-1)); + (void)close(fd2); + goto err; + } + (void)elf_end(e); + (void)close(fd); + *elfp = e2; + *fdp = fd2; + return (0); + +err: + if (e != NULL) + (void)elf_end(e); + (void)close(fd); + return (-1); } static void @@ -308,19 +459,17 @@ proc_addr2sym(struct proc_handle *p, uin u_long symtabstridx = 0, dynsymstridx = 0; int fd, error = -1; - if ((map = proc_addr2map(p, addr)) == NULL) + if ((map = proc_addr2map(p, addr)) == NULL) { + DPRINTFX("ERROR: proc_addr2map failed to resolve 0x%jx", addr); return (-1); - if ((fd = find_dbg_obj(map->pr_mapname)) < 0) { - DPRINTF("ERROR: open %s failed", map->pr_mapname); - goto err0; } - if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - DPRINTFX("ERROR: elf_begin() failed: %s", elf_errmsg(-1)); - goto err1; + if (open_object(map, &e, &fd) != 0) { + DPRINTFX("ERROR: failed to open object %s", map->pr_mapname); + return (-1); } if (gelf_getehdr(e, &ehdr) == NULL) { DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); - goto err2; + goto err; } /* @@ -354,15 +503,13 @@ proc_addr2sym(struct proc_handle *p, uin error = lookup_addr(e, symtabscn, symtabstridx, off, addr, &s, symcopy); if (error != 0) - goto err2; + goto err; out: demangle(s, name, namesz); -err2: - elf_end(e); -err1: - close(fd); -err0: +err: + (void)elf_end(e); + (void)close(fd); free(map); return (error); } @@ -455,21 +602,18 @@ proc_name2sym(struct proc_handle *p, con int fd, error = -1; if ((map = proc_name2map(p, object)) == NULL) { - DPRINTFX("ERROR: couldn't find object %s", object); - goto err0; - } - if ((fd = find_dbg_obj(map->pr_mapname)) < 0) { - DPRINTF("ERROR: open %s failed", map->pr_mapname); - goto err0; + DPRINTFX("ERROR: proc_name2map failed to resolve %s", object); + return (-1); } - if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - DPRINTFX("ERROR: elf_begin() failed: %s", elf_errmsg(-1)); - goto err1; + if (open_object(map, &e, &fd) != 0) { + DPRINTFX("ERROR: failed to open object %s", map->pr_mapname); + return (-1); } if (gelf_getehdr(e, &ehdr) == NULL) { DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); - goto err2; + goto err; } + /* * Find the index of the STRTAB and SYMTAB sections to locate * symbol names. @@ -505,13 +649,10 @@ out: off = ehdr.e_type == ET_EXEC ? 0 : map->pr_vaddr; symcopy->st_value += off; -err2: - elf_end(e); -err1: - close(fd); -err0: +err: + (void)elf_end(e); + (void)close(fd); free(map); - return (error); } @@ -543,7 +684,7 @@ proc_iter_symbyaddr(struct proc_handle * Elf *e; int i, fd; prmap_t *map; - Elf_Scn *scn, *foundscn = NULL; + Elf_Scn *scn, *foundscn; Elf_Data *data; GElf_Ehdr ehdr; GElf_Shdr shdr; @@ -552,24 +693,22 @@ proc_iter_symbyaddr(struct proc_handle * char *s; int error = -1; - if ((map = proc_name2map(p, object)) == NULL) + if ((map = proc_name2map(p, object)) == NULL) { + DPRINTFX("ERROR: proc_name2map failed to resolve %s", object); return (-1); - if ((fd = find_dbg_obj(map->pr_mapname)) < 0) { - DPRINTF("ERROR: open %s failed", map->pr_mapname); - goto err0; } - if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - DPRINTFX("ERROR: elf_begin() failed: %s", elf_errmsg(-1)); - goto err1; + if (open_object(map, &e, &fd) != 0) { + DPRINTFX("ERROR: failed to open object %s", map->pr_mapname); + return (-1); } if (gelf_getehdr(e, &ehdr) == NULL) { DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); - goto err2; + goto err; } /* * Find the section we are looking for. */ - scn = NULL; + foundscn = scn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { gelf_getshdr(scn, &shdr); if (which == PR_SYMTAB && @@ -587,7 +726,7 @@ proc_iter_symbyaddr(struct proc_handle * stridx = shdr.sh_link; if ((data = elf_getdata(foundscn, NULL)) == NULL) { DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); - goto err2; + goto err; } for (i = 0; gelf_getsym(data, i, &sym) != NULL; i++) { if (GELF_ST_BIND(sym.st_info) == STB_LOCAL && @@ -618,14 +757,12 @@ proc_iter_symbyaddr(struct proc_handle * if (ehdr.e_type != ET_EXEC) sym.st_value += map->pr_vaddr; if ((error = (*func)(cd, &sym, s)) != 0) - goto err2; + goto err; } error = 0; -err2: +err: elf_end(e); -err1: close(fd); -err0: free(map); return (error); } From owner-svn-src-head@freebsd.org Tue Dec 6 04:19:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBBE4C6958B; Tue, 6 Dec 2016 04:19:09 +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 B41C31D0E; Tue, 6 Dec 2016 04:19:09 +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 uB64J9Wi063776; Tue, 6 Dec 2016 04:19:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB64J8oA063771; Tue, 6 Dec 2016 04:19:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612060419.uB64J8oA063771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 04:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309594 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:19:10 -0000 Author: markj Date: Tue Dec 6 04:19:08 2016 New Revision: 309594 URL: https://svnweb.freebsd.org/changeset/base/309594 Log: libproc: Cache ELF handles for loaded objects. libproc previously created a new handle for each symbol lookup, which gives rather egregious performance for DTrace's ustack() action. With this change libproc will cache the libelf descriptor upon access, making lookups much faster in the common case. Modified: head/lib/libproc/_libproc.h head/lib/libproc/libproc.h head/lib/libproc/proc_create.c head/lib/libproc/proc_rtld.c head/lib/libproc/proc_sym.c Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Tue Dec 6 04:18:09 2016 (r309593) +++ head/lib/libproc/_libproc.h Tue Dec 6 04:19:08 2016 (r309594) @@ -32,12 +32,24 @@ #include #include +#include #include #include "libproc.h" struct procstat; +struct file_info { + Elf *elf; + int fd; + u_int refs; +}; + +struct map_info { + prmap_t map; + struct file_info *file; +}; + struct proc_handle { struct proc_handle_public public; /* Public fields. */ int flags; /* Process flags. */ @@ -45,13 +57,13 @@ struct proc_handle { int wstat; /* Process wait status. */ int model; /* Process data model. */ rd_agent_t *rdap; /* librtld_db agent */ - rd_loadobj_t *rdobjs; /* Array of loaded objects. */ - size_t rdobjsz; /* Array size. */ - size_t nobjs; /* Num. objects currently loaded. */ - rd_loadobj_t *rdexec; /* rdobj for program executable. */ - struct lwpstatus lwps; /* Process status. */ + struct map_info *mappings; /* File mappings for proc. */ + size_t maparrsz; /* Map array size. */ + size_t nmappings; /* Number of mappings. */ + prmap_t *exec_map; /* Executable text mapping. */ + lwpstatus_t lwps; /* Process status. */ struct procstat *procstat; /* libprocstat handle. */ - char execpath[MAXPATHLEN]; /* Path to program executable. */ + char execpath[PATH_MAX]; /* Path to program executable. */ }; #ifdef DEBUG Modified: head/lib/libproc/libproc.h ============================================================================== --- head/lib/libproc/libproc.h Tue Dec 6 04:18:09 2016 (r309593) +++ head/lib/libproc/libproc.h Tue Dec 6 04:19:08 2016 (r309594) @@ -131,7 +131,7 @@ char *proc_objname(struct proc_handle *, prmap_t *proc_obj2map(struct proc_handle *, const char *); int proc_iter_objs(struct proc_handle *, proc_map_f *, void *); int proc_iter_symbyaddr(struct proc_handle *, const char *, int, - int, proc_sym_f *, void *); + int, proc_sym_f *, void *); int proc_addr2sym(struct proc_handle *, uintptr_t, char *, size_t, GElf_Sym *); int proc_attach(pid_t pid, int flags, struct proc_handle **pphdl); int proc_continue(struct proc_handle *); Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Tue Dec 6 04:18:09 2016 (r309593) +++ head/lib/libproc/proc_create.c Tue Dec 6 04:19:08 2016 (r309594) @@ -230,8 +230,24 @@ bad: void proc_free(struct proc_handle *phdl) { + struct file_info *file; + size_t i; + for (i = 0; i < phdl->nmappings; i++) { + file = phdl->mappings[i].file; + if (file != NULL && --file->refs == 0) { + if (file->elf != NULL) { + (void)elf_end(file->elf); + (void)close(file->fd); + } + free(file); + } + } + if (phdl->maparrsz > 0) + free(phdl->mappings); if (phdl->procstat != NULL) procstat_close(phdl->procstat); + if (phdl->rdap != NULL) + rd_delete(phdl->rdap); free(phdl); } Modified: head/lib/libproc/proc_rtld.c ============================================================================== --- head/lib/libproc/proc_rtld.c Tue Dec 6 04:18:09 2016 (r309593) +++ head/lib/libproc/proc_rtld.c Tue Dec 6 04:19:08 2016 (r309594) @@ -31,46 +31,99 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include + #include #include "_libproc.h" +static void rdl2prmap(const rd_loadobj_t *, prmap_t *); + static int map_iter(const rd_loadobj_t *lop, void *arg) { - struct proc_handle *phdl = arg; - - if (phdl->nobjs >= phdl->rdobjsz) { - phdl->rdobjsz *= 2; - phdl->rdobjs = reallocf(phdl->rdobjs, sizeof(*phdl->rdobjs) * - phdl->rdobjsz); - if (phdl->rdobjs == NULL) + struct file_info *file; + struct map_info *mapping, *tmp; + struct proc_handle *phdl; + size_t i; + + phdl = arg; + if (phdl->nmappings >= phdl->maparrsz) { + phdl->maparrsz *= 2; + tmp = reallocarray(phdl->mappings, phdl->maparrsz, + sizeof(*phdl->mappings)); + if (tmp == NULL) return (-1); + phdl->mappings = tmp; } + + mapping = &phdl->mappings[phdl->nmappings]; + rdl2prmap(lop, &mapping->map); if (strcmp(lop->rdl_path, phdl->execpath) == 0 && (lop->rdl_prot & RD_RDL_X) != 0) - phdl->rdexec = &phdl->rdobjs[phdl->nobjs]; - memcpy(&phdl->rdobjs[phdl->nobjs++], lop, sizeof(*lop)); + phdl->exec_map = &mapping->map; + file = NULL; + if (lop->rdl_path[0] != '\0') { + /* Look for an existing mapping of the same file. */ + for (i = 0; i < phdl->nmappings; i++) + if (strcmp(mapping->map.pr_mapname, + phdl->mappings[i].map.pr_mapname) == 0) { + file = phdl->mappings[i].file; + break; + } + + if (file == NULL) { + file = malloc(sizeof(*file)); + if (file == NULL) + return (-1); + file->elf = NULL; + file->fd = -1; + file->refs = 1; + } else + file->refs++; + } + mapping->file = file; + phdl->nmappings++; return (0); } +static void +rdl2prmap(const rd_loadobj_t *rdl, prmap_t *map) +{ + + map->pr_vaddr = rdl->rdl_saddr; + map->pr_size = rdl->rdl_eaddr - rdl->rdl_saddr; + map->pr_offset = rdl->rdl_offset; + map->pr_mflags = 0; + if (rdl->rdl_prot & RD_RDL_R) + map->pr_mflags |= MA_READ; + if (rdl->rdl_prot & RD_RDL_W) + map->pr_mflags |= MA_WRITE; + if (rdl->rdl_prot & RD_RDL_X) + map->pr_mflags |= MA_EXEC; + (void)strlcpy(map->pr_mapname, rdl->rdl_path, + sizeof(map->pr_mapname)); +} + rd_agent_t * proc_rdagent(struct proc_handle *phdl) { + if (phdl->rdap == NULL && phdl->status != PS_UNDEAD && phdl->status != PS_IDLE) { - if ((phdl->rdap = rd_new(phdl)) != NULL) { - phdl->rdobjs = malloc(sizeof(*phdl->rdobjs) * 64); - phdl->rdobjsz = 64; - if (phdl->rdobjs == NULL) - return (phdl->rdap); - rd_loadobj_iter(phdl->rdap, map_iter, phdl); - } - } + if ((phdl->rdap = rd_new(phdl)) == NULL) + return (NULL); + phdl->maparrsz = 64; + phdl->mappings = calloc(phdl->maparrsz, + sizeof(*phdl->mappings)); + if (phdl->mappings == NULL) + return (phdl->rdap); + if (rd_loadobj_iter(phdl->rdap, map_iter, phdl) != RD_OK) + return (NULL); + } return (phdl->rdap); } @@ -78,7 +131,6 @@ void proc_updatesyms(struct proc_handle *phdl) { - memset(phdl->rdobjs, 0, sizeof(*phdl->rdobjs) * phdl->rdobjsz); - phdl->nobjs = 0; + memset(phdl->mappings, 0, sizeof(*phdl->mappings) * phdl->maparrsz); rd_loadobj_iter(phdl->rdap, map_iter, phdl); } Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Tue Dec 6 04:18:09 2016 (r309593) +++ head/lib/libproc/proc_sym.c Tue Dec 6 04:19:08 2016 (r309594) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2016 Mark Johnston * Copyright (c) 2010 The FreeBSD Foundation * Copyright (c) 2008 John Birrell (jb@freebsd.org) * All rights reserved. @@ -64,8 +65,6 @@ typedef struct ctf_file ctf_file_t; extern char *__cxa_demangle(const char *, char *, size_t *, int *); #endif /* NO_CXA_DEMANGLE */ -static void proc_rdl2prmap(rd_loadobj_t *, prmap_t *); - static int crc32_file(int fd, uint32_t *crc) { @@ -131,18 +130,27 @@ out: * returned. */ static int -open_object(prmap_t *map, Elf **elfp, int *fdp) +open_object(struct map_info *mapping) { char path[PATH_MAX]; GElf_Shdr shdr; Elf *e, *e2; Elf_Data *data; Elf_Scn *scn; + struct file_info *file; + prmap_t *map; const char *debugfile, *scnname; size_t ndx; uint32_t crc; int fd, fd2; + if (mapping->map.pr_mapname[0] == '\0') + return (-1); /* anonymous object */ + if (mapping->file->elf != NULL) + return (0); /* already loaded */ + + file = mapping->file; + map = &mapping->map; if ((fd = open(map->pr_mapname, O_RDONLY | O_CLOEXEC)) < 0) { DPRINTF("ERROR: open %s failed", map->pr_mapname); return (-1); @@ -225,8 +233,8 @@ open_object(prmap_t *map, Elf **elfp, in internal: /* We didn't find a debug file, just return the object's descriptor. */ - *elfp = e; - *fdp = fd; + file->elf = e; + file->fd = fd; return (0); external: @@ -237,8 +245,8 @@ external: } (void)elf_end(e); (void)close(fd); - *elfp = e2; - *fdp = fd2; + file->elf = e2; + file->fd = fd2; return (0); err: @@ -248,166 +256,107 @@ err: return (-1); } -static void -proc_rdl2prmap(rd_loadobj_t *rdl, prmap_t *map) -{ - map->pr_vaddr = rdl->rdl_saddr; - map->pr_size = rdl->rdl_eaddr - rdl->rdl_saddr; - map->pr_offset = rdl->rdl_offset; - map->pr_mflags = 0; - if (rdl->rdl_prot & RD_RDL_R) - map->pr_mflags |= MA_READ; - if (rdl->rdl_prot & RD_RDL_W) - map->pr_mflags |= MA_WRITE; - if (rdl->rdl_prot & RD_RDL_X) - map->pr_mflags |= MA_EXEC; - strlcpy(map->pr_mapname, rdl->rdl_path, - sizeof(map->pr_mapname)); -} - char * proc_objname(struct proc_handle *p, uintptr_t addr, char *objname, size_t objnamesz) { + prmap_t *map; size_t i; - rd_loadobj_t *rdl; - for (i = 0; i < p->nobjs; i++) { - rdl = &p->rdobjs[i]; - if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) { - strlcpy(objname, rdl->rdl_path, objnamesz); + for (i = 0; i < p->nmappings; i++) { + map = &p->mappings[i].map; + if (addr >= map->pr_vaddr && + addr < map->pr_vaddr + map->pr_size) { + strlcpy(objname, map->pr_mapname, objnamesz); return (objname); } } return (NULL); } +/* + * Currently just returns the first mapping of the named object, effectively + * what Plmid_to_map(p, PR_LMID_EVERY, objname) does in illumos libproc. + */ prmap_t * proc_obj2map(struct proc_handle *p, const char *objname) { - size_t i; + char path[PATH_MAX], *base; prmap_t *map; - rd_loadobj_t *rdl; - char path[MAXPATHLEN]; + size_t i; - rdl = NULL; - for (i = 0; i < p->nobjs; i++) { - basename_r(p->rdobjs[i].rdl_path, path); - if (strcmp(path, objname) == 0) { - rdl = &p->rdobjs[i]; + map = NULL; + for (i = 0; i < p->nmappings; i++) { + strlcpy(path, p->mappings[i].map.pr_mapname, sizeof(path)); + base = basename(path); + if (strcmp(base, objname) == 0) { + map = &p->mappings[i].map; break; } } - if (rdl == NULL) { - if (strcmp(objname, "a.out") == 0 && p->rdexec != NULL) - rdl = p->rdexec; - else - return (NULL); - } - - if ((map = malloc(sizeof(*map))) == NULL) - return (NULL); - proc_rdl2prmap(rdl, map); + if (map == NULL && strcmp(objname, "a.out") == 0 && p->exec_map != NULL) + map = p->exec_map; return (map); } int proc_iter_objs(struct proc_handle *p, proc_map_f *func, void *cd) { + char last[MAXPATHLEN], path[MAXPATHLEN], *base; + prmap_t *map; size_t i; - rd_loadobj_t *rdl; - prmap_t map; - char path[MAXPATHLEN]; - char last[MAXPATHLEN]; int error; - if (p->nobjs == 0) - return (-1); + if (p->nmappings == 0) + if (proc_rdagent(p) == NULL) + return (-1); error = 0; memset(last, 0, sizeof(last)); - for (i = 0; i < p->nobjs; i++) { - rdl = &p->rdobjs[i]; - proc_rdl2prmap(rdl, &map); - basename_r(rdl->rdl_path, path); + for (i = 0; i < p->nmappings; i++) { + map = &p->mappings[i].map; + strlcpy(path, map->pr_mapname, sizeof(path)); + base = basename(path); /* * We shouldn't call the callback twice with the same object. * To do that we are assuming the fact that if there are * repeated object names (i.e. different mappings for the * same object) they occur next to each other. */ - if (strcmp(path, last) == 0) + if (strcmp(base, last) == 0) continue; - if ((error = (*func)(cd, &map, path)) != 0) + if ((error = (*func)(cd, map, base)) != 0) break; strlcpy(last, path, sizeof(last)); } return (error); } -prmap_t * -proc_addr2map(struct proc_handle *p, uintptr_t addr) +static struct map_info * +_proc_addr2map(struct proc_handle *p, uintptr_t addr) { + struct map_info *mapping; size_t i; - int cnt, lastvn = 0; - prmap_t *map; - rd_loadobj_t *rdl; - struct kinfo_vmentry *kves, *kve; - /* - * If we don't have a cache of listed objects, we need to query - * it ourselves. - */ - if (p->nobjs == 0) { - if ((kves = kinfo_getvmmap(proc_getpid(p), &cnt)) == NULL) + if (p->nmappings == 0) + if (proc_rdagent(p) == NULL) return (NULL); - for (i = 0; i < (size_t)cnt; i++) { - kve = kves + i; - if (kve->kve_type == KVME_TYPE_VNODE) - lastvn = i; - if (addr >= kve->kve_start && addr < kve->kve_end) { - if ((map = malloc(sizeof(*map))) == NULL) { - free(kves); - return (NULL); - } - map->pr_vaddr = kve->kve_start; - map->pr_size = kve->kve_end - kve->kve_start; - map->pr_offset = kve->kve_offset; - map->pr_mflags = 0; - if (kve->kve_protection & KVME_PROT_READ) - map->pr_mflags |= MA_READ; - if (kve->kve_protection & KVME_PROT_WRITE) - map->pr_mflags |= MA_WRITE; - if (kve->kve_protection & KVME_PROT_EXEC) - map->pr_mflags |= MA_EXEC; - if (kve->kve_flags & KVME_FLAG_COW) - map->pr_mflags |= MA_COW; - if (kve->kve_flags & KVME_FLAG_NEEDS_COPY) - map->pr_mflags |= MA_NEEDS_COPY; - if (kve->kve_flags & KVME_FLAG_NOCOREDUMP) - map->pr_mflags |= MA_NOCOREDUMP; - strlcpy(map->pr_mapname, kves[lastvn].kve_path, - sizeof(map->pr_mapname)); - free(kves); - return (map); - } - } - free(kves); - return (NULL); - } - - for (i = 0; i < p->nobjs; i++) { - rdl = &p->rdobjs[i]; - if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) { - if ((map = malloc(sizeof(*map))) == NULL) - return (NULL); - proc_rdl2prmap(rdl, map); - return (map); - } + for (i = 0; i < p->nmappings; i++) { + mapping = &p->mappings[i]; + if (addr >= mapping->map.pr_vaddr && + addr < mapping->map.pr_vaddr + mapping->map.pr_size) + return (mapping); } return (NULL); } +prmap_t * +proc_addr2map(struct proc_handle *p, uintptr_t addr) +{ + + return (&_proc_addr2map(p, addr)->map); +} + /* * Look up the symbol at addr, returning a copy of the symbol and its name. */ @@ -452,21 +401,23 @@ proc_addr2sym(struct proc_handle *p, uin GElf_Ehdr ehdr; GElf_Shdr shdr; Elf *e; - Elf_Scn *scn, *dynsymscn = NULL, *symtabscn = NULL; - prmap_t *map; + Elf_Scn *scn, *dynsymscn, *symtabscn; + struct map_info *mapping; const char *s; uintptr_t off; - u_long symtabstridx = 0, dynsymstridx = 0; - int fd, error = -1; + u_long symtabstridx, dynsymstridx; + int error = -1; - if ((map = proc_addr2map(p, addr)) == NULL) { + if ((mapping = _proc_addr2map(p, addr)) == NULL) { DPRINTFX("ERROR: proc_addr2map failed to resolve 0x%jx", addr); return (-1); } - if (open_object(map, &e, &fd) != 0) { - DPRINTFX("ERROR: failed to open object %s", map->pr_mapname); + if (open_object(mapping) != 0) { + DPRINTFX("ERROR: failed to open object %s", + mapping->map.pr_mapname); return (-1); } + e = mapping->file->elf; if (gelf_getehdr(e, &ehdr) == NULL) { DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); goto err; @@ -476,7 +427,8 @@ proc_addr2sym(struct proc_handle *p, uin * Find the index of the STRTAB and SYMTAB sections to locate * symbol names. */ - scn = NULL; + symtabstridx = dynsymstridx = 0; + scn = dynsymscn = symtabscn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { gelf_getshdr(scn, &shdr); switch (shdr.sh_type) { @@ -491,7 +443,7 @@ proc_addr2sym(struct proc_handle *p, uin } } - off = ehdr.e_type == ET_EXEC ? 0 : map->pr_vaddr; + off = ehdr.e_type == ET_EXEC ? 0 : mapping->map.pr_vaddr; /* * First look up the symbol in the dynsymtab, and fall back to the @@ -508,56 +460,39 @@ proc_addr2sym(struct proc_handle *p, uin out: demangle(s, name, namesz); err: - (void)elf_end(e); - (void)close(fd); - free(map); return (error); } -prmap_t * -proc_name2map(struct proc_handle *p, const char *name) +static struct map_info * +_proc_name2map(struct proc_handle *p, const char *name) { + char path[MAXPATHLEN], *base; + struct map_info *mapping; size_t i; - int cnt; - prmap_t *map = NULL; - char tmppath[MAXPATHLEN]; - struct kinfo_vmentry *kves, *kve; - rd_loadobj_t *rdl; - /* - * If we haven't iterated over the list of loaded objects, - * librtld_db isn't yet initialized and it's very likely - * that librtld_db called us. We need to do the heavy - * lifting here to find the symbol librtld_db is looking for. - */ - if (p->nobjs == 0) { - if ((kves = kinfo_getvmmap(proc_getpid(p), &cnt)) == NULL) + mapping = NULL; + if (p->nmappings == 0) + if (proc_rdagent(p) == NULL) return (NULL); - for (i = 0; i < (size_t)cnt; i++) { - kve = kves + i; - basename_r(kve->kve_path, tmppath); - if (strcmp(tmppath, name) == 0) { - map = proc_addr2map(p, kve->kve_start); - break; - } - } - free(kves); - } else - for (i = 0; i < p->nobjs; i++) { - rdl = &p->rdobjs[i]; - basename_r(rdl->rdl_path, tmppath); - if (strcmp(tmppath, name) == 0) { - if ((map = malloc(sizeof(*map))) == NULL) - return (NULL); - proc_rdl2prmap(rdl, map); - break; - } - } + for (i = 0; i < p->nmappings; i++) { + mapping = &p->mappings[i]; + (void)strlcpy(path, mapping->map.pr_mapname, sizeof(path)); + base = basename(path); + if (strcmp(base, name) == 0) + break; + } + if (i == p->nmappings) + mapping = NULL; + if (mapping == NULL && strcmp(name, "a.out") == 0) + mapping = _proc_addr2map(p, p->exec_map->pr_vaddr); + return (mapping); +} - if (map == NULL && strcmp(name, "a.out") == 0 && p->rdexec != NULL) - map = proc_addr2map(p, p->rdexec->rdl_saddr); +prmap_t * +proc_name2map(struct proc_handle *p, const char *name) +{ - return (map); + return (&_proc_name2map(p, name)->map); } /* @@ -592,23 +527,25 @@ int proc_name2sym(struct proc_handle *p, const char *object, const char *symbol, GElf_Sym *symcopy, prsyminfo_t *si) { - Elf *e; - Elf_Scn *scn, *dynsymscn = NULL, *symtabscn = NULL; - GElf_Shdr shdr; GElf_Ehdr ehdr; - prmap_t *map; + GElf_Shdr shdr; + Elf *e; + Elf_Scn *scn, *dynsymscn, *symtabscn; + struct map_info *mapping; uintptr_t off; - u_long symtabstridx = 0, dynsymstridx = 0; - int fd, error = -1; + u_long symtabstridx, dynsymstridx; + int error = -1; - if ((map = proc_name2map(p, object)) == NULL) { + if ((mapping = _proc_name2map(p, object)) == NULL) { DPRINTFX("ERROR: proc_name2map failed to resolve %s", object); return (-1); } - if (open_object(map, &e, &fd) != 0) { - DPRINTFX("ERROR: failed to open object %s", map->pr_mapname); + if (open_object(mapping) != 0) { + DPRINTFX("ERROR: failed to open object %s", + mapping->map.pr_mapname); return (-1); } + e = mapping->file->elf; if (gelf_getehdr(e, &ehdr) == NULL) { DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); goto err; @@ -618,7 +555,8 @@ proc_name2sym(struct proc_handle *p, con * Find the index of the STRTAB and SYMTAB sections to locate * symbol names. */ - scn = NULL; + symtabstridx = dynsymstridx = 0; + scn = dynsymscn = symtabscn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { gelf_getshdr(scn, &shdr); switch (shdr.sh_type) { @@ -646,13 +584,10 @@ proc_name2sym(struct proc_handle *p, con goto out; out: - off = ehdr.e_type == ET_EXEC ? 0 : map->pr_vaddr; + off = ehdr.e_type == ET_EXEC ? 0 : mapping->map.pr_vaddr; symcopy->st_value += off; err: - (void)elf_end(e); - (void)close(fd); - free(map); return (error); } @@ -668,7 +603,6 @@ proc_name2ctf(struct proc_handle *p, con return (NULL); ctf = ctf_open(map->pr_mapname, &error); - free(map); return (ctf); #else (void)p; @@ -681,26 +615,27 @@ int proc_iter_symbyaddr(struct proc_handle *p, const char *object, int which, int mask, proc_sym_f *func, void *cd) { - Elf *e; - int i, fd; - prmap_t *map; - Elf_Scn *scn, *foundscn; - Elf_Data *data; GElf_Ehdr ehdr; GElf_Shdr shdr; GElf_Sym sym; - unsigned long stridx = -1; + Elf *e; + Elf_Scn *scn, *foundscn; + Elf_Data *data; + struct map_info *mapping; char *s; - int error = -1; + unsigned long stridx = -1; + int error = -1, i; - if ((map = proc_name2map(p, object)) == NULL) { + if ((mapping = _proc_name2map(p, object)) == NULL) { DPRINTFX("ERROR: proc_name2map failed to resolve %s", object); return (-1); } - if (open_object(map, &e, &fd) != 0) { - DPRINTFX("ERROR: failed to open object %s", map->pr_mapname); + if (open_object(mapping) != 0) { + DPRINTFX("ERROR: failed to open object %s", + mapping->map.pr_mapname); return (-1); } + e = mapping->file->elf; if (gelf_getehdr(e, &ehdr) == NULL) { DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); goto err; @@ -755,14 +690,11 @@ proc_iter_symbyaddr(struct proc_handle * continue; s = elf_strptr(e, stridx, sym.st_name); if (ehdr.e_type != ET_EXEC) - sym.st_value += map->pr_vaddr; + sym.st_value += mapping->map.pr_vaddr; if ((error = (*func)(cd, &sym, s)) != 0) goto err; } error = 0; err: - elf_end(e); - close(fd); - free(map); return (error); } From owner-svn-src-head@freebsd.org Tue Dec 6 04:20:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAC0EC69650; Tue, 6 Dec 2016 04:20:33 +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 9B9501ED8; Tue, 6 Dec 2016 04:20:33 +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 uB64KWlk063888; Tue, 6 Dec 2016 04:20:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB64KWWS063884; Tue, 6 Dec 2016 04:20:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612060420.uB64KWWS063884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 04:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309595 - in head: cddl/lib/libdtrace lib/libproc lib/libproc/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:20:34 -0000 Author: markj Date: Tue Dec 6 04:20:32 2016 New Revision: 309595 URL: https://svnweb.freebsd.org/changeset/base/309595 Log: libproc: Match prefixes when looking up mapped object by name. When looking up an object by name, allow prefix matches if no direct match is found. This allows one to, for example, match libc entry probes with: # dtrace -n 'pid$target:libc.so::entry' -c ./foo instead of requiring "libc.so.7" or a glob. Also remove proc_obj2map() as it currently just duplicates the functionality of proc_name2map(). It's supposed to take a Solaris link-map ID as a paramter, but support for this isn't implemented and isn't required to support DTrace's pid provider. Modified: head/cddl/lib/libdtrace/libproc_compat.h head/lib/libproc/libproc.h head/lib/libproc/proc_sym.c head/lib/libproc/tests/proc_test.c Modified: head/cddl/lib/libdtrace/libproc_compat.h ============================================================================== --- head/cddl/lib/libdtrace/libproc_compat.h Tue Dec 6 04:19:08 2016 (r309594) +++ head/cddl/lib/libdtrace/libproc_compat.h Tue Dec 6 04:20:32 2016 (r309595) @@ -44,7 +44,7 @@ #define Pdelbkpt proc_bkptdel #define Pgrab_error strerror #define Plmid(p, a, l) (-1) -#define Plmid_to_map(p, l, o) proc_obj2map((p), (o)) +#define Plmid_to_map(p, l, o) proc_name2map(p, o) #define Plookup_by_addr proc_addr2sym #define Pname_to_ctf(p, obj) (ctf_file_t *)proc_name2ctf(p, obj) #define Pname_to_map proc_name2map Modified: head/lib/libproc/libproc.h ============================================================================== --- head/lib/libproc/libproc.h Tue Dec 6 04:19:08 2016 (r309594) +++ head/lib/libproc/libproc.h Tue Dec 6 04:20:32 2016 (r309595) @@ -128,7 +128,6 @@ __BEGIN_DECLS prmap_t *proc_addr2map(struct proc_handle *, uintptr_t); prmap_t *proc_name2map(struct proc_handle *, const char *); char *proc_objname(struct proc_handle *, uintptr_t, char *, size_t); -prmap_t *proc_obj2map(struct proc_handle *, const char *); int proc_iter_objs(struct proc_handle *, proc_map_f *, void *); int proc_iter_symbyaddr(struct proc_handle *, const char *, int, int, proc_sym_f *, void *); Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Tue Dec 6 04:19:08 2016 (r309594) +++ head/lib/libproc/proc_sym.c Tue Dec 6 04:20:32 2016 (r309595) @@ -274,31 +274,6 @@ proc_objname(struct proc_handle *p, uint return (NULL); } -/* - * Currently just returns the first mapping of the named object, effectively - * what Plmid_to_map(p, PR_LMID_EVERY, objname) does in illumos libproc. - */ -prmap_t * -proc_obj2map(struct proc_handle *p, const char *objname) -{ - char path[PATH_MAX], *base; - prmap_t *map; - size_t i; - - map = NULL; - for (i = 0; i < p->nmappings; i++) { - strlcpy(path, p->mappings[i].map.pr_mapname, sizeof(path)); - base = basename(path); - if (strcmp(base, objname) == 0) { - map = &p->mappings[i].map; - break; - } - } - if (map == NULL && strcmp(objname, "a.out") == 0 && p->exec_map != NULL) - map = p->exec_map; - return (map); -} - int proc_iter_objs(struct proc_handle *p, proc_map_f *func, void *cd) { @@ -468,9 +443,10 @@ _proc_name2map(struct proc_handle *p, co { char path[MAXPATHLEN], *base; struct map_info *mapping; - size_t i; + size_t i, len; - mapping = NULL; + if ((len = strlen(name)) == 0) + return (NULL); if (p->nmappings == 0) if (proc_rdagent(p) == NULL) return (NULL); @@ -479,13 +455,18 @@ _proc_name2map(struct proc_handle *p, co (void)strlcpy(path, mapping->map.pr_mapname, sizeof(path)); base = basename(path); if (strcmp(base, name) == 0) - break; + return (mapping); + } + /* If we didn't find a match, try matching prefixes of the basename. */ + for (i = 0; i < p->nmappings; i++) { + strlcpy(path, p->mappings[i].map.pr_mapname, sizeof(path)); + base = basename(path); + if (strncmp(base, name, len) == 0) + return (&p->mappings[i]); } - if (i == p->nmappings) - mapping = NULL; - if (mapping == NULL && strcmp(name, "a.out") == 0) - mapping = _proc_addr2map(p, p->exec_map->pr_vaddr); - return (mapping); + if (strcmp(name, "a.out") == 0) + return (_proc_addr2map(p, p->exec_map->pr_vaddr)); + return (NULL); } prmap_t * Modified: head/lib/libproc/tests/proc_test.c ============================================================================== --- head/lib/libproc/tests/proc_test.c Tue Dec 6 04:19:08 2016 (r309594) +++ head/lib/libproc/tests/proc_test.c Tue Dec 6 04:20:32 2016 (r309595) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014, 2015 Mark Johnston + * Copyright (c) 2014-2016 Mark Johnston * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -152,15 +152,15 @@ verify_bkpt(struct proc_handle *phdl, GE "expected map name '%s' doesn't match '%s'", mapname, mapbname); } -ATF_TC(map_alias_obj2map); -ATF_TC_HEAD(map_alias_obj2map, tc) +ATF_TC(map_alias_name2map); +ATF_TC_HEAD(map_alias_name2map, tc) { atf_tc_set_md_var(tc, "descr", "Callers are supposed to be able to use \"a.out\" as an alias for " - "the program executable. Make sure that proc_obj2map() handles " + "the program executable. Make sure that proc_name2map() handles " "this properly."); } -ATF_TC_BODY(map_alias_obj2map, tc) +ATF_TC_BODY(map_alias_name2map, tc) { struct proc_handle *phdl; prmap_t *map1, *map2; @@ -171,10 +171,10 @@ ATF_TC_BODY(map_alias_obj2map, tc) (void)proc_rdagent(phdl); /* Ensure that "target_prog" and "a.out" return the same map. */ - map1 = proc_obj2map(phdl, target_prog_file); + map1 = proc_name2map(phdl, target_prog_file); ATF_REQUIRE_MSG(map1 != NULL, "failed to look up map for '%s'", target_prog_file); - map2 = proc_obj2map(phdl, aout_object); + map2 = proc_name2map(phdl, aout_object); ATF_REQUIRE_MSG(map2 != NULL, "failed to look up map for '%s'", aout_object); ATF_CHECK_EQ(strcmp(map1->pr_mapname, map2->pr_mapname), 0); @@ -184,15 +184,14 @@ ATF_TC_BODY(map_alias_obj2map, tc) proc_free(phdl); } -ATF_TC(map_alias_name2map); -ATF_TC_HEAD(map_alias_name2map, tc) +ATF_TC(map_prefix_name2map); +ATF_TC_HEAD(map_prefix_name2map, tc) { atf_tc_set_md_var(tc, "descr", - "Callers are supposed to be able to use \"a.out\" as an alias for " - "the program executable. Make sure that proc_name2map() handles " - "this properly."); + "Verify that proc_name2map() returns prefix matches of the " + "basename of loaded objects if no full matches are found."); } -ATF_TC_BODY(map_alias_name2map, tc) +ATF_TC_BODY(map_prefix_name2map, tc) { struct proc_handle *phdl; prmap_t *map1, *map2; @@ -202,13 +201,11 @@ ATF_TC_BODY(map_alias_name2map, tc) /* Initialize the rtld_db handle. */ (void)proc_rdagent(phdl); - /* Ensure that "target_prog" and "a.out" return the same map. */ - map1 = proc_name2map(phdl, target_prog_file); - ATF_REQUIRE_MSG(map1 != NULL, "failed to look up map for '%s'", - target_prog_file); - map2 = proc_name2map(phdl, aout_object); - ATF_REQUIRE_MSG(map2 != NULL, "failed to look up map for '%s'", - aout_object); + /* Make sure that "ld-elf" and "ld-elf.so" return the same map. */ + map1 = proc_name2map(phdl, "ld-elf"); + ATF_REQUIRE_MSG(map1 != NULL, "failed to look up map for 'ld-elf'"); + map2 = proc_name2map(phdl, "ld-elf.so"); + ATF_REQUIRE_MSG(map2 != NULL, "failed to look up map for 'ld-elf.so'"); ATF_CHECK_EQ(strcmp(map1->pr_mapname, map2->pr_mapname), 0); ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); @@ -315,7 +312,7 @@ ATF_TC_BODY(symbol_lookup_fail, tc) /* Initialize the rtld_db handle. */ (void)proc_rdagent(phdl); - map = proc_obj2map(phdl, target_prog_file); + map = proc_name2map(phdl, target_prog_file); ATF_REQUIRE_MSG(map != NULL, "failed to look up map for '%s'", target_prog_file); @@ -376,8 +373,8 @@ ATF_TC_BODY(signal_forward, tc) ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, map_alias_obj2map); ATF_TP_ADD_TC(tp, map_alias_name2map); + ATF_TP_ADD_TC(tp, map_prefix_name2map); ATF_TP_ADD_TC(tp, map_alias_name2sym); ATF_TP_ADD_TC(tp, symbol_lookup); ATF_TP_ADD_TC(tp, symbol_lookup_fail); From owner-svn-src-head@freebsd.org Tue Dec 6 04:21:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6087C698A7; Tue, 6 Dec 2016 04:21:36 +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 751FA613; Tue, 6 Dec 2016 04:21:36 +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 uB64LZsO064619; Tue, 6 Dec 2016 04:21:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB64LZaf064616; Tue, 6 Dec 2016 04:21:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612060421.uB64LZaf064616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 04:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309596 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:21:36 -0000 Author: markj Date: Tue Dec 6 04:21:35 2016 New Revision: 309596 URL: https://svnweb.freebsd.org/changeset/base/309596 Log: libproc: Cache symbol tables for mapped objects upon access. Extend the file handle cache entries to include symbol tables as well. An index is used to implement binary search by symbol value. Lookups by name are comparatively rare and are thus still implemented with a linear search, but support for a binary search by name would be straightforward to add if needed. Modified: head/lib/libproc/_libproc.h head/lib/libproc/proc_create.c head/lib/libproc/proc_sym.c Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Tue Dec 6 04:20:32 2016 (r309595) +++ head/lib/libproc/_libproc.h Tue Dec 6 04:21:35 2016 (r309596) @@ -39,10 +39,22 @@ struct procstat; +struct symtab { + Elf_Data *data; + u_int nsyms; + u_int *index; + u_long stridx; +}; + struct file_info { Elf *elf; int fd; u_int refs; + GElf_Ehdr ehdr; + + /* Symbol tables, sorted by value. */ + struct symtab dynsymtab; + struct symtab symtab; }; struct map_info { Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Tue Dec 6 04:20:32 2016 (r309595) +++ head/lib/libproc/proc_create.c Tue Dec 6 04:21:35 2016 (r309596) @@ -239,6 +239,10 @@ proc_free(struct proc_handle *phdl) if (file->elf != NULL) { (void)elf_end(file->elf); (void)close(file->fd); + if (file->symtab.nsyms > 0) + free(file->symtab.index); + if (file->dynsymtab.nsyms > 0) + free(file->dynsymtab.index); } free(file); } Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Tue Dec 6 04:20:32 2016 (r309595) +++ head/lib/libproc/proc_sym.c Tue Dec 6 04:21:35 2016 (r309596) @@ -101,6 +101,74 @@ fail: } static int +symvalcomp(void *thunk, const void *a1, const void *a2) +{ + struct symtab *symtab; + GElf_Sym sym1, sym2; + u_int i1, i2; + int ret; + + i1 = *(const u_int *)a1; + i2 = *(const u_int *)a2; + symtab = thunk; + + (void)gelf_getsym(symtab->data, i1, &sym1); + (void)gelf_getsym(symtab->data, i2, &sym2); + if (sym1.st_value < sym2.st_value) + ret = -1; + else if (sym1.st_value == sym2.st_value) + ret = 0; + else + ret = 1; + return (ret); +} + +static int +load_symtab(Elf *e, struct symtab *symtab, u_long sh_type) +{ + GElf_Ehdr ehdr; + GElf_Shdr shdr; + Elf_Scn *scn; + u_int nsyms; + + if (gelf_getehdr(e, &ehdr) == NULL) + return (-1); + + scn = NULL; + while ((scn = elf_nextscn(e, scn)) != NULL) { + (void)gelf_getshdr(scn, &shdr); + if (shdr.sh_type == sh_type) + break; + } + if (scn == NULL) + return (-1); + + if ((symtab->data = elf_getdata(scn, NULL)) == NULL) + return (-1); + + nsyms = shdr.sh_size / shdr.sh_entsize; + + symtab->index = calloc(nsyms, sizeof(u_int)); + if (symtab->index == NULL) + return (-1); + for (u_int i = 0; i < nsyms; i++) + symtab->index[i] = i; + qsort_r(symtab->index, nsyms, sizeof(u_int), symtab, symvalcomp); + symtab->nsyms = nsyms; + symtab->stridx = shdr.sh_link; + return (0); +} + +static void +load_symtabs(struct file_info *file) +{ + + file->symtab.nsyms = file->dynsymtab.nsyms = 0; + (void)load_symtab(file->elf, &file->symtab, SHT_SYMTAB); + (void)load_symtab(file->elf, &file->dynsymtab, SHT_DYNSYM); +} + +static int open_debug_file(char *path, const char *debugfile, uint32_t crc) { size_t n; @@ -159,6 +227,10 @@ open_object(struct map_info *mapping) DPRINTFX("ERROR: elf_begin() failed: %s", elf_errmsg(-1)); goto err; } + if (gelf_getehdr(e, &file->ehdr) != &file->ehdr) { + DPRINTFX("ERROR: elf_getehdr() failed: %s", elf_errmsg(-1)); + goto err; + } scn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { @@ -235,6 +307,7 @@ internal: /* We didn't find a debug file, just return the object's descriptor. */ file->elf = e; file->fd = fd; + load_symtabs(file); return (0); external: @@ -247,6 +320,7 @@ external: (void)close(fd); file->elf = e2; file->fd = fd2; + load_symtabs(file); return (0); err: @@ -333,55 +407,49 @@ proc_addr2map(struct proc_handle *p, uin } /* - * Look up the symbol at addr, returning a copy of the symbol and its name. + * Look up the symbol at addr using a binary search, returning a copy of the + * symbol and its name. */ static int -lookup_addr(Elf *e, Elf_Scn *scn, u_long stridx, uintptr_t off, uintptr_t addr, - const char **name, GElf_Sym *symcopy) +lookup_symbol_by_addr(Elf *elf, struct symtab *symtab, uintptr_t addr, + const char **namep, GElf_Sym *sym) { - GElf_Sym sym; Elf_Data *data; const char *s; - uint64_t rsym; - int i; + int min, max, mid; - if ((data = elf_getdata(scn, NULL)) == NULL) { - DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); - return (1); - } - for (i = 0; gelf_getsym(data, i, &sym) != NULL; i++) { - rsym = off + sym.st_value; - if (addr >= rsym && addr < rsym + sym.st_size) { - s = elf_strptr(e, stridx, sym.st_name); - if (s != NULL) { - *name = s; - memcpy(symcopy, &sym, sizeof(*symcopy)); - /* - * DTrace expects the st_value to contain - * only the address relative to the start of - * the function. - */ - symcopy->st_value = rsym; - return (0); - } + data = symtab->data; + min = 0; + max = symtab->nsyms - 1; + + while (min <= max) { + mid = (max + min) / 2; + (void)gelf_getsym(data, symtab->index[mid], sym); + if (addr >= sym->st_value && + addr < sym->st_value + sym->st_size) { + s = elf_strptr(elf, symtab->stridx, sym->st_name); + if (s != NULL && namep != NULL) + *namep = s; + return (0); } + + if (addr < sym->st_value) + max = mid - 1; + else + min = mid + 1; } - return (1); + return (ENOENT); } int proc_addr2sym(struct proc_handle *p, uintptr_t addr, char *name, size_t namesz, GElf_Sym *symcopy) { - GElf_Ehdr ehdr; - GElf_Shdr shdr; - Elf *e; - Elf_Scn *scn, *dynsymscn, *symtabscn; + struct file_info *file; struct map_info *mapping; const char *s; uintptr_t off; - u_long symtabstridx, dynsymstridx; - int error = -1; + int error; if ((mapping = _proc_addr2map(p, addr)) == NULL) { DPRINTFX("ERROR: proc_addr2map failed to resolve 0x%jx", addr); @@ -392,49 +460,22 @@ proc_addr2sym(struct proc_handle *p, uin mapping->map.pr_mapname); return (-1); } - e = mapping->file->elf; - if (gelf_getehdr(e, &ehdr) == NULL) { - DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); - goto err; - } - /* - * Find the index of the STRTAB and SYMTAB sections to locate - * symbol names. - */ - symtabstridx = dynsymstridx = 0; - scn = dynsymscn = symtabscn = NULL; - while ((scn = elf_nextscn(e, scn)) != NULL) { - gelf_getshdr(scn, &shdr); - switch (shdr.sh_type) { - case SHT_SYMTAB: - symtabscn = scn; - symtabstridx = shdr.sh_link; - break; - case SHT_DYNSYM: - dynsymscn = scn; - dynsymstridx = shdr.sh_link; - break; - } + file = mapping->file; + off = file->ehdr.e_type == ET_DYN ? mapping->map.pr_vaddr : 0; + if (addr < off) + return (ENOENT); + addr -= off; + + error = lookup_symbol_by_addr(file->elf, &file->dynsymtab, addr, &s, + symcopy); + if (error == ENOENT) + error = lookup_symbol_by_addr(file->elf, &file->symtab, addr, + &s, symcopy); + if (error == 0) { + symcopy->st_value += off; + demangle(s, name, namesz); } - - off = ehdr.e_type == ET_EXEC ? 0 : mapping->map.pr_vaddr; - - /* - * First look up the symbol in the dynsymtab, and fall back to the - * symtab if the lookup fails. - */ - error = lookup_addr(e, dynsymscn, dynsymstridx, off, addr, &s, symcopy); - if (error == 0) - goto out; - - error = lookup_addr(e, symtabscn, symtabstridx, off, addr, &s, symcopy); - if (error != 0) - goto err; - -out: - demangle(s, name, namesz); -err: return (error); } @@ -480,7 +521,7 @@ proc_name2map(struct proc_handle *p, con * Look up the symbol with the given name and return a copy of it. */ static int -lookup_name(Elf *e, Elf_Scn *scn, u_long stridx, const char *symbol, +lookup_symbol_by_name(Elf *elf, struct symtab *symtab, const char *symbol, GElf_Sym *symcopy, prsyminfo_t *si) { GElf_Sym sym; @@ -488,12 +529,11 @@ lookup_name(Elf *e, Elf_Scn *scn, u_long char *s; int i; - if ((data = elf_getdata(scn, NULL)) == NULL) { - DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); - return (1); - } + if (symtab->nsyms == 0) + return (ENOENT); + data = symtab->data; for (i = 0; gelf_getsym(data, i, &sym) != NULL; i++) { - s = elf_strptr(e, stridx, sym.st_name); + s = elf_strptr(elf, symtab->stridx, sym.st_name); if (s != NULL && strcmp(s, symbol) == 0) { memcpy(symcopy, &sym, sizeof(*symcopy)); if (si != NULL) @@ -501,21 +541,17 @@ lookup_name(Elf *e, Elf_Scn *scn, u_long return (0); } } - return (1); + return (ENOENT); } int proc_name2sym(struct proc_handle *p, const char *object, const char *symbol, GElf_Sym *symcopy, prsyminfo_t *si) { - GElf_Ehdr ehdr; - GElf_Shdr shdr; - Elf *e; - Elf_Scn *scn, *dynsymscn, *symtabscn; + struct file_info *file; struct map_info *mapping; uintptr_t off; - u_long symtabstridx, dynsymstridx; - int error = -1; + int error; if ((mapping = _proc_name2map(p, object)) == NULL) { DPRINTFX("ERROR: proc_name2map failed to resolve %s", object); @@ -526,49 +562,17 @@ proc_name2sym(struct proc_handle *p, con mapping->map.pr_mapname); return (-1); } - e = mapping->file->elf; - if (gelf_getehdr(e, &ehdr) == NULL) { - DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); - goto err; - } - /* - * Find the index of the STRTAB and SYMTAB sections to locate - * symbol names. - */ - symtabstridx = dynsymstridx = 0; - scn = dynsymscn = symtabscn = NULL; - while ((scn = elf_nextscn(e, scn)) != NULL) { - gelf_getshdr(scn, &shdr); - switch (shdr.sh_type) { - case SHT_SYMTAB: - symtabscn = scn; - symtabstridx = shdr.sh_link; - break; - case SHT_DYNSYM: - dynsymscn = scn; - dynsymstridx = shdr.sh_link; - break; - } - } - - /* - * First look up the symbol in the dynsymtab, and fall back to the - * symtab if the lookup fails. - */ - error = lookup_name(e, dynsymscn, dynsymstridx, symbol, symcopy, si); - if (error == 0) - goto out; + file = mapping->file; + off = file->ehdr.e_type == ET_DYN ? mapping->map.pr_vaddr : 0; - error = lookup_name(e, symtabscn, symtabstridx, symbol, symcopy, si); + error = lookup_symbol_by_name(file->elf, &file->dynsymtab, symbol, + symcopy, si); + if (error == ENOENT) + error = lookup_symbol_by_name(file->elf, &file->symtab, symbol, + symcopy, si); if (error == 0) - goto out; - -out: - off = ehdr.e_type == ET_EXEC ? 0 : mapping->map.pr_vaddr; - symcopy->st_value += off; - -err: + symcopy->st_value += off; return (error); } @@ -596,16 +600,12 @@ int proc_iter_symbyaddr(struct proc_handle *p, const char *object, int which, int mask, proc_sym_f *func, void *cd) { - GElf_Ehdr ehdr; - GElf_Shdr shdr; GElf_Sym sym; - Elf *e; - Elf_Scn *scn, *foundscn; - Elf_Data *data; + struct file_info *file; struct map_info *mapping; - char *s; - unsigned long stridx = -1; - int error = -1, i; + struct symtab *symtab; + const char *s; + int error, i; if ((mapping = _proc_name2map(p, object)) == NULL) { DPRINTFX("ERROR: proc_name2map failed to resolve %s", object); @@ -616,35 +616,14 @@ proc_iter_symbyaddr(struct proc_handle * mapping->map.pr_mapname); return (-1); } - e = mapping->file->elf; - if (gelf_getehdr(e, &ehdr) == NULL) { - DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); - goto err; - } - /* - * Find the section we are looking for. - */ - foundscn = scn = NULL; - while ((scn = elf_nextscn(e, scn)) != NULL) { - gelf_getshdr(scn, &shdr); - if (which == PR_SYMTAB && - shdr.sh_type == SHT_SYMTAB) { - foundscn = scn; - break; - } else if (which == PR_DYNSYM && - shdr.sh_type == SHT_DYNSYM) { - foundscn = scn; - break; - } - } - if (!foundscn) + + file = mapping->file; + symtab = which == PR_SYMTAB ? &file->symtab : &file->dynsymtab; + if (symtab->nsyms == 0) return (-1); - stridx = shdr.sh_link; - if ((data = elf_getdata(foundscn, NULL)) == NULL) { - DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); - goto err; - } - for (i = 0; gelf_getsym(data, i, &sym) != NULL; i++) { + + error = 0; + for (i = 0; gelf_getsym(symtab->data, i, &sym) != NULL; i++) { if (GELF_ST_BIND(sym.st_info) == STB_LOCAL && (mask & BIND_LOCAL) == 0) continue; @@ -669,13 +648,11 @@ proc_iter_symbyaddr(struct proc_handle * if (GELF_ST_TYPE(sym.st_info) == STT_FILE && (mask & TYPE_FILE) == 0) continue; - s = elf_strptr(e, stridx, sym.st_name); - if (ehdr.e_type != ET_EXEC) + s = elf_strptr(file->elf, symtab->stridx, sym.st_name); + if (file->ehdr.e_type == ET_DYN) sym.st_value += mapping->map.pr_vaddr; if ((error = (*func)(cd, &sym, s)) != 0) - goto err; + break; } - error = 0; -err: return (error); } From owner-svn-src-head@freebsd.org Tue Dec 6 04:22:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2172CC699C5; Tue, 6 Dec 2016 04:22:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D661F8F4; Tue, 6 Dec 2016 04:22:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB64Mdjk067720; Tue, 6 Dec 2016 04:22:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB64McT8067715; Tue, 6 Dec 2016 04:22:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612060422.uB64McT8067715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 04:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309597 - in head: cddl/compat/opensolaris/include cddl/lib/libdtrace lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:22:40 -0000 Author: markj Date: Tue Dec 6 04:22:38 2016 New Revision: 309597 URL: https://svnweb.freebsd.org/changeset/base/309597 Log: libproc: Add support for some proc_attach() flags. This change adds some handling for the equivalent of Solaris' PGRAB_* flags. In particular, support for PGRAB_RDONLY is needed to avoid a nasty deadlock: dtrace(1) may otherwise stop the master process for its pseudo-terminal and end up blocking while writing to standard output. Modified: head/cddl/compat/opensolaris/include/libproc.h head/cddl/lib/libdtrace/libproc_compat.h head/lib/libproc/libproc.h head/lib/libproc/proc_create.c head/lib/libproc/proc_util.c Modified: head/cddl/compat/opensolaris/include/libproc.h ============================================================================== --- head/cddl/compat/opensolaris/include/libproc.h Tue Dec 6 04:21:35 2016 (r309596) +++ head/cddl/compat/opensolaris/include/libproc.h Tue Dec 6 04:22:38 2016 (r309597) @@ -38,9 +38,6 @@ #define PR_RLC 0x0001 #define PR_KLC 0x0002 -#define PGRAB_RDONLY O_RDONLY -#define PGRAB_FORCE 0 - #include_next #endif Modified: head/cddl/lib/libdtrace/libproc_compat.h ============================================================================== --- head/cddl/lib/libdtrace/libproc_compat.h Tue Dec 6 04:21:35 2016 (r309596) +++ head/cddl/lib/libdtrace/libproc_compat.h Tue Dec 6 04:22:38 2016 (r309597) @@ -34,6 +34,9 @@ * Functions sorted alphabetically. */ #define PR_LMID_EVERY 0 +#define PGRAB_RDONLY PATTACH_RDONLY +#define PGRAB_FORCE PATTACH_FORCE + #define Psetrun(p, a1, a2) proc_continue((p)) #define Pxlookup_by_addr(p, a, n, s, sym, i) \ proc_addr2sym(p, a, n, s, sym) Modified: head/lib/libproc/libproc.h ============================================================================== --- head/lib/libproc/libproc.h Tue Dec 6 04:21:35 2016 (r309596) +++ head/lib/libproc/libproc.h Tue Dec 6 04:22:38 2016 (r309597) @@ -50,6 +50,11 @@ typedef void (*proc_child_func)(void *); #define PS_DEAD 5 #define PS_LOST 6 +/* Flags for proc_attach(). */ +#define PATTACH_FORCE 0x01 +#define PATTACH_RDONLY 0x02 +#define PATTACH_NOSTOP 0x04 + /* Reason values for proc_detach(). */ #define PRELEASE_HANG 1 #define PRELEASE_KILL 2 Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Tue Dec 6 04:21:35 2016 (r309596) +++ head/lib/libproc/proc_create.c Tue Dec 6 04:22:38 2016 (r309597) @@ -127,7 +127,7 @@ proc_attach(pid_t pid, int flags, struct struct proc_handle *phdl; int error, status; - if (pid == 0 || pid == getpid()) + if (pid == 0 || (pid == getpid() && (flags & PATTACH_RDONLY) == 0)) return (EINVAL); if (elf_version(EV_CURRENT) == EV_NONE) return (ENOENT); @@ -140,27 +140,32 @@ proc_attach(pid_t pid, int flags, struct if (error != 0) goto out; - if (ptrace(PT_ATTACH, proc_getpid(phdl), 0, 0) != 0) { - error = errno; - DPRINTF("ERROR: cannot ptrace child process %d", pid); - goto out; - } + if ((flags & PATTACH_RDONLY) == 0) { + if (ptrace(PT_ATTACH, proc_getpid(phdl), 0, 0) != 0) { + error = errno; + DPRINTF("ERROR: cannot ptrace child process %d", pid); + goto out; + } - /* Wait for the child process to stop. */ - if (waitpid(pid, &status, WUNTRACED) == -1) { - error = errno; - DPRINTF("ERROR: child process %d didn't stop as expected", pid); - goto out; - } + /* Wait for the child process to stop. */ + if (waitpid(pid, &status, WUNTRACED) == -1) { + error = errno; + DPRINTF("ERROR: child process %d didn't stop as expected", pid); + goto out; + } - /* Check for an unexpected status. */ - if (!WIFSTOPPED(status)) - DPRINTFX("ERROR: child process %d status 0x%x", pid, status); - else - phdl->status = PS_STOP; + /* Check for an unexpected status. */ + if (!WIFSTOPPED(status)) + DPRINTFX("ERROR: child process %d status 0x%x", pid, status); + else + phdl->status = PS_STOP; + + if ((flags & PATTACH_NOSTOP) != 0) + proc_continue(phdl); + } out: - if (error && phdl != NULL) { + if (error != 0 && phdl != NULL) { proc_free(phdl); phdl = NULL; } Modified: head/lib/libproc/proc_util.c ============================================================================== --- head/lib/libproc/proc_util.c Tue Dec 6 04:21:35 2016 (r309596) +++ head/lib/libproc/proc_util.c Tue Dec 6 04:22:38 2016 (r309597) @@ -87,21 +87,25 @@ proc_detach(struct proc_handle *phdl, in if (phdl == NULL) return (EINVAL); + if (reason == PRELEASE_HANG) + return (EINVAL); if (reason == PRELEASE_KILL) { kill(proc_getpid(phdl), SIGKILL); - return (0); + goto free; } + if ((phdl->flags & PATTACH_RDONLY) != 0) + goto free; pid = proc_getpid(phdl); if (ptrace(PT_DETACH, pid, 0, 0) != 0 && errno == ESRCH) - return (0); + goto free; if (errno == EBUSY) { kill(pid, SIGSTOP); waitpid(pid, &status, WUNTRACED); ptrace(PT_DETACH, pid, 0, 0); kill(pid, SIGCONT); - return (0); } - +free: + proc_free(phdl); return (0); } From owner-svn-src-head@freebsd.org Tue Dec 6 04:23:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0692C69AAE; Tue, 6 Dec 2016 04:23:33 +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 C001DB33; Tue, 6 Dec 2016 04:23:33 +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 uB64NWx3067803; Tue, 6 Dec 2016 04:23:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB64NW2I067801; Tue, 6 Dec 2016 04:23:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612060423.uB64NW2I067801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 04:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309598 - in head: . lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:23:34 -0000 Author: markj Date: Tue Dec 6 04:23:32 2016 New Revision: 309598 URL: https://svnweb.freebsd.org/changeset/base/309598 Log: Bump the libproc library version. Modified: head/ObsoleteFiles.inc head/lib/libproc/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Dec 6 04:22:38 2016 (r309597) +++ head/ObsoleteFiles.inc Tue Dec 6 04:23:32 2016 (r309598) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20161205: libproc version bump +OLD_LIBS+=usr/lib/libproc.so.3 +OLD_LIBS+=usr/lib32/libproc.so.3 # 20161127: Remove vm_page_cache(9) OLD_FILES+=usr/share/man/man9/vm_page_cache.9.gz # 20161124: new clang import which bumps version from 3.8.0 to 3.9.0. Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Tue Dec 6 04:22:38 2016 (r309597) +++ head/lib/libproc/Makefile Tue Dec 6 04:23:32 2016 (r309598) @@ -37,7 +37,7 @@ CFLAGS+= -I${.CURDIR}/../../cddl/contrib CFLAGS+= -DNO_CTF .endif -SHLIB_MAJOR= 3 +SHLIB_MAJOR= 4 MAN= From owner-svn-src-head@freebsd.org Tue Dec 6 04:28:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73C55C69C00; Tue, 6 Dec 2016 04:28:57 +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 43285D8E; Tue, 6 Dec 2016 04:28:57 +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 uB64SuoR068071; Tue, 6 Dec 2016 04:28:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB64Su1x068070; Tue, 6 Dec 2016 04:28:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612060428.uB64Su1x068070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 04:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309599 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 04:28:57 -0000 Author: markj Date: Tue Dec 6 04:28:56 2016 New Revision: 309599 URL: https://svnweb.freebsd.org/changeset/base/309599 Log: libdtrace: Don't use a read-only handle for enumerating pid probes. Enumeration of return probes involves disassembling subroutines in the target process, and ptrace(2) is currently used to read from the target process. libproc could read from the backing file instead to avoid this problem, but in the common case libdtrace will have a writeable handle on the process anyway. In particular, a writeable handle is needed to list USDT probes, and libdtrace will cache such a handle for processes that it controls via dtrace -c and -p. Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Tue Dec 6 04:23:32 2016 (r309598) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Tue Dec 6 04:28:56 2016 (r309599) @@ -729,8 +729,13 @@ dt_pid_create_probes(dtrace_probedesc_t (void) snprintf(provname, sizeof (provname), "pid%d", (int)pid); if (gmatch(provname, pdp->dtpd_provider) != 0) { +#ifdef __FreeBSD__ + if ((P = dt_proc_grab(dtp, pid, 0, 1)) == NULL) +#else if ((P = dt_proc_grab(dtp, pid, PGRAB_RDONLY | PGRAB_FORCE, - 0)) == NULL) { + 0)) == NULL) +#endif + { (void) dt_pid_error(dtp, pcb, NULL, NULL, D_PROC_GRAB, "failed to grab process %d", (int)pid); return (-1); From owner-svn-src-head@freebsd.org Tue Dec 6 06:04:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D609FC69574; Tue, 6 Dec 2016 06:04:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5C0410EC; Tue, 6 Dec 2016 06:04:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB664Dkk008255; Tue, 6 Dec 2016 06:04:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB664DjF008254; Tue, 6 Dec 2016 06:04:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612060604.uB664DjF008254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 6 Dec 2016 06:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309602 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 06:04:14 -0000 Author: ngie Date: Tue Dec 6 06:04:13 2016 New Revision: 309602 URL: https://svnweb.freebsd.org/changeset/base/309602 Log: Remove svn[lite]{bench,fsfs} if either MK_SVN == no or MK_SVNLITE == no MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 6 04:38:08 2016 (r309601) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 6 06:04:13 2016 (r309602) @@ -8826,7 +8826,9 @@ OLD_FILES+=usr/share/man/man8/wpa_suppli .if ${MK_SVNLITE} == no || ${MK_SVN} == yes OLD_FILES+=usr/bin/svnlite OLD_FILES+=usr/bin/svnliteadmin +OLD_FILES+=usr/bin/svnlitebench OLD_FILES+=usr/bin/svnlitedumpfilter +OLD_FILES+=usr/bin/svnlitefsfs OLD_FILES+=usr/bin/svnlitelook OLD_FILES+=usr/bin/svnlitemucc OLD_FILES+=usr/bin/svnliterdump @@ -8839,7 +8841,9 @@ OLD_FILES+=usr/share/man/man1/svnlite.1. .if ${MK_SVN} == no OLD_FILES+=usr/bin/svn OLD_FILES+=usr/bin/svnadmin +OLD_FILES+=usr/bin/svnbench OLD_FILES+=usr/bin/svndumpfilter +OLD_FILES+=usr/bin/svnfsfs OLD_FILES+=usr/bin/svnlook OLD_FILES+=usr/bin/svnmucc OLD_FILES+=usr/bin/svnrdump From owner-svn-src-head@freebsd.org Tue Dec 6 06:12:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19ACEC691A7; Tue, 6 Dec 2016 06:12:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DDB14171F; Tue, 6 Dec 2016 06:12:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB66C2mY012246; Tue, 6 Dec 2016 06:12:02 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB66C27b012245; Tue, 6 Dec 2016 06:12:02 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612060612.uB66C27b012245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 6 Dec 2016 06:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309603 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 06:12:03 -0000 Author: avos Date: Tue Dec 6 06:12:01 2016 New Revision: 309603 URL: https://svnweb.freebsd.org/changeset/base/309603 Log: rsu: fix printf format specifiers. Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Tue Dec 6 06:04:13 2016 (r309602) +++ head/sys/dev/usb/wlan/if_rsu.c Tue Dec 6 06:12:01 2016 (r309603) @@ -1473,7 +1473,7 @@ rsu_process_key(struct ieee80211vap *vap if (&vap->iv_nw_keys[0] <= k && k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) { KASSERT(k->wk_keyix < nitems(sc->group_keys), - ("keyix %d > %d\n", k->wk_keyix, nitems(sc->group_keys))); + ("keyix %u > %zu\n", k->wk_keyix, nitems(sc->group_keys))); RSU_LOCK(sc); sc->group_keys[k->wk_keyix] = (set ? k : NULL); From owner-svn-src-head@freebsd.org Tue Dec 6 06:15:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03705C6970B; Tue, 6 Dec 2016 06:15:30 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C75191AE0; Tue, 6 Dec 2016 06:15:29 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB66FSgs012406; Tue, 6 Dec 2016 06:15:28 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB66FSUW012405; Tue, 6 Dec 2016 06:15:28 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612060615.uB66FSUW012405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 6 Dec 2016 06:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309604 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 06:15:30 -0000 Author: loos Date: Tue Dec 6 06:15:28 2016 New Revision: 309604 URL: https://svnweb.freebsd.org/changeset/base/309604 Log: Fix the armv6 build after r309553. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/include/pmap.h Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Tue Dec 6 06:12:01 2016 (r309603) +++ head/sys/arm/include/pmap.h Tue Dec 6 06:15:28 2016 (r309604) @@ -30,7 +30,6 @@ #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ -#include #if __ARM_ARCH >= 6 #include #else @@ -38,6 +37,7 @@ #endif #ifdef _KERNEL +#include extern vm_paddr_t dump_avail[]; extern vm_paddr_t phys_avail[]; From owner-svn-src-head@freebsd.org Tue Dec 6 10:21:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92A39C69F54; Tue, 6 Dec 2016 10:21:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B401CD4; Tue, 6 Dec 2016 10:21:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6ALQjP011341; Tue, 6 Dec 2016 10:21:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6ALPIL011330; Tue, 6 Dec 2016 10:21:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612061021.uB6ALPIL011330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Dec 2016 10:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309607 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 10:21:27 -0000 Author: tuexen Date: Tue Dec 6 10:21:25 2016 New Revision: 309607 URL: https://svnweb.freebsd.org/changeset/base/309607 Log: Whitespace changes. The tools using to generate the sources has been updated and produces different whitespaces. Commit this seperately to avoid intermixing these with real code changes. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_asconf.h head/sys/netinet/sctp_bsd_addr.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_crc32.c head/sys/netinet/sctp_crc32.h head/sys/netinet/sctp_header.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.h head/sys/netinet/sctp_ss_functions.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet6/sctp6_usrreq.c head/sys/netinet6/sctp6_var.h Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Tue Dec 6 10:19:55 2016 (r309606) +++ head/sys/netinet/sctp_asconf.c Tue Dec 6 10:21:25 2016 (r309607) @@ -151,24 +151,19 @@ sctp_process_asconf_add_ip(struct sockad union sctp_sockstore store; struct sctp_paramhdr *ph; uint16_t param_type, aparam_length; - #if defined(INET) || defined(INET6) uint16_t param_length; - #endif struct sockaddr *sa; int zero_address = 0; int bad_address = 0; - #ifdef INET struct sockaddr_in *sin; struct sctp_ipv4addr_param *v4addr; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *v6addr; - #endif aparam_length = ntohs(aph->ph.param_length); @@ -306,24 +301,19 @@ sctp_process_asconf_delete_ip(struct soc union sctp_sockstore store; struct sctp_paramhdr *ph; uint16_t param_type, aparam_length; - #if defined(INET) || defined(INET6) uint16_t param_length; - #endif struct sockaddr *sa; int zero_address = 0; int result; - #ifdef INET struct sockaddr_in *sin; struct sctp_ipv4addr_param *v4addr; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *v6addr; - #endif aparam_length = ntohs(aph->ph.param_length); @@ -441,23 +431,18 @@ sctp_process_asconf_set_primary(struct s union sctp_sockstore store; struct sctp_paramhdr *ph; uint16_t param_type, aparam_length; - #if defined(INET) || defined(INET6) uint16_t param_length; - #endif struct sockaddr *sa; int zero_address = 0; - #ifdef INET struct sockaddr_in *sin; struct sctp_ipv4addr_param *v4addr; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *v6addr; - #endif aparam_length = ntohs(aph->ph.param_length); @@ -1785,7 +1770,7 @@ sctp_handle_asconf_ack(struct mbuf *m, i * if there are any "sent" params still on the queue, these are * implicitly "success", or "failed" (if we got an error back) ... * so process these appropriately - * + * * we assume that the correlation_id's are monotonically increasing * beginning from 1 and that we don't have *that* many outstanding * at any given time @@ -1861,7 +1846,6 @@ sctp_is_scopeid_in_nets(struct sctp_tcb /* didn't find one */ return (0); } - #endif /* @@ -2435,10 +2419,8 @@ sctp_is_addr_pending(struct sctp_tcb *st } } - /* - * we want to find the sequences which consist of ADD -> DEL -> ADD - * or DEL -> ADD - */ + /* we want to find the sequences which consist of ADD -> DEL -> ADD + * or DEL -> ADD */ if (add_cnt > del_cnt || (add_cnt == del_cnt && last_param_type == SCTP_ADD_IP_ADDRESS)) { return (1); @@ -2490,10 +2472,8 @@ sctp_find_valid_localaddr(struct sctp_tc if (sctp_is_addr_restricted(stcb, sctp_ifa) && (!sctp_is_addr_pending(stcb, sctp_ifa))) continue; - /* - * found a valid local v4 address to - * use - */ + /* found a valid local v4 address to + * use */ if (addr_locked == SCTP_ADDR_NOT_LOCKED) SCTP_IPI_ADDR_RUNLOCK(); return (&sctp_ifa->address.sa); @@ -2510,10 +2490,8 @@ sctp_find_valid_localaddr(struct sctp_tc } sin6 = &sctp_ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { - /* - * we skip unspecifed - * addresses - */ + /* we skip unspecifed + * addresses */ continue; } if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, @@ -2530,10 +2508,8 @@ sctp_find_valid_localaddr(struct sctp_tc if (sctp_is_addr_restricted(stcb, sctp_ifa) && (!sctp_is_addr_pending(stcb, sctp_ifa))) continue; - /* - * found a valid local v6 address to - * use - */ + /* found a valid local v6 address to + * use */ if (addr_locked == SCTP_ADDR_NOT_LOCKED) SCTP_IPI_ADDR_RUNLOCK(); return (&sctp_ifa->address.sa); @@ -2781,14 +2757,11 @@ sctp_process_initack_addresses(struct sc uint16_t plen, ptype; struct sctp_ifa *sctp_ifa; union sctp_sockstore store; - #ifdef INET6 struct sctp_ipv6addr_param addr6_store; - #endif #ifdef INET struct sctp_ipv4addr_param addr4_store; - #endif SCTPDBG(SCTP_DEBUG_ASCONF2, "processing init-ack addresses\n"); @@ -2915,19 +2888,16 @@ sctp_addr_in_initack(struct mbuf *m, uin { struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; - #ifdef INET struct sockaddr_in *sin; struct sctp_ipv4addr_param *a4p; struct sctp_ipv6addr_param addr4_store; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *a6p; struct sctp_ipv6addr_param addr6_store; struct sockaddr_in6 sin6_tmp; - #endif switch (sa->sa_family) { @@ -3079,14 +3049,11 @@ sctp_check_address_list_all(struct sctp_ struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; uint32_t vrf_id; - #ifdef INET struct sockaddr_in *sin; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; - #endif if (stcb) { @@ -3301,14 +3268,11 @@ sctp_asconf_send_nat_state_update(struct struct sctp_asconf_addr *aa; struct sctp_ifa *sctp_ifap; struct sctp_asconf_tag_param *vtag; - #ifdef INET struct sockaddr_in *to; - #endif #ifdef INET6 struct sockaddr_in6 *to6; - #endif if (net == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "sctp_asconf_send_nat_state_update: Missing net\n"); Modified: head/sys/netinet/sctp_asconf.h ============================================================================== --- head/sys/netinet/sctp_asconf.h Tue Dec 6 10:19:55 2016 (r309606) +++ head/sys/netinet/sctp_asconf.h Tue Dec 6 10:21:25 2016 (r309607) @@ -90,7 +90,6 @@ sctp_asconf_send_nat_state_update(struct extern int sctp_is_addr_pending(struct sctp_tcb *, struct sctp_ifa *); - #endif /* _KERNEL */ #endif /* !_NETINET_SCTP_ASCONF_H_ */ Modified: head/sys/netinet/sctp_bsd_addr.h ============================================================================== --- head/sys/netinet/sctp_bsd_addr.h Tue Dec 6 10:19:55 2016 (r309606) +++ head/sys/netinet/sctp_bsd_addr.h Tue Dec 6 10:21:25 2016 (r309607) @@ -48,7 +48,6 @@ void sctp_startup_iterator(void); #ifdef INET6 void sctp_gather_internal_ifa_flags(struct sctp_ifa *ifa); - #endif #ifdef SCTP_PACKET_LOGGING Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Tue Dec 6 10:19:55 2016 (r309606) +++ head/sys/netinet/sctp_cc_functions.c Tue Dec 6 10:21:25 2016 (r309607) @@ -160,17 +160,13 @@ sctp_cwnd_update_after_fr(struct sctp_tc uint32_t srtt; srtt = net->lastsa; - /* - * lastsa>>3; we don't need - * to devide ... - */ + /* lastsa>>3; we don't need + * to devide ... */ if (srtt == 0) { srtt = 1; } - /* - * Short Version => Equal to - * Contel Version MBe - */ + /* Short Version => Equal to + * Contel Version MBe */ net->ssthresh = (uint32_t) (((uint64_t) 4 * (uint64_t) net->mtu * (uint64_t) net->cwnd) / @@ -405,10 +401,8 @@ cc_bw_decrease(struct sctp_tcb *stcb, st net->flight_size, probepoint); if (net->cc_mod.rtcc.ret_from_eq) { - /* - * Switch over to CA if we are less - * aggressive - */ + /* Switch over to CA if we are less + * aggressive */ net->ssthresh = net->cwnd - 1; net->partial_bytes_acked = 0; } @@ -784,9 +778,9 @@ sctp_cwnd_update_after_sack_common(struc /* * At this point our bw_bytes has been updated by * incoming sack information. - * + * * But our bw may not yet be set. - * + * */ if ((net->cc_mod.rtcc.new_tot_time / 1000) > 0) { nbw = net->cc_mod.rtcc.bw_bytes / (net->cc_mod.rtcc.new_tot_time / 1000); @@ -851,10 +845,8 @@ sctp_cwnd_update_after_sack_common(struc } break; case SCTP_CMT_RPV2: - /* - * lastsa>>3; we don't need - * to divide ... - */ + /* lastsa>>3; we don't need + * to divide ... */ srtt = net->lastsa; if (srtt == 0) { srtt = 1; @@ -938,10 +930,8 @@ sctp_cwnd_update_after_sack_common(struc } break; case SCTP_CMT_RPV2: - /* - * lastsa>>3; we don't need - * to divide ... - */ + /* lastsa>>3; we don't need + * to divide ... */ srtt = net->lastsa; if (srtt == 0) { srtt = 1; @@ -1108,10 +1098,8 @@ sctp_cwnd_update_after_ecn_echo_common(s sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); } } else { - /* - * Further tuning down required over the drastic - * original cut - */ + /* Further tuning down required over the drastic + * original cut */ net->ssthresh -= (net->mtu * num_pkt_lost); net->cwnd -= (net->mtu * num_pkt_lost); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { @@ -1125,10 +1113,8 @@ sctp_cwnd_update_after_ecn_echo_common(s net->ssthresh = net->cwnd / 2; if (net->ssthresh < net->mtu) { net->ssthresh = net->mtu; - /* - * here back off the timer as well, to slow - * us down - */ + /* here back off the timer as well, to slow + * us down */ net->RTO <<= 1; } net->cwnd = net->ssthresh; @@ -1375,10 +1361,8 @@ sctp_cwnd_new_rtcc_transmission_begins(s cwnd_in_mtu = SCTP_BASE_SYSCTL(sctp_initial_cwnd); if (cwnd_in_mtu == 0) { - /* - * Using 0 means that the value of RFC 4960 - * is used. - */ + /* Using 0 means that the value of RFC 4960 + * is used. */ cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); } else { /* @@ -1390,10 +1374,8 @@ sctp_cwnd_new_rtcc_transmission_begins(s cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; } if (net->cwnd > cwnd) { - /* - * Only set if we are not a timeout (i.e. - * down to 1 mtu) - */ + /* Only set if we are not a timeout (i.e. + * down to 1 mtu) */ net->cwnd = cwnd; } } @@ -2023,10 +2005,8 @@ htcp_param_update(struct sctp_nets *net) htcp_beta_update(&net->cc_mod.htcp_ca, minRTT, maxRTT); htcp_alpha_update(&net->cc_mod.htcp_ca); - /* - * add slowly fading memory for maxRTT to accommodate routing - * changes etc - */ + /* add slowly fading memory for maxRTT to accommodate routing + * changes etc */ if (minRTT > 0 && maxRTT > minRTT) net->cc_mod.htcp_ca.maxRTT = minRTT + ((maxRTT - minRTT) * 95) / 100; } @@ -2109,7 +2089,6 @@ htcp_min_cwnd(struct sctp_tcb *stcb, str { return (net->ssthresh); } - #endif static void Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Tue Dec 6 10:19:55 2016 (r309606) +++ head/sys/netinet/sctp_crc32.c Tue Dec 6 10:21:25 2016 (r309607) @@ -113,7 +113,6 @@ sctp_calculate_cksum(struct mbuf *m, uin base = sctp_finalize_crc32c(base); return (base); } - #endif /* !defined(SCTP_WITH_NO_CSUM) */ Modified: head/sys/netinet/sctp_crc32.h ============================================================================== --- head/sys/netinet/sctp_crc32.h Tue Dec 6 10:19:55 2016 (r309606) +++ head/sys/netinet/sctp_crc32.h Tue Dec 6 10:21:25 2016 (r309607) @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) #if !defined(SCTP_WITH_NO_CSUM) uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t); - #endif void sctp_delayed_cksum(struct mbuf *, uint32_t offset); - #endif /* _KERNEL */ #endif /* __crc32c_h__ */ Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Tue Dec 6 10:19:55 2016 (r309606) +++ head/sys/netinet/sctp_header.h Tue Dec 6 10:21:25 2016 (r309607) @@ -182,7 +182,6 @@ struct sctp_init { uint32_t initial_tsn; /* I-TSN */ /* optional param's follow */ } SCTP_PACKED; - #define SCTP_IDENTIFICATION_SIZE 16 #define SCTP_ADDRESS_SIZE 4 #define SCTP_RESERVE_SPACE 6 Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Dec 6 10:19:55 2016 (r309606) +++ head/sys/netinet/sctp_indata.c Tue Dec 6 10:21:25 2016 (r309607) @@ -341,10 +341,8 @@ sctp_place_control_in_stream(struct sctp q = &strm->uno_inqueue; if (asoc->idata_supported == 0) { if (!TAILQ_EMPTY(q)) { - /* - * Only one stream can be here in old style - * -- abort - */ + /* Only one stream can be here in old style + * -- abort */ return (-1); } TAILQ_INSERT_TAIL(q, control, next_instrm); @@ -487,13 +485,13 @@ sctp_queue_data_to_stream(struct sctp_tc * has wrapped but not in the stream. Is this worth worrying about * or should we just change our queue sort at the bottom to be by * TSN. - * - * Could it also be legal for a peer to send ssn 1 with TSN 2 and ssn 2 - * with TSN 1? If the peer is doing some sort of funky TSN/SSN + * + * Could it also be legal for a peer to send ssn 1 with TSN 2 and + * ssn 2 with TSN 1? If the peer is doing some sort of funky TSN/SSN * assignment this could happen... and I don't see how this would be * a violation. So for now I am undecided an will leave the sort by * SSN alone. Maybe a hybred approach is the answer - * + * */ struct sctp_queued_to_read *at; int queue_needed; @@ -828,10 +826,8 @@ restart: TAILQ_INSERT_TAIL(&nc->reasm, tchk, sctp_next); tchk = TAILQ_FIRST(&control->reasm); } - /* - * Now lets add it to the queue - * after removing control - */ + /* Now lets add it to the queue + * after removing control */ TAILQ_INSERT_TAIL(&strm->uno_inqueue, nc, next_instrm); nc->on_strm_q = SCTP_ON_UNORDERED; if (control->on_strm_q) { @@ -855,10 +851,8 @@ restart: } sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); if ((nc->first_frag_seen) && !TAILQ_EMPTY(&nc->reasm)) { - /* - * Switch to the new guy and - * continue - */ + /* Switch to the new guy and + * continue */ control = nc; goto restart; } else { @@ -918,10 +912,8 @@ sctp_inject_old_unordered_data(struct sc uint32_t tmp; if (SCTP_TSN_GT(chk->rec.data.fsn_num, control->fsn_included)) { - /* - * Easy way the start of a new guy beyond - * the lowest - */ + /* Easy way the start of a new guy beyond + * the lowest */ goto place_chunk; } if ((chk->rec.data.fsn_num == control->fsn_included) || @@ -931,10 +923,10 @@ sctp_inject_old_unordered_data(struct sc * started the pd-api on the higher TSN * (since the equals part is a TSN failure * it must be that). - * - * We are completly hosed in that case since I - * have no way to recover. This really will - * only happen if we can get more TSN's + * + * We are completly hosed in that case since + * I have no way to recover. This really + * will only happen if we can get more TSN's * higher before the pd-api-point. */ sctp_abort_in_reasm(stcb, control, chk, @@ -1136,10 +1128,8 @@ done_un: } } if (strm->pd_api_started) { - /* - * Can't add more must have gotten an un-ordered above being - * partially delivered. - */ + /* Can't add more must have gotten an un-ordered above being + * partially delivered. */ return (0); } deliver_more: @@ -1171,21 +1161,15 @@ deliver_more: ret++; } if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { - /* - * A singleton now slipping through - mark - * it non-revokable too - */ + /* A singleton now slipping through - mark + * it non-revokable too */ sctp_mark_non_revokable(asoc, control->sinfo_tsn); } else if (control->end_added == 0) { - /* - * Check if we can defer adding until its - * all there - */ + /* Check if we can defer adding until its + * all there */ if ((control->length < pd_point) || (strm->pd_api_started)) { - /* - * Don't need it or cannot add more - * (one being delivered that way) - */ + /* Don't need it or cannot add more + * (one being delivered that way) */ goto out; } } @@ -1387,10 +1371,8 @@ sctp_queue_data_for_reasm(struct sctp_tc * we know the first FSN (which is the TSN). */ if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn_num)) { - /* - * We have already delivered up to - * this so its a dup - */ + /* We have already delivered up to + * this so its a dup */ sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_9); @@ -1417,10 +1399,8 @@ sctp_queue_data_for_reasm(struct sctp_tc */ if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn_num)) { - /* - * We have already delivered up to - * this so its a dup - */ + /* We have already delivered up to + * this so its a dup */ SCTPDBG(SCTP_DEBUG_XXX, "New fsn: %u is already seen in included_fsn: %u -- abort\n", chk->rec.data.fsn_num, control->fsn_included); @@ -1430,10 +1410,8 @@ sctp_queue_data_for_reasm(struct sctp_tc return; } } - /* - * validate not beyond top FSN if we have seen last - * one - */ + /* validate not beyond top FSN if we have seen last + * one */ if (SCTP_TSN_GT(chk->rec.data.fsn_num, control->top_fsn)) { SCTPDBG(SCTP_DEBUG_XXX, "New fsn: %u is beyond or at top_fsn: %u -- abort\n", @@ -1467,10 +1445,8 @@ sctp_queue_data_for_reasm(struct sctp_tc inserted = 1; break; } else if (at->rec.data.fsn_num == chk->rec.data.fsn_num) { - /* - * Gak, He sent me a duplicate str seq - * number - */ + /* Gak, He sent me a duplicate str seq + * number */ /* * foo bar, I guess I will just free this * new guy, should we abort too? FIX ME @@ -1778,19 +1754,15 @@ sctp_process_a_data_chunk(struct sctp_tc return (0); } if (ordered && ((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED)) { - /* - * We can't have a switched order with an - * unordered chunk - */ + /* We can't have a switched order with an + * unordered chunk */ snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", tsn); goto err_out; } if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { - /* - * We can't have a switched unordered with a - * ordered chunk - */ + /* We can't have a switched unordered with a + * ordered chunk */ snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", tsn); goto err_out; @@ -2086,7 +2058,7 @@ sctp_process_a_data_chunk(struct sctp_tc * if it is not being reset.. that way we would not create a * HOLB when amongst streams being reset and those not being * reset. - * + * */ if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && SCTP_TSN_GT(tsn, liste->tsn)) { @@ -2284,10 +2256,10 @@ sctp_slide_mapping_arrays(struct sctp_tc /* * Now we also need to check the mapping array in a couple of ways. * 1) Did we move the cum-ack point? - * - * When you first glance at this you might think that all entries that - * make up the position of the cum-ack would be in the nr-mapping - * array only.. i.e. things up to the cum-ack are always + * + * When you first glance at this you might think that all entries + * that make up the position of the cum-ack would be in the + * nr-mapping array only.. i.e. things up to the cum-ack are always * deliverable. Thats true with one exception, when its a fragmented * message we may not deliver the data until some threshold (or all * of it) is in place. So we must OR the nr_mapping_array and @@ -2346,10 +2318,8 @@ sctp_slide_mapping_arrays(struct sctp_tc /* The complete array was completed by a single FR */ /* highest becomes the cum-ack */ int clr; - #ifdef INVARIANTS unsigned int i; - #endif /* clear the array */ @@ -2497,8 +2467,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i (stcb->asoc.numduptsns) || /* we have dup's */ (is_a_gap) || /* is still a gap */ (stcb->asoc.delayed_ack == 0) || /* Delayed sack disabled */ - (stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq) /* hit limit of pkts */ - ) { + (stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq) /* hit limit of pkts */ ) { if ((stcb->asoc.sctp_cmt_on_off > 0) && (SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) && @@ -2510,9 +2479,9 @@ sctp_sack_check(struct sctp_tcb *stcb, i /* * CMT DAC algorithm: With CMT, delay acks * even in the face of - * - * reordering. Therefore, if acks that do not - * have to be sent because of the above + * + * reordering. Therefore, if acks that do + * not have to be sent because of the above * reasons, will be delayed. That is, acks * that would have been sent due to gap * reports will be delayed with DAC. Start @@ -2719,7 +2688,7 @@ sctp_process_data(struct mbuf **mm, int * Now, what do we do with KNOWN * chunks that are NOT in the right * place? - * + * * For now, I do nothing but ignore * them. We may later want to add * sysctl stuff to switch out and do @@ -2761,8 +2730,7 @@ sctp_process_data(struct mbuf **mm, int /* discard the rest of this packet */ stop_proc = 1; } /* else skip this bad chunk and - * continue... */ - break; + * continue... */ break; } /* switch of chunk type */ } *offset += SCTP_SIZE32(chk_length); @@ -3019,10 +2987,8 @@ sctp_process_segment_range(struct sctp_t } tp1->sent = SCTP_DATAGRAM_NR_ACKED; if (tp1->data) { - /* - * sa_ignore - * NO_NULL_CHK - */ + /* sa_ignore + * NO_NULL_CHK */ sctp_free_bufspace(stcb, &stcb->asoc, tp1, 1); sctp_m_freem(tp1->data); tp1->data = NULL; @@ -3031,8 +2997,7 @@ sctp_process_segment_range(struct sctp_t } } break; - } /* if (tp1->TSN_seq == theTSN) */ - if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, theTSN)) { + } /* if (tp1->TSN_seq == theTSN) */ if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, theTSN)) { break; } tp1 = TAILQ_NEXT(tp1, sctp_next); @@ -3483,10 +3448,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t if ((stcb->asoc.prsctp_supported) && (PR_SCTP_RTX_ENABLED(tp1->flags))) { - /* - * Has it been retransmitted tv_sec times? - - * we store the retran count there. - */ + /* Has it been retransmitted tv_sec times? - + * we store the retran count there. */ if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) { /* Yes, so drop it */ if (tp1->data != NULL) { @@ -3498,10 +3461,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t continue; } } - /* - * SCTP_PRINTF("OK, we are now ready to FR this - * guy\n"); - */ + /* SCTP_PRINTF("OK, we are now ready to FR this + * guy\n"); */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(tp1->rec.data.TSN_seq, tp1->snd_count, 0, SCTP_FR_MARKED); @@ -3521,18 +3482,14 @@ sctp_strike_gap_ack_chunks(struct sctp_t alt = tp1->whoTo; /* sa_ignore NO_NULL_CHK */ if (asoc->sctp_cmt_pf > 0) { - /* - * JRS 5/18/07 - If CMT PF is on, + /* JRS 5/18/07 - If CMT PF is on, * use the PF version of - * find_alt_net() - */ + * find_alt_net() */ alt = sctp_find_alternate_net(stcb, alt, 2); } else { - /* - * JRS 5/18/07 - If only CMT is on, + /* JRS 5/18/07 - If only CMT is on, * use the CMT version of - * find_alt_net() - */ + * find_alt_net() */ /* sa_ignore NO_NULL_CHK */ alt = sctp_find_alternate_net(stcb, alt, 1); } @@ -3713,10 +3670,8 @@ sctp_fs_audit(struct sctp_association *a struct sctp_tmit_chunk *chk; int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0; int ret; - #ifndef INVARIANTS int entry_flight, entry_cnt; - #endif ret = 0; @@ -3933,8 +3888,7 @@ sctp_express_handle_sack(struct sctp_tcb tp1->whoTo->RTO = /* * sa_ignore - * NO_NULL_CH - * K + * NO_NULL_CHK */ sctp_calculate_rto(stcb, asoc, tp1->whoTo, @@ -4066,10 +4020,8 @@ sctp_express_handle_sack(struct sctp_tcb } if (net == stcb->asoc.primary_destination) { if (stcb->asoc.alternate) { - /* - * release the alternate, - * primary is good - */ + /* release the alternate, + * primary is good */ sctp_free_remote_addr(stcb->asoc.alternate); stcb->asoc.alternate = NULL; } @@ -4152,10 +4104,8 @@ again: } } else { if (net->window_probe) { - /* - * In window probes we must assure a timer - * is still running there - */ + /* In window probes we must assure a timer + * is still running there */ net->window_probe = 0; if (!SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { SCTP_OS_TIMER_START(&net->rxt_timer.timer, to_ticks, @@ -4775,7 +4725,7 @@ hopeless_peer: } /* * Check for revoked fragments: - * + * * if Previous sack - Had no frags then we can't have any revoked if * Previous sack - Had frag's then - If we now have frags aka * num_seg > 0 call sctp_check_for_revoked() to tell if peer revoked @@ -4840,10 +4790,8 @@ hopeless_peer: } if (net == stcb->asoc.primary_destination) { if (stcb->asoc.alternate) { - /* - * release the alternate, - * primary is good - */ + /* release the alternate, + * primary is good */ sctp_free_remote_addr(stcb->asoc.alternate); stcb->asoc.alternate = NULL; } @@ -5054,10 +5002,8 @@ again: } } else { if (net->window_probe) { - /* - * In window probes we must assure a timer - * is still running there - */ + /* In window probes we must assure a timer + * is still running there */ if (!SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net); @@ -5213,10 +5159,8 @@ sctp_kick_prsctp_reorder_queue(struct sc } else { /* Its a fragmented message */ if (ctl->first_frag_seen) { - /* - * Make it so this is next to - * deliver, we restore later - */ + /* Make it so this is next to + * deliver, we restore later */ strmin->last_sequence_delivered = ctl->sinfo_ssn - 1; need_reasm_check = 1; break; @@ -5280,10 +5224,8 @@ sctp_kick_prsctp_reorder_queue(struct sc } else { /* Its a fragmented message */ if (ctl->first_frag_seen) { - /* - * Make it so this is next to - * deliver - */ + /* Make it so this is next to + * deliver */ strmin->last_sequence_delivered = ctl->sinfo_ssn - 1; need_reasm_check = 1; break; @@ -5392,11 +5334,11 @@ sctp_handle_forward_tsn(struct sctp_tcb /* * here we will perform all the data receiver side steps for * processing FwdTSN, as required in by pr-sctp draft: - * + * * Assume we get FwdTSN(x): - * - * 1) update local cumTSN to x 2) try to further advance cumTSN to x + - * others we have 3) examine and update re-ordering queue on + * + * 1) update local cumTSN to x 2) try to further advance cumTSN to x + * + others we have 3) examine and update re-ordering queue on * pr-in-streams 4) clean up re-assembly queue 5) Send a sack to * report where we are. */ Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Dec 6 10:19:55 2016 (r309606) +++ head/sys/netinet/sctp_input.c Tue Dec 6 10:21:25 2016 (r309607) @@ -161,10 +161,8 @@ sctp_handle_init(struct mbuf *m, int iph *abort_no_unlock = 1; goto outnow; } - /* - * We are only accepting if we have a socket with positive - * so_qlimit. - */ + /* We are only accepting if we have a socket with positive + * so_qlimit. */ if ((stcb == NULL) && ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || @@ -709,10 +707,8 @@ sctp_handle_nat_colliding_state(struct s LIST_REMOVE(stcb, sctp_asocs); stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; - /* - * put it in the bucket in the vtag hash of assoc's for the - * system - */ + /* put it in the bucket in the vtag hash of assoc's for the + * system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); return (1); @@ -730,10 +726,8 @@ sctp_handle_nat_colliding_state(struct s sctp_toss_old_cookies(stcb, &stcb->asoc); stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; - /* - * put it in the bucket in the vtag hash of assoc's for the - * system - */ + /* put it in the bucket in the vtag hash of assoc's for the + * system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); return (1); @@ -764,7 +758,6 @@ sctp_handle_abort(struct sctp_abort_chun { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; - #endif uint16_t len; uint16_t error; @@ -866,10 +859,8 @@ sctp_handle_shutdown(struct sctp_shutdow struct sctp_association *asoc; int some_on_streamwheel; int old_state; - #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; - #endif SCTPDBG(SCTP_DEBUG_INPUT2, @@ -946,10 +937,8 @@ sctp_handle_shutdown(struct sctp_shutdow (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT)) { SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_RECEIVED); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - /* - * notify upper layer that peer has initiated a - * shutdown - */ + /* notify upper layer that peer has initiated a + * shutdown */ sctp_ulp_notify(SCTP_NOTIFY_PEER_SHUTDOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); /* reset time */ @@ -999,7 +988,6 @@ sctp_handle_shutdown_ack(struct sctp_shu struct sctp_nets *net) { struct sctp_association *asoc; - #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; @@ -1169,10 +1157,8 @@ sctp_handle_error(struct sctp_chunkhdr * uint16_t error_len; struct sctp_association *asoc; int adjust; - #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; - #endif /* parse through all of the errors and process */ @@ -1492,10 +1478,8 @@ sctp_process_cookie_existing(struct mbuf int retval; int spec_flag = 0; uint32_t how_indx; - #if defined(SCTP_DETAILED_STR_STATS) int j; - #endif net = *netp; @@ -1619,7 +1603,6 @@ sctp_process_cookie_existing(struct mbuf ) { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; - #endif /* * Here is where collision would go if we @@ -1820,7 +1803,6 @@ sctp_process_cookie_existing(struct mbuf (inp->sctp_socket->so_qlimit == 0)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Dec 6 11:41:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D60BCC69830; Tue, 6 Dec 2016 11:41:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5C5D1992; Tue, 6 Dec 2016 11:41:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6BfJWd042092; Tue, 6 Dec 2016 11:41:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6BfJIs042091; Tue, 6 Dec 2016 11:41:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201612061141.uB6BfJIs042091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 6 Dec 2016 11:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309612 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 11:41:20 -0000 Author: andrew Date: Tue Dec 6 11:41:19 2016 New Revision: 309612 URL: https://svnweb.freebsd.org/changeset/base/309612 Log: Add the full set of GICD_PIDR* registers Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_v3_reg.h Modified: head/sys/arm64/arm64/gic_v3_reg.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_reg.h Tue Dec 6 11:14:31 2016 (r309611) +++ head/sys/arm64/arm64/gic_v3_reg.h Tue Dec 6 11:41:19 2016 (r309612) @@ -94,11 +94,20 @@ * Registers (v3) */ #define GICD_IROUTER(n) (0x6000 + ((n) * 8)) -#define GICD_PIDR2 (0xFFE8) -#define GICR_PIDR2_ARCH_MASK (0xF0) -#define GICR_PIDR2_ARCH_GICv3 (0x30) -#define GICR_PIDR2_ARCH_GICv4 (0x40) +#define GICD_PIDR4 0xFFD0 +#define GICD_PIDR5 0xFFD4 +#define GICD_PIDR6 0xFFD8 +#define GICD_PIDR7 0xFFDC +#define GICD_PIDR0 0xFFE0 +#define GICD_PIDR1 0xFFE4 +#define GICD_PIDR2 0xFFE8 + +#define GICR_PIDR2_ARCH_MASK 0xF0 +#define GICR_PIDR2_ARCH_GICv3 0x30 +#define GICR_PIDR2_ARCH_GICv4 0x40 + +#define GICD_PIDR3 0xFFEC /* Redistributor registers */ #define GICR_CTLR GICD_CTLR From owner-svn-src-head@freebsd.org Tue Dec 6 12:43:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86DB9C68D58; Tue, 6 Dec 2016 12:43:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2EE58F2; Tue, 6 Dec 2016 12:43:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6Ch8SV069605; Tue, 6 Dec 2016 12:43:08 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6Ch8KX069600; Tue, 6 Dec 2016 12:43:08 GMT (envelope-from np@FreeBSD.org) Message-Id: <201612061243.uB6Ch8KX069600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 6 Dec 2016 12:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309613 - in head/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 12:43:09 -0000 Author: np Date: Tue Dec 6 12:43:07 2016 New Revision: 309613 URL: https://svnweb.freebsd.org/changeset/base/309613 Log: cxgbe(4): Update firmwares from version 1.16.12.0 to 1.16.22.0. Obtained from: Chelsio Communications MFC after: 3 days Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.16.22.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.16.22.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.16.22.0.bin.uu (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu head/sys/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu head/sys/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/firmware/t6fw_cfg.txt head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt head/sys/dev/cxgbe/t4_main.c head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile head/sys/modules/cxgbe/t6_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Dec 6 11:41:19 2016 (r309612) +++ head/sys/conf/files Tue Dec 6 12:43:07 2016 (r309613) @@ -1381,7 +1381,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.16.22.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1405,7 +1405,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.16.22.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1429,7 +1429,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.16.22.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue Dec 6 11:41:19 2016 (r309612) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Dec 6 12:43:07 2016 (r309613) @@ -5801,10 +5801,9 @@ const char *t4_get_port_type_description "KR4_100G", "CR4_QSFP", "CR_QSFP", - "CR_SFP28", + "CR2_QSFP", "SFP28", "KR_SFP28", - "CR2_QSFP", }; if (port_type < ARRAY_SIZE(port_type_description)) Added: head/sys/dev/cxgbe/firmware/t4fw-1.16.22.0.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.16.22.0.bin.uu Tue Dec 6 12:43:07 2016 (r309613) @@ -0,0 +1,9603 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +begin-base64 644 t4fw +AAAEKgEQFgAAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAABA0EHAQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFRodSBEZWMgIDEgMDI6 +NTE6MjEgUFNUIDIwMTYgb24gdm5jNC5hc2ljZGVzaWduZXJzLmNvbTovaG9tZS9maXJtd2FyZS9j +dnMvZnctcmVsZWFzZSksIFZlcnNpb24gVDR4eCAwMS4xMC4xNi4wMAAAAAAAAAAAAAAAAK6qwFZg +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//2M4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//kuAAAAAA +H/+S5AAAAAAf/5LoAAAAAB//kuwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+KUOMACfgf/4pQH/+KUOMAFEgf +/4pQH/+KUOMAFEgf/4pQH/+L8OMAFEgf/4vwH/+S3OMAFegf/5LgH/+0AOMAHNgf/7QAH/+0AOMA +Pfgf/8AAH//+eeMAPfggAAAAIAABauMAfHQgAAF4IAABfOMAfeAgAAF8IAABheMAfeQgAAGYIAAB +nOMAffAgAAGcIAABpeMAffQgAAG4IAABvOMAfgAgAAG8IAABxeMAfgQgAAHYIAAB2OMAfhAgAAHc +IAAB4uMAfhAgAAH4IAAB+OMAfhggAAH8IAAB/OMAfhggAAIYIAACGOMAfhggAAIcIAACHOMAfhgg +AAI4IAACOOMAfhggAAI8IAACPOMAfhggAAJYIAACWOMAfhggAAJcIAACYuMAfhggAAJ4IAACeOMA +fiAgAAJ8IAACguMAfiAgAAKYIAHz1uMAfiggAwAAIAMVlOMCb2ggAxWUIAMVlOMChPwgAxWYIAbc +HOMChQAgBtwgIAbfkOMGS4ggCAAAIAgOYOMGTvggCA5gIAkpBuMGXVggCSkQIAkp3OMHeAggCwAA +IAsAAOMHeNQgCwAAIAsAAOMHeNQgCwAAIAuf+OMHeNQAAAAAAAAAAAAAAAAgABOGIAATeCAAF2Ig +ABN4IAAW3SAAE3ggABQqIAAWdSAAFfogABN4IAAVqSAAFWIgABT1IAATZSAAFJ8gABN4IAATeCAA +E3ggABRKAAAAAP///////w/8///w////APwgAKujIACtGiAArUogAK0QIACs0SAArMcgAKyRIACs +hyAArHYgAKwiIACtSCAArBggAKvtIACtSiAAq+MgAKvRARAYAQAEAAAAAAAAAAAAAAAAAAoAAAAK +AAAAFAAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEA +AQACAAMABAAFAAYABwAIAAkACgAOABEAFQAZAB4AIwAtADwAUABkAMgBLAGQAfQAAAAAAAAAAAAA +AAAAAAAAAAAAAQABAAIAAgADAAMAAwADAAQABAAEAAQABAAFAAUABQAFAAUABQAGAAYABwAHAAAA +AgAAAAYAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKA +AAADgAAABQEAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAA +AcAAAAKAAAADgAD/AAECAgAAABAgQAAAAAAABAACAAEAAIAAQAAgABAACCBAgAAAAAAAAAAAAAAA +AAAgCKlLIAipSyAIqQMgCKjKIAiokCAIqEsgCKhLIAiqQCAIqkAgCKhLIAiqQCAIqkAgCKhLIAio +SyAIp/cgCKpAIAiqQCAIqkAgCKpAIAiqQCAIqkAgCKpAIAiqQCAIqkAgCKpAIAiqQCAIqkAgCKpA +IAiqQCAIqkAgCKpAIAioJyADCtAAAAABIAMK2AAAAAIgAw8IAAAA/yADCDAAAAD/IAMKvAAAAAIg +AwrAAAAAAyADCsgAAAAHAAAAAAAAAAAgAwqgAAAAASADCqQAAAACIAMKrAAAAAQgAw8IAAAA/yAD +CDAAAAD/AAAAAAAAAAAgAwgwAAAAACADDwgAAAAAIAMJbAAAAAEgAwl0AAAABCADCXwAAAAIIAMJ +iAAAACAgAwmYAAAAQCADCaAAAACAIAMJqAAAAQAgAwmwAAACACADCcQAAAQAIAMJ2AAACAAgAwnw +AAAQACADCgQAACAAIAMKFAAAQAAgAwogAACAACADCjQAAQAAIAMKRAACAAAgAwpUABAAACADCmwA +IAAAIAMKhABAAAAgAwqMAIAAACADCVgAAAAQIAMJYAAAABEgAwlAAAAAACADCUQAAAABIAMJSAAA +AAIgAwlQAAAAAwAAAAAAAP//AAAAAAAAAAAAAAAAAAD//wAAAAAAAAAAIAMIwAAAAQAgAwjMAAAA +gCADCNwAAABAIAMI7AAAACAgAwj8AAAAECADCQwAAAAIIAMJGAAAAAQgAwkkAAAAAiADCTAAAAAB +AAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEA +AAABAAAAAQAAAAEAAAABAAAABwAAAAcAAAAGAAAABgAMNQAAEEaqABRYVQAYagAAACtoAAAjgwAA +GGoAAA0GAAALKgAAAAAAAAAAAAAAAAAAaCsAAGgrAABsggAAb5wAAEpoAABKaAAATSkAAEpoAABO +6gAATJgAAFI9AABPuAABhqAAAYagAAII1gACCNYAAgjVAAII1QACiwsAAosLAAII1QACtnIAArZy +AAMNQAAEBgcAAAAAAAAAAAAAAAAAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1 +ODg7OwAAAAAAAAABAxERCAgQCQMBAAAAAAAAIATAYCABrcwgADdAIAF9KCABqhggAaSMIAFeECAE +Lmwf/+o8IACXeCAArggf/90QIABmYCAAV8AAAAAAAAAAACABfuAgAIYwAAAAAAAAAAAf/9X0H//F +fB//wpQf/8AwIABSwCAARhwgAENIIACjGB//4/AgBq7oAAAAAAAAAAAgAEnQAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAACABtTQgAZVQIAC4WCAAt4wf//EQH//QoB//zDggAIOoIAVBmCABLoAg +AQ6UIAD1wCAA6jAgAN2sIADQJCAAuzggBMRYIAMmaCABI4ggA1SQIAHf1CAAZiAAAAAAIAC4vCAF +ulQgAKsYIAGH5CAAApggAJzYAAAAAAAAAAAf//RYIAC4dCADKRgAAAAAAAAAACADpswgACeEIAAJ +aCAAJoAAAAAAIAAyeCAAMBAgAC1AAAAAACAANwAgASdIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAIAA0nCAEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAANkAg +A6/AIAA1UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAICwAAACADEugIAAAAIAMS +9AgAAAAgAxMACgAAACADEwwMAAAAIAMTGBIAAAAgAxMoDQAAACADEzwOAAAAIAMTTBMAAAAgAxNc +CgAAACADE3AOAAAAIAMTfBgAAAAgAxOMDQAAACADE6gOAAAAIAMTuBAAAAAgAxPIEgAAACADE9wO +AAAAIAMT8BAAAAAgAxQAEQAAACADFBQKAAAAIAMUKAsAAAAgAxQ0DQAAACADFEAUAAAAIAMUUAoA +AAAgAxRoDwAAACADFHQGAAAAIAMUhAYAAAAgAxSMBgAAACADFJQGAAAAIAMUnAYAAAAgAxSkCQAA +ACADFKwGAAAAIAMUuAQAAAAgAxTABgAAACADFMgLAAAAIAMU0AsAAAAgAxTcBAAAACADFMAEAAAA +IAMU6AkAAAAgAxTwCQAAACADFPwAAAAAAAAAAA0AAAAgAxUICgAAACADFRgGAAAAIAMVJAIAAAAg +AxUsAwAAACADDtwBAAAAIAMVMAAAAAAAAAAA12qkeOjHt1YkIHDbwb3O7vV8D69Hh8YqqDBGE/1G +lQFpgJjYi0T3r///W7GJXNe+a5ARIv2YcZOmeUOOSbQIIfYeJWLAQLNAJl5aUem2x6rWLxBdAkQU +U9ih5oHn0/vIIeHN5sM3B9b01Q2HRVoU7anj6QX876P4Z28C2Y0qTIr/+jlCh3H2gW2dYSL95TgM +pL7qREvez6n2u0tgvr+8cCibfsbqoSf61O8whQSIHQXZ1NA55tuZ5R+ifPjErFZl9CkiREMq/5er +lCOn/JOgOWVbWcOPDMyS/+/0fYWEXdFvqH5P/izm4KMBQxROCBGh91N+gr068jUq19K764bTkQcM +ERYHDBEWBwwRFgcMERYFCQ4UBQkOFAUJDhQFCQ4UBAsQFwQLEBcECxAXBAsQFwYKDxUGCg8VBgoP +FQYKDxUf/8AAAAQAICAG35AgBuRAH/zeACAG39Af/6wkH/+tNB//sKADgAAAgQAAAB//sJAA//gA +AQAAAAAQAACBBAEAgQQAAAEEAAABBAEAgAAAAAAF//8f/4VABgAAACoAAAAf/8/4IARBfAIAAACA +EAAAQUAAAEFAAQCDAAAB//+//7////8f/5jcBAAACCADDPiBgAAADAAAAB//kzD//wAA//8A/wAB +AAAAAP//H/+xkB//qNQP///////QZP//02Af/2acH/zg6CAG3Wz//770H/9mkB//ZxT//8FgH/+t +7B//nuQf/OIAAAAIuOD//gDhAZIAH/+ZUAD///8f/64MH/+dhARBAAgEAQAIpQAAAMAAAADABAAA +MAAAAB//rpAAAB1AAAD/gCAG3CAgC2Aw4QAuAB//roQf/6pMH/+vQB//qrAAABeA4AAAoOEAMLgA +AIAA4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+zwB//s7gf/OAIH/+zvB// +s9gf/7PQH/+z1B//s/Af/7PoH/+z7CAG39Af/7GQH/+sJB/83gAf/600H/+tMB//rdAf/52UH/+w +3B//qjggCwBgH/+vXAAA/4AAAB4gH/+TMB//r2gf/69kH/+vyCALBnAEAAAIBQAAAIP/AACBAAAA +ABAAACoAAAAgAAmsIAMMGB//iZAf/4VAH/+HRB//sKBnRSMB782riZi63P4QMlR2H/+AAAAAPygg +Aw7cz////yALB2AQAAAAP////wIAAABAAAAA//9//yALCIAf/7CQIAAjuCALCLAgCwkgCAAAAAD/ +//8gCwmQ9////yALC4AgACBg//7//yALFmCAAAAAIAMM8AwAAAAAAEAAAAD//wAAgAD/+///D/aA +ACALGdAgCxoAAAEAAAAEAAAgC3RAH/+t4CAAMnggADRYIAAwECALGpAgAC1AIAsbICALG3AgCxwA +BAEACOAAAAAgCxyAIAscQFMAAAAgCxygUgAAACALHOBRAAAAIAHpBB//qqQgCx9wIAsf0CALH6Ag +CyJQH/+uDCALIqAf/52MH/+tsCALJJAUAAAAgAAAAngAAACAAAAGgACwAAAACgAA4zCS///wAIAA +sQDhAZoAAAIAACALJFAf/5sEAAB+QB//reQA/8AAH/+t8B//k7QBAAAAKAAAACYAAAAgCyTAH/+T +8AYAAAAFgAAAH/+p/CsAAAAgAE04IAt28B//q5gDgAAAB////zUAAAADAAAAAD///4BAAAAID/// +H////yAAAAAAAMAAH/+tyD0AAAAf/5l8BwAAAIEEAQCBBAAAH/+sFAAAOpjDAAAAAAAP/wBDAAAA +AAgABAAAAB//q8wgC3dQH/+zNB//sbAf/5jcAAYAAOEAegAf/5lMH/+t1CCgAAAf/6wsH/+dnB// +nYggC3eAAAMHgCALd/Af/5toACAAAABAAAAAAAkAAAAwAv/8+H/AAAAAo/+7AKP/ugANAAAA4AMA +AIP/tgAP////D//4AP8AAAAgC3gwIAsmICALJlAgC3jAAA8AAAAKAAD//wAPA//AAIP/wAAgC3lA +IAt5sB//rrAf/7Ig/2DwAB//sgAf/5LwBIAACB//gFAARAAA/x///wDAAAABgMIAAACBAPAAAACB +gAAA/3///x/84HQf/6jU/7//////AAAAgAAAAACG3R//ntwf/OIAH/+T4O4AAAAAAAm8H/ziDA8A +AAAgCyaQH/+uUAAACLwf/69UH/+fWB//mXgf/4BgIAbdwAAAMAAAACcQH//cgCALgbAgC4GAH/+u +tB//mXAAAP/+H/+dfN6tvu8gAwfgNAAAAD8AAAAf/69wAACJBgCZAAAf/7D4EAAHAgHAgACZAAAA +H/+v4ACIAAiCgAABH/+xSAMVAAADEQAAAA8D/yALKwAf/620IAuCACALK2AgCyuwIAssQCALKzAg +AOTUIAssECALLeAgCy4QIAsuYCALLsAgAOp4KQAAAAAAiRQgAPDcIAuCcCALgtAgAPrQH/+vAPDw +8PD/AP8AqqqqqszMzMwf/7JAAAAfEB//sEgAA///AAAn/yABA1AgC4NAAA9CQCADW7Af/66IAAkA +AAAASACCAAAAIAEnUCALg7Af/640OwAACA4AAADQAAAAH/+AoAAAH8oAAAhQAAAfQCALOBAgCzgw +IAs4UAAJAAgf/7FEMAAAAP//9/8gCzqgIANh9AAAg/8gBuMIFaAAACAG5AAf/7EIH/+t3AAACAYA +AIjMfwAAAAAAD/4gC4hwIAuJAAAA4AAgC4ZQIAuI0B//mxwABAP/CgAAACAG4Egf/62gIAbgkB// +njCD/7cAg/+2ICALOtDhAAAAMwAAAB//sRAf/7IEA//gAH///wAAP/aQAAAf2AP/8AAgC2WwIAtl +cCALZdAf/7MQIAs7UBoAAAAgCzugIAF1cB//sQwAD///H/+vMB//rewgC4mQH/+dvB//qlAf/6xE +IABqiCAG3UggAAWIH/+pMB//mpgf/5kYH/+qqCALPrDABAAAH/+sOB//rFAf/7HwH/+xZCALiqAg +Cz7wIAMNoCAAa2jgAQAAH/+e4CALi/AgCz8wIACn8B//ntggAKTwIAuLcCALi8Af/5s8IAtBQOD/ +/gAgC2hQH/+e5CALTOAf/63oH/+VbCALVwAgC1eQH/+xtCALWkAgC1pwSAAAACABvQgf/6uoIAG/ +DB//mcwf/6pMH/+pRB//rDQf/6lsAAAYMAAAFjwf/6x0IAbfxB//qfQf/5lQ4QAuAB//rIDhAF4A +4QIOAP//v//hAA4A4QGOAP//vv8f/52EH/+qgCABwnggAc6g4AUAAAP/AAAf/6m0IAMM+B/8v/88 +AAAAAAX//4MAAAAf/6lMIAHkmCALY/Af/67EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIGAAAAAAAAA//// +/////////////////x///IAf//yAH//8SB///Egf//xIH//8SB//9dAf//j4H//3VB//91Qf//dU +IAaw2AAAAAAAAAAAAAAAAAAAAAAgBrQgIAa0IAAAAAAAAAAAAAAAAAAAAAAgBrDYIAaw2B//+ewf +//nsH//57B//+ewf//nsH//57AAAAAAgAcOQAAAAAAAAAAAAAAAAAAAAAAIBAAAAAAAAAAAAAAAA +AAAEAAAAAAAAAIGAAAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAAAAAAABgFAAAAgAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAIAoAEfKTE/KT0w8D5jEBAgAW8pEX8pJ3awaQYLRmd2P4VA8xVcbQ +DxQAY//5AAAAbBAIKCAFJyAHKTEF+CCGFeAZRQD5AA6FYXcBAIoiFvKE/eUIBeAMlQDxV7wN4A+l +AOrygRvHAoAApogrgp4KeQopkr/9YA2DogCdACiCnQmIAegWBSQNUYAAKNII9wANqJIAnQArYq7s +8nUVirmAACpirSzCf+yrAQRz/QAA/UAKHiIAnQAu1gj9QAoeIgCdAC8gFKT/Dw9HLyQU9eAMXdIA +nQAZ8mcuIhYsISmIFR/yZa7Mn4DqIh4uZ8KAAP0AZhWgDSUA/QBGFeALZQDt8l4dVgKAAAuqAosU +moHpABUEQEEAAIkVCACKKDwQ/SDGFeBMBQD9IOYVoAxFAOy7NgTIgQAAbbkFCACGCQJh7vJPFaCH +gACIFe4ABQ3PAoAAqYjojCAlpDUAAAvJDG2ZAggCYS0hKdMP6iEoJugFAAANDU8tJSn9QAd0YgCd +AP/kgAXgDBUA+iCoFeAe5QDqIh4uzUKAAPggJhXgCAUA+CAGFaANBQDoFgIl2YEAAFiEkv7gABc3 +xQEA98AARzANlQDt5p0oBAqAAPmABVlSAJ0AwCDRDwAAAOokAAnYBIAA7EQACugEgABYhnvSoNEP +AAAAAMCwD4k06dYILfYuAAD6QGgdoBvFAPwAAh2gDRUAWIs/Y//BAADqJAAK2ASAAFiIFNKg0Q8A +//lYDaAIBQDqJAAD2GEAAPwAAh2gDZUAWIszY/+RwKBZwEYd8gaI2Pkf8giQD6UAY/+k2iBYC4xj +/nAAAAAAAPwAAh3gCgUA+kUkHa/8KgCKJ+tEAApoBIAA+0QAFaAMBQBYgAvSoNEPAAAAbBAGLiIQ +lBHlIRoq0ASAACYgB/ZBKBXgH8UA6hYAKsfCgAD/AlIN4WYBAAcJQvEgcA3ihQEAZIHy1PApIAX8 +QEgVoBuFAP6eAA2wGkUA+yAPlSIAnQDn8d8eC9YAAOXx2xtPAoAA9MAMEhIAnQClmS2SngdqCiqi +v/egEbtSAJ0AKZKdCpkB7pQABI5JgACMKYsqDAc+DLsM92AJA+IAnQAqIE4tIEyxqPugDewgCxUA +KCROKjABKSIY80AN9pIAnQArIActIST4YCQVoAxVAP1ABAUwuxEA4KoRDdqCgAALqgIb8cMKiAIq +IQcsIQkL3QL7BgAMeqoBAOvxvh1TAoAACswCKiEimOCIIJzjneQLqgKa4v0AABQwCmUACogCmOEt +IhCd5SwgOBvxs/gAIh2gTRUA+cEmFaDMGQAM2Dkd8a+U6Ay9OfmmAA6wCwUAm+cY8aKd5u3xoxTg +BQAALCYYm+uZ6ugAFQdIwQAACQCK7eYOIchBAADv5g8neQEAAAkghg8CYwkAhg8CYQxuEaXu6uad +I4CxgACIKS8gOKeIKCYJ8+AIF5IAnQCJEAkJR/kgBwFSAJ0AwCDRD54S6iQAC9gEgABYiOqOEv9N +EA3gH8UA7BIBKVAEgADtEgAp2ASAAFiF19Kg0Q8AHvF5iuj3QAY4kgCdAAxpEaWZK5Ke92AGi1IA +nQApkp0Haworsr8LmQFkkL+wrJzo7pQADPN+AABgACwAAAAAAPPf8EhSAJ0ACVQM9J0AFa/4AgAA +AAAAAOsSAClQBIAAWIdk0qDRDwDqJAADWGEAAPwAIh2gDWUAWIqFY/9pjSLA5A7dAvxARhXv/X4A +AAAA+EOoFaTZAQAA0QQAvBoMiAL4Q6YVr/jGAIonjRHAwOqsIC7YBIAAWH9g0qDRD9ogWIVtY/75 +AAD/9zwNoAkFAMCgWb+EHvFDiuj5X/l4kB/FAP/9KA2gCQUAwJDAugurNPvBBhXv/O4AAAAAbBAO +lRwoIhAuIgknITUpIAcjFg4qMgL+YIgV4A0VAPxgaB2ntQEA4yEaJdv5AAAL2zn6IaYV4ZkBAOf/ +Ngm3woAA/sJSDeOqAQAODkLxwHAN4tMBAGTUYyYgBcHo+f4ADzAXRQD2wCQdYgCdAIciix705fwN +4A6FACuwAZ8R82AhJxIAnQCZEJkamhQY8Rbt8RcSKA0AAOUWCyyvAoAA6FUIDN+CgACtu+sWCSJw +BQAAiRqeGI0b9SAGqhIAnQArUp6GGf1gCiPiAJ0AL1KdJmK/Bv8BZPQ5GfEEiZj3IAmYkgCdACqC +rmShUhrxASOCrSqifx3w/Qo7AesWBSTb/QAA+mAJ5iIAnQCb2PpgH2YiAJ0AhymGKgwDPgdmDPLA +CaviAJ0AKRoA8yIyDeD69QArIBacE/tgCf0iAJ0AixGGwyogOPfg5hWgBgUA9+EmFaBHBQD74QYV +4KoZAAp2ORfw75YWLSIXFvDsnfotIhud+4nECnY5lhf5YBFK4gCdAIYdnh/sFgMjDdmAAGABCBnw +1omYapEuixsqUp6PGXujSy1SnS/yvw/dAZ0VhhXr8M4U0/0AAO9kAAMB6YAAmrhl/xNgA0qeH/wg +ZhWgCgUAWb8FGfDFiZgY8MKME+4SDySO2wAA//9cDaAPBQDAoPogphWv/uYAHfC8wLoLmzT7oQYV +7/72AAAAAAD/+xQNoA8FAJ4fLxYQ/CBmFaAKBQBZvvEZ8LGMEy8SEImYjh8Y8K35P/VwkgCdAGAC +vcCgmhWLFRbwqcDaDZ007WYILfYmAABgAqSeHy8WEJwT6iQACdgEgABYiAiMEy8SEO4SDyV1oYAA +YAJanh8vFhD6QPAVoAwFAFiH4YwTLxIQ7hIPLXVmAABgA8eOF4sTiBSMEfYgyBWvigUAKiQ7DJkM +CGYCmbSs2AbuAi0iEOgmGylQBIAAWIaOjh+MExjwhvqzphWhCQUAc5sNKyAWKgr/+2AETSIAnQCK +KSsgOA8CAKOq6iYJKAQKgADzYAQ/kgCdACYhNS/CBCshGikiEOb/Ng3vwoAAf9sLCgpCZKAFCw1C +ZNBz/iAmFeAdhQD5/gAO8AoVAPohphWgBjUA9iGGFa/1xgCKJy8WEIse6qwgKmAEgABYgx4vEhCa +Ey0iG/lAiBXv/N4AAAAAAAAA6iAHKeAEgABYh3sY8FuME/4h6BWv/Z4A2iBYhH0Y8FaME44f+kEo +Fa/9tgBxnogKvwz//QAV7/4KAIsUihYtIhAZ8FwLqgIb8FwKaAKGHRrwUwmIAunwUhsLPgAAIxYR +JRYSJiAHhcAjIQf2QSQV4GYRAOtVAQsygoAA9qYACrozAQDmISIpmwKAAAN3AgpVAiMhJAlmApXw +hSCX85by/eCmFeOYAQDo9gYsygKAAAk5AuMSESJT+QAA6fYEKq4CgADl5QIGQIEAAOX2ASfIwQAA +5RISIhQ1AABtqQUIAIYJAmEmIBSkZgYGRyYkFPTACDXSAJ0AiBj4s6YVoQcFAPLh8g3g+fUAKyAW ++WAIzWIAnQAqIhexquomFyGAqYAAjCkrIDijzJwp82AHn5IAnQCNHWXQz8Ag0Q8vIE5k+9kOeAL4 +QEYVoACGAAAAAAAA8x/cwFIAnQAOPwz//QAV7+42AAAAAAAA6xIOKVAEgADtEgwqYASAAFiEXdKg +0Q8A6xIMKVAEgABYhgDSoNEPAPpAaB2gG8UA/AAiHaANFQBYiSFj/8GLEPpAaB2gDBUA7RILJdhh +AABYiRtj/6kAACYgO2RgceokAA5YBIAA/CAoFa+JBQDpJDsscASAAFiF7fohBhWgCwUAKyYb+kdm +He/7zgAAAAAA6xIFKVAEgABYCWlj/u+KJ+tEAApoBIAA+0QAFaAMBQBYfe3SoNEPANogWIP7Y/8I +6iAHKeAEgABYhvFj/twAACchCSUWEiMWESQWEyYgB4TAIyEk9EDkFeBmEQDrRAELMoKAAAZEAgpE +AvZERBWqtQEA6yIHLdMCgAAKdwIJZgIqsRWaEpTwhSCX85by/eCmFeNIAQDo9gYqIgKAAAQzAuP2 +BCXYgQAA9CJoFa/DBQADuwEjEhHrqQgKrgKAAAXlAuX2ASZggQAA5RISJMkBAADpy0N+QASAAC1M +/gzWEaaG5pM7d+DBAAD0n+/xEgCdAG3ZBQgAhgwCYWP97YsQ+kBoHaAMFQD7YkAV4A0FAFiIyGP+ +WgAAAPuPAAw//vYACJ0MDUkUbZkFCCCGDAJj79oIBcEBAADpTAwFSMEAAPWf7UESAJ0AK8z+bbkF +CECGCQJlY/2UAABsEAYoIAUc74n33w4F4BpFAPsACp0iAJ0AKyBOiciwuyskTvcgCMiSAJ0ALnKu +7e+BFxFxgAArcq0t0n8NuwHmtAAFkSmAALCe7sYIJYg5gAAvIBSz/w8PRy8kFPXgEMXSAJ0ALiBz ++EOoFe/69QD7wAQA0AsVAOC4GgdoBQAA+xcADTTdAQAtJHMJiAEIuDkKmQHpJh0sBw4AAIoifKcE +KCBOyY99pwgrIEwpIE57kxTMbCwgFO0iAi5YHAAAZNHJwCDRDwCOJ8fzD68B7yYCJ1DBAABYdVrj +72UVATmAACigANMP0w8DiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/ciSfTD2SfpiqZFMqniplk +r5wooAADiAooghDsoActWASAAPpAaB2gDTUAC4AAZa/gY/96AAD//1QNoAoFAMCgWb16HO85icj5 +P/bokgCdAMBgKSAUs5n4QoYd7/weAAAAAAAAAADqJAAK2ASAAFiFMtKg0Q8AKiAFKyAHwdT9QA5l +YbsBAAUFR/igDnlSAJ0AkxCNNp0S7e8lHZgEgAD1YAmKEgCdAAy6EaeqLqKe98ANnNIAnQAqop0N +vAoswr8MqgFkoT36QAgV4AwVAFgh3x3vGSkhCRjvGSshIi8gBx7vIywhJPlmAA2w/xEA6BICL/qC +gAAPzAIOzAIspgCOIJui+UCmFaAPJQDppgMvdgKAAA/uAv9AJhWgCQUA7QAVBVBhAACxmeqDHgyP +6AAADDkR9yAARPAIpQAolp30v/K5EgCdAIon60QACmgEgAD7RAAVoAwFAFh9CWP+Ov/3bA2gCwUA +wLoLmzTrxggrbwYAAGP+2+okAAtYBIAAWAh1/d3UBa/3dgCKJ8Cw+0QAFaAMFQBYhbYZ7vaZoP5A +CBWgG8UA+d3oBaAMFQD5QEYVoA0VAP3AABcwCBUA6O4CDXgEgADu9gEpUASAAFiIAsAg0Q+JyPcg +BKCSAJ0ADDoRp6ouop73wAVU0gCdACqinQ0+Ci7ivw6qAWSgmLCfn8hlrsGIIusWASQE4YAA+L/s +OVIAnQCKJysKAPtEABWgDBUAWIF6ixAe7tKeoIwgHe7SnaL9gAAWMA0VAA3MApyhi7b7QGYV7/VK +AAAAAOtUAAlQBIAAWIS4Y/08jzP+IEYV7/jWAP/5ZA2gCgUA+iAmFeAKBQBZvOwc7qyJyIsRHe6r ++T/6uJIAnQD//cgNoAoFAADAoMCKCJg0+YEGFa/9igAAAADqJAAF2GEAAPwAIh2gDaUAWIfHY/9R +AABsEAQoIBTvix5qGASAAIon+mBoHeAMBQDqrCAp6ASAAFh8p9Kg0Q8AiyJzvksU7o+KSGqhRxvu +jCyyrsrHHe6NLLKtLdJ/DcsBfcAbsK6eSH3AIS8gFO8kFC/a0AAA2iBYCA1j/6fAsMCKCKg06EYI +Lf8WAACJIsmVwCDRD8CgWby7ikhroa1j/+oAAAAAAAD6QGgdoBvFAPwAIh2gDRUAWIedwCDRDwBs +EAgsIg8vIAcoITQnMgf+Q0QVp9UBAPm/wBXgCxUA6bk5CbAEgADrIgkqUASAAPgghhXgBBUA6Hc2 +D0/CgAD3IlIN4f8BAAsJQvEgcA3ijgEAZIJywbTsex8OlHQAACwgT+kgTSZgBQAADAxHLCRP/SAU +o6IAnQAsIAX7gBL9YgCdAI0i+iAGFa/7NQD9YA5Y4gCdACgiGY4y+cAU1SIAnQCJOBjuSxzuSOSS +Ym/fgoAAmhCYEay76O5CFUgNAACZE+sWAi+nAoAAqET14A0iEgCdAIsTKkKe+0AbG+IAnQCKEilC +ndMPKqK/CpkB7pQABJJxgACMKYsqDAU+0w8Muwz1YAnb4gCdAC0aAPWh8g3g+PUAKyAW+WAZdSIA +nQAsISIZ7j0oIQcqISQrIQn8QPAV6ogBAOmqAgxDAoAACLsCGe42GO4nDS1A6cwCDuqCgAAI3QKd +4IkgnOKa5PvAZhXgClUA6+4uHM4CgAAKmQKZ4YgvmOUsIDj3wQYV4A0FAP3A5hXgCiUA/dxMBeBJ +JQD4wIgVoMwZAAyaOZjpDNs5jWWd6h3uIPzAyBWgCQUA7OYLI4fhgAAKnBANzAKc7IwRiWiX75nu +iGko5hCNai3mEewAFQdJIQAACQCKiGf44AujogCdAB/uBQq9Ag/dAp3mwMX8k6YVoQkFAPUh8g3g ++PUAKyAW+WATpSIAnQAsIhmKKSsgTykgOOWqCAZgBQAA7CYZJdv9AAArJE+aKfMgD4+SAJ0AixRl +se/AINEPnxWfFp4X6iQACtgEgABYhUWOF+8SBSV1kYAAjBRlz9uKJ9sw7BIAJVDBAABYgFTAINEP +Gu3Uiqj3QBCIkgCdAIwTK0Ke/WARQ6IAnQCLEilCnSuyvx3tywuZAeSSFGVj/QAAnNjulAAM8mYA +AGAAjiggOfEf+A4SAJ0A//vkDaAJFQAAAAAA85/sSFIAnQAJ5wz2/YAV7/X6AAAAAMGze8kUKSA6 +mhD+IMYV4Az1AP0gEP0iAJ0A6iQACtgEgABYg7TSoNEPAPAAGA2gGtUAwKGMNyshCY04jjLrrxEN +3QKAAA+7AuS7AglQBIAAWIOYwCDRDwAAAP//WA2gGoUA6iQAB9hhAAD8IGgV4AwVAFiGx2P/BQAA +CrgCmObA1fyTphXhDAUAdcsNKyAWKQr/+WAONWIAnQCKFGShXYtqjGeKaat7B8wMnGf3YNIN4A4F +ALGqjGWbaotmmmms6qt7d7sBsaqOKZtmmmUtIDil7p4p86AKN5IAnQCJJyiZFMqCi5nJvhntjyiw +AJ8VnxYJiAooghAssAf6QGgdoA01AAuAAI8ViyLHo/tf8oDiAJ0AKCE0h2cuIRqKL4sp6Hc2D2fC +gAB3ywoLCULIlA4LQmSwtMHU+v4ADrAMFQD8IIYVr/KuANogWIGMY/4KiifqrDArWASAAFhsOdKg +0Q8AAP/yqA2gCQUAAACfFZ8Wnhf6QPAVoAwFAFiEo44X7xIFLWX+AADqJAAH2EkAAPwAIh2gDQUA +WIZ+Y/3gAAAAAADqIAcq4ASAAFiEbWP9gZ8V/iDGFeAKBQBZu4oa7UqKqI8V+V/u2JIAnQD/9+AN +oAkFAMCQHO1EwLoLqzT7gQYV7/eaAAAAAADzX/o4UgCdAAnnDPb9gBXv/PIAiiefFe8WBinYBIAA +7BIAJVDBAABYf7TWoP4gqBXv+hYAnxXvFgYpUASAAFiBVP4gqBXv+rYAAADBU/pAaB2gCwUA/AAC +HaANNQBYelErIAWPFooQ9X/ahWIAnQBj/SGfFZ8W6iAHKuAEgABYhD7+IKgV7/iuAAAAAGwQDpMc +lRqIL4opLiEaJyE0LzIE+EDwFee1AQD7f8AV4A0VAAvbOesWCyngBIAA9+EAD/GZAQDnIAUvN8KA +AP7B8g3iqgEA8UBwDeJuAQBkZEHBpAj6jfrgI00iAJ0AjiKLHPXEXA3gCoUAK7ABnxLzYCBXEgCd +AJkR6Oz8ElgNAACbGRvs/OkWCCyvAoAA6FUIDNeCgACrquoWByJwBQAAhhieFosZ9MAF6hIAnQAq +Up6GF/tACWPiAJ0AL1KdJmK/Bv8BZPQhGezqiZj3IAjgkgCdACqCrmShORrs5yOCrSqifx3s4wo7 +AesWAyTb/QAA+mAJHiIAnQCb2PpgHqYiAJ0AhymGKgwDPgdmDPLACOPiAJ0AKRoA8yIyDeD69QAr +IBacEPtgCSUiAJ0AG+zoKSA4+9nMBaAGBQD34OYVoEcFAP2AiBXgmRkACXY5Cbo5ixKaFJYV/WAR +0uIAnQCGG2Rh02ABAxnswomYapEuixkqUp6PF3ujSy1SnS/yvw/dAZ0ThhPr7LoU0/0AAO9kAAMB +6YAAmrhl/ytgA0qeHfwgBhWgCgUAWbrxGeyxiZiMEBjsru4SDSSO2wAA//9cDaAPBQDAoPogZhWv +/uYAHeyowLoLmzT7oQYV7/72AAAAAAD/+3QNoA8FAACeHZ8e/CAGFaAKBQBZut0Z7J2MEI8eiZiO +HRjsmfk/9jiSAJ0AYAK+wKCaE4sTFuyVwNoNnTTtZggt9u4AAGACpZ4dnx6cEOokAAnYBIAAWIP0 +jBCPHu4SDSV2eYAAYAJdnh2fHvpA8BWgDAUAWIPOjBCPHu4SDS12TgAAYAPEnBD+IaYVr4kFAOkk +OyY4QQAABwCG5xICJ7CBAAAGAmGNx5f4isSJxq19B6oMmsR32wmeHewWACTIBQAAjBKLEIYVjhSZ +tp23Bu4C7SIPKVAEgABYgnKOHRjsaowQ+rOmFaEHBQBzewgrIBYpCv95uX6KKSsgOKOq6iYJKAQK +gADzYAQnkgCdACYhNI/EKyEaiS/m/zYN78KAAH/bCgoKQsikCw1CZNBz/iBGFeAdRQD5/gAO8AoV +APohZhWgBjUA9iFGFa/1xgAAAAAAAJ4diiefHosc6qwgKmAEgABYfwLvEg4tYASAAP4hqBWv/FIA +6iAHKeAEgABYg2GMEBjsQP4hqBWv/bYA2iBYgGOMEBjsPI4d+kEoFa/9wgBxnogKvwz//YAV7/4K +ABfsPhvsPh3sQwapAoYbGuxC7ZkCBkBBAADlYVRn6IEAACUWEJMfJSAHg8AFJUDqMwEKqoKAAAUz +AgczAichByohIiYhCfRB6BXqdwEA66oCC7sCgAAHZgInISST8IMglvOZ9pry9eCmFeOpAQDlEhAt +UgKAAAp3Auf2BCmeAoAAA+MC4/YBIlP9AADjEg8iDDUAAG2pBQgAhg0CYSYgFKRmBgZHJiQU9MAI +HdIAnQCIFvizphWhBwUA8uHyDeD59QArIBb5YAi1YgCdAMg/iykqIDiju5sp80AH35IAnQCMG2XA +18Ag0Q8tIE5k2/MK6AL4QEYVoACGAAAAAAAA8x/d0FIAnQAK7wz//YAV7+6+AAAAAAAA6xIMKVAE +gADtEgoqYASAAFiASdKg0Q8A6xIKKVAEgABYgezSoNEPAPpAaB2gG8UA/AAiHaANFQBYhQ1j/8GL +EfpAaB2gDBUA7RIJJdhhAABYhQdj/6kAAAAAACYgO2Rgdyv6gCskO+wSAi5YBIAACCCGDQJj7PYI +LPAEgADtIg8pUASAAFiB1fogxhWgDAUA/EdmHa/7ygDrEgMpUASAAFgFU2P+8oon60QACmgEgAD7 +RAAVoAwFAFh519Kg0Q8A2iBYf+Vj/wDqIAcp4ASAAFiC22P+3wAAACchByQWESYgB4TAkx/yREQV +4GYRAOpEAQsygoAABkQCFuu6LCEkiicGRAImIQn6ZgAJ+ncBAOuhFSu7AoAAB2YChy+U8IQgl/WT +8vfgZhWjOQEA6fYGKZoCgAADzALjEg8qJgKAAATkAuz2BCVQgQAA9eAmFa/MBQAMqgGqvOQSESZh +AQAA7Is9fEgEgACwSAyGEaaWdsM29J/wiJIAnQBtiQUJQIYNAmVj/gCLEfpAaB2gDBUA+2JAFeAN +BQBYhLZj/mIAAAD7DwAM//8OAAnMDAxIFG2JBQlghg0CZ+/NCAVJAQAA6EwMBsCBAAD1n+3YkgCd +ALDObekFCYCGCAJpY/2oAAAAbBAGKCAFIyAHJAoD/Q9ARFEzAQAoICJkgG8CKgJYeAr9TMCA0A0V +ACwgIRjrbQ8CAOwzEQZ9VoAAqDMpMp4PAgBuk0UrMp1ksD/6QAgVoP7lAA7OAf3GAA7wDwUA/EQm +HeAJBQD4IAYV4AwFAPggJhXgDpUA+CBGFeANBQBYfb70c6YVoAIFANEPwCDRDwAAbBAKKiAF+EDw +FeAMFQD4YGgdp7UBAOgWACXb+QAA68s5ChgEgADrFgUsIASAAP1BwARRmQEAwcP9QCAlIgCdAI0i +7+tFHpwWAADr60ERsBEAAOYWBCz3goAAr+7uFgMs1wKAAKuq6hYHLMAEgACHF/UABCISAJ0AihQn +cp6GE48X+uAHW6IAnQAmYr8v8p0G/wHvFgYnmhGAACUhG4pChymGKgWlNvVPAA5xCwUAfLMB1aCY +GgdmDPTABePiAJ0AKhoA9UIyDeD89QArIBaYGv1gBf0iAJ0AikL6oA56ogCdAIwVG+s2h0OYGut3 +AQYI+YAAYAC2AAAa6xeKqOgWCiUM34AAixeMFIYTK7KejxcmYr98s0Mv8p0c6w4G/wHk8DllW/0A +AJvI7xYGL/tuAABgAqMAAAAA+CFmFeAKBQBZuUQa6wSKqIkb6BIKJQ7fAAD//0wNoA8FAMDwHOr+ +wLoLqzT7gQYV7/8GAAAAAAD//HgNoA8FAJkb6iQACtgEgABYglyJG+gSCiV5qYAAYAI1AJkb+kDw +FaAMBQBYgjaJG+gSCi15lgAAYAMa8OAEiFIAnQAtIRqMKZcY+CFGFaLtAQDpFgsvBBYAAJcY+CFG +FaLsAQDpFgsnA4GAAJga6RYLLv/CgAB1+14O1Qz51egFoLfpAOZCAy3cgoAAC3kCmRgIZgH2gGYV +oAECAIonmRsrEgDqrCAp4ASAAFh9hokb+CFIFaALJQDrpAItIASAAOqiAigECoAA8v/7uFIAnQCM +KZcYmBqZG44YjxblrQwKWASAAOXMCAlQBIAA7UYCKugEgADsJgkp4ASAAFh9oYgaiRuPF/vzphWh +DgUAdesIKyAWJgr/drkMwKH6IKYVr/d2AAAAAOogByrgBIAAWIHLiRv4IUgVr/+KAI8pGOrFiRal +/58pjEOLQI0V58QABMiBAAD8DgAFN+sBAO4WAS6I5gAAJyAHBwdBCHcKJ3Kf7q0QDVPCgADtqgIC +QEEAAOp3AQHT/QAA58cCAYw9AABtqQUIAIYJAmGLQMCAmBIZ6rAa6q8vIRqGFh7qrCQhBxjqqfwg +KBWh1zEA/6AARrpEAQDt0IAqJwKAAOzMDyZwQQAA+IYACjTMHQDkZgAmYAUAAAw8DBTqhA1dDOgi +AC/6AoAAn2aXZ55jnWUMpDkJiQLpZgQsRgKAAORmAiHQBQAACKgCmGEmIBTjZggNIASAAOYkFCgE +CoAA82AEGpIAnQCIF/UTphWhBwUA9OHyDeD59QArIBb5YAUdYgCdAIgS0oDRDwCKFWSgo8Ag0Q8A +AAAAAAAA6iQABNhhAAD8IIgV4AwVAFiDhWP/2Yon/CEmFafbQQDqrCAoBAqAAPWgBGHSAJ0AjBYr +CgHszCAp6ASAAFh4ZJoS+oAIFe/7zgAAixbsTREJUASAAP1gAEXwDBUAWHay9IBgFa/9ogBlu/z5 +X9/I0gCdAC8gIPH/33eSAJ0AY/9zAAAAAAAAAOogByrgBIAAWIFZiBLSgNEPiifcMOsSACVQgQAA +WHzuwLL7QEYd4AIFANEPAAAAAOs0AA44BIAA/GBoHeAMBQBYeEHbQOw0AAroBIAA6hYCK/AEgADv +EgYpUASAAFh9DfqACBXv+xYA6iQABNhJAAD8ACIdoA0FAFiDSWP+6QAAbBAIkhSTFRnqK4hA+CBG +Fa/LBQDrKgECcCEAAPogZhWniEEA5IHAYlARAACPEy0hBamMLMAAr98EzAvv/EAuWASAAP+ADYri +AJ0A+iAmFaBoAQD+ACId4A0FAAb9OAvfC+vdCgfYIQAAghWeEPkAAEVwDCUA8kEAFeAPBQDyQIAV +oAIOAI0UDlUM/+AgFaADBQDv5AAEQAUAAPEOYA3gfgEAhhMioAAt0QUEIgvm1ggJWASAAOIWBiMx +AQAA9kAGeqIAnQAIBkDyACIdoA0FAAYtOAvSC+vdCgFYIQAA9yAQFaACFQAHIziHFQdmCxfqAqc3 +J3CgBjIKBjML7HwIAZghAACO0AsAiQXuNi4mAAMAiyLSAOqsASTIBQAA9F/7I+IAnQAFKQwOKgz7 +oAYVoAcVAPVgKBXgBgUACXY4CGgIIrIABeUIJbYBflsCIiwB4rYAJn0SgAAW6emLEh7p6Oa2AQeQ +BQAABiIChhXuuwEMbgKAAA27ApJg+oAGFeEsHQDRD4sQ/CAoFe/9UgAAAPxPAA3//MYAhRUZ6bkF +xQv4AAoV4AIFALEi5YMeCQ/oAAAd6dKGEhrp0u1tAQfYBQAADbsCjRXqZgEMTgKAAAlmAuvWACYQ +BQAA9oAGFaEiHQDRDwAAAADqFgEtaASAAPvAaB3v+dYA/Y8ADf/5PgBsEAz4QEgVoAoFAOsgBynI +BIAA8oBoHefFAQD9n8AVoAQVAOxMOQy4BIAA/CEmFaG7AQDzG1wN4AwFAJoWnBWZE5sUmxsuIBYV +6Yod6Ysf6a3vFggtx4KAAO2ICA2nAoAApUQd6akoFgr50wQFoP/1AH/hEwIqAlgspBjpfh3pouoW +CCUqEYAAYAAXAABmY8v4wB8okPr1ACkgFvsgGU0iAJ0AiYj3IAYQkgCdACtSrhzpc2Sw0SzCfytS +rQy7AWSwx7CZmYgc6ZFks0sswIAszDf+IWgVpMwdAKw86xYCJmAdAAD1wAWCEgCdAC5Cnv3ACCui +AJ0AjBorQp0swr8MuwHrFgAlmVGAACpxDIl3mRH9QA6sYgCdACxwEOtyAyYJQYAA+Z/7KNIAnQAu +cgNk4NCPFmXxsIYRjxiNFO4SAClQBIAA5v82C9gEgADvFgEp4ASAAFgqWhjpRx3pa+evLm0wBIAA +YALyAADAoFm3gRjpQYmIHelk+T/5iJIAnQD//QgNoAsFAMCwwKoKmTT5AQYV7/zOAABqkSQrQp58 +s0GMGitCnSzCvwy7AeSwNWTz/QAA/wEGFa/9KgAAAAAA/CGmFaAKBQBZt2oY6SqJiB3pTuwSDSSP +EwAA//yMDaALBQDAsMD6D580/wEGFe/8UgAAAAAAAAD//BgNoAsFAAAAAIoYwLGbFvlf+SriAJ0A +wOCeFvlf+MriAJ0A63QACVAEgADtEgkp4ASAAFgqlv4AIh3gBxUA5xYJLTgEgAD/QGYV7/u6AGSw +SY8V/gAiHaAMBQAP7DhkwIyIEYYY6iQAC9gEgADtEgQp4ASAAOhmNgjwBIAA5hYBIPgRAABYKyLo +6PwdMASAAP3SPgXv9/4AAAAAixgPAgAPAgD5YTYN4AwFAHmjAcDB+AAiHeAOBQAMnjjsFgUnfJGA +AOt0AAlQBIAA7RIJKeAEgABYK8D3QGgd4AsVAPohJhXgChUA+uBmFa/9ngCLEBXpASohB4lwHOj9 +/9HIBeqqAQD/QAAVOJkBAOyqAgTAPQAA/CEoFaSIHQDqtgAkQAkAAAg4DI4gmbPoXzkBs/0AAO+2 +Ai92AoAA7m4CBahBAADutgEuDuYAAIgT6IwgIZRVAADqPP4qyASAAG2pBQgAhgkCYSs8/gy7Eatb +mxAoIBQsIASjiPWACJkSAJ0ACAlHKSQU9SAKLlIAnQCIcigmHIlx6BYHLagEgADzIAowUgCdAPE1 ++A3gBwUAp2YmRp0qIBYrCv97oQrrEgEpUASAAFgujowZZcDjwCDRD+sSASlQBIAAWC6JLiAWGOin +/dGWBeD/9QD/3+UcYgCdAGP8h4gZZY/SKnAQ23D8YGgdoAkVAPtf4BWgDQUA6p04CVAEgABYKUzA +INEPAAAA+kBoHaAbxQD8ACIdoA0VAFiBvWP/vQAAHei3LdCA6xIEJujdAAD6QGgdpN0dAPxgAEbw +DBUA7dwHJdhhAABYgbJj/48uIBYvCv//3/r0YgCdAOsSASlQBIAAWC5hwCDRD4sQDGwRrLv6IAYV +7/uWACgkFI1w8b/4upIAnQD6QGgdoAwFAFh04PbAYBWv/BIAiifrNAAJ6ASAAPtEABWgDAUAWHaD +0qDRDwAAAAAAAADrEgIpUASAAFgB8/ogCBXv+sIAAAAAAADqJAAMYASAAFgDdogXiXGaHOekAA1f +AoAA61UIBPVNgADrVAAJUASAAP0AaB3gDAUAWAM790AAQ//6OgCKJ/ygaB2gCyUA6qwgKegEgABY +KT4rcBD5f/E40gCdAClwFQkIRWSOGStxCRzocCpxDC9wEY4nDKoMq/8PiAn9wqQVr80FAO7sICR4 +iQAA7e4BBEBJAAAK+Dmofa7O7uxAJuiBAADu21p+0ASAAA7qMBvoYC2hAf1ABBWh+TEAC/8KKyIX +7/KfLmQCgAAM3QIL7gwP7iyu3ahe/cAkHe/dgQD9wAQd7/Z2AIsU+kBoHaAMFQD7YkAV4A0FAFiB +UWP+DQAA/a8ADT/+mgBsEAQjIAAkCu10MQYiIQO8ItEPhCGGIPJAaBWgCCUA92QAArCUcQD5DwAM +czYBAPRgAEHzZoEA5eg9HAEKgAAAZhr2YAEBvUQBAOUiAQGoOQAA5SIMAZhpAAAEJCwEMyijItEP +bBAIiiInIAeJMJUV+ELQFaF3AQDxXUwN6JkBAPggJhXg/PUAfIEdBQtH+3/AFeAJFQDrmzkJUASA +AFguB/NTMA3g/PUAGuf4iKgW5/b3AA2YkgCdAC5irhnn9mTh2ymSfyVirQlVAWRR0SiM/yimCOlU +AAKNgYAAG+gSJbCA7efrEqjdAAD4IAYV5FUdAOVFCAvPAoAA5pkIAqgNAAD04AiSEgCdACiSnvUA +EzviAJ0AJZKdDXgKKIK/CFUBZFGIKSAW/SMmDaDr1QAqMBD7QBJUYgCdACsxC7y72iBYLbMoIBQs +IASkiPWADEEXmAEAKSQU9SAOLlIAnQCKFR7n6Y0RKCEHHOfNGefl/6HgFeqIAQD/AAAUNP8dAOmI +Agf4BQAAD08MmFCLIA/sOfygZhXnqgEA7FYCLd4CgADrSwICyEEAAOtWASHAQQAA+UAJcVIAnQDo +QQ1iU/0AAG2pBQgAhgkCYcCAmBTpIAQiW/0AAAy7Eatb9SAJCRIAnQCIMigmHOkyASXYQQAAmxMo +FgLzIAm4UAUFAGaRUKVMiBQMfRGm3ezWnSwQBIAA0Q8AAAAAAPcADpCSAJ0ADHkRppkukp71wA77 +4gCdACWSnQ17CiuyvwtVAWRRzbCNnahlXt1gAGMAAAAAAAAA6iQACdgEgADtEgUqYASAAFh759Kg +0Q8AwKBZtcga54eIqPkf8hiQ/PUA//lYDaAFBQAAAAAAAAD6QGgdoBvFAPwAIh2gDRUAWICnY/+x +wFDA6g6INPlBBhWv+K4AHeedLdCALdw3+uMAFeTdHQDtTQgJUASAAP2gYBXgDBUAWICaY/97AAAA +APhChh2v+g4AAAAAiif9IGgdoAsVAOqsICpoBIAAWHV6+iCGFa/7SgCLMPNgCKKSAJ0A4hIEK+cC +gACmzCTGndEPAAAAAAAAAOsSAClQBIAAWADjY/4wAADqJAAMYASAAFgCaIkxixOIEuysEQ0oBIAA +7LsIBPWdgADaIP0AaB3gDAUAWAIviBSlpaVMDH0Rpt3s1p0sEASAANEPAAAAAAD/9pQNoAUFAI01 +jDQe52r6YOgV4AklAPxwAAewrXEA+y8ADLuMIQD7IAQA08wBAOjMCA/4CoAA/4ABBn3dAQDuuwEG +cDkAAO67DAZgaQAADb0sDcwo/WAARb/1ugAAAADqJAAD2EkAAPwAIh2gDQUAWIBTY/5hwKBZtWYa +5yaIqB3nJvkf8QiQ/PUA//jwDaAFBQDAUMC6C4s0+0EGFe/4tgCwSwy7EetbCAlQBIAA+2IAFeAM +BQBYc4KzTOISBCvvAoAApt0s1p3RDwBsEASJNxfnOSswFvnOYAWjKgUACiooC7YJ6KgICzcCgACo +ZhjnM6dn5HK/KQEKgAD++AgVoAwVAOhmCA5oCoAA5kEYdMAhAACLMpjgnpOWkg27Aih2wJsy0Q8A +AB/nJq+vKfK9ALEE7fLBLnAKgAAOmQL596YV7/71AA7dAw2ZAR7nHuVywClvAoAArt2Z0I8ymFDm +hgApAQqAAOWGAS4gCoAABP8CKHbAnzLRDwAAAGwQChnnEgkpCiiSf+IWCCloBIAA+wAEANAGFQDm +FgorKAqAAPgghhXgVU0AEucJG+cJHOb6GObX9c4QBaMqBQDq2igOvwKAAOmSfybruQAAnRWkpKh3 +rKycFihyuSRCn+uqCATL/QAA+iDmFaOZAQD4ISYV4GMFAPiABAIwAGoAihrAsP3/4h2gYwUA7FUD +BQLhgACbGi1yuAReAQ7dAZ0QAQCHAzZgaD7VihiLF40VHObriBbjOQkB8oEAAO4WCSzPAoAAqYj9 +AABGP//1AOKICA8BCoAA6IKfK0gKgAAPmQMJRAELgABj/6oAihmLFLGqCgpDKrZ/0Q8AAGwQBBvm +2IogK7J/HubX+08ADXMvBQAPrygO/ggp4r8o4r79zaQF7/v1AAuZA+mLAQ1nAoAA/YAARn/09QD9 +gAgVoAMVAPkO4B3gDQUAGebIGOa0+QAARn8sAQDs/AgF/USAAMspCOowKcK/L+LACYgM6PsTfoEK +gAAv4r4AOBoEiAMI/wEv5r79oCAV4bsdAOSwLGZgwQAAf7cUY//EAAAJ6jD5l+YV7/+GAAAAAAAA +/aAgFeG7HQDlv9xmYMEAAFguYsAg0Q8AbBAEJiEJ+EKQFe/4BQAnIBXomAELNgKAAOiZDAu5AoAA +B2YC+EKGHeAHBQAnNAD4YGYdoAQVAARmApYxFeZlJFat0Q8AAAAAbBAEFuaYFeZv0w+mIgU1AiUm +gCQigGdAC20IBSgigGeAAmP/89EPAGwQBBPmjyI2imP//AAAAABsEAQoIAUlIAf6YKgVr/TVAPpA +SBXgAyUA/QEgEdFVAQDAINEPAIgpmisPAgD7AAg8IgCdABrmfwpaCemh/CVQCwAAKqEA+yAEs6IA +nQDzYARwEgCdAAIqAlhyyCsiAg8CAAO6AWSvuIonBLsB6yYCJVDBAABYbDzj5kcVATmAACigANMP +0w8DiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/ciSfTD2SfdiqZFMqniplkr2wooAADiAooghDs +oActWASAAPpAaB2gDTUAC4AAZa/gY/9KAAD//1QNoAoFANogWHK1KyAi6rsMCVAEgABYc//aUPoA +Ih3gDAUAWHVCiyIDugHzf/rmYgCdAC8gB9og/AAiHaANBQD1YAQHMb8BAO4mAiXYfQAAWH81wCDR +DwAAAAAAAADrICIpUASAAFhz6yogBcGDeKEMaKgpiyLzYAQFf/xGACkgOsC/e5nq+kBoHaALBQD8 +AAIdoA0lAFhzImP/1wAA+kBoHaALBQD8AAIdoA0lAFhym2P/vwAAbBAKiCsd5hcuICGLN/xgyBWg +/+UAD+4BLiQhDcwBDLsM64kIeMgEgADAINEPAwCGCQJhmxUoIAUlIAf4IQYV7/TVAPxASBXgAyUA +/RtAQdFVAQCKKRzmE5sr+0AIFGIAnQAMXAnrwfwmYAsAACzBAP1gBKOiAJ0A86AEYBIAnQDaIFhy +WosiA7oBZK+biicEuwHrJgIlUMEAAFhrzwqrAuPl2RUBKYAAKLAA0w8DiAooghAssAf6QGgdoA1F +AAuAAOukAA1/HgAAiSdkn1oqmRQrkgnKqGS/TyiwAAOICiiCECywB/pAaB2gDTUAC4AA66QADX8u +AABj/y0AAAAAAP//SA2gCwUA2iBYckcrICLquwwJUASAAFhzkdpQ+gAiHeAMBQBYdNSLIgO6AfN/ ++s5iAJ0ALyAH2iD8ACIdoA0FAPVgBAcxvwEA7iYCJdh9AABYfsfAINEPAAAAAAAAAOsgIilQBIAA +WHN9KiAFwYN4oQxoqCmLIvNgBAV//DoAKSA6wL97mer6QGgdoAsFAPwAAh2gDSUAWHK0Y//XAAD6 +QGgdoAsFAPwAAh2gDSUAWHItY/+/AABsEAQc5buLNCkwFv1gBAW1mR0A9SAICJIAnQDu5bYUiImA +APvLagWv/eUA5OWIFKS5AABplSIsoX7sswx2UBEAAPtgCJuiAJ0AKyAGsLsLC0frJAYlgsmAAMAg +0Q8soX7TD+yzDHZ4EQAA/2AH0+IAnQAoIAawiAgIR+gkBix+3gAAiSeLIiqZFA27AZsii5lkoLQo +sAAEiAooghDaIP1g8BWgDTUAC4AAwCDRDwCLIoonDwIADbsB6yYCJVDBAABYa1fJrSigAASICiiC +EOygBy1YBIAA+kBoHaANRQALgABlr+CJJ2SfbyqZFGSgYIqZZK9kKKAABIgKKIIQ7KAHLVgEgAD6 +QGgdoA01AAuAAGWv4GP/QgAA6iQACdgEgADsRAAK6ASAAFhzNcAg0Q8A6iQACdgEgADsRAAK6ASA +AFv/QcAg0Q8A//0cDaALBQD//nQNoAoFAIg3IuJ/CYgR+EAAQT/7lgCINyLifwmIEfhAAEE/+/oA +bBAEGuVFKKLbZIALCeowK6LcC5kMZ5AB0Q9YdOrRDwBsEAQd5VgnIAcc5Vf+QQQV4OcRAA7cOZww +iCD7yjYF4AolAPpgRhXgGQUA6TYDLEYCgAAKiQL4YCYV4XcBAOYgeSu8AoAA9+YAD3ANBQD8BAId +oAs1AOnlRRMCOYAAnTWcMwuKAhblQpoxGuVCBu4CJiEJnjSaNgRmAiIgB505lTv4xgALcSIBAOY2 +CikUAoAAAv8CCf8C7zYILZAEgADRDywhCCshCZ01lTcHzAIEuwIJuwIJzAKcNOs2Bi0QBIAA0Q8A +bBAEGOURHuUmLCAHHeUmGeUp+kEEFeD8EQD/zQAO8cwBAO02AC5kAoAADLsCCbsC44CAKbAEgAAd +5OP8QAgVoA4FAJ5l7WYCIbjdAAD6wIYV5HcdAOp8/y5mAoAA7HwCDVcCgADsZgElU+EAAJpjAgSJ +mWYjZgcGIIslIQn0wWYVpDMdAOVmCiuQBIAA6IAFAyjBAABtOQIFAmHRDwAAAGwQBh3lBQsrEa2z +KjJ/GeUDF+TgiKDAQPjgAETwBhUA6bkIBAGpgAAsMngvMnv5gAV8YgCdAGXxFCw2fCsyeSs2e91A +DeQWAQIAlKAN5BbAyfxABdwiAJ0ALzJ7wcDt5PAXg5GAACIyfCohBI4g8+H+Daa6AQAkNnz0b2YV +oAAeAC42fO2vAQXD/QAACP8C7yUEJYxZAAAiMnywzO8yeyEA8YAAycZj/7/aIFh1BWWgwiohBP9B +AAwWmgEAyJfRD9ogWHT40Q/aIFh0utEPAAAAAAAA+kBoHaALBQBYdYjRDy4s+OrSiC8BCoAA/MAB +Bd/89QAMuwMLqgEq1ohZuPAkNnwkNnv6b+gVr/ziAAAAFeSAL1BhZPBqWa41WHRxKHLb0w/IgVh0 +RilQYWSfKVh0QMiuFeS8LFJrsMzsVmsmAsmAAFhzx2P/DgAAAAAc5Lb+b4gVoApVAPxvSBXgC0UA +7RYAIWvlAABZtyD6b+gVr/syAC4ye+I2fC96HgAAIjZ70Q8f5Kov8q5x9ov2rCYdr/4iAAAAAABZ +rfz6rWYVr/6SAGwQBBTkohnknOjkeRlewoAApLQjQn+piOi4CAGCIYAAKjIAeKkCKkJ7HOSUKzEE +KkZ/DLoB6jUEKdAEgABYdLfOqSkxBP8hAAwW2QEAyNfRD9owWHSr0Q/aMFh0bdEPAPpAaB2gCwUA +WHU80Q8jRn/RDwAAbBAE8GDgDe/59QCIIgk5AwmIAZgiiicqrDBYajzj5EYVARmAACigAAOICiiC +EOygBy1YBIAA+kBoHaANRQALgABlr+CJJ8uSKpkUyqWKmcmtKKAAA4gKKIIQ7KAHLVgEgAD6QGgd +oA01AAuAAGWv4NEPAAD//1wNoAoFANEPAABsEAgW5GYb5GYd5Dz1yDQFoBjFAOMs6CXTgQAA+EAN +zCczAQAMNRGkVehSnilmwoAApsQpQH/5ABCT4gCdAChSnWSCB5sR6gseDUgEgACZEAoghgsCZQsC +Yw0AhwkCYQkCYRbkUR/kT+3DCAkBCoAA8iCmFeAOFQDj5BAfcAqAAJ4Tr8/+IIYV7//1AP/XAA9w +B0UA/iBGFaAAugAAipnJrSigAAOICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+ApQiBkkOstQHwe +5C2MFQ3bCa7eDLsKLEB9pruKsi7ggGShOP3Hvg2gCBUAwPANjziIFQ//CQj/Ci/9Fy/8HC/yG/Hh +cA3gDAUAwLEL2wMLC0crRHwLuwkIuwqmu/yPph2gDAUAjbDvUp4m8/8AAC7g///gBHuiAJ0AL1Kd +9v/gFeD49QDx58AN53cBAHhxdOoSBCZABQAA6ER9JuPhAABYdDyJE9Kg6xICJIBhgACKoguqASom +AoonKqwwWGnEya0ooAADiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/giSdknxsqmRRlrvL/+8QN +oAoFAIwRixAMgIYMYIYLAmkLAmfRD48RjRAuRH8PwIYPoIYNAm0NAmvRD5sR6gceDUAEgACYEAoA +hgsCYwsCYQ3ghwgCb+jsAAnQBIAAWa1fZK+v7eO+Ga8CgADkVQgJZsKAAPeAAEI/+TIAAAD+IKgV +oAsVAPu3AA3wDAUA/I+mHae7AQArRHwLuwn/YAEFsAwFAPdgAEW/+3oAAAALYIYLQIYKAmcKAmXR +DwAAbBAEGOOFAgNHDDMRqDMrMoQZ45IosACKsQmICgohjAIKPiiCEAMCPvxAaB2gDSUAC4AAIjaE +0Q9sEAQU43cCA0cMMxEEMwgkMoQqQgEmQAAoQAj6mGgdoKklAAIFPgMCPnmBIxjjfghoCiiCEOpU +AApYBIAA/EBoHaANJQALgAAiNoTRDwAAAOskAApQBIAAWHQB80BoHa//NgAAAAAAAGwQBFmwwxLj +XBPjfQwCACkiggkajgOoCoiEC4AAY//rEuOkA+gwBO4wBbEwkyCUIZUiEuOgE+NfhCAEMwKTIBLj +nsAwKDdAKDdEKDdIKDdMIz0BcjPtEuOZwDCTIMcvE+OYAyMDEuOXhCAENAGUIBLjloQgBDQBlCAS +45SEIAQ0AZQgEuOThCAENAGUIMcvwDEDIwMS45CEIAQ0AZQgY//8AAAAEuONgyADExQPMxGTIBLj +isAwIyYAV//ZEOOJkQCSAZMClAMR44eCEAHqMKIRAfAxwEAE5BYAAgAR44OCECMaAAMiApIQEeOA +wCGSEATkMYQDgwKCAYEAANIwASMAAAAAEON7kQCSAZMClAMR43mCEAHqMKIRAfExwEAE5BYAAgAR +43GCECMqAAMiApIQEeNxwCGSEATkMYQDgwKCAYEAANMwATMAAAAAEONskQCSAZMClAMR42qCEAHq +MKIRAfIxwEAE5BYAAgAR41+CECNKAAMiApIQEeNiwCGSEATkMYQDgwKCAYEAANQwAUMAAAAAAFyU +AV2UAl6UA1+UAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAABckAFdkAJekANfkABTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAnJQAHZABnZQCnpQDn5QECJQFCZQGCpQHC5QAQwAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAJyQAZ2QAp6QBx2QA5+QBHiQBXmQBnqQB3uQAFMAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADclAAdkAHdlALelAPflAQElAUFlAYGlAcHlAgIlAkJ +lAoKlAsLlABDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3JAB3ZAC3pALHZAD35AEtJAFtZAGtpAH +t5AIuJAJuZAKupALu5AAUwAAAB///aQA0jEQ//4KAAAAAAAf//3sANMxEP/+CgAAAAAAH//+NADU +MRD//goAAAAAAAD0MAoAAAAAAPQwCgAAAAAA9DAKAAAAAGwQCCcgB4giFuJX/cSmBeF3AQDlgPFr +1wKAABjiUC6AgOaqCAdw3QAA/VPIFaTuHQCuTuviSxdwCQAA/4AIS6AJpQAqop0LfAoswr8MqgHq +FgIlB/mAAIjY9wAI8JIAnQAvYq7s4kEXhcGAACpirSzCf+yrAQRz/QAA/UAFJiIAnQCe2P1ABS4i +AJ0ALyAUpP8PD0cvJBT14AeuUgCdAPggSBXnhQEA+QAHcVIAnQDoPBAiDD0AALBKbakFCACGCQJh +wFCIEo0y7SYcIkv9AADrMgEszwKAAKmImBPzYApAUAoFAOoWAC2LSgAAixDrSwgL5wKAAObMCAXb +/QAA68adKpAEgADRD+okAAnYBIAA7EQACugEgABYdgnSoNEPAMCwCYw07NYILfseAACNImXf1fpA +aB2gG8UA/AAiHaANFQBYes1j/7///AwNoAoFAAAAjiJl77AtgIAt3Df64wAV5N0dAO1NCAlQBIAA +/aBAFeAMFQBYesBj/4zAoFmv0x3h9ojY+R/2wJAJpQBj/5zaIFv7GWP/BgCOJ54RiOn7wqQV78kF +AOXpFCdggQAACckB6b0IClcCgADqVQwEQEEAAJjpCFUy5eUUJukBAAD9AAg64gCdAGirPairK7zw ++6AE0+IAnQDvEgIiDHUAALBObekFCACGDwJhK8IBC6sI5ckEJdvBAAD9YAbMYgCdAOvGAS3ABIAA +ZFCp9QBoHe/6lgAAAAAAAOokAA7gBIAA7BYELFgEgABb/HiLMYgTjRTqFgAtZwKAAOyICAX0/YAA +2iD7AGgd4AwFAFv8P40Q7a0ICpAEgADtTQgL9wKAAObuCAbr/QAALead0Q8I3Qz6IEgV5P0dANMP +bfkFCCCGCwJjKxIC708MBMEBAADtuwgHjEEAAC78/23pBQhAhgsCZS/JBA2oDKiYKIww6MYBL/rW +AAAqnECawfuABhWgCAUA+YCEHa/9FgALiAz5wSYVr/vaACicQPmAJhWv/LIAbBAEHeGeGuGfHOGd +LdKYKqF+LMKOo93qOgwO7kKAAP2AAEZwCwUAK8QEK8QFWRBA+kBoHaALBQBb/OrRDwAAAGwQBBjh +kSmCfyowBy2RAi6RBP0gpBWgDwUA65IAJokRgADu7P8mk/0AAOKVAi93AoAA7rsIDmcCgAD9bwAN +sADGACuRBS2RBLG7/7/gFa+7AQDrlQUvdwKAAP1gBrxiAJ0AjJDuzAgN3wKAAAvLDAsAhw/fYOsA +BwbzJ4AAHuFzKZEFK+J/CZkRqdnt4n0lhhGAAIzRi9CbwIvQnLGf0J/RK+J/sLsr5n/1oAYcH7kB +AIzZ+aMAFa/JBQD5AAQEfxIFAKLSKyY6/6IEHeVJBQDp1REkIQEAAOTWBy0vAoAA5NYGKlgEgAD1 +gATkIgCdACXVEOhYCAR4GwAA7IxAJ/oBAAD94ARjogCdAMky6UQABQCBgABtqQUDAIYJAmErIkKr +WP8ABYxiAJ0A6CZCJpPhAADRDy+VBf/8mA2gCwUAwKX9woYFoDslAFmzi8Ag0Q8t4oCM0YvQm8CL +0Jyxn9Cf0SvigrC7+9BGFe/8+gAAwMD7D+gVoA0VAFh6usAg0Q8AAAAAAAAA79YJJpPhAADRDwDL +MPpgaB3gXMUA7Kw2CnAEgABtyQULIIYOAmP4YABF8F5FAH6hDS+srNMPbfkFC0CGBAJlKY376SZC +JpPhAADRDwAAAADkJkImk+EAANEPAABsEASCIwICQdEPAABsEASFI4MgFOEX+ECEFaFVAQDq4RUa +rsKAAORUCAGAuYAA+wAEBDaYOQAJiAIoJQQiQn/RDx3hDBPhDR/hDSZCfishBC5Cf5JgliGj//1g +BAX2yzkADLsCr1/vJgAnKAUAACVGfyJGfuslBCqQBIAA0Q8AAGwQBIogZaBQHeD+6iIDKfbCgACu +3f2v6BXgDBUA/IBABjGqAQAGqgINyCwI3SgnJQXtzAwEWAUAAP1tAAw/+8UA66oBDE5CgAAJWQID +qgKaIwmIAiglBNEPjyMb4OoPD0EL/hGr6y2yfxng5CyyfnLZGdnA8yPeDaAMBQDAwCy2fyy2fvpA +CBWgAEYA2MDzDEYNoAwFAHLRHI0hmtCOICmyfZ3hnCDsJgEky/0AAPlvphXv/VoAGeDQGODQqYio +6HihIOq2fy+BLgAAza0qsn1qohgtsnv9b+YV4ABKAAAAAAAAAOy2fyf/KYAA+kAIFa/+pgAc4MGI +IayZqen5DwAM8AwFAAnIOPlvxhWv/ioAbBAE9cF6BeAGFQD0QGgdoAI1APaAQAMwAB4AALAiKFJ/ +6GP3cquBAADRDwBsEAQoIhzrNAAKYASAAO1UAAlQBIAAC4AA0qDRDwAAAGwQBPRCSBWkI0EA8loA +CT9TgQAEIgqEJoIhBUQoCkQRpCLRD2wQBCoiEiMgB/o+AAQwBjUA9QAJEJEzAQAKyFH1AAkokgCd +APooAAawOwUA/cEwBaAKVQBZstcX4Ibk4IQZzwKAAPRgBhISAJ0Ap5kqkp73QAiJ0gCdACqSnQQ7 +CiuyvwuqAfFO4A3nRQEAKCEHGeCI/8EQBaqIAQDr4IccRwKAAAmIApigGOCF/EAIFeA8BQCcp/tA +phXgGYUAmaP5QEYVoAgFAJim7t0CDv4CgACdpAb/Ap+hLyISD49B6KYIL/8CgACfqe3gdhn3AoAA +p+4m5p0sIhIqIhANzALsJhIpWASAAFjkLWhCGYon+gAiHeAMBQD7RAAVoA0VAFhuA9Kg0Q8AwCDR +DxzgT4vIarFbDDkRp5ktkp5u02Yqkp0EPQot0r8NqgHkoFll8/0AAP+BBhWv/MIALxoAD6oC+kJG +Fa/7YgAoKgAIqgL6QkYVr/tWAAAAiSLLmWhCTcAg0Q8AAAAA//vsDaAKBQDAoFmuEhzgNIvIa7GW +//uYDaAKBQAAwKDA2g29NP2BBhXv+1oAAAAA6iQAAdhhAAD8AAIdoA01AFh472lCsYwnL8kUisn/ +hAAVr8gFAOjuAQf4QQAA78UUJVPBAADqxgkncQEAAH6rKinBFR3gM6qamsmdoIwg+8BiBeANFQDr +pgIuZgKAAA3MAv1AJhWgAgUA0Q8d4CmdoIwg+8BQBeANFQDrpgIuZgKAAA3MAv1AJhWgAgUA0Q8A +bBAYFOAikhCOIBngH4sjLSIBLCICLBYiLRYkKxYj+CDGFeAIFQD4IOYVoA81AP4hJhXgCgUA+iCm +FaAPtQD+IiYV4Ap1APohphWgCJUA+CHmFaAJhQD4IcYV4AtlAPohhhXgDUUA/CFGFeAMVQD8IWYV +oA3FAPwiRhXgDNUA/CJmFaAL5QD6IoYV4An1APgiphXgCEUAmBQa3//6JKYVoAIlAPIhBhWgAqUA +IhYQEt/4hRYrEiQpEgUmUX4sEiInUX8GmSgvQICpefheiBWjmQEAA5kK7pIAL1AEgAAlUj4tEiMI +7ggLUACOFywSJC0SIgbuKC9Aga5++F6oFaPuAQAD7gqO4CoWFuoSIy1YBIAAqO4LUACOGCwSFi0S +JAbuKC9Agq5++F7IFaPuAQAD7gqO4CoWF+oSIi1YBIAACO4IC1AAjhksEhctEhYG7igvQIOufvhe +6BWj7gEAA+4KjuAqFhjqEiQtWASAAKjuC1AAjhosEhgtEhcG7igvQISufvhfCBWj7gEAA+4KjuAq +FhnqEhYtWASAAKjuC1AAjhssEhktEhgG7igvQIWufvhfKBWj7gEAA+4KjuAqFhrqEhctWASAAAju +CAtQAI4cLBIaLRIZBu4oL0CGrn74X0gVo+4BAAPuCo7gKhYb6hIYLVgEgACo7gtQAI4dLBIbLRIa +Bu4oL0CHrn74X2gVo+4BAAPuCo7gKhYc6hIZLVgEgACo7gtQAI4eLBIcLRIbBu4oL0CIDn4I+F+I +FaPuAQAD7gou4gAqFh3qEhotWASAAKjuC1AAjh8sEh0tEhwG7igvQIkOfgj4X6gVo+4BAAPuCi7i +ACoWHuoSGy1YBIAACO4IC1AALhIQLBIeLRIdBu4oL0CKrn74X8gVo+4BAAPuCo7gKhYf6hIcLVgE +gACo7gtQAC4SESwSHy0SHgbuKC9Ai65++F/oFaPuAQAD7gqO4CoWIOoSHS1YBIAAqO4LUAAsEiAu +EhItEh8oEiUG7igvQIyufvkP6BWj7gEAA+4KLuIAKhYh6hIeLVgEgAAI7ggLUAAsEiEtEiAuEhMv +QI0oEiUG7iiaE65++RAIFaPuAQAD7gqO4OoSHy1YBIAAmxGo7gtQAIwRLRIhLhIUL0COKBIlBu4o +mhKufvkQKBWj7gEAA+4KjuDqEiAtWASAACsWI6juC1AALBIjLhIVjRMoEiUG7igvQI+ufvkQSBWj +7gEAA+4KjuDqEiEtMASAACYWIujuCAtYBIAAC1AAjhEqFiQpEhIrEhMoEiUtEhWPFewSFCRBAQAA +6BYlJuhBAADtFhUn+EEAAO8WBSZgQQAA7BYUJdhBAADrFhMkyEEAACkWEosdiRyMHi8SEI0f6BIR +JmBBAADsFg4n+EEAAO8WECboQQAA7RYPJEBBAADoFhEkyEEAAOkWDCXYQQAAmx2JFosXiBuNGe8S +CiERAQAA7BIIJEBBAADoFgsm6EEAAO0WCSf4QQAA7xYKIiBBAADvEgQmYEEAAOwWCCXYQQAA6xYH +JMghAADpFgYn+/0AAO8WBC/hZgAAixCIE4wSj7CJs42yjrGsmabdqu6o/5+wnrGdspmz0Q8AAABs +EAQpIhX4oAAE8Dh1AOmMDAEgQQAA8yAART+LBQDrpBAlUEUAAPkABdNiAJ0AKwoAWanJLCIVKyIU +7c0RCUAEgAD8QkYV7oA9AP1rAA2wCTUA+kJmFeAKJQBtqgyOhA4Oju6GBCRAEQAADwIA0w/TD22a +IemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIPrRAAJUASAAFv+rYogiCKJIY8jCAiO +CQmODw+OCgqOmiCfIykmAegmAilABIAAGd7KAgCGAwJh+AAKFeAJtQBtmgIIAIrRDwAAAAAAAAD9 +gQAVoAsFAFmpmvhAaB2gCUUA0w9tmiHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD +6iQAClgEgABb/ovaQP/7/A2gPIUAAGwQBikiFfhCiBWgRgUA0w/4gABFdZkBAAlmDHSrAbGIKiYV +BioM6CYUJVFBAAD2gAezogCdAOs0AAtgBIAAWalu+EBoHaAJRQDTD9MPbZoh6YIEJEBBAACKgYuC +jIMJCY4KCo4LC44MDI6ZgJqBm4KcgyUsEOokAArYBIAAW/5oBkcM9uAFjtIAnQDmNAgK0ASAAPbg +aB2gAwUA5BYAKkAEgAD4yGgdoAlFAAoCZwhAhgoCZQgghgoCYwgAhuoMAAlABIAAbZoh6YIEJEBB +AACKgYuCjIMJCY4KCo4LC44MDI6ZgJqBm4Kcg+okAArYBIAAW/5L6lQAAZgFAADmbMAiIQEAAO9t +mmpABIAAixAKPBELywjsfAwK0ASAAFmpNtEPAAAAAAAA6zQACmAEgABZqTHRDwAAAPZgAEYwAwUA +/CAGFa//JgBsEAQY3l4Z3lwa3loT3l2TI5gimSH6QAYVoAsFACsmFSsmFNEPAAAAbBAG3iDk4hAq +YASAAOdCByvQBIAA+7yUBeAYNQDjQhUpkASAAOdyDiL76QAAePsnGN5LCPgKiICaE5wS7hYBLAAi +gAAAkxAqsqXsVAAJWASAAFmq72Slx/KCphXgAgUA0Q8AAAAAK+ISC5tS7hYBJf9BgAAa3jPjFgAp +WASAAOqixyrgBIAAWariZKV6Gt4s2yDqoskq4ASAAFmq3SN9BeSmz2GaAQAAGt4m2yDqossq4ASA +AFmq1vdH4A3jhgUAGt4g2yDqos0q4ASAAFmq0GSmxBreG9sg6qLPKuAEgABZqsv7QEKIEgCdACsw +5cFY9WAr4GIAnQBptyElNOWLEPqCphXgAgUA0Q+TECqynexUAAlYBIAAWaq+ZKcCixD6gqYV4AIF +ANEPAJMQKrKr7FQACVgEgABZqrZlrxr6IGgdoAu1AFjgMfoAIh3gAwUA6rM4BQDhgADqEgIrWASA +AFmpOsipHN3+jREMrDYs1hdlMyWNEPyCphXgAgUA0Q8uQG5k7tKTECqywexUAAlYBIAAWaqfZa6/ ++iBoHaAbZQBY4Br6ACId4AIFAOqyOAUAqYAA6hICK1gEgABZqSQsfQMqxShlItGNEPyCphXgAgUA +0Q8AAJMQKrKz7FQACVgEgABZqotkorca3dbbINMP6qKfKuAEgABZqoZlrlr6IGgdoAtVAFjgAfoA +Ih3gAgUA6rI4BSfpgADqEgIrWASAAFmpCixAb/GAJz7SAJ0AZKTfihP6AKId4AzVAFjf3tKg0Q+T +ECqyuexUAAlYBIAAWapwZa7H+iBoHaAbJQBY3+tkojUrQG5kt2/qEgIrWASAAFmo9ixCFgrMNixG +FosQ+oKmFeACBQDRD5MQKrK37FQACVgEgABZql5kojMa3anbIOqisSrgBIAAWapZZa5t+iBoHaAL +5QBY39VkodvqEgIrWASAAFmo4St9Aiq1FIsQ+oKmFeACBQDRD5MQKrKp7FQACVgEgABZqkpkoioa +3ZTbIOqitSrgBIAAWapFZKOHGt2Q2yDTD+qioyrgBIAAWapAZa4H+iBoHaALdQBY37tkoXUrQG5k +tuMa3YWLEuqi7ytgBIAAWao2ZaZGK0BvwMgMuwIrRG+LEPqCphXgAgUA0Q8AAJMQKrK/7FQACVgE +gABZqitkoe8a3XbbINMP6qKhKuAEgABZqiZlrZ/6IGgdoAtlAFjfoWShDStAbmS2ahrda4sS6qLv +K2AEgABZqhxkpnkrQG8sCv0MuwErRG+LEPqCphXgAgUA0Q8AkxAqsqfsVAAJWASAAFmqEWShtxrd +XNsg0w/qopsq4ASAAFmqDGSi2hrdVtsg6qK7KuAEgABZqgdkrF8a3VLbIOqiwyrgBIAAWaoCZaxM +Gt1NixLqot0rYASAAFmp/WWkUosRK7ISC5lSyJlokgf5IA9h0gCdAIwRK8YS8oKmFeACBQDRD5MQ +KrKX7FQACVgEgABZqfBkoXoa3TrbIOqimSrgBIAAWanrZay0+iBoHaALJQBY32bKohrdMosS6qLv +K2AEgABZqeNlrJSKE/oAQh3gDNUAWN9I0qDRD8Ag0Q8AAAD6IGgdoAv1AFjfWGSv6uoSAitYBIAA +Wahl6xIAI+ALAAAqxRX6gqYV4AIFANEPAAD6IGgdoBsVAFjfTGSvui1AbmTVBilAb/E/4ZeSAJ0A +8T/hV9IAnQDqEgIrWASAAFmoUy5CFwruNi5GF4sQ+oKmFeACBQDRDwD6IGgdoAulAFjfOmSvci9A +btMPZPR26hICK1gEgABZqEUoQTT7AA8CogCdAIoT+gFCHeAM1QBY3xnSoNEPAAAA+iBoHaAbVQBY +3ypkrzLqEgEqWASAAOwSAitoBIAAWN6yixD6gqYV4AIFANEPAAAA+iBoHaALlQBY3x5krwIpQG5k +lBka3OmLEuqi7ytgBIAAWamZZaJcK0BvjRD8gqYV4AwVAAy7AvqN5h3gAgUA0Q8AAAAAAAAA+iBo +HaALFQBY3wxkrroa3NiLEtMP6qLvK2AEgABZqYhlqymKE/oAIh3gDNUAWN7t0qDRDwAAAADqEgIr +WASAAFmoDvVAFfKSAJ0Axy/RDwD6IGgdoAuFAFje+PoAIh3gAgUA6rI4BQFJgAAsQG4PAgBkw4Ma +3MjrEgIrYASAAFmpcGWibi1Ab8DoDt0CLURvZS41jxD+gqYV4AIFANEPAOoSASpYBIAAWN7tZa+c +KzDlY/pzAAAAAPogaB2gGwUAWN7eZK4CKEBu0w9kgvXqEgIrWASAAFmn6SlCGIsQK0YVCpk2+IMG +FeACBQDRDwAA+iBoHaALNQBY3tBkrcoa3JyLEtMP6qLVK2AEgABZqUzj3KIdBy4AAIsRK7ISC8lR +yJlokgf5P/kR0gCdAI4RjBADvQEt5hL8gqYVoAIFANEPZS2EjxD+gqYV4AIFANEP6hICK1gEgABZ +p8gqRTSCEPKCphWgAgUA0Q8lfQT0sAAV4AsFAPqgaB2gjAUAWadZ6hICKtgEgABY3wUrMOXAxAy7 +Avp8Jh2nuwEA+nymHe/l/gAtMOX6IEgVoA4lAA7dAu005StYBIAAWaewKzDl+nyGHa/lbgAAihJZ +mycvMOJ/qRSKElmbJNyg6hICI9gTAABZqRdkobfAov242AWgOwUAWa6Xxy/RDxrcXYsS6qLXK2AE +gABZqQ5lrj6LESuyEgvJUWiRCmiSB/k/8WnSAJ0AHtxfA70BDt0CjhGMEC3mEvyCphWgAgUA0Q+K +E/oBIh3gDNUAWN5n0qDRDwAAAPogaB2gC0UAWN54ZKxqGtxEixLTD+qi1StgBIAAWaj049xNHQVm +AACLESuyEgvpUciZaJIH+T/uEdIAnQCOEYwQA70BLeYS/IKmFaACBQDRDxrcM4sS6qLfK2AEgABZ +qORlrZaLESuyEguZUmiRCmiSB/k/7CnSAJ0AH9w3ghHvvwID6BcAAO8mEibqAQAALNDlwOEOzAIs +1OXygqYV4AIFANEPihP6AQId4AzVAFjeOdKg0Q8jfQUjPIArMOXAwQy7AgsLR/p8ph3v4BIAAAAa +3BSLEuqi1ytgBIAAWajEZa0XixErshIL6VFokQpokgf5P+gx0gCdAB3cGAO8AQ3MAo0RLNYSixD6 +gqYV4AIFANEPAAAAAAD24ABDMAsFAPrAaB2gjAUAWabawVDqEgIrWASAAFjehisw5QW7Avp8Jh2n +uwEA+nymHe/eEgAAACsw5cDIDLsCCwtH+nymHe/dvgCKE/oA4h3gDNUAWN4J0qDRD4oT+gICHeAM +xQBY3gXSoNEPihP6AUId4AzFAFjeAdKg0Q+KE/oBIh3gDMUAWN380qDRDwCKE/oBAh3gDMUAWN34 +0qDRD4oT+gJCHeAMxQBY3fTSoNEPAIoT+gIiHeAMxQBY3e/SoNEPihP6AMId4AzFAFjd69Kg0Q+K +E/oA4h3gDMUAWN3n0qDRD4oT+gDCHeAM1QBY3eLSoNEPAGwQBCQiEGRAbCkwECowESwwGuswEizO +AoAACpkC6jATLM4CgAALmQLrMBkszgKAAAqZAuowGCSFEQAACKoRC6oC6zAbLVYCgAAMqgIIqhEL +qgKxquomFiSEjQAAKSIS69u8FMAogAALmwErJhIsQAUtCpV9wUnAINEPAC4wFC8wFegwFi92AoAA +D+4C7zAXL3YCgAAI7gII7hEP7gL912AAUI0FAC8iEnj3JMCl/bdSBaA7BQBZrc7AINEPAAAAAPqA +aB2gC2UAWPjOwCDRDwCMJynJFIvJ+YQAFa/KBQDqiAEEyQEAAOnFFCXbAQAA68YJJEEBAAB4uwYu +wRWr65vJGNuV2bD4AAgdoA9FAG36AgkCYRzbe5ywiiD9QAAVMAxFAAyqApqxKTAUKjAVHtuL7zAW +LM4CgAAKmQLqMBcszgKAAA+ZAu62AizOAoAACpkC6bYEIcAhAADoBgAF+GEAAA8AiioiEokiDaoC +6iYSLPfmAAD6QGgdoA01AAvgAGP+6QBsEAYoIAQpChh5gQPAINEPKiISJCIQ0w/zQApH0gCdAC9A +btMPDwIA/ecAgNCcVQArQAV8sdUc22n8QAgV4AolAP6ACBWgOwUAWa2I+oBoHaANJQD8TKYd4AsV +AFj4iMAg0Q8AHNtfjSCONi8xC/hj8BWgClUA+CAGFaA7BQBZrXsa21gkIhgsMQuILIlKhUf9AABE +MAsFAPhBhhWgDQUA5VIOJJBKgAAtRh4KngL+gUYVoAAeACtCHutaCAHYgQAAWaYEL0IeLjELjUCv +7i5GHipQBCxQBRjbROtQBi1WAoAADKoC6VAHLVYCgAALqgLs2z8dLgKAAAlVAghVAfSgYBXv+MUA ++KAEArA7BQD+oGgd4ApVAFmtVSoiEykxCytCHg8CAAqZCOkmEyLAwQAA+X/2xSIAnQAd2y4sQgoN +zAHsRgopUASAAFj1j/pAaB2gCwUA/AACHaANJQBYNqfAINEPAC8iEy4xC/pAaB2gCwUA/8AAR3AM +BQD+QmYVoA0lAFg2nsAg0Q8AAABsEAYc2xktIgAuMgX0QOgVp1UBAP6/wBXgCBUAD4859IKCFaAK +VQD0IAYVoDtFAFmtLIkiZZCYJiAHF9rYBgZB6jIFK0cCgACniCuCniSsH/m1pAXkRB0AdLN8KIKd +CWsKK7K/C4gB7YQABAOpgAAc2vYMAIdtSQIIAmGINB7a157QiSAc2tnq1gMm2EEAAOzWAizOAoAA +6UkCAeCBAADp1gEpUASAAAuAAAxvEaf/5PadIpR1AACKJ/oBQh3gDAUA+0QAFaANpQBYaGPSoNEP +wCDRDwAAAAD//iwNoAgFAOokAApoBIAA+sMAFeAMBQBYc2/AINEPAGwQBIcnKnkUH9rS+OKkFe/N +BQDocgglUAcAAOxyCyVSgQAA6pN3c9iBAAANuwGrmejBdHTJAQAALo0B6nUUJ1KBAADqk3F8MASA +AHmhfZp47wAFCzgEgAAHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEX2qCXYIUgk2WUZPO1 +eAWgB6UA4mYCKq4CgAAHVQLlZgErEASAANEPwCDRDwAAAAAAAPeAaB2gCAUA+OFmFa/+cgAImgwK +ugwqrQEqrOD64QYVr/4iACy8QPzhBhWv/fYAAGwQBMePCFgDCDgCCEgDqGjoIggLgQqAAAIiGKIy +0Q8AbBAEBDgDCFgDqGjoIggLgQqAAAIiGKIy0Q8AAGwQBAQ4AwhYAQhIA6ho6CIIC4EKgAACIhii +MtEPAAAAbBAEBUgDCDgBCFgDqGjoIggLgQqAAAIiGKIy0Q8AAABsEAQjIhAoMAX4QkgV4JQlAHSJ +SP8ooAMQjQUAeJ89cJ8Z6tqAFL1YgAAKmgH6QkYVoAIFANEPAAAAAAD9tPYFoApVAPxgCBXgOwUA +WayRKzBu0w9psQUsMAV0wQbAINEPAAAA+mBoHaANJQD8TKYd4AsVAFj3jMAg0Q8AjCcvyRSLyf+E +ABWvyAUA6O4BB/kBAADvxRQl2wEAAOvGCSdxAQAAfrsGKcEVq5ubyRzaU9mw/AAIHaAKRQBtqgIJ +AmEc2jmcsIkgHtpO+//iHaAMRQDqtgQszgKAAAyZApmxKCISjyKesg2IAugmEi/7hgAA+kBoHaAN +NQAL4ADAINEPbBAEE9pKAyIC0Q8AbBAGJiAHiCIc2g/0QggV4WYBAOWCe2tPAoAArJkokp4a2gj3 +ABOK0gCdACSSnQpoCiiCvwhEAejaHBIS6YAAJyISiin4QUgV4HdBAJcQCHcKJ3KQ6pkMA9jBAAD7 +IA+z4gCdACsgFigK/3ixEvpA8BWgDAUAWHDW7NnzFRGhgAArIQcd2gD5tE4F6rsBAO/aAB3fAoAA +DbsCm0CIIPu0RgXgSgUA+oBmFaAGVQDvRgIsdgKAAAbuAp5BLSISjhAvIRr7tDIFot1RAOruEQ7t +goAADe4CC+4C+wYADDHeMQCp3S3QgOhGBC/6AoAAn0YNfQzuRgcm6MEAAJ1FKiIViyn3QABFf+kF +AOe7CAVQwQAA6iYVJdjBAADrJgkiUIEAAPiAC2xiAJ0AG9nxxJD6AAgd4A0FAAoCYQoCYQoCYSlE +IC1EJC1EJy1EJvyEph3vigUAKkQhL1IR/odmHej/HQD+h0Yd6P8dAP6HJh3o/x0AL0Q4LiIW/ofm +HajuHQD+h8YdqO4dAP6Hph2o7h0ALkQ8ijQY2efv2dsR8GEAAPVABhgQ+fUA7gYAAlChAAAKAIop +RDAoRDH+hkYd7/71AC5EM4o0LUQj+obmHaj9HQD+hEYd6OodAP6Gxh2o7h0A/oamHajuHQAuRDTr +AAUCSQEAAAkCYSggBwgIQQyIEayIJoadKyAWLwr/f7EK+kDwFaA8BQBYcESINGiAJ4on+gCCHeAM +BQD7RAAVoA1FAFhnNCsiEiz6fwy7AfpCRhXgAgUA0Q8e2bstIhIO3QL8QkYV7/8uANogWHB87Nl6 +FXApgABgACuIXhnZrrGImF4JiAL4hmYdqPgdAP6GRh3o/x0A/oYmHej/HQD+hgYd7/zeAMAg0Q8A +AOtsGClQBIAA/AAiHaANVQBYcivAINEPAOtsEilQBIAA/AAiHaANBQBYciXAINEPAGwQBiQiEioK +jukiEyJ8bIAAKDELqYj4QmYVoAkFAOkmESyQBIAA0Q8vIhgv8HR68VQoIAUa2Y/p2Y8UAlmAACsx +CwpEASQmEo05LCITfZg/LiIRq8zsJhMiZZ6AAGTgko3sfdcgiOv7wGgdoAsFAPwAAh2gDSUAC4AA +wJDpJhEskASAANEPwCDRDwAAAAAAAP2y9AWgCiUA/kAIFaA7BQBZq4cqIhApoAUrCpV7kdbAwvxM +ph2gCxUAWPaGwCDRDxzZb43g/8CwFaAKVQD0IAYVoDsFAFmrei0iEsCQ+EImFe++9QAO3QHtJhIs +kASAANEPANogWPO5wJDpJhEskASAANEPbBAIKiISDwIA80APJ9CI5QAtIhgr0HT5YA60IgCdACkg +BRzZVu/ZVhSOQYAADKoCKiYS80AnO1IAnQCOLCgyBiQwIPxhRBWv9cUA/wAnrSVEAQAMDE79m2AV +oCZVAPWABAZwhbUA9WAS1GAnFQAPqAKs6fhBhhXgOxUA+EJGFaAsJQD2gkYN4AoFAHZBCntBB/yA +KD0iAJ0ALTAwKiIQLjAxLzAy6qBwLu4CgAAO3QLuMDMu7gKAAA/dAujdEQV4GQAA7t0CD4IKgAAN +Dhn1wCPXVf0BAArlEQX1ApUR+iAGFaA7BQD9sk4FoApVAFmrMxzY4xvZJSzCoC8iGCuyiqXM7/B0 +LmZCgACsu/pCJhXgiLUA6rAFLegEgAD54Bg1IJ6lAP9AF/QgmLUA+UAXtCIAnQD1QBdwkJmVAPlA +IKVgD0UA9oAFfGIAnQD2gAU8IgCdACkwQSwwQC4wPCowPegwPi5mAoAA6cwCD3YCgAAK7gIpMD/q +MEIvdgKAAAjuAugwQy5mAoAA6swCD3YCgADp7gIOZgKAAAjMAg7IDOoiECQEi4AAJaISflEIBegM +ZoACLqYSLqITfOEIDskMZpACLKYTirwPqgKavHZBPcPB/IAJfCIAnQD2gA+MYgCdAMLi/oAXdCIA +nQAvEBBl8xLAINEPAAAoMCPAkQiYOSi0QSgUEPaf+l0iAJ0AKjAhf6e7KTBBLDBALjA8KjA96DA+ +LmYCgADpzAIPdgKAAAruAikwP+owQi92AoAACO4C6DBDLmYCgADqzAIPdgKAAOnuAg5mAoAACMwC +DsgM6iIQJASLgAAkohJ+QQgE6AxmgAIuphIuohN84QgOyQxmkAIsphMuMDgoMDmMvOkwOi92AoAA +CO4C6DA7L3YCgAAJ7gLq2LofdgKAAAjuAu/MAgdwBQAALiYWnLz7YWYVr/y2AAAA+ABiHaOa4QD5 +H+z2YgCdACgwJCkwJeswJixGAoAACYgC6TAnLEYCgAALiAIIiBHpiAIGWBEAAPltAA4/9b4AACkw +IfEgB84SAJ0AKjAkLDAl7jAmLVYCgAAMqgLsMCctVgKAAA6qAgiqEQyqAmWgzywwTC4wTe8wTi5m +AoAADswC7jBPLmYCgAAPzAIIzBEOzALqIhAmBWmAAC6iGP3ABROiAJ0ALLYSKjBILjBJ7zBKLVYC +gAAOqgLuMEstVgKAAA+qAgiqEQ6qAiq2FCkwNC4wNeowNizOAoAADpkC6Nh7HM4CgAAKmQL6ZvAV +oA4FAC62FS62E+i2CyzOAoAACpkC+WGmFe/4hgAuMDgvMDnoMDovdgKAAA/uAu8wOy92AoAACO4C +CO4RD+4C7NhpF3AFAAAuJhb9YWYVr/eyAAAqIhAvoAUoCpX5/+8EIgCdAMCS+EymHeALFQBY9WzA +INEPHNhc7bIALXAEgAD6QkgVoDsFAPogBhWgClUAWapeLSIS+kIIFaBOBQAO3QItJhIuMEErMEAs +MDwvMD3tMD4t3gKAAO67Ag5mAoAAD8wCLjA/7zBCLmYCgAANzALtMEMt3gKAAO+7Ag5mAoAA7swC +Dd4CgAANuwIMvQz3v+poEgCdAC2iEnzRCA3PDGbwAiymEiyiE/uf6ZxiAJ0ADLgMZo0o+0JmFeAC +BQDRDwAAACowOCwwOe4wOi1WAoAADKoC7DA7LVYCgAAOqgIIqhEMqgLp2CkVUAUAAComFpm7itcp +PCD7QcgVoAs1AG26BQkAhgoCYcAg0Q8pIhFkkH+Jl4me+SYAFeALZQAqPCDTD225BQoghgkCY8Ag +0Q8AACoiEGP+vAAA/+4wDa/19QAc2BMvMDApMDGOsOgwMi/+AoAACf8C6TAzL/4CgADo/wINaASA +AOgwIC/+AoAA+eYAD/AKJQD4IAYVoDsFAFmqCsAg0Q8AAAD6QiYVr/2SAInXKzELiZ6/uwtLS+W/ +fGTIwQAAY/w1AGwQBisiByYgBw8CACi5FAUNR/VhyBWhZgEA47IJJA5RgAD5oBBRUgCdABzX7ygi +AP9gSBWgClUA/b/AFeAJFQDtnTkJeASAAPggBhWgOwUAWanrHNfm/GAQFeAKVQD+ShAVoDsFAFmp +5hfXlOXXkxtPAoAA9MALwhIAnQCnmSqSnvdAD1pSAJ0AKpKdBWsKK7K/C6oBZKGlKyEHKSBALyAH +9a8yBeq7AQDt19Ed3wKAAPUgC5iR7wEA9SAJGRIAnQD1gAjakgCdAMDA+a+UBaD/EQDpIQgv+oKA +AA+7Au27Ag90AoAADpkCCJkCm6COIJim9UBGFeA/BQD5QIYV4A1FAP9AZhXgCQUA6aYFJViBAADp +pgcvdgKAAP3GAA9wDyUA7qYBLnYCgADv7gIFSQEAAAMghgsCYwMAhgsCYf9BJhWvlXUABICGCQJp +BGCGCQJnBECGCQJl6CISK08CgACnme2WnSEhIQAA9QxGDa9nhQAW16EjIhIPAgAHOQgqkicllH0s +kiYspgArkib7YCYVoAgFAOiWJiGbgQAA6JYnKdAEgABZp5P6AKIdoDsFAOxkAAnoBIAAWamRLyIS +wOHTD/XvAA+wDQUAD+04ZN+k5SQFKVAEgABZp4bAINEPAPyAUBWv+54A//jYDaADBQAc1zCLyGqx +fwxpEaeZKJKe9wAEclIAnQAqkp0FbQot0r8NqgFkoHywvp7IZa55YAAcAAAAAAAAAPwQQh2v+n4A +LyBACP8Q/mAGFe/3wgCPImTwXxzXbu4iACloBIAA+eBoHaAJFQD/LQAMcApVAPggBhWgOwUAWalm +wCDRDwAAAP/4hA2gCgUAwKBZpOoc1wyLyPl/+5CSAJ0A//40DaAKBQDAoMDaDb00/YEGFe/9+gAA +AI8w6iQAA1hhAAD/rqgFp//BAP5IBh3gDBUA/mAGFaANRQBYb8L+QEgV7/3eAGwQCIknKyAHKJkU +9OAABnG7AQDmkgkkCAmAAPmACeFSAJ0ALSBBHNbw5NbwHZgEgADxs0wN4AVFAPYAAh3gDQUA9WAG +2hIAnQAMuhGkqi6invXADRviAJ0AKaKdDL4KLuK/DpkB6pQABInpgAAvIEFl8WYc1vEZ1yooIQct +IAce1yn+QQQV6ogBAPwgAAXw3REA6t0QDEcCgADtiAIN3AKAAAv/Ag7/AgmIApigiCCfpP9AxhWg +DQUAnaX9QOYV4DsFAP1ARhWgCUUA66YDLEYCgAAJiALopgElSIEAAAYghgkCYwYAhgkCYfzgABWw +DCUADLsCm6kMOhEEqgj1U6YV75l1AOkkBSlQBIAAWacFwCDRDwAAAAD/+/wNoAYFAB/WsI7498AG +uJIAnQAMOhGkqiiinvUAB4PiAJ0AKqKdDDgKKIK/CKoB5KDeZ0v9AACZ+PlAaB3v/DoAKiBACKoQ ++sAGFa/6+gCPni3wBCfwBR7WzuXwBi7uAoAAB90C7/AHLu4CgAAF3QII3REP3QIO3QEl3Gf0jgAK +8IeVAPSggBXv+n4AjyLrFgQnhHmAABzW4e4iACloBIAA+eBoHaAJFQD/LQAMcApVAPggBhWgOwUA +WajXwCDRDyzcSOvcZylwBIAA/sBoHeS7HQBZp7xj/n8AAAAAAP/5pA2gCQUAmxT8IKYV4AoFAFmk +Uh/WdI0VjviLFBzWdPnf+ICSAJ0A//y4DaAKBQDAoMDKDOw0/eEGFa/8fgAAAACNYOokAAXYYQAA +/a14BafdwQDtJEAq6ASAAPzABhWgDBUAWG8o/kBIFe/9MgBsEAaJJyMgByiZFAMDQeaSCSQHMYAA +FNZb9ayyBeeFAQD5AAihUgCdAPRgBpoSAJ0ADDkRpJkqkp4FOworsr/3QAnqUgCdACqSnQuqAWSg +9ykgByshBxzWmPtAAAXw2REA6t0QDd8CgAANuwIMuwKboI4g+ayuBaA/BQD/QGYV4A1FAOimAi92 +AoAADe4CnqEsIEH6AAId4A8FAPlEABXh6QEA5cDRb3QCgAAsIQifpQ7MAh7Wgp+nnqYOzAKcpAYg +hgkCYwYAhgkCYf1gABWwDCUADLsCm6kMORGkmf0zphXvmHUA6CQFKVAEgABZpnPAINEPAAAAAP/8 +aA2gBgUAF9Yei3hqsX8MORGkmS2SngU8CuzCvygECoAA96AEClIAnQAqkp0MqgHkoHVl6/0AAJ14 +Za8ZYAAOLiBACO4Q/sAGFa/7mgAAjyJk8GUc1mHuIgApaASAAPngaB2gCRUA/y0ADHAKVQD4IAYV +oDsFAFmoVcAg0Q8A+hEiHe/8vgD/+yQNoAoFAMCgWaPYi3j5f/uokgCdAP/+YA2gCgUAAMCgwMoM +vDT84QYVr/4iAAAAAACPYOokAAHYYQAA/6yMBaf/wQD+SAYd4AwVAP7ABhWgDUUAWG6w/kBIFe/9 +xgBsEASKKo6vGNY96CYLIUiBAADp5gAleOEAAO8mCClYBIAA/kEmFaAMBQD5QeYV75iFAPhAph2g +DSUAWG0cwCDRDwAAAGwQBBvWLioxDNMPK7J/HNYP+GIQFeAUZQD7Q/YN4AUFAHyhF+okAArYBIAA +7DQACmgEgABY8nrAINEPAGiRQWiSIWiUCcBA//9kDaAFBQB8odF7q87aMFjyqNWg//8QDaAEBQD9 +QOYNoBRlAHujAmAAAcBA2jBY8r///pwNoAUFANowWPLT5aQABQERgAD9rBgFoApVAPxgKBXgOwUA +WagB//38DaAEBQAAAAD//dANoATFAGwQBCkwE/EmAA3g9YUAaJEDwCDRD4QnhE4c1f3tMBEiQBcA +AC2EYv5iUBWgClUA/wxmHaA7BQBZp+4qTQTsMBEh2GEAAFjy5OU7CAJQFwAA7DASJVOBAABY8t/q +JAAKWASAAFj0NcAg0Q+EJw8CAA8CAIROHNXoLTARLUQC/mJQFaAKVQD+gGYdoDsFAFmn2Os8GCJQ +CwAA7DARJVMhAABY8s3lOwgCUA8AAOwwEiVSoQAAWPLJwCDRDwAAbBAE9EBgJeizHQAjVFf6qsYd +4EQ1APSqph2gCHUA+KqGHaAJBQD4qmYd4EoFACpUUtEPAGwQBI84/auQBaAKVQD8YhAV4DsFAP/g +aB2h//EAWae4KTAQ6tXCFIyRAABokllplBKINiKifwmIEagiKCAFKQqVeYFewCDRDwAAANowWPUM +/18ADeAJdQCLp4u+LLKODJ1W/SNAHejsuQDA037QEPtgQCXgDAUAWPTWwCDRDwAAWPPxwCDRDwCL +Niqifwm7EftAAEVwCwUAWPN+wCDRDwAAAADApf2rRAWgOwUAWaeU+kBoHaALJQBY8pbAINEPAGwQ +BIguIyw4c4kFwCDRDwAAiy6Is+xEAAroBIAA67zgKVAEgAALgACMIu0gBS5+7gAAZN/Vji5z6dZj +/80AAABsEBYrIAeHNSMWGog05RYXKkgEgACZHOoSFyn4BIAA/+HkFeADFQDyIeYV4MhZAPwjZhWh +uwEAKxYW/CNIFaC/eQD6ImYV56oBACoWFRvVeS7BPS3CH/wiBhXj9vUA+2/EFeB3+QD+IkYVoEhR +AP2DsBWsOB0A6zsMBFQ+gAAPCEn4IcYVoAAaAJYe/CAGHa+7AQArFhT1QDwhEgCdAI8i++BBoJIA +nQDw5XAN4AoFAOoWESOASYAA2jBY/Vn0AAId4AYFAC0SG9pw+gBiHeAMJQDtvDkKWASAAFj9QfdA +AEMwDvUAduBU9CFmFaT2HQDjFgon+AUAAP4jBhXgAToAAAAAKBISZIdiKRIaiZV9lp4rEhIsEhD8 +IGgd4AoVAOoWESnQBIAAWP1vZqeS+gBiHeAFBQAKtTpkV3zDYJQb8iFGFeTGHQAsFhgtEhYc1Nge +1Nrj1NoeoASAAPWgCToSAJ0A6RIYLrcCgACjZihinvkAQSPiAJ0AJmKdDtgKKIK/CGYB22DmtAAF +vYGAAI/ImxX34D3okgCdACkyrurVJhS7gYAALjKtLaJg7esBB9P9AAD9wDrmYgCdAJrI/cA6/mIA +nQCNHCwgFA8CAK3MDAxHLCQU9YA8flIAnQAuEhspEhTxwMAN4Ag1APkAPYjiAJ0AZFDOihsPAgDI +oWRQY+tkAAlQBIAA/ABiHaAdhQBY/WPuEg4teASAAOYSCiKvmYAAHNUGLRIT+alqBeAKBQCa8prz +mvSa9elpAg9EAoAA6fYALuiCgADo3QIK9sKAAP+mAA6wG8UA/eAmFeAKVQBZpucrEhX5YDgpUgCd +AMAg7BIYKm8CgACj3SzWndEPAAAAAAAAj8j34DjgkgCdAOkSGCo3AoAAo2YoYp75ADk74gCdACti +nQ5NCi3Svw27Aea0AAW42YAAsP6eyPrAaB3v+xYALxIR0w9k8HfrEgUpUASAAPwAYh2gHYUAWP0w +GdTYFtTVjhooEAAmYp8J7gIZ1KkIHxTmhgsP+wKAAOn/AgR8oIAALBIQ7RISI1v/AAAosj8rsX2e +oJ+hnaKco5uk+UCmFaAAcgAALBIQLRISK2EFiGOeoJ+hm6KYo52knKUmrBgtEhOMHgLdEO0WBy5k +AoAA7BYIK6b+AAAa1Gj4IUgVoA8FAP4gxhXgDyUAnx0KiAIoFgnrZAAJUASAAPwAYh2gHYUAWP0F +jRkvEhqJFisSGo/18TXQDeP+9QAc1KmLtP9ARhWgj5kA/UAGFeBviQD9QCYVoN+hAPDQABMwz5EA +7tShHulCgADupgMsQQKAAP0GAAx5uwEA66YELmDCgAAMZgIIZgImpgUsEg3pnAElMGEAAOkWBiZj +/QAA7BYNLnumAADrZAAJUASAAPwAYh2gHYUAWPzhFtSMiRePGPohKBXgDQUAnRGdEp0TnRSdpP1A +phXv/vUAnqKeo5ugLhIa6f8CCsbCgADo/wIA4DEAAOb/AgDYIQAA7RwQJTBhAADvpgEg0BEAAFj7 +sPlAaB3gDBUA6sk5DSgEgADpFh4lIAmAACQWH/4AIh2gDQUACe045RYgJurhgAAT1GyIGIwXGtRr +KxIbhBoV1DrxeAAUsA4VAOvrOQongoAA9IYACnYPBQALrzn9JgAMsA01APkmAAwwDCUAC9w5LBYd +CfkCKRYZ+eYAD7AFBQD+I4YV4AMKAAAPVlD+GAAF8M/JAPwhKBXgj7EA/UAGFeDveQDs7hEMRAKA +AOvMEA3agoAA7LsCCzPCgAD4xgALMM+BAP2IABYxj2kA7O4CDEUCgAAI7gIc1BScoSgQAAbuAvvG +AA9wb7kA9MgAEzu/AQD3xgAPMAYlAObuAg3dAoAA7qYELEICgAALiAKYpRvUNpuiGNQ2+UBmFa/5 +jgCZoZSgnqKeo56knqWdpp2nnaidqS8SHeVcASUwoQAA/qARnGIAnQDrZAAJUASAAPwAgh2gLYUA +WPx25FBRas7CgAD0oApgkgCdACsSHMfv+yYADPANBQDjmQIL/S4AAI0TLBIajhKPEYvMLMIQmaGb +qfVABhWgCAUAmKKYpp+jnqSdp5yljBT9QQYVr/4mAC0SGywSGRvUDwyZAuuZAgaEGYAA8OJADe/+ +9QCZoZSgnqKeo56k/0CmFaANBQCdpp2nnaj9QSYV7/02AC8SGiIWISvyFibxOCLxOizyFejxOSs0 +AoAABiICJvE7LfIb7vIaLEQCgAAIZgIo8hcv8hmfop6jnaScppunmKiWpZmhlKCSqfIkKBWv+/YA +AAAAAAAAAPDiQA3v+/UAmaGUoJuim6ObpPtAphXgCAUAmKaYp5io+UEmFa/7OgAsEhqNEi/BOybB +OSjBOC7BOuvCGCs0AoAA5v8CDEQCgAAI7gImwhSIzCzCEJukmKeWqJmhnaKUoJyjn6WeqYwU/UDG +Fa/6GgArEhvsEhklg1GAABvTzcfv/SYADLANBQDrmQIDgPGAAJmhlKCeop6jnqSepZ2mnaedqP1B +JhXv+TIALhIaIhYhLeISLOITK+IYiO2G7i/iFILvLuIRnqKdo5ykm6WYppann6mZoZSgkqjyJCgV +r/hWACsSHMff+yYADPAMBQDjmQIDgPGAAJmhlKCdop2jnaSdpZymnKecqP1BJhWv95oAmaGUoI4T +/iAoFeAIBQCYopijmKSYppinmKifpf9BJhWv9woAKhIaGdOfiqUT0zQlEiDkEh8lTDCAAOPTMBOD +uYAAHNOZixoMuwL7P0YV7+eiAIUfwNL3rQAK/+gmAMCl/acmBaAbxQDuPhEJ6ASAAFmlc2P4ZwAA ++iKIFaAOBQCeEZ4SnhOeFFj6tCQWH+UWICViYYAA+iKIFaALBQBY+qckFh/0JAYV7/DaAC8SEGX4 +lmP4OhrTUogaCogC+T9GFa/l1gDAoFlejsinG9N5K7CAZLBaKhIUWPqg6RIeLV9OAAD6IogVoAsV +AFj6lPgjyBXv71oAAAD/4CQNoDYFAOsSEinQBIAA7BIQKOgEgABY+2Nj+FYAACsSGowc7RIXKVAE +gABYZuzSoNEPAAAAAPumwgWhSxUAWY5JLBoADKwC+6a4BaFLFQBZjklj/4UAAMCwwNoN/TTtxggt +xU4AAPpAaB2gG8UA/AACHaANFQBYa6dj/6EAAAAAKxIW+kBoHaAMBQDtEhgl2GEAAFhroGP/hMCg +WaCzHNLWj8j5/8HIkgCdAGP/t9ogW+v5Y/hsiieNHMDA6qwgLtgEgABYYH7SoOsSGCpnAoAAo8wr +xp3RDwAAAAAAAP/foA2gBgUA/+FIDaAFRQDAoFmgnhzSwI/IHtLB+f/GuJIAnQD/4/ANoAYFAAAA +AP/jlA2gCwUAwNoN/TT9gQYV7+OSAAAAAGwQBBTTJYIgJEJ/E9MkBCIMAyIC0Q8AAGwQDBjTIhrS +sRnTHyiAfSqiqSmShgmqEeqZCAR8RIAAJJ0B9JAAFaAAMgAAACSdAyRMgBnS3yhBKfkACAxiAJ0A +GtLL6gAFCMgEgAAJAmEJAmEJAmEJAmEZ0w8Y0ugf0wyOIJ8S+CDGFaAKRQDpFgAvdgKAAArqApoR +KUAHL0Ep/aYMBaGZAQDj7gIMzAKAAAn/Agj/Ap8UKyA5/iFmFaANJQCdGQy7AusWCCgECoAA9GAE +sZIAnQCJRyqZFOSgf2TggQAAjZmLwP/4Ah2gJYUA7s4BBoIZgABtCC59sTgv0AAp0Ad18S8vwQXu ++AgMzwKAAOndCARBAQAA6NsRftAEgADtpAAFAImAAGP/ygAA/68ADX//vgD9bwANcAkFAAqdOObU +AA6BpgAA6kQACNgEgAD8AIIdoA0lAFhcsNEP//4MDaANBQAAACocOvpHQBXgDGUAWZ1GY/9cwnaO +aPoAoh2gO0UA7NLNG2gEgAD+RzAV4+4BAFmkpIpoCo9Xd/FtikcuoRX7RAAVr8sFAAurAavr62pw +c2kBAADvogAmgYGAAH3xKCzQANMPDwIAdcEdKdAHDJkR6d0IBcEBAADo2yR+0ASAAO2kAA1+xgAA +/e8ADfAKBQALrTjm1AAG+mGAAGP/dgAA/68ADT//cgAsIDkKDUN9yYiOIAjuEQ4+Ap5r0Q8AAAD/ +rwAOv/5CAGwQBiggBSwgB8GUDwIA+QAQdWHMAQApIgJlkcMtMAEb0iTm0iQeOASAAP+hQAbQD6UA +LiBOZeJX7tIcHk8CgAD1gArSEgCdAKaZKJKenBALywr3ABGU0gCdACuyvyqSnQurAesWASWOSYAA +iuj3QA64kgCdAChiru3SEBQL+YAALGKtLdJ/7csBBUP9AAD9gAteYgCdAJjo/YALZmIAnQApIBSk +mQkJRykkFPUgDXXSAJ0AHtIRG9IKjCD4ICgV4AoFACq2Mu7MAg5uAoAA/WcGFaAORQAO3QIttjEb +0m3ckOsPHg3QBIAADAJnC0CGDAJlCyCGDAJjCwCG7AwABNkBAAAK4IYLAm8KwIYLAm0KoIYLAmsK +gIYLAmkuMQEoIQktIAcsMAEb0lsqIST8IAAGMN0RAOrdEA5kAoAADcwCDKoCHdJVLCEiC6oCKpYg +DcwCiyAd0fMoliMuliQsliL9YAAVsAwlAAy7AiuWIYoz6pYlJMgHAADtABUEymEAAAkAigx4EaaI +/xOmFeflAQD5wAa5UgCdAMAg0Q8AAIro90AH4JIAnQAMeRGmmS2Sngt7Ciuyv/egCGTSAJ0ALZKd +C9sBZLEAsK2d6OsWAS305gAA/CAGFaABZgAAAAAAAOokAAnYBIAA7EQACugEgABYZafSoNEPAAAA +AMCwD6k06eYILfTmAAD6QGgdoBvFAPwAIh2gDRUAWGprY//BAADqJAAK2ASAAFhnQNKg0Q8AixD6 +QGgdoAwVAPtjABXgDaUAWGphY/+XwKBZn3Qe0ZaK6Plf8PiQD6UAY/+q2iBb6rr/+TQNoA+lAACK +J+tEAApoBIAA+0QAFaAMBQBYXzzSoNEPAAAAAP/3XA2gCwUAwLgLmwL6QEYV7/0eAAAAAPwgBhWg +CgUAWZ9cHtF/iuiMEBvRf/lf93iQD6UA//woDaALBQAAwLAPrTT9wQYV7/vyAABsEAYoIAUmIAfn +NAAK2ASAAPgCgh3gBTUA+QAPnWFmAQALCEdoghSKIhjRbBfRbeRkAAUDyYAAwCDRDwArIh1lseGI +J4OI+wKkFe/MBQDpggskcIEAAAzsAey7CAp/AoAA7BYAJdkBAADzIA38YgCdAC2JFKP6r90thRT7 +YA3rogCdAMl1yUPZMG1JBQcAhgkCYYrgDwIADwIAr6r7QBCsYgCdAPvABhWv/f4A7GoRAyTxAAAH +qggrop4PAgD3YArZ0gCdACqinQhrCiuyvwuqAWWgT+tsGClQBIAA/AAiHaANNQBYagPAINEPABvR +Oom49yAMoJIAnQAMShEHqggsop73gA0B0gCdACqinQhMCizCvwyqAeShjmTr/QAALbYIZK+vGdFW +maCIIP+jTgXgCxUA66YCLEYCgAAFiAKYoYgzL/J//6KCBaiIHQCo/5+j7gAVBUhBAAD/omgF4AgF +ALGI6YMeDA/oAACfphnRl/lBBhXgGAUAmKeOIAjuEQXuAp6pDE0Rp90l1p2OIiwgBoknC+4C69GO +FmAFAADsJAYkyIEAAIiR/SCCFe/MBQAMnAHuJgIkQ0EAAOiWASbowQAA7ZUEJmEBAAB8iyIqkQUd +0RioqJiRnYCMIOuGAi5mAoAABcwC/QAmFaACBQDRDx3REJ2AjCAb0XbrhgIuZgKAAAXMAv0AJhWg +AgUA0Q/aIFhmkdKg0Q8AAAD/+sQNoAoFAFgAJ2P+FwAA8yBoHeAOBQD/AWYVr/e+AOO6DAOBuYAA +CksU7LwIK8AEgADsTDYJyASAANMPbckFCACGCQJhiRCqeOtNDATJAQAAbdkFCCCGCQJjixAK/Ays +uyu8QPvABhXv9ooAwKBZnq8b0NGJuBjQ0vk/8viSAJ0A//n8DaAKBQDAoMDaDZ00/WEGFe/5wgCP +EC/8QP/ABhXv9aYAAABsEAYS0MYX0UL1oZ4FoBOVAPhQyBWgpiUAKiKCf6cgKyKCf7cYKiKELKAI +JaAHdsE3iETAoAuAAAUzDGU/2tEPLSKEKSKHKiKH+WAABPuqgQB6mTAK6jArQkHDwgy7KKuq+puG +Fa/+6gAuoQsu7PgODkPu7Pwi6/0AAP+iAAq//s4AAAAADAIALyKCf//FJdAHblu/3HD6AKIdoAsF +AP6gABcw/wUAWaLuJVzxylsoCnGYEcChWZbP+iAoFeAJ9QAJWTaZEAm7DPogJhXgCgUAWX1yihAK +VQxlX9fAoVmWxfoOIh3gCgUAWX1sY/9lAABsEAYoIAUvIAfBlPkAFM1h/wEA9CAmFaeFAQCYEvUA +D7kSAJ0AiSId0H7r0H8foASAAObQfhyRlgAA9eAPQhAHtQDvFgAv1wKAAKaqLKKeC/sKK7K/94AV +u+IAnQAsop0LywHntAAFkomAAI7Y98AS+JIAnQAsYq7q0OsWECmAAC9irSui5uv8AQdD/QAA++AP +jmIAnQCY2PvgD6ZiAJ0AKyAUKTAHq5kJCUcpJBT1IBG10gCdAB/Q3J9wiSD8AIId4AUVAOV2AizO +AoAADZkCmXGINhnQ1iyiGv+g3gWiiB0ACYgBqMz84GYVoCsFAO4AFQPIQQAACQCKm3cZ0F/pdgYh +4MEAAOwHHgPAgQAACAJj7uMFA+DBAAAMAmEvdhCIIOV2EixGAoAADYgCKHYRjDMqohgMjBSsqup2 +EyP5gQAA7gAVA9FBAAAKAIopdhbrdhch0EEAAApghg8CZwpAhg8CZS0wAY8zGNB98aAFB9AchQAt +IAcV0K76RIQVoN0RAOMxAS7qgoAACN0CLXYgiyApdiIsdiP9YAAVsAw1AAy7Aut2ISPIBwAA7uMF +BMpBAAAJAmEJAmEuIAcoIQny5SYV4BmlAP7lBhXgCwUA63YlLEUCgAD5BgAMce4BAOh2Ji90AoAA +Dq4CBe4C/uSGFaAJtQDsEgIqbwKAAKbdKdad+YAHqVIAnQDAINEPAAD//4QNoAmFAC4iHWTuBv4g +BhXgA+4Ajtj3wAfgkgCdAAxKEaaqKKKe9wAIo+IAnQAsop0LSAoogr8IzAHrxAAGCEGAALDpmdjn +tAAN8H4AAP4gBhXgAVIA6iQACdgEgADsEgEq6ASAAFhj49Kg0Q8AAMDAwLoL6zTr1ggucKYAAPpA +aB2gG8UA/AAiHaANFQBYaKdj/8EAAOokAArYBIAAWGV80qDRDwCLEPpAaB2gDBUA+2MAFeANtQBY +aJ1j/5fAoFmdsB3P0o7Y+d/suJIAnQBj/6oAAADrxAAJUASAAFvo8/ugmAWv9v4AiieNEcDA6qwg +LtgEgABYXXfSoNEP//U8DaALBQAAAAAAAFv+/P4gCBXv9AYA/iAGFeAKBQBZnZgdz7uO2I8QG8+7 ++d/3eJIAnQD//DwNoAsFAAAAAP/74A2gDAUAwMoM7DT9oQYVr/veAAAAAGwQCuQiBypQBIAAiCL+ +QPAVr88FAOVBFS1nAoAA7DwIAiCBAAAPRAGkVORMQC5YBIAA9YAl0qHuAQAtsAfs3P4tsASAAOSA +CGboDQAAwCDRDx/Pme0WACXAgQAAmBMdz5j1ACSaogCdAOXPlh8gBIAA9cAfYhIAnQAM6xGluymy +nu4WASZAIQAA+SAlm6IAnQArsp0N6Aoogr8IuwHntAAFoBmAAI34mhTTD/egIsiSAJ0AKVKu69AB +FKBBgAAuUq0vsuYbz30P6AHoFgImy/0AAP/AH4ZiAJ0Ambj/wB/GYgCdAC4gFC1gB67d+iCGFafd +AQAtJBT1oCFt0gCdABnPvh/P8Y0giDTuz4EaXwKAAOW7CA7uAoAA8QAE+lAFNQCDYyohJAXcAigg +By1hAf7gRhWgFIUAlHP84CYVoIgRAOzPixxCgoAA+QYADHAEBQD44AYVoAglAOwABQPgQQAAbYoC +DAJhLiEJLCAHlHX84SYV4DilAON2CC9tAoAA+aYADrHMAQDtdgYuZAKAAAyqAg+qApp0KSEJAioC +/sAkFaAMBQDltp0s3QKAAPlmAA2wDQUAWGTQwCDRD4gTiID1gCAVoIkVAPWmAAo3iMEAeYkZlHHv +z7oWS/0AAP7gBhXhmR0A+OBGFeAAUgCUcYgTGc+2mXCIgQhYFJhyjzYZz68oIgcUz68pkhr1AqQV +4v8dAAT/ASUWBg+ZCO+CCSRAgQAA+OBmFe/JBQDpiAEFIAkAAOgWBSonAoAABP8ICFUI7KkIAqkB +AADl8wp0yAkAACgSBgj/DOoWBCzPAoAABJkM5JBFbicCgADvSAgDyEEAAJkX+KAOyqIAnQAPVQwF +TRTTD23ZBQ8AhgkCYYkVDc8Mp1jsjBAkyQEAAG35BQkghgwCYy0iAAjdERjPhfTgAESwDxUA/yDG +FeAMRQAM3AKYlBjPfpyVjGMoghgVz4H/ni4F6MwdAKyImJcYz3zvABUE6IEAAP+e+AXgDAUAsczt +gx4OD+gAAP8hRhWgLAUAnJuHY4Q0jDUIRAHvzAELwkKAAAhEAgVEApScKGAJLWALJGAKJWAI789s +HukCgADmRBAMQwKAAP0GAAwwxTEA7UQCDmHCgAAMRAIIRAKMNhjPDJSd9GFIFaXVHQDvzAEO6EKA +AA3MAv0hxhWkVQEA6EQBCqoCgAAFRAKIZZifhWYllhCPZySWEi+WEY1kLZYTLGAB8YAEp9IAnQAs +IAcdzxbywCQV4MwRAO8hJC5igoAADcwCLJYUiCD8AwId4Aw1AO2WFyxGAoAADIgCHM7o/yLGFaAN +BQD5IqYVoAglAOwABQThgQAAbYoCDAJhKCEJmhQuIAf7AAAUMBylAAyIAiiWGvmeYAWh7gEA7ZYZ +L3QCgAAO/gII7gKIECOWHSeWHO6WGCRADQAAmBCOFI8QL7adLWAHiif/oABGsAwFAOvUAAVQgQAA +WFxN0qDRDwAAZM5WbckFD0CGCQJlY/5EjfiaFPegBviSAJ0ADEsRpbsosp64yfkAB6viAJ0AGM6Q +KbKdCEgKKIK/CJkB65QABIcxgACw2Zn417DuFgEt4C4AAI0QixH6QGgdoAwVAO3cAyXYYQAAWGdH +wCDRDwAAAMDgnhKIEhvOfMCaCdk06bYILGCGAAD6QGgdoBvFAPwAIh2gDRUAWGc7wCDRDwD1jwAN +/+0aAAWLDPogZhXv7aoAAAAAAAD8IQYVoAoFAFmcRh/OaY34ihSMGPm/3JiSAJ0AY/+wAJwY6xIC +KVAEgABb54mKFPwhCBWv7xIAAP/tZA2gCwUAnhH8IQYVoAoFAFmcNh/OWIoUjfiMGI4R+b/4SJIA +nQD//LgNoAsFAP/8aA2gCQUAwIoI2DT54QYVr/xmAAAAAGwQBikgBSYgB9gw9gBiHeAaRQD7IA/N +IWYBAAUJR/0jAAFfxQUAiyIZzkQTzkTkZAAFg7GAAMAg0Q+IJ4uILoEV6YILJHiBAAAF+gHq7ggK *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Dec 6 12:57:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73F9FC694B7; Tue, 6 Dec 2016 12:57:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E86C160D; Tue, 6 Dec 2016 12:57:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6CvSHH074010; Tue, 6 Dec 2016 12:57:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6CvS68074008; Tue, 6 Dec 2016 12:57:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201612061257.uB6CvS68074008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 6 Dec 2016 12:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309616 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 12:57:29 -0000 Author: andrew Date: Tue Dec 6 12:57:28 2016 New Revision: 309616 URL: https://svnweb.freebsd.org/changeset/base/309616 Log: Adda new common GIC header to handle the common parts of the GICv2 and GICv3 drivers. For now it just contains common distributor registers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Added: head/sys/arm/arm/gic_common.h (contents, props changed) Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Tue Dec 6 12:57:04 2016 (r309615) +++ head/sys/arm/arm/gic.c Tue Dec 6 12:57:28 2016 (r309616) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #ifdef INTRNG #include "pic_if.h" @@ -76,20 +77,6 @@ __FBSDID("$FreeBSD$"); /* We are using GICv2 register naming */ /* Distributor Registers */ -#define GICD_CTLR 0x000 /* v1 ICDDCR */ -#define GICD_TYPER 0x004 /* v1 ICDICTR */ -#define GICD_IIDR 0x008 /* v1 ICDIIDR */ -#define GICD_IGROUPR(n) (0x0080 + ((n) * 4)) /* v1 ICDISER */ -#define GICD_ISENABLER(n) (0x0100 + ((n) * 4)) /* v1 ICDISER */ -#define GICD_ICENABLER(n) (0x0180 + ((n) * 4)) /* v1 ICDICER */ -#define GICD_ISPENDR(n) (0x0200 + ((n) * 4)) /* v1 ICDISPR */ -#define GICD_ICPENDR(n) (0x0280 + ((n) * 4)) /* v1 ICDICPR */ -#define GICD_ICACTIVER(n) (0x0380 + ((n) * 4)) /* v1 ICDABR */ -#define GICD_IPRIORITYR(n) (0x0400 + ((n) * 4)) /* v1 ICDIPR */ -#define GICD_ITARGETSR(n) (0x0800 + ((n) * 4)) /* v1 ICDIPTR */ -#define GICD_ICFGR(n) (0x0C00 + ((n) * 4)) /* v1 ICDICFR */ -#define GICD_SGIR(n) (0x0F00 + ((n) * 4)) /* v1 ICDSGIR */ -#define GICD_SGI_TARGET_SHIFT 16 /* CPU Registers */ #define GICC_CTLR 0x0000 /* v1 ICCICR */ @@ -107,14 +94,6 @@ __FBSDID("$FreeBSD$"); #define GIC_SUPPORT_SECEXT(_sc) \ ((_sc->typer & GICD_TYPER_SECURITYEXT) == GICD_TYPER_SECURITYEXT) -/* First bit is a polarity bit (0 - low, 1 - high) */ -#define GICD_ICFGR_POL_LOW (0 << 0) -#define GICD_ICFGR_POL_HIGH (1 << 0) -#define GICD_ICFGR_POL_MASK 0x1 -/* Second bit is a trigger bit (0 - level, 1 - edge) */ -#define GICD_ICFGR_TRIG_LVL (0 << 1) -#define GICD_ICFGR_TRIG_EDGE (1 << 1) -#define GICD_ICFGR_TRIG_MASK 0x2 #ifndef GIC_DEFAULT_ICFGR_INIT #define GIC_DEFAULT_ICFGR_INIT 0x00000000 @@ -192,14 +171,14 @@ static inline void gic_irq_unmask(struct arm_gic_softc *sc, u_int irq) { - gic_d_write_4(sc, GICD_ISENABLER(irq >> 5), (1UL << (irq & 0x1F))); + gic_d_write_4(sc, GICD_ISENABLER(irq), (1UL << (irq & 0x1F))); } static inline void gic_irq_mask(struct arm_gic_softc *sc, u_int irq) { - gic_d_write_4(sc, GICD_ICENABLER(irq >> 5), (1UL << (irq & 0x1F))); + gic_d_write_4(sc, GICD_ICENABLER(irq), (1UL << (irq & 0x1F))); } #endif @@ -239,11 +218,11 @@ arm_gic_init_secondary(device_t dev) arm_gic_map[cpu] = gic_cpu_mask(sc); for (irq = 0; irq < sc->nirqs; irq += 4) - gic_d_write_4(sc, GICD_IPRIORITYR(irq >> 2), 0); + gic_d_write_4(sc, GICD_IPRIORITYR(irq), 0); /* Set all the interrupts to be in Group 0 (secure) */ for (irq = 0; GIC_SUPPORT_SECEXT(sc) && irq < sc->nirqs; irq += 32) { - gic_d_write_4(sc, GICD_IGROUPR(irq >> 5), 0); + gic_d_write_4(sc, GICD_IGROUPR(irq), 0); } /* Enable CPU interface */ @@ -276,11 +255,11 @@ arm_gic_init_secondary(device_t dev) arm_gic_map[PCPU_GET(cpuid)] = gic_cpu_mask(sc); for (i = 0; i < sc->nirqs; i += 4) - gic_d_write_4(sc, GICD_IPRIORITYR(i >> 2), 0); + gic_d_write_4(sc, GICD_IPRIORITYR(i), 0); /* Set all the interrupts to be in Group 0 (secure) */ for (i = 0; GIC_SUPPORT_SECEXT(sc) && i < sc->nirqs; i += 32) { - gic_d_write_4(sc, GICD_IGROUPR(i >> 5), 0); + gic_d_write_4(sc, GICD_IGROUPR(i), 0); } /* Enable CPU interface */ @@ -295,9 +274,9 @@ arm_gic_init_secondary(device_t dev) /* * Activate the timer interrupts: virtual, secure, and non-secure. */ - gic_d_write_4(sc, GICD_ISENABLER(27 >> 5), (1UL << (27 & 0x1F))); - gic_d_write_4(sc, GICD_ISENABLER(29 >> 5), (1UL << (29 & 0x1F))); - gic_d_write_4(sc, GICD_ISENABLER(30 >> 5), (1UL << (30 & 0x1F))); + gic_d_write_4(sc, GICD_ISENABLER(27), (1UL << (27 & 0x1F))); + gic_d_write_4(sc, GICD_ISENABLER(29), (1UL << (29 & 0x1F))); + gic_d_write_4(sc, GICD_ISENABLER(30), (1UL << (30 & 0x1F))); } #endif /* INTRNG */ #endif /* SMP */ @@ -484,18 +463,19 @@ arm_gic_attach(device_t dev) #endif icciidr = gic_c_read_4(sc, GICC_IIDR); - device_printf(dev,"pn 0x%x, arch 0x%x, rev 0x%x, implementer 0x%x irqs %u\n", - icciidr>>20, (icciidr>>16) & 0xF, (icciidr>>12) & 0xf, - (icciidr & 0xfff), sc->nirqs); + device_printf(dev, + "pn 0x%x, arch 0x%x, rev 0x%x, implementer 0x%x irqs %u\n", + GICD_IIDR_PROD(icciidr), GICD_IIDR_VAR(icciidr), + GICD_IIDR_REV(icciidr), GICD_IIDR_IMPL(icciidr), sc->nirqs); /* Set all global interrupts to be level triggered, active low. */ for (i = 32; i < sc->nirqs; i += 16) { - gic_d_write_4(sc, GICD_ICFGR(i >> 4), GIC_DEFAULT_ICFGR_INIT); + gic_d_write_4(sc, GICD_ICFGR(i), GIC_DEFAULT_ICFGR_INIT); } /* Disable all interrupts. */ for (i = 32; i < sc->nirqs; i += 32) { - gic_d_write_4(sc, GICD_ICENABLER(i >> 5), 0xFFFFFFFF); + gic_d_write_4(sc, GICD_ICENABLER(i), 0xFFFFFFFF); } /* Find the current cpu mask */ @@ -507,15 +487,15 @@ arm_gic_attach(device_t dev) mask |= mask << 16; for (i = 0; i < sc->nirqs; i += 4) { - gic_d_write_4(sc, GICD_IPRIORITYR(i >> 2), 0); + gic_d_write_4(sc, GICD_IPRIORITYR(i), 0); if (i > 32) { - gic_d_write_4(sc, GICD_ITARGETSR(i >> 2), mask); + gic_d_write_4(sc, GICD_ITARGETSR(i), mask); } } /* Set all the interrupts to be in Group 0 (secure) */ for (i = 0; GIC_SUPPORT_SECEXT(sc) && i < sc->nirqs; i += 32) { - gic_d_write_4(sc, GICD_IGROUPR(i >> 5), 0); + gic_d_write_4(sc, GICD_IGROUPR(i), 0); } /* Enable CPU interface */ @@ -725,7 +705,7 @@ gic_config(struct arm_gic_softc *sc, u_i mtx_lock_spin(&sc->mutex); - reg = gic_d_read_4(sc, GICD_ICFGR(irq >> 4)); + reg = gic_d_read_4(sc, GICD_ICFGR(irq)); mask = (reg >> 2*(irq % 16)) & 0x3; if (pol == INTR_POLARITY_LOW) { @@ -747,7 +727,7 @@ gic_config(struct arm_gic_softc *sc, u_i /* Set mask */ reg = reg & ~(0x3 << 2*(irq % 16)); reg = reg | (mask << 2*(irq % 16)); - gic_d_write_4(sc, GICD_ICFGR(irq >> 4), reg); + gic_d_write_4(sc, GICD_ICFGR(irq), reg); mtx_unlock_spin(&sc->mutex); } @@ -1089,7 +1069,7 @@ arm_gic_ipi_send(device_t dev, struct in if (CPU_ISSET(i, &cpus)) val |= arm_gic_map[i] << GICD_SGI_TARGET_SHIFT; - gic_d_write_4(sc, GICD_SGIR(0), val | gi->gi_irq); + gic_d_write_4(sc, GICD_SGIR, val | gi->gi_irq); } static int @@ -1157,7 +1137,7 @@ arm_gic_config(device_t dev, int irq, en mtx_lock_spin(&sc->mutex); - reg = gic_d_read_4(sc, GICD_ICFGR(irq >> 4)); + reg = gic_d_read_4(sc, GICD_ICFGR(irq)); mask = (reg >> 2*(irq % 16)) & 0x3; if (pol == INTR_POLARITY_LOW) { @@ -1179,7 +1159,7 @@ arm_gic_config(device_t dev, int irq, en /* Set mask */ reg = reg & ~(0x3 << 2*(irq % 16)); reg = reg | (mask << 2*(irq % 16)); - gic_d_write_4(sc, GICD_ICFGR(irq >> 4), reg); + gic_d_write_4(sc, GICD_ICFGR(irq), reg); mtx_unlock_spin(&sc->mutex); @@ -1196,7 +1176,7 @@ arm_gic_mask(device_t dev, int irq) { struct arm_gic_softc *sc = device_get_softc(dev); - gic_d_write_4(sc, GICD_ICENABLER(irq >> 5), (1UL << (irq & 0x1F))); + gic_d_write_4(sc, GICD_ICENABLER(irq), (1UL << (irq & 0x1F))); gic_c_write_4(sc, GICC_EOIR, irq); /* XXX - not allowed */ } @@ -1208,7 +1188,7 @@ arm_gic_unmask(device_t dev, int irq) if (irq > GIC_LAST_SGI) arm_irq_memory_barrier(irq); - gic_d_write_4(sc, GICD_ISENABLER(irq >> 5), (1UL << (irq & 0x1F))); + gic_d_write_4(sc, GICD_ISENABLER(irq), (1UL << (irq & 0x1F))); } #ifdef SMP @@ -1222,7 +1202,7 @@ arm_gic_ipi_send(device_t dev, cpuset_t if (CPU_ISSET(i, &cpus)) val |= arm_gic_map[i] << GICD_SGI_TARGET_SHIFT; - gic_d_write_4(sc, GICD_SGIR(0), val | ipi); + gic_d_write_4(sc, GICD_SGIR, val | ipi); } static int Added: head/sys/arm/arm/gic_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/gic_common.h Tue Dec 6 12:57:28 2016 (r309616) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Andrew Turner under + * the sponsorship of the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _GIC_COMMON_H_ +#define _GIC_COMMON_H_ + +/* Common register values */ +#define GICD_CTLR 0x0000 /* v1 ICDDCR */ +#define GICD_TYPER 0x0004 /* v1 ICDICTR */ +#define GICD_IIDR 0x0008 /* v1 ICDIIDR */ +#define GICD_IIDR_PROD_SHIFT 24 +#define GICD_IIDR_PROD_MASK 0xff000000 +#define GICD_IIDR_PROD(x) \ + (((x) & GICD_IIDR_PROD_MASK) >> GICD_IIDR_PROD_SHIFT) +#define GICD_IIDR_VAR_SHIFT 16 +#define GICD_IIDR_VAR_MASK 0x000f0000 +#define GICD_IIDR_VAR(x) \ + (((x) & GICD_IIDR_VAR_MASK) >> GICD_IIDR_VAR_SHIFT) +#define GICD_IIDR_REV_SHIFT 12 +#define GICD_IIDR_REV_MASK 0x0000f000 +#define GICD_IIDR_REV(x) \ + (((x) & GICD_IIDR_REV_MASK) >> GICD_IIDR_REV_SHIFT) +#define GICD_IIDR_IMPL_SHIFT 0 +#define GICD_IIDR_IMPL_MASK 0x00000fff +#define GICD_IIDR_IMPL(x) \ + (((x) & GICD_IIDR_IMPL_MASK) >> GICD_IIDR_IMPL_SHIFT) +#define GICD_IGROUPR(n) (0x0080 + (((n) >> 5) * 4)) /* v1 ICDISER */ +#define GICD_ISENABLER(n) (0x0100 + (((n) >> 5) * 4)) /* v1 ICDISER */ +#define GICD_ICENABLER(n) (0x0180 + (((n) >> 5) * 4)) /* v1 ICDICER */ +#define GICD_ISPENDR(n) (0x0200 + (((n) >> 5) * 4)) /* v1 ICDISPR */ +#define GICD_ICPENDR(n) (0x0280 + (((n) >> 5) * 4)) /* v1 ICDICPR */ +#define GICD_ICACTIVER(n) (0x0380 + (((n) >> 5) * 4)) /* v1 ICDABR */ +#define GICD_IPRIORITYR(n) (0x0400 + (((n) >> 2) * 4)) /* v1 ICDIPR */ +#define GICD_ITARGETSR(n) (0x0800 + (((n) >> 2) * 4)) /* v1 ICDIPTR */ +#define GICD_ICFGR(n) (0x0C00 + (((n) >> 4) * 4)) /* v1 ICDICFR */ +/* First bit is a polarity bit (0 - low, 1 - high) */ +#define GICD_ICFGR_POL_LOW (0 << 0) +#define GICD_ICFGR_POL_HIGH (1 << 0) +#define GICD_ICFGR_POL_MASK 0x1 +/* Second bit is a trigger bit (0 - level, 1 - edge) */ +#define GICD_ICFGR_TRIG_LVL (0 << 1) +#define GICD_ICFGR_TRIG_EDGE (1 << 1) +#define GICD_ICFGR_TRIG_MASK 0x2 +#define GICD_SGIR 0x0F00 /* v1 ICDSGIR */ +#define GICD_SGI_TARGET_SHIFT 16 + +#endif /* _GIC_COMMON_H_ */ From owner-svn-src-head@freebsd.org Tue Dec 6 13:46:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F76CC63B16; Tue, 6 Dec 2016 13:46:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B6DC138A; Tue, 6 Dec 2016 13:46:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6DkCfR093627; Tue, 6 Dec 2016 13:46:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6DkCfP093626; Tue, 6 Dec 2016 13:46:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201612061346.uB6DkCfP093626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 6 Dec 2016 13:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309617 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 13:46:13 -0000 Author: andrew Date: Tue Dec 6 13:46:12 2016 New Revision: 309617 URL: https://svnweb.freebsd.org/changeset/base/309617 Log: Move the stored signal mask later in the jump buf. It was being clobbered by a later store of a VFP register. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/include/setjmp.h Modified: head/sys/arm64/include/setjmp.h ============================================================================== --- head/sys/arm64/include/setjmp.h Tue Dec 6 12:57:28 2016 (r309616) +++ head/sys/arm64/include/setjmp.h Tue Dec 6 13:46:12 2016 (r309617) @@ -49,7 +49,7 @@ * The registers to save are: r19 to r29, and d8 to d15. */ #define _JBLEN 31 -#define _JB_SIGMASK 21 +#define _JB_SIGMASK 22 /* This should only be needed in libc and may change */ #ifdef __ASSEMBLER__ From owner-svn-src-head@freebsd.org Tue Dec 6 13:55:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9715C63F5D; Tue, 6 Dec 2016 13:55:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A4CC1B2A; Tue, 6 Dec 2016 13:55:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6DtJGn097968; Tue, 6 Dec 2016 13:55:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6DtJLW097963; Tue, 6 Dec 2016 13:55:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201612061355.uB6DtJLW097963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 6 Dec 2016 13:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309618 - in head/sys: arm/arm arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 13:55:20 -0000 Author: andrew Date: Tue Dec 6 13:55:19 2016 New Revision: 309618 URL: https://svnweb.freebsd.org/changeset/base/309618 Log: Move the common bit manipulation macros from the GICv3 header to the common GIC header file. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/gic.c head/sys/arm/arm/gic_common.h head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_reg.h head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Tue Dec 6 13:46:12 2016 (r309617) +++ head/sys/arm/arm/gic.c Tue Dec 6 13:55:19 2016 (r309618) @@ -171,14 +171,14 @@ static inline void gic_irq_unmask(struct arm_gic_softc *sc, u_int irq) { - gic_d_write_4(sc, GICD_ISENABLER(irq), (1UL << (irq & 0x1F))); + gic_d_write_4(sc, GICD_ISENABLER(irq), GICD_I_MASK(irq)); } static inline void gic_irq_mask(struct arm_gic_softc *sc, u_int irq) { - gic_d_write_4(sc, GICD_ICENABLER(irq), (1UL << (irq & 0x1F))); + gic_d_write_4(sc, GICD_ICENABLER(irq), GICD_I_MASK(irq)); } #endif @@ -274,9 +274,9 @@ arm_gic_init_secondary(device_t dev) /* * Activate the timer interrupts: virtual, secure, and non-secure. */ - gic_d_write_4(sc, GICD_ISENABLER(27), (1UL << (27 & 0x1F))); - gic_d_write_4(sc, GICD_ISENABLER(29), (1UL << (29 & 0x1F))); - gic_d_write_4(sc, GICD_ISENABLER(30), (1UL << (30 & 0x1F))); + gic_d_write_4(sc, GICD_ISENABLER(27), GICD_I_MASK(27)); + gic_d_write_4(sc, GICD_ISENABLER(29), GICD_I_MASK(29)); + gic_d_write_4(sc, GICD_ISENABLER(30), GICD_I_MASK(30)); } #endif /* INTRNG */ #endif /* SMP */ @@ -447,7 +447,7 @@ arm_gic_attach(device_t dev) /* Get the number of interrupts */ sc->typer = gic_d_read_4(sc, GICD_TYPER); - nirqs = 32 * ((sc->typer & 0x1f) + 1); + nirqs = GICD_TYPER_I_NUM(sc->typer); #ifdef INTRNG if (arm_gic_register_isrcs(sc, nirqs)) { Modified: head/sys/arm/arm/gic_common.h ============================================================================== --- head/sys/arm/arm/gic_common.h Tue Dec 6 13:46:12 2016 (r309617) +++ head/sys/arm/arm/gic_common.h Tue Dec 6 13:55:19 2016 (r309618) @@ -35,6 +35,7 @@ /* Common register values */ #define GICD_CTLR 0x0000 /* v1 ICDDCR */ #define GICD_TYPER 0x0004 /* v1 ICDICTR */ +#define GICD_TYPER_I_NUM(n) ((((n) & 0x1F) + 1) * 32) #define GICD_IIDR 0x0008 /* v1 ICDIIDR */ #define GICD_IIDR_PROD_SHIFT 24 #define GICD_IIDR_PROD_MASK 0xff000000 @@ -54,13 +55,17 @@ (((x) & GICD_IIDR_IMPL_MASK) >> GICD_IIDR_IMPL_SHIFT) #define GICD_IGROUPR(n) (0x0080 + (((n) >> 5) * 4)) /* v1 ICDISER */ #define GICD_ISENABLER(n) (0x0100 + (((n) >> 5) * 4)) /* v1 ICDISER */ +#define GICD_I_MASK(n) (1ul << ((n) & 0x1f)) +#define GICD_I_PER_ISENABLERn 32 #define GICD_ICENABLER(n) (0x0180 + (((n) >> 5) * 4)) /* v1 ICDICER */ #define GICD_ISPENDR(n) (0x0200 + (((n) >> 5) * 4)) /* v1 ICDISPR */ #define GICD_ICPENDR(n) (0x0280 + (((n) >> 5) * 4)) /* v1 ICDICPR */ #define GICD_ICACTIVER(n) (0x0380 + (((n) >> 5) * 4)) /* v1 ICDABR */ #define GICD_IPRIORITYR(n) (0x0400 + (((n) >> 2) * 4)) /* v1 ICDIPR */ +#define GICD_I_PER_IPRIORITYn 4 #define GICD_ITARGETSR(n) (0x0800 + (((n) >> 2) * 4)) /* v1 ICDIPTR */ #define GICD_ICFGR(n) (0x0C00 + (((n) >> 4) * 4)) /* v1 ICDICFR */ +#define GICD_I_PER_ICFGRn 16 /* First bit is a polarity bit (0 - low, 1 - high) */ #define GICD_ICFGR_POL_LOW (0 << 0) #define GICD_ICFGR_POL_HIGH (1 << 0) Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Tue Dec 6 13:46:12 2016 (r309617) +++ head/sys/arm64/arm64/gic_v3.c Tue Dec 6 13:55:19 2016 (r309618) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include "pic_if.h" +#include #include "gic_v3_reg.h" #include "gic_v3_var.h" Modified: head/sys/arm64/arm64/gic_v3_reg.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_reg.h Tue Dec 6 13:46:12 2016 (r309617) +++ head/sys/arm64/arm64/gic_v3_reg.h Tue Dec 6 13:55:19 2016 (r309618) @@ -59,36 +59,13 @@ /* * Registers (v2/v3) */ -#define GICD_CTLR (0x0000) -#define GICD_CTLR_G1 (1 << 0) -#define GICD_CTLR_G1A (1 << 1) -#define GICD_CTLR_ARE_NS (1 << 4) -#define GICD_CTLR_RWP (1 << 31) - -#define GICD_TYPER (0x0004) -#define GICD_TYPER_IDBITS(n) ((((n) >> 19) & 0x1F) + 1) -#define GICD_TYPER_I_NUM(n) ((((n) & 0x1F) + 1) * 32) - -#define GICD_ISENABLER(n) (0x0100 + (((n) >> 5) * 4)) -#define GICD_I_PER_ISENABLERn (32) - -#define GICD_ICENABLER(n) (0x0180 + (((n) >> 5) * 4)) -#define GICD_IPRIORITYR(n) (0x0400 + (((n) >> 2) * 4)) -#define GICD_I_PER_IPRIORITYn (4) - -#define GICD_I_MASK(n) (1 << ((n) % 32)) - -#define GICD_ICFGR(n) (0x0C00 + (((n) >> 4) * 4)) -/* First bit is a polarity bit (0 - low, 1 - high) */ -#define GICD_ICFGR_POL_LOW (0 << 0) -#define GICD_ICFGR_POL_HIGH (1 << 0) -#define GICD_ICFGR_POL_MASK (0x1) -/* Second bit is a trigger bit (0 - level, 1 - edge) */ -#define GICD_ICFGR_TRIG_LVL (0 << 1) -#define GICD_ICFGR_TRIG_EDGE (1 << 1) -#define GICD_ICFGR_TRIG_MASK (0x2) - -#define GICD_I_PER_ICFGRn (16) +/* GICD_CTLR */ +#define GICD_CTLR_G1 (1 << 0) +#define GICD_CTLR_G1A (1 << 1) +#define GICD_CTLR_ARE_NS (1 << 4) +#define GICD_CTLR_RWP (1 << 31) +/* GICD_TYPER */ +#define GICD_TYPER_IDBITS(n) ((((n) >> 19) & 0x1F) + 1) /* * Registers (v3) Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Tue Dec 6 13:46:12 2016 (r309617) +++ head/sys/arm64/arm64/gicv3_its.c Tue Dec 6 13:55:19 2016 (r309618) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From owner-svn-src-head@freebsd.org Tue Dec 6 14:08:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA523C69279; Tue, 6 Dec 2016 14:08:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B46BDDF; Tue, 6 Dec 2016 14:08:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6E8nZs002238; Tue, 6 Dec 2016 14:08:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6E8ndQ002237; Tue, 6 Dec 2016 14:08:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612061408.uB6E8ndQ002237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 6 Dec 2016 14:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309619 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 14:08:51 -0000 Author: mjg Date: Tue Dec 6 14:08:49 2016 New Revision: 309619 URL: https://svnweb.freebsd.org/changeset/base/309619 Log: ifndef atomic_cas_* in cddl code in preparation for native implementations This is a temporary change to not require all architectures to import at once. Discussed with: jhb Modified: head/sys/cddl/compat/opensolaris/sys/atomic.h Modified: head/sys/cddl/compat/opensolaris/sys/atomic.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/atomic.h Tue Dec 6 13:55:19 2016 (r309618) +++ head/sys/cddl/compat/opensolaris/sys/atomic.h Tue Dec 6 14:08:49 2016 (r309619) @@ -41,11 +41,15 @@ extern void atomic_add_64(volatile uint6 extern void atomic_dec_64(volatile uint64_t *target); #endif #ifndef __sparc64__ +#ifndef atomic_cas_32 extern uint32_t atomic_cas_32(volatile uint32_t *target, uint32_t cmp, uint32_t newval); +#endif +#ifndef atomic_cas_64 extern uint64_t atomic_cas_64(volatile uint64_t *target, uint64_t cmp, uint64_t newval); #endif +#endif extern uint64_t atomic_add_64_nv(volatile uint64_t *target, int64_t delta); extern uint8_t atomic_or_8_nv(volatile uint8_t *target, uint8_t value); extern void membar_producer(void); @@ -123,6 +127,7 @@ atomic_dec_64_nv(volatile uint64_t *targ return (atomic_add_64_nv(target, -1)); } +#ifndef atomic_cas_ptr #if !defined(COMPAT_32BIT) && defined(__LP64__) static __inline void * atomic_cas_ptr(volatile void *target, void *cmp, void *newval) @@ -138,5 +143,6 @@ atomic_cas_ptr(volatile void *target, vo (uint32_t)cmp, (uint32_t)newval)); } #endif /* !defined(COMPAT_32BIT) && defined(__LP64__) */ +#endif #endif /* !_OPENSOLARIS_SYS_ATOMIC_H_ */ From owner-svn-src-head@freebsd.org Tue Dec 6 15:12:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F45DC69759; Tue, 6 Dec 2016 15:12:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD804687; Tue, 6 Dec 2016 15:12:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6FCFsl031124; Tue, 6 Dec 2016 15:12:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6FCF8r031116; Tue, 6 Dec 2016 15:12:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201612061512.uB6FCF8r031116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 6 Dec 2016 15:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309622 - in head/sys: arm/arm arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 15:12:17 -0000 Author: andrew Date: Tue Dec 6 15:12:14 2016 New Revision: 309622 URL: https://svnweb.freebsd.org/changeset/base/309622 Log: Create two GIC ivars to find the bus type and GIC hardware version. These will be used by the gicv2m and ITS ACPI drivers to only attach to the correct parent. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/gic.c head/sys/arm/arm/gic.h head/sys/arm/arm/gic_common.h head/sys/arm/arm/gic_fdt.c head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/gic_v3_reg.h head/sys/arm64/arm64/gic_v3_var.h Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Tue Dec 6 14:31:47 2016 (r309621) +++ head/sys/arm/arm/gic.c Tue Dec 6 15:12:14 2016 (r309622) @@ -467,6 +467,9 @@ arm_gic_attach(device_t dev) "pn 0x%x, arch 0x%x, rev 0x%x, implementer 0x%x irqs %u\n", GICD_IIDR_PROD(icciidr), GICD_IIDR_VAR(icciidr), GICD_IIDR_REV(icciidr), GICD_IIDR_IMPL(icciidr), sc->nirqs); +#ifdef INTRNG + sc->gic_iidr = icciidr; +#endif /* Set all global interrupts to be level triggered, active low. */ for (i = 32; i < sc->nirqs; i += 16) { @@ -611,6 +614,33 @@ arm_gic_alloc_resource(device_t bus, dev count, flags)); } +static int +arm_gic_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct arm_gic_softc *sc; + + sc = device_get_softc(dev); + + switch(which) { + case GIC_IVAR_HW_REV: + KASSERT(GICD_IIDR_VAR(sc->gic_iidr) < 3 && + GICD_IIDR_VAR(sc->gic_iidr) != 0, + ("arm_gic_read_ivar: Unknown IIDR revision %u (%.08x)", + GICD_IIDR_VAR(sc->gic_iidr), sc->gic_iidr)); + *result = GICD_IIDR_VAR(sc->gic_iidr); + return (0); + case GIC_IVAR_BUS: + KASSERT(sc->gic_bus != GIC_BUS_UNKNOWN, + ("arm_gic_read_ivar: Unknown bus type")); + KASSERT(sc->gic_bus <= GIC_BUS_MAX, + ("arm_gic_read_ivar: Invalid bus type %u", sc->gic_bus)); + *result = sc->gic_bus; + return (0); + } + + return (ENOENT); +} + int arm_gic_intr(void *arg) { @@ -1307,6 +1337,7 @@ static device_method_t arm_gic_methods[] DEVMETHOD(bus_alloc_resource, arm_gic_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), + DEVMETHOD(bus_read_ivar, arm_gic_read_ivar), /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, arm_gic_disable_intr), Modified: head/sys/arm/arm/gic.h ============================================================================== --- head/sys/arm/arm/gic.h Tue Dec 6 14:31:47 2016 (r309621) +++ head/sys/arm/arm/gic.h Tue Dec 6 15:12:14 2016 (r309622) @@ -75,6 +75,9 @@ struct arm_gic_softc { #endif #ifdef INTRNG + uint32_t gic_iidr; + u_int gic_bus; + int nranges; struct arm_gic_range * ranges; #endif Modified: head/sys/arm/arm/gic_common.h ============================================================================== --- head/sys/arm/arm/gic_common.h Tue Dec 6 14:31:47 2016 (r309621) +++ head/sys/arm/arm/gic_common.h Tue Dec 6 15:12:14 2016 (r309622) @@ -32,6 +32,18 @@ #ifndef _GIC_COMMON_H_ #define _GIC_COMMON_H_ +#define GIC_IVAR_HW_REV 500 +#define GIC_IVAR_BUS 501 + +/* GIC_IVAR_BUS values */ +#define GIC_BUS_UNKNOWN 0 +#define GIC_BUS_FDT 1 +#define GIC_BUS_ACPI 2 +#define GIC_BUS_MAX 2 + +__BUS_ACCESSOR(gic, hw_rev, GIC, HW_REV, u_int); +__BUS_ACCESSOR(gic, bus, GIC, BUS, u_int); + /* Common register values */ #define GICD_CTLR 0x0000 /* v1 ICDDCR */ #define GICD_TYPER 0x0004 /* v1 ICDICTR */ Modified: head/sys/arm/arm/gic_fdt.c ============================================================================== --- head/sys/arm/arm/gic_fdt.c Tue Dec 6 14:31:47 2016 (r309621) +++ head/sys/arm/arm/gic_fdt.c Tue Dec 6 15:12:14 2016 (r309622) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef INTRNG struct arm_gic_devinfo { @@ -140,6 +141,10 @@ gic_fdt_attach(device_t dev) #endif int err; +#ifdef INTRNG + sc->base.gic_bus = GIC_BUS_FDT; +#endif + err = arm_gic_attach(dev); if (err != 0) return (err); Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Tue Dec 6 14:31:47 2016 (r309621) +++ head/sys/arm64/arm64/gic_v3.c Tue Dec 6 15:12:14 2016 (r309622) @@ -297,6 +297,13 @@ gic_v3_attach(device_t dev) } } + /* + * Read the Peripheral ID2 register. This is an implementation + * defined register, but seems to be implemented in all GICv3 + * parts and Linux expects it to be there. + */ + sc->gic_pidr2 = gic_d_read(sc, 4, GICD_PIDR2); + /* Get the number of supported interrupt identifier bits */ sc->gic_idbits = GICD_TYPER_IDBITS(typer); @@ -358,6 +365,21 @@ gic_v3_read_ivar(device_t dev, device_t *result = (uintptr_t)rman_get_virtual( sc->gic_redists.pcpu[PCPU_GET(cpuid)]); return (0); + case GIC_IVAR_HW_REV: + KASSERT( + GICR_PIDR2_ARCH(sc->gic_pidr2) == GICR_PIDR2_ARCH_GICv3 || + GICR_PIDR2_ARCH(sc->gic_pidr2) == GICR_PIDR2_ARCH_GICv4, + ("gic_v3_read_ivar: Invalid GIC architecture: %d (%.08X)", + GICR_PIDR2_ARCH(sc->gic_pidr2), sc->gic_pidr2)); + *result = GICR_PIDR2_ARCH(sc->gic_pidr2); + return (0); + case GIC_IVAR_BUS: + KASSERT(sc->gic_bus != GIC_BUS_UNKNOWN, + ("gic_v3_read_ivar: Unknown bus type")); + KASSERT(sc->gic_bus <= GIC_BUS_MAX, + ("gic_v3_read_ivar: Invalid bus type %u", sc->gic_bus)); + *result = sc->gic_bus; + return (0); } return (ENOENT); @@ -1101,7 +1123,7 @@ gic_v3_redist_find(struct gic_v3_softc * r_bsh = rman_get_bushandle(&r_res); pidr2 = bus_read_4(&r_res, GICR_PIDR2); - switch (pidr2 & GICR_PIDR2_ARCH_MASK) { + switch (GICR_PIDR2_ARCH(pidr2)) { case GICR_PIDR2_ARCH_GICv3: /* fall through */ case GICR_PIDR2_ARCH_GICv4: break; Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Tue Dec 6 14:31:47 2016 (r309621) +++ head/sys/arm64/arm64/gic_v3_fdt.c Tue Dec 6 15:12:14 2016 (r309622) @@ -123,6 +123,7 @@ gic_v3_fdt_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + sc->gic_bus = GIC_BUS_FDT; /* * Recover number of the Re-Distributor regions. Modified: head/sys/arm64/arm64/gic_v3_reg.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_reg.h Tue Dec 6 14:31:47 2016 (r309621) +++ head/sys/arm64/arm64/gic_v3_reg.h Tue Dec 6 15:12:14 2016 (r309622) @@ -80,9 +80,12 @@ #define GICD_PIDR1 0xFFE4 #define GICD_PIDR2 0xFFE8 +#define GICR_PIDR2_ARCH_SHIFT 4 #define GICR_PIDR2_ARCH_MASK 0xF0 -#define GICR_PIDR2_ARCH_GICv3 0x30 -#define GICR_PIDR2_ARCH_GICv4 0x40 +#define GICR_PIDR2_ARCH(x) \ + (((x) & GICR_PIDR2_ARCH_MASK) >> GICR_PIDR2_ARCH_SHIFT) +#define GICR_PIDR2_ARCH_GICv3 0x3 +#define GICR_PIDR2_ARCH_GICv4 0x4 #define GICD_PIDR3 0xFFEC Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Tue Dec 6 14:31:47 2016 (r309621) +++ head/sys/arm64/arm64/gic_v3_var.h Tue Dec 6 15:12:14 2016 (r309622) @@ -68,6 +68,9 @@ struct gic_v3_softc { /* Re-Distributors */ struct gic_redists gic_redists; + uint32_t gic_pidr2; + u_int gic_bus; + u_int gic_nirqs; u_int gic_idbits; From owner-svn-src-head@freebsd.org Tue Dec 6 15:16:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E3CC69866; Tue, 6 Dec 2016 15:16:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67780925; Tue, 6 Dec 2016 15:16:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6FG01h032135; Tue, 6 Dec 2016 15:16:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6FG0r6032134; Tue, 6 Dec 2016 15:16:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201612061516.uB6FG0r6032134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 6 Dec 2016 15:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309623 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 15:16:01 -0000 Author: andrew Date: Tue Dec 6 15:16:00 2016 New Revision: 309623 URL: https://svnweb.freebsd.org/changeset/base/309623 Log: Add the missing gic_common.h include for GIC_BUS_FDT. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_v3_fdt.c Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Tue Dec 6 15:12:14 2016 (r309622) +++ head/sys/arm64/arm64/gic_v3_fdt.c Tue Dec 6 15:16:00 2016 (r309623) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "gic_v3_reg.h" #include "gic_v3_var.h" From owner-svn-src-head@freebsd.org Tue Dec 6 15:42:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF41C6A11A; Tue, 6 Dec 2016 15:42:20 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E08A71681; Tue, 6 Dec 2016 15:42:19 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6FgJfB043848; Tue, 6 Dec 2016 15:42:19 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6FgJnm043847; Tue, 6 Dec 2016 15:42:19 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201612061542.uB6FgJnm043847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 6 Dec 2016 15:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309624 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 15:42:20 -0000 Author: vangyzen Date: Tue Dec 6 15:42:18 2016 New Revision: 309624 URL: https://svnweb.freebsd.org/changeset/base/309624 Log: locale: fix the powerpc build Reported by: markj (and bde, in a way) MFC after: 3 days X-MFC with: r309364 Sponsored by: Dell EMC Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Tue Dec 6 15:16:00 2016 (r309623) +++ head/usr.bin/locale/locale.c Tue Dec 6 15:42:18 2016 (r309624) @@ -500,8 +500,10 @@ format_grouping(const char *binary) rval[0] = '\0'; roff = 0; for (cp = binary; *cp != '\0'; ++cp) { +#if CHAR_MIN != 0 if (*cp < 0) break; /* garbage input */ +#endif len = snprintf(&rval[roff], sizeof(rval) - roff, "%u;", *cp); if (len < 0 || (unsigned)len >= sizeof(rval) - roff) break; /* insufficient space for output */ From owner-svn-src-head@freebsd.org Tue Dec 6 15:49:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B5B8C6A427; Tue, 6 Dec 2016 15:49:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3C3631B22; Tue, 6 Dec 2016 15:49:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6Fnddv044250; Tue, 6 Dec 2016 15:49:39 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6Fndxo044249; Tue, 6 Dec 2016 15:49:39 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201612061549.uB6Fndxo044249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 6 Dec 2016 15:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309625 - head/sbin/rcorder X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 15:49:40 -0000 Author: vangyzen Date: Tue Dec 6 15:49:39 2016 New Revision: 309625 URL: https://svnweb.freebsd.org/changeset/base/309625 Log: Add rcorder-visualize.sh, which generates graphviz from rc.d scripts This is imported from NetBSD. The author--Joerg Sonnenberger--agreed to apply a two-clause BSD license, just so the license was clear. This source tree location matches NetBSD, and is the first place someone might look for such a tool. Obtained from: Joerg Sonnenberger via NetBSD MFC after: 3 days Sponsored by: Dell EMC Added: head/sbin/rcorder/rcorder-visualize.sh (contents, props changed) Added: head/sbin/rcorder/rcorder-visualize.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/rcorder/rcorder-visualize.sh Tue Dec 6 15:49:39 2016 (r309625) @@ -0,0 +1,52 @@ +#!/bin/sh +# $NetBSD: rcorder-visualize.sh,v 1.5 2009/08/09 17:08:53 apb Exp $ +# +# Copyright (c) 2009 by Joerg Sonnenberger +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# +# Simple script to show the dependency graph for rc scripts. +# Output is in the dot(1) language and can be rendered using +# sh rcorder-visualize | dot -T svg -o rcorder.svg +# dot(1) can be found in graphics/graphviz in pkgsrc. + +rc_files=${*:-/etc/rc.d/*} + +{ +echo ' digraph {' +for f in $rc_files; do +< $f awk ' +/# PROVIDE: / { provide = $3 } +/# REQUIRE: / { for (i = 3; i <= NF; i++) requires[$i] = $i } +/# BEFORE: / { for (i = 3; i <= NF; i++) befores[$i] = $i } + +END { + print " \"" provide "\";" + for (x in requires) print " \"" provide "\"->\"" x "\";" + for (x in befores) print " \"" x "\"->\"" provide "\";" +} +' +done +echo '}' +} From owner-svn-src-head@freebsd.org Tue Dec 6 17:05:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45464C6AD99; Tue, 6 Dec 2016 17:05:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EFA5B9A0; Tue, 6 Dec 2016 17:05:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6H53N8076360; Tue, 6 Dec 2016 17:05:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6H532K076359; Tue, 6 Dec 2016 17:05:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612061705.uB6H532K076359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 6 Dec 2016 17:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309626 - head/contrib/libc-vis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 17:05:04 -0000 Author: bdrewery Date: Tue Dec 6 17:05:02 2016 New Revision: 309626 URL: https://svnweb.freebsd.org/changeset/base/309626 Log: strvis(3): Avoid internal state of multibyte functions being tainted. The mbtoc(3) and wctomb(3) functions use internal state which may be tainted before the call to strvis(3). In this context we can just use the thread-safe versions mbrtoc(3) and wcrtomb(3) which allow passing our own state from our stack. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/contrib/libc-vis/vis.c Modified: head/contrib/libc-vis/vis.c ============================================================================== --- head/contrib/libc-vis/vis.c Tue Dec 6 15:49:39 2016 (r309625) +++ head/contrib/libc-vis/vis.c Tue Dec 6 17:05:02 2016 (r309626) @@ -353,12 +353,14 @@ makeextralist(int flags, const char *src wchar_t *dst, *d; size_t len; const wchar_t *s; + mbstate_t mbstate; + bzero(&mbstate, sizeof(mbstate)); len = strlen(src); if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL) return NULL; - if ((flags & VIS_NOLOCALE) || mbstowcs(dst, src, len) == (size_t)-1) { + if ((flags & VIS_NOLOCALE) || mbsrtowcs(dst, &src, len, &mbstate) == (size_t)-1) { size_t i; for (i = 0; i < len; i++) dst[i] = (wchar_t)(u_char)src[i]; @@ -400,6 +402,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, int clen = 0, cerr, error = -1, i, shft; char *mbdst, *mdst; ssize_t mbslength, maxolen; + mbstate_t mbstate; _DIAGASSERT(mbdstp != NULL); _DIAGASSERT(mbsrc != NULL || mblength == 0); @@ -456,10 +459,11 @@ istrsenvisx(char **mbdstp, size_t *dlen, */ if (mbslength == 1) mbslength++; + bzero(&mbstate, sizeof(mbstate)); while (mbslength > 0) { /* Convert one multibyte character to wchar_t. */ if (!cerr) - clen = mbtowc(src, mbsrc, MB_LEN_MAX); + clen = mbrtowc(src, mbsrc, MB_LEN_MAX, &mbstate); if (cerr || clen < 0) { /* Conversion error, process as a byte instead. */ *src = (wint_t)(u_char)*mbsrc; @@ -530,9 +534,10 @@ istrsenvisx(char **mbdstp, size_t *dlen, len = wcslen(start); maxolen = dlen ? *dlen : (wcslen(start) * MB_LEN_MAX + 1); olen = 0; + bzero(&mbstate, sizeof(mbstate)); for (dst = start; len > 0; len--) { if (!cerr) - clen = wctomb(mbdst, *dst); + clen = wcrtomb(mbdst, *dst, &mbstate); if (cerr || clen < 0) { /* * Conversion error, process as a byte(s) instead. From owner-svn-src-head@freebsd.org Tue Dec 6 17:06:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05F98C6AE16; Tue, 6 Dec 2016 17:06:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C980BB1F; Tue, 6 Dec 2016 17:06:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6H6Etg076439; Tue, 6 Dec 2016 17:06:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6H6EKM076438; Tue, 6 Dec 2016 17:06:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612061706.uB6H6EKM076438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 6 Dec 2016 17:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309627 - head/contrib/netbsd-tests/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 17:06:16 -0000 Author: bdrewery Date: Tue Dec 6 17:06:14 2016 New Revision: 309627 URL: https://svnweb.freebsd.org/changeset/base/309627 Log: Remove unneeded hack fixed by r309626. strvis(3) being tainted by our mbtowc(3) calls was causing spurious failures here. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Tue Dec 6 17:05:02 2016 (r309626) +++ head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Tue Dec 6 17:06:14 2016 (r309627) @@ -137,16 +137,10 @@ ATF_TC_BODY(mbtowc, tc) h_mbtowc("ja_JP.ISO2022-JP", "\033$B", "\033$B$\"\033(B"); h_mbtowc("ja_JP.SJIS", "\202", "\202\240"); h_mbtowc("ja_JP.eucJP", "\244", "\244\242"); -#ifndef __FreeBSD__ /* Moved last as it fails */ h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); -#endif h_mbtowc("zh_TW.Big5", "\241", "\241@"); h_mbtowc("zh_TW.eucTW", "\241", "\241\241"); -#ifdef __FreeBSD__ - atf_tc_expect_fail("zh_CN.GB18030"); - h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); -#endif } ATF_TP_ADD_TCS(tp) From owner-svn-src-head@freebsd.org Tue Dec 6 17:13:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BDADC692AD; Tue, 6 Dec 2016 17:13:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B86E15B8; Tue, 6 Dec 2016 17:13:18 +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 uB6HDHJr080582; Tue, 6 Dec 2016 17:13:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6HDH0g080581; Tue, 6 Dec 2016 17:13:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612061713.uB6HDH0g080581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 6 Dec 2016 17:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309630 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 17:13:18 -0000 Author: kib Date: Tue Dec 6 17:13:17 2016 New Revision: 309630 URL: https://svnweb.freebsd.org/changeset/base/309630 Log: Do not leak curthread->inact_mtx when cancelling in pthread_cond_wait(3). Leave robust-protected region before checking for cancellation by calling _thr_testcancel(). Otherwise, if cancelling request was pending, the cancel handler is called with the dandling inact_mtx, which triggers an assert if any mutex operation is performed by the handler. Reported and tested by: Dimitri Staessens Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libthr/thread/thr_cond.c Modified: head/lib/libthr/thread/thr_cond.c ============================================================================== --- head/lib/libthr/thread/thr_cond.c Tue Dec 6 17:10:17 2016 (r309629) +++ head/lib/libthr/thread/thr_cond.c Tue Dec 6 17:13:17 2016 (r309630) @@ -224,16 +224,26 @@ cond_wait_kernel(struct pthread_cond *cv * state and unlock the mutex without making the state * consistent and the state will be unrecoverable. */ - if (error2 == 0 && cancel) + if (error2 == 0 && cancel) { + if (robust) { + _mutex_leave_robust(curthread, mp); + robust = false; + } _thr_testcancel(curthread); + } if (error == EINTR) error = 0; } else { /* We know that it didn't unlock the mutex. */ _mutex_cv_attach(mp, recurse); - if (cancel) + if (cancel) { + if (robust) { + _mutex_leave_robust(curthread, mp); + robust = false; + } _thr_testcancel(curthread); + } error2 = 0; } if (robust) From owner-svn-src-head@freebsd.org Tue Dec 6 17:30:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62AD7C69918; Tue, 6 Dec 2016 17:30:23 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47AC21E0D; Tue, 6 Dec 2016 17:30:23 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OHR00J00XEC3C00@mr11p00im-asmtp004.me.com>; Tue, 06 Dec 2016 17:30:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1481045417; bh=SgTKYDyxuc1kuF5rtwEPSOm0fADYi2ELHNizAFmWO0c=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=ruWSo2RMUrjIIISZOzpqc06fieS48OEiR8scx1/7edWRnBgmIEvRcqWG1ioml8iam amao/XMZ0IA2gEwe7xwtESKUGo7AiTpUJNET1iEx6OUOx0jdTvbhe2OV8BitcWP51B +CoyOsYFJ+YhVvHg2whqbY6pdSX71sOY8xB8CiohhpFnQZyOY6+9t4YdG+OnxhoD/V 3DpQt/dqA+5SGlVdf6DIgd99RGYxW0Mfkj5u4RVYUBK7wt36ZIwPHMYcjiz9/08+4h 1mu34QJsBlG72Utkk2708RwbdrjdT2ZZum0HKxtmYknWH5xycmCvYORedldgb9UKxy kCmEjIYT546nw== Received: from [192.168.1.4] (c-67-188-225-23.hsd1.ca.comcast.net [67.188.225.23]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OHR001YUXYFQE20@mr11p00im-asmtp004.me.com>; Tue, 06 Dec 2016 17:30:16 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-06_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1612060263 User-Agent: Microsoft-MacOutlook/f.1c.1.161117 Date: Tue, 06 Dec 2016 09:30:15 -0800 Subject: Re: svn commit: r309625 - head/sbin/rcorder From: Ravi Pokala Sender: "Pokala, Ravi" To: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r309625 - head/sbin/rcorder References: <201612061549.uB6Fndxo044249@repo.freebsd.org> In-reply-to: <201612061549.uB6Fndxo044249@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 17:30:23 -0000 For grins, I ran this on my build server. The resulting graph is... complex= . But one thing was immediately clear: neither /etc/rc.d/dhclient and /etc/r= c.d/natd depend on anything. That seems wrong: I would expect them to have s= ome sort of dependency on NETWORKING, either BEFORE (since dhclient may be i= nvolved in bringing up the network) or REQUIRE (since it doesn=E2=80=99t make sens= e to run a networking daemon like natd before networking is up). Or am I missing something? Thanks, Ravi (rpokala@) -----Original Message----- From: on behalf of Eric van Gyzen Date: 2016-12-06, Tuesday at 07:49 To: , , Subject: svn commit: r309625 - head/sbin/rcorder Author: vangyzen Date: Tue Dec 6 15:49:39 2016 New Revision: 309625 URL: https://svnweb.freebsd.org/changeset/base/309625 Log: Add rcorder-visualize.sh, which generates graphviz from rc.d scripts =20 This is imported from NetBSD. The author--Joerg Sonnenberger--agreed to apply a two-clause BSD license, just so the license was clear. =20 This source tree location matches NetBSD, and is the first place someone might look for such a tool. =20 Obtained from: Joerg Sonnenberger via NetBSD MFC after: 3 days Sponsored by: Dell EMC Added: head/sbin/rcorder/rcorder-visualize.sh (contents, props changed) Added: head/sbin/rcorder/rcorder-visualize.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/rcorder/rcorder-visualize.sh Tue Dec 6 15:49:39 2016 (r30962= 5) @@ -0,0 +1,52 @@ +#!/bin/sh +# $NetBSD: rcorder-visualize.sh,v 1.5 2009/08/09 17:08:53 apb Exp $ +# +# Copyright (c) 2009 by Joerg Sonnenberger +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIE= S +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE= , +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# +# Simple script to show the dependency graph for rc scripts. +# Output is in the dot(1) language and can be rendered using +# sh rcorder-visualize | dot -T svg -o rcorder.svg +# dot(1) can be found in graphics/graphviz in pkgsrc. + +rc_files=3D${*:-/etc/rc.d/*} + +{ +echo ' digraph {' +for f in $rc_files; do +< $f awk ' +/# PROVIDE: / { provide =3D $3 } +/# REQUIRE: / { for (i =3D 3; i <=3D NF; i++) requires[$i] =3D $i } +/# BEFORE: / { for (i =3D 3; i <=3D NF; i++) befores[$i] =3D $i } + +END { + print " \"" provide "\";" + for (x in requires) print " \"" provide "\"->\"" x "\";" + for (x in befores) print " \"" x "\"->\"" provide "\";" +} +' +done +echo '}' +} From owner-svn-src-head@freebsd.org Tue Dec 6 17:35:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 968AEC69D3A; Tue, 6 Dec 2016 17:35:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B3F474F; Tue, 6 Dec 2016 17:35:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x241.google.com with SMTP id s82so8155643ioi.3; Tue, 06 Dec 2016 09:35:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=sf2bRsh7oytMnESug3rMFqxaEBx1wuykj47QaLviAgw=; b=Nzar9+Dao7sbUu1CWtCd6fAXNgcV3h0WvqpL9zEU84YipWjx9qfWHmI+Btk7KAseCD zMgnw7ce7rwpjNKkXW4a9zAD5gYevlex83BHgqKF48Lr3UMW77V+L7cju5r8/2/h/S4f AVr0tTlMSGwurTQ7UhEFQbr3b2j7exrp6g/Kbhw6ve1DZp3NEaoF9Ya3+p3MXLxl83Dt BcW8QuTZwQscSIrbBMU3gwDveeR9lkIcqwVLl2wt1nyanIJZX0QvvKDLEiZJhJ590vqC 9t0PEpoSb4AgMBLJGPFiSIqB0blXZDmr8G9I1+fbNvEmIxVJU7cPyuyDF9Otd9TV0zhg nSJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=sf2bRsh7oytMnESug3rMFqxaEBx1wuykj47QaLviAgw=; b=Cs0QACS+Ffnsjt05FybsBONvgf/4XpyKvfN3oG1XGPoSP5ON4Yig+vGKYYIqXPZ0J8 z4EGQ+0M2lUS2cAUNECchPaTPFNXD6XcxtzADPmrF3xoRp6Lek/CAFdLPzUt+hpIWV6b VgtjG4hp4lMzzwbuZ3LtnK7nOWpHmLUYyiXvbV9ErSRID29Y++GsUxAfJIcdkhw1XgQV 4+FWBcDMq6JO73llCI6nW6r3G+t5cfWXD6f2jtHGpEI//QpRpOEVq61kyboiQG2c4GYu 4UdlPMuRbKXY14vWWP7oX+p9NqUX5K23cvVDZLVo5Jfj5dETM1geJpFOunp0yw4Pf68S xgCQ== X-Gm-Message-State: AKaTC03o5OCtpoaC7J5d3TudXtlDPJxonxJ8YHzCRxTPxWq3la4GdEK7WSf3nRFnkcp50w== X-Received: by 10.36.85.5 with SMTP id e5mr3145045itb.42.1481045735482; Tue, 06 Dec 2016 09:35:35 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p20sm1783688itc.8.2016.12.06.09.35.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Dec 2016 09:35:34 -0800 (PST) Subject: Re: svn commit: r309627 - head/contrib/netbsd-tests/lib/libc/locale Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_83C3E7F5-E5A3-43D3-BF3D-B4A011D5090C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201612061706.uB6H6EKM076438@repo.freebsd.org> Date: Tue, 6 Dec 2016 09:35:33 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <1EA4A689-5DE5-4B6D-95BC-96C9430B41A3@gmail.com> References: <201612061706.uB6H6EKM076438@repo.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 17:35:36 -0000 --Apple-Mail=_83C3E7F5-E5A3-43D3-BF3D-B4A011D5090C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 6, 2016, at 09:06, Bryan Drewery wrote: >=20 > Author: bdrewery > Date: Tue Dec 6 17:06:14 2016 > New Revision: 309627 > URL: https://svnweb.freebsd.org/changeset/base/309627 >=20 > Log: > Remove unneeded hack fixed by r309626. >=20 > strvis(3) being tainted by our mbtowc(3) calls was causing > spurious failures here. >=20 > MFC after: 2 weeks > Sponsored by: Dell EMC Isilon >=20 > Modified: > head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c >=20 > Modified: head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Tue Dec = 6 17:05:02 2016 (r309626) > +++ head/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c Tue Dec = 6 17:06:14 2016 (r309627) > @@ -137,16 +137,10 @@ ATF_TC_BODY(mbtowc, tc) > h_mbtowc("ja_JP.ISO2022-JP", "\033$B", "\033$B$\"\033(B"); > h_mbtowc("ja_JP.SJIS", "\202", "\202\240"); > h_mbtowc("ja_JP.eucJP", "\244", "\244\242"); > -#ifndef __FreeBSD__ > /* Moved last as it fails */ > h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); > -#endif > h_mbtowc("zh_TW.Big5", "\241", "\241@"); > h_mbtowc("zh_TW.eucTW", "\241", "\241\241"); > -#ifdef __FreeBSD__ > - atf_tc_expect_fail("zh_CN.GB18030"); > - h_mbtowc("zh_CN.GB18030", "\241", "\241\241"); > -#endif > } It=E2=80=99s interesting how we always hit this at $work, but upstream = has never hit this once AFAIK. -Ngie --Apple-Mail=_83C3E7F5-E5A3-43D3-BF3D-B4A011D5090C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYRvblAAoJEPWDqSZpMIYVP4oP/i2Cx9psvWTcqTKY/UTfYMdP lI+DjGBgXXuKWUhbEk4d8XHgzrR7+t1v0fvp9e2Igz2vQz5BVaawIwvKHpVxv6yJ Clixjq4CL+AAJDehwAHyimdsKPIKuCTp5HT6J11iYsuNL788LJ9iWwW7n6a50T6o Q0TIXZnpGh+MR64oFbBHwXBLboJ8klKlihR3/jHa8wBoC319BpbeXkUxoFXPI/oD WksJO3W0/ZfGmzSGVh47US+06Qzst+WIoBzLhnSbfTxoXF5qafw2HpLXYri2dinh rIrJ/Q97f+4OU0jhrlSs5kkGHF0EzX7gfi4Ir+Yly2s9vMnjNgTn3jUlHfPgP8VA 4EFJBAoPwPpRFEwP/ovF2baXybr+L1YdA5WAPlNx22VKTxR1kWYUqvJ6J2I09vM5 SuBhj62cTGjACBoOGwbf9mIm8meEHD0g25p90g+waKq4QMgCkDONSiaHOr79QMMw /OpH0t42xRC6dyACJr7hk45JB2ug5Wvxm+1ARdswqmPq9rRGEQBre8VcrQJH+Ly1 OMsTSU/gZwHvB1XwGPMJ+o3tActXKv3jZxnhbUl0lRQ87cDvbMCxDTV0YvRpFD4L M9TtcSFMlcrQYrHdNEz9FPkTaP1wGupCbUEtEsUBVmMTDpX8DqE9KbVEqv0U3AEv hCwzEAJ7L0Q5Zi42YOSQ =30YW -----END PGP SIGNATURE----- --Apple-Mail=_83C3E7F5-E5A3-43D3-BF3D-B4A011D5090C-- From owner-svn-src-head@freebsd.org Tue Dec 6 18:08:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 987C6C6A728; Tue, 6 Dec 2016 18:08:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 652761699; Tue, 6 Dec 2016 18:08:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id e9so20487047pgc.1; Tue, 06 Dec 2016 10:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=3s2lZxhjHE627e3AeDrTsGfF6ArlIqRqkDgatlWSRv8=; b=Yd4DbQHUfTw3Bm+Z8qj26JF8LweoBuOixQ8Ob8FHE0bYnN27PiaV4zSFgmm5/1w6oR zeBkVCbK+XWw7eVSzW2veHPo77WqbUNFZm9qbBnFf1lrZmPIDCOmEER+wrTmKCVP1nSs hFlfASS+DrPJA2lTDKPHzeykePAWcYPaF4rR7JTz3TMjL6KfHglMcgMh+zQunYsrzoqd DMoKnfYLtvrv6GyjPRxixu7BqAi6BHeTaJYKk4C5Mo08m26e7Wc5W1q5S/ncp/Cewxeb BjNeM4pDpnmYzwEteBtNm2DgRfcHGaSJyxkAlE2ynDb+WxPAdSfRlGM5/mDmBk8n3Fg/ 82PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=3s2lZxhjHE627e3AeDrTsGfF6ArlIqRqkDgatlWSRv8=; b=LPdfxrhRAabqTp9Shz5juHmwxYFp5n+bOlmeHOtrVDbVlwDvbH7d4ro28BP44kg/Zi CHoYmkEph9X9W4oLUsZR+z9XyaF6Kl4Tqr+MKTK3seomlkhpBhmAE0Wkc81yxNJ6RLwf 1sGM5+teyUVmcrM/o6/CytPQCorgwKab8owU2nazG/+nFCsDt/ESpZSuM+ZskZ891t3J yV8sl+J3+z2zFM5zwq8YUmsjFS38/T7vQ85e6RhlTwaqCaeX+olLhb53eX7NLdjo6BIr +5aAUJh9B9Pbzg4NRJEiUpUR5rXj9LsrO02OuxpczsyvaEusuBK62/kjZoLjomr4pbPe aH3w== X-Gm-Message-State: AKaTC03cnyFpJ4iLC5Q/1XzA/e3EU1OUML4RNJQrX/LgBPhWOeG3hK1L7Htz9pMQQ1NeUw== X-Received: by 10.84.208.102 with SMTP id f35mr138026372plh.137.1481047705747; Tue, 06 Dec 2016 10:08:25 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s5sm36622347pgj.19.2016.12.06.10.08.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Dec 2016 10:08:25 -0800 (PST) Subject: Re: svn commit: r309627 - head/contrib/netbsd-tests/lib/libc/locale Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_12A9C0E9-3076-4B67-8A68-0E426C304310"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <1EA4A689-5DE5-4B6D-95BC-96C9430B41A3@gmail.com> Date: Tue, 6 Dec 2016 10:08:23 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201612061706.uB6H6EKM076438@repo.freebsd.org> <1EA4A689-5DE5-4B6D-95BC-96C9430B41A3@gmail.com> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 18:08:26 -0000 --Apple-Mail=_12A9C0E9-3076-4B67-8A68-0E426C304310 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 6, 2016, at 09:35, Ngie Cooper (yaneurabeya) = wrote: =E2=80=A6 > It=E2=80=99s interesting how we always hit this at $work, but upstream = has never hit this once AFAIK. > -Ngie Spoke too soon=E2=80=A6 guess amd64 just hid the error when I marked it = as a failure, whereas i386 revealed it. Cheers, -Ngie % kyua report ... =3D=3D=3D> Failed tests lib/libc/locale/mbstowcs_test:mbstowcs_basic -> failed: Test failed = [0.003s] lib/libc/stdio/printbasic_test:int_within_limits -> failed: = printf("%tu", (size_t)-1) =3D=3D> [18446744073709551615], expected = [4294967295] [0.003s] lib/libc/stdio/printfloat_test:hexadecimal_floating_point -> failed: = printf("%La", 0x3.243f6a8885a31p0L) =3D=3D> [0x1.921fb54442d188p+1], = expected [0x1.921fb54442d18p+1] [0.003s] lib/libc/sys/mincore_test:mincore_resid -> failed: = /usr/src/svn/contrib/netbsd-tests/lib/libc/sys/t_mincore.c:210: mlock = failed: Cannot allocate memory [0.003s] =3D=3D=3D> Summary Results read from = /root/.kyua/store/results.usr_tests.20161206-060934-946752.db Test cases: 5956 total, 53 skipped, 28 expected failures, 0 broken, 4 = failed Total time: 5226.723s --Apple-Mail=_12A9C0E9-3076-4B67-8A68-0E426C304310 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYRv6YAAoJEPWDqSZpMIYVrEEP/3cLFIbvQwsRELtAS0y9fxHZ hUH06xnnTeyD7AVi4Q5EgotDhoyP/ozSkKBg0kq75G1XwNLByeo7yQaRC3vAkCxW xr1Zsslz49n9MBOONpdJkp3uoqb4/T/0kHAIVNH2M1QiOBV35yjODICe8GnEEMip SCafzle3BDQa9hjfdJyt7AF3ptNC2e703YiyOlqZmOqY+dONUWR58jMsTnxPZoNR 4BVwykndBncQzCm5y4Rl3HRpoqMzzgIR76WOx409D8dldyHk3EPUAaH1JpxOJiAu CRz716eJwFML2fejQYyNiYzYTA0Jo+tD72lCp+96uB9tFZMy+UQSX+OVN3EHE/64 ptXEoOobAyMK8HQ8umysLtrURovcKmirJIV4rTD3tbb0KbBaOBZj/RXQWeDdltYn Zs3Wn3ftXFAG5HQqodJV0BuG/Xhn/TU9xRHHtLnBGBNAVjECZokl8GhYgZ2LBIz+ JtPUj6nO2XSCUaQrLtzBbsMHgFjA0HEDscYf/hrKKYPOfXAlUMzGF85b9gZDE/qk KMD5Unzgi4jmUgTTo/bjOSCEFISMR5E+4FKMcsoPLakSc6QGUTZLpqur6/D3xr8D hXjWNJEW5pzbUxmyBXYpr7K6S/oO6yNUE2TWjNKePvG5GKDGmDkQcveCvOZZJ1Lb 5gm2Hsn+QvXaw/4e/y+S =RMkm -----END PGP SIGNATURE----- --Apple-Mail=_12A9C0E9-3076-4B67-8A68-0E426C304310-- From owner-svn-src-head@freebsd.org Tue Dec 6 18:22:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E7BFC6AD66; Tue, 6 Dec 2016 18:22:26 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78E08F6; Tue, 6 Dec 2016 18:22:26 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6IMPa2007945; Tue, 6 Dec 2016 18:22:25 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6IMPDQ007942; Tue, 6 Dec 2016 18:22:25 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201612061822.uB6IMPDQ007942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Tue, 6 Dec 2016 18:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309631 - head/tools/regression/sockets/unix_cmsg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 18:22:26 -0000 Author: sobomax Date: Tue Dec 6 18:22:25 2016 New Revision: 309631 URL: https://svnweb.freebsd.org/changeset/base/309631 Log: Auto-generate 2 test cases that differ only in structure and SCM_XXX constant used. We can do it programmatically, but that would make code convoluted and more complex. I have two more of those types coming for the CLOCK_REALTIME and CLOCK_MONOTONIC. This seems like an elegant and scallable approach. Added: head/tools/regression/sockets/unix_cmsg/t_xxxtime.c.in - copied, changed from r309630, head/tools/regression/sockets/unix_cmsg/t_timeval.c head/tools/regression/sockets/unix_cmsg/t_xxxtime.h.in - copied, changed from r309590, head/tools/regression/sockets/unix_cmsg/t_timeval.h Deleted: head/tools/regression/sockets/unix_cmsg/t_bintime.c head/tools/regression/sockets/unix_cmsg/t_bintime.h head/tools/regression/sockets/unix_cmsg/t_timeval.c head/tools/regression/sockets/unix_cmsg/t_timeval.h Modified: head/tools/regression/sockets/unix_cmsg/Makefile Modified: head/tools/regression/sockets/unix_cmsg/Makefile ============================================================================== --- head/tools/regression/sockets/unix_cmsg/Makefile Tue Dec 6 17:13:17 2016 (r309630) +++ head/tools/regression/sockets/unix_cmsg/Makefile Tue Dec 6 18:22:25 2016 (r309631) @@ -1,11 +1,31 @@ # $FreeBSD$ PROG= unix_cmsg -SRCS= unix_cmsg.c t_bintime.h t_bintime.c uc_common.h uc_common.c \ - t_generic.h t_generic.c t_peercred.h t_peercred.c t_timeval.h \ - t_timeval.c t_cmsgcred.h t_cmsgcred.c t_sockcred.h t_sockcred.c \ +SRCS= ${AUTOSRCS} unix_cmsg.c uc_common.h uc_common.c \ + t_generic.h t_generic.c t_peercred.h t_peercred.c \ + t_cmsgcred.h t_cmsgcred.c t_sockcred.h t_sockcred.c \ t_cmsgcred_sockcred.h t_cmsgcred_sockcred.c t_cmsg_len.h t_cmsg_len.c +CLEANFILES+= ${AUTOSRCS} MAN= WARNS?= 3 +REXP_bintime= 's|%%TTYPE%%|bintime|g ; s|%%DTYPE%%|bintime|g ; \ + s|%%SCM_TTYPE%%|SCM_BINTIME|g ; \ + s|%%MAJ_MEMB%%|sec|g ; s|%%MIN_MEMB%%|frac|g' +REXP_timeval= 's|%%TTYPE%%|timeval|g ; s|%%DTYPE%%|timeval|g ; \ + s|%%SCM_TTYPE%%|SCM_TIMESTAMP|g ; \ + s|%%MAJ_MEMB%%|tv_sec|g ; s|%%MIN_MEMB%%|tv_usec|g' + +.for ttype in bintime timeval +AUTOSRCS+= t_${ttype}.h t_${ttype}.c + +t_${ttype}.o: t_${ttype}.c t_${ttype}.h + +t_${ttype}.c: t_xxxtime.c.in + sed ${REXP_${ttype}} < ${.ALLSRC} > ${.TARGET} + +t_${ttype}.h: t_xxxtime.h.in + sed ${REXP_${ttype}} < ${.ALLSRC} > ${.TARGET} +.endfor + .include Copied and modified: head/tools/regression/sockets/unix_cmsg/t_xxxtime.c.in (from r309630, head/tools/regression/sockets/unix_cmsg/t_timeval.c) ============================================================================== --- head/tools/regression/sockets/unix_cmsg/t_timeval.c Tue Dec 6 17:13:17 2016 (r309630, copy source) +++ head/tools/regression/sockets/unix_cmsg/t_xxxtime.c.in Tue Dec 6 18:22:25 2016 (r309631) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -35,28 +36,29 @@ __FBSDID("$FreeBSD$"); #include #include -#include "uc_common.h" +#include "t_%%TTYPE%%.h" #include "t_generic.h" -#include "t_timeval.h" +#include "uc_common.h" +#if defined(%%SCM_TTYPE%%) static int -check_scm_timestamp(struct cmsghdr *cmsghdr) +check_scm_%%TTYPE%%(struct cmsghdr *cmsghdr) { - const struct timeval *tv; + const struct %%DTYPE%% *bt; - if (uc_check_cmsghdr(cmsghdr, SCM_TIMESTAMP, sizeof(struct timeval)) < 0) + if (uc_check_cmsghdr(cmsghdr, %%SCM_TTYPE%%, sizeof(struct %%DTYPE%%)) < 0) return (-1); - tv = (struct timeval *)CMSG_DATA(cmsghdr); + bt = (struct %%DTYPE%% *)CMSG_DATA(cmsghdr); - uc_dbgmsg("timeval.tv_sec %"PRIdMAX", timeval.tv_usec %"PRIdMAX, - (intmax_t)tv->tv_sec, (intmax_t)tv->tv_usec); + uc_dbgmsg("%%DTYPE%%.%%MAJ_MEMB%% %"PRIdMAX", %%DTYPE%%.%%MIN_MEMB%% %"PRIuMAX, + (intmax_t)bt->%%MAJ_MEMB%%, (uintmax_t)bt->%%MIN_MEMB%%); return (0); } static int -t_timeval_client(int fd) +t_%%TTYPE%%_client(int fd) { struct msghdr msghdr; struct iovec iov[1]; @@ -69,14 +71,14 @@ t_timeval_client(int fd) rv = -2; - cmsg_size = CMSG_SPACE(sizeof(struct timeval)); + cmsg_size = CMSG_SPACE(sizeof(struct %%DTYPE%%)); cmsg_data = malloc(cmsg_size); if (cmsg_data == NULL) { uc_logmsg("malloc"); goto done; } uc_msghdr_init_client(&msghdr, iov, cmsg_data, cmsg_size, - SCM_TIMESTAMP, sizeof(struct timeval)); + %%SCM_TTYPE%%, sizeof(struct %%DTYPE%%)); if (uc_socket_connect(fd) < 0) goto done; @@ -91,7 +93,7 @@ done: } static int -t_timeval_server(int fd1) +t_%%TTYPE%%_server(int fd1) { struct msghdr msghdr; struct iovec iov[1]; @@ -107,7 +109,7 @@ t_timeval_server(int fd1) fd2 = -1; rv = -2; - cmsg_size = CMSG_SPACE(sizeof(struct timeval)); + cmsg_size = CMSG_SPACE(sizeof(struct %%DTYPE%%)); cmsg_data = malloc(cmsg_size); if (cmsg_data == NULL) { uc_logmsg("malloc"); @@ -135,7 +137,7 @@ t_timeval_server(int fd1) break; cmsghdr = CMSG_FIRSTHDR(&msghdr); - if (check_scm_timestamp(cmsghdr) < 0) + if (check_scm_%%TTYPE%%(cmsghdr) < 0) break; } if (i > uc_cfg.ipc_msg.msg_num) @@ -149,7 +151,8 @@ done: } int -t_timeval(void) +t_%%TTYPE%%(void) { - return (t_generic(t_timeval_client, t_timeval_server)); + return (t_generic(t_%%TTYPE%%_client, t_%%TTYPE%%_server)); } +#endif /* %%SCM_TTYPE%% */ Copied and modified: head/tools/regression/sockets/unix_cmsg/t_xxxtime.h.in (from r309590, head/tools/regression/sockets/unix_cmsg/t_timeval.h) ============================================================================== --- head/tools/regression/sockets/unix_cmsg/t_timeval.h Tue Dec 6 01:35:27 2016 (r309590, copy source) +++ head/tools/regression/sockets/unix_cmsg/t_xxxtime.h.in Tue Dec 6 18:22:25 2016 (r309631) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2005 Andrey Simonenko + * Copyright (c) 2016 Maksym Sobolyev * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,4 +27,6 @@ * $FreeBSD$ */ -int t_timeval(void); +#if defined(%%SCM_TTYPE%%) +int t_%%TTYPE%%(void); +#endif From owner-svn-src-head@freebsd.org Tue Dec 6 18:50:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10991C6A69D; Tue, 6 Dec 2016 18:50:24 +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 D45EE14E9; Tue, 6 Dec 2016 18:50:23 +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 uB6IoNCO017219; Tue, 6 Dec 2016 18:50:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6IoNv2017218; Tue, 6 Dec 2016 18:50:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612061850.uB6IoNv2017218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Dec 2016 18:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309638 - head/contrib/telnet/telnetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 18:50:24 -0000 Author: glebius Date: Tue Dec 6 18:50:22 2016 New Revision: 309638 URL: https://svnweb.freebsd.org/changeset/base/309638 Log: When telnetd(8) composes argument list for login(1), an unexpected sequence of memory allocation failures combined with insufficient error checking could result in the construction and execution of an argument sequence that was not intended. Fix that treating malloc(3) failures as fatal condition. Submitted by: brooks Security: FreeBSD-SA-16:36.telnetd Modified: head/contrib/telnet/telnetd/sys_term.c Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Tue Dec 6 18:50:06 2016 (r309637) +++ head/contrib/telnet/telnetd/sys_term.c Tue Dec 6 18:50:22 2016 (r309638) @@ -1159,7 +1159,7 @@ addarg(char **argv, const char *val) */ argv = (char **)malloc(sizeof(*argv) * 12); if (argv == NULL) - return(NULL); + fatal(net, "failure allocating argument space"); *argv++ = (char *)10; *argv = (char *)0; } @@ -1170,11 +1170,12 @@ addarg(char **argv, const char *val) *argv = (char *)((long)(*argv) + 10); argv = (char **)realloc(argv, sizeof(*argv)*((long)(*argv) + 2)); if (argv == NULL) - return(NULL); + fatal(net, "failure allocating argument space"); argv++; cpp = &argv[(long)argv[-1] - 10]; } - *cpp++ = strdup(val); + if ((*cpp++ = strdup(val)) == NULL) + fatal(net, "failure allocating argument space"); *cpp = 0; return(argv); } From owner-svn-src-head@freebsd.org Tue Dec 6 18:50:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4749DC6A6E7; Tue, 6 Dec 2016 18:50:35 +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 E71AC163E; Tue, 6 Dec 2016 18:50:34 +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 uB6IoYmK017269; Tue, 6 Dec 2016 18:50:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6IoY1U017268; Tue, 6 Dec 2016 18:50:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612061850.uB6IoY1U017268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Dec 2016 18:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309639 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 18:50:35 -0000 Author: glebius Date: Tue Dec 6 18:50:33 2016 New Revision: 309639 URL: https://svnweb.freebsd.org/changeset/base/309639 Log: Fix possible buffer overflow(s) in link_ntoa(3). A specially crafted sockaddr_dl argument can trigger a static buffer overflow in the libc library, with possibility to rewrite with arbitrary data following static buffers that belong to other library functions. Reviewed by: kib Security: FreeBSD-SA-16:37.libc Modified: head/lib/libc/net/linkaddr.c Modified: head/lib/libc/net/linkaddr.c ============================================================================== --- head/lib/libc/net/linkaddr.c Tue Dec 6 18:50:22 2016 (r309638) +++ head/lib/libc/net/linkaddr.c Tue Dec 6 18:50:33 2016 (r309639) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -122,31 +123,47 @@ char * link_ntoa(const struct sockaddr_dl *sdl) { static char obuf[64]; - char *out = obuf; - int i; - u_char *in = (u_char *)LLADDR(sdl); - u_char *inlim = in + sdl->sdl_alen; - int firsttime = 1; - - if (sdl->sdl_nlen) { - bcopy(sdl->sdl_data, obuf, sdl->sdl_nlen); - out += sdl->sdl_nlen; - if (sdl->sdl_alen) + _Static_assert(sizeof(obuf) >= IFNAMSIZ + 20, "obuf is too small"); + char *out; + const char *in, *inlim; + int namelen, i, rem; + + namelen = (sdl->sdl_nlen <= IFNAMSIZ) ? sdl->sdl_nlen : IFNAMSIZ; + + out = obuf; + rem = sizeof(obuf); + if (namelen > 0) { + bcopy(sdl->sdl_data, out, namelen); + out += namelen; + rem -= namelen; + if (sdl->sdl_alen > 0) { *out++ = ':'; + rem--; + } } - while (in < inlim) { - if (firsttime) - firsttime = 0; - else + + in = (const char *)sdl->sdl_data + sdl->sdl_nlen; + inlim = in + sdl->sdl_alen; + + while (in < inlim && rem > 1) { + if (in != (const char *)sdl->sdl_data + sdl->sdl_nlen) { *out++ = '.'; + rem--; + } i = *in++; if (i > 0xf) { - out[1] = hexlist[i & 0xf]; + if (rem < 3) + break; + *out++ = hexlist[i & 0xf]; i >>= 4; - out[0] = hexlist[i]; - out += 2; - } else *out++ = hexlist[i]; + rem -= 2; + } else { + if (rem < 2) + break; + *out++ = hexlist[i]; + rem++; + } } *out = 0; return (obuf); From owner-svn-src-head@freebsd.org Tue Dec 6 18:50:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08FB1C6A754; Tue, 6 Dec 2016 18:50:46 +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 CCD311787; Tue, 6 Dec 2016 18:50:45 +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 uB6IojEA017321; Tue, 6 Dec 2016 18:50:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6IojX6017320; Tue, 6 Dec 2016 18:50:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612061850.uB6IojX6017320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Dec 2016 18:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309640 - head/lib/libvmmapi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 18:50:46 -0000 Author: glebius Date: Tue Dec 6 18:50:44 2016 New Revision: 309640 URL: https://svnweb.freebsd.org/changeset/base/309640 Log: Fix possible integer overflow in guest memory bounds checking, which could lead to access from the virtual machine to the heap of the bhyve(8) process. Submitted by: Felix Wilhelm Patch by: grehan Security: FreeBSD-SA-16:38.bhyve Modified: head/lib/libvmmapi/vmmapi.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Tue Dec 6 18:50:33 2016 (r309639) +++ head/lib/libvmmapi/vmmapi.c Tue Dec 6 18:50:44 2016 (r309640) @@ -426,13 +426,18 @@ vm_map_gpa(struct vmctx *ctx, vm_paddr_t { if (ctx->lowmem > 0) { - if (gaddr < ctx->lowmem && gaddr + len <= ctx->lowmem) + if (gaddr < ctx->lowmem && len <= ctx->lowmem && + gaddr + len <= ctx->lowmem) return (ctx->baseaddr + gaddr); } if (ctx->highmem > 0) { - if (gaddr >= 4*GB && gaddr + len <= 4*GB + ctx->highmem) - return (ctx->baseaddr + gaddr); + if (gaddr >= 4*GB) { + if (gaddr < 4*GB + ctx->highmem && + len <= ctx->highmem && + gaddr + len <= 4*GB + ctx->highmem) + return (ctx->baseaddr + gaddr); + } } return (NULL); From owner-svn-src-head@freebsd.org Tue Dec 6 18:58:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB357C6AE5C; Tue, 6 Dec 2016 18:58:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE80EE3; Tue, 6 Dec 2016 18:58:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6IwgDY021751; Tue, 6 Dec 2016 18:58:42 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6IwgRl021750; Tue, 6 Dec 2016 18:58:42 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201612061858.uB6IwgRl021750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 6 Dec 2016 18:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309649 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 18:58:43 -0000 Author: oshogbo Date: Tue Dec 6 18:58:42 2016 New Revision: 309649 URL: https://svnweb.freebsd.org/changeset/base/309649 Log: tcpdump: allow to use BIOCROTZBUF in capability mode The libpcap library can use a BIOCROTZBUF ioctl when net.bpf.zerocopy_enable sysctl is set. Reported by: olivier@ Tested by: olivier@ Modified: head/contrib/tcpdump/tcpdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Tue Dec 6 18:55:01 2016 (r309648) +++ head/contrib/tcpdump/tcpdump.c Tue Dec 6 18:58:42 2016 (r309649) @@ -1919,7 +1919,7 @@ main(int argc, char **argv) error("%s", pcap_geterr(pd)); #ifdef HAVE_CASPER if (RFileName == NULL && VFileName == NULL) { - static const unsigned long cmds[] = { BIOCGSTATS }; + static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF }; /* * The various libpcap devices use a combination of From owner-svn-src-head@freebsd.org Tue Dec 6 19:07:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B454C6A10C; Tue, 6 Dec 2016 19:07:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 0670E15A5; Tue, 6 Dec 2016 19:07:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 4BB685648E; Tue, 6 Dec 2016 13:07:39 -0600 (CST) Subject: Re: svn commit: r309625 - head/sbin/rcorder To: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201612061549.uB6Fndxo044249@repo.freebsd.org> From: Eric van Gyzen Message-ID: Date: Tue, 6 Dec 2016 13:07:38 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 19:07:40 -0000 On 12/06/2016 11:30, Ravi Pokala wrote: > For grins, I ran this on my build server. The resulting graph is... > complex. But one thing was immediately clear: neither > /etc/rc.d/dhclient and /etc/rc.d/natd depend on anything. That seems > wrong: I would expect them to have some sort of dependency on > NETWORKING, either BEFORE (since dhclient may be involved in bringing > up the network) or REQUIRE (since it doesn’t make sense to run a > networking daemon like natd before networking is up). I saw that, too. I'm pretty sure they're not called directly, but are called from other scripts, such as network.subr and ipfw, respectively. They certainly /look/ like they can be called directly. Maybe that's leftover from an older style of configuration? I defer to the rc experts. Eric From owner-svn-src-head@freebsd.org Tue Dec 6 19:08:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B738C6A177; Tue, 6 Dec 2016 19:08:30 +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 2B5781723; Tue, 6 Dec 2016 19:08:30 +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 uB6J8TwG025862; Tue, 6 Dec 2016 19:08:29 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6J8TMS025860; Tue, 6 Dec 2016 19:08:29 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201612061908.uB6J8TMS025860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 6 Dec 2016 19:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309650 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 19:08:30 -0000 Author: ed Date: Tue Dec 6 19:08:29 2016 New Revision: 309650 URL: https://svnweb.freebsd.org/changeset/base/309650 Log: Properly sign extend the result of jrand48() and mrand48(). These functions are supposed to return a value between [_2^31, 2^31). This doesn't seem to work on 64-bit systems, where we return a value between [0, 3^32). Patch up the function to use proper casts to int32_t. While there, fix some other style bugs. MFC after: 2 weeks Modified: head/lib/libc/gen/jrand48.c head/lib/libc/gen/mrand48.c Modified: head/lib/libc/gen/jrand48.c ============================================================================== --- head/lib/libc/gen/jrand48.c Tue Dec 6 18:58:42 2016 (r309649) +++ head/lib/libc/gen/jrand48.c Tue Dec 6 19:08:29 2016 (r309650) @@ -14,11 +14,14 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "rand48.h" long jrand48(unsigned short xseed[3]) { + _dorand48(xseed); - return ((long) xseed[2] << 16) + (long) xseed[1]; + return ((int32_t)(((uint32_t)xseed[2] << 16) | (uint32_t)xseed[1])); } Modified: head/lib/libc/gen/mrand48.c ============================================================================== --- head/lib/libc/gen/mrand48.c Tue Dec 6 18:58:42 2016 (r309649) +++ head/lib/libc/gen/mrand48.c Tue Dec 6 19:08:29 2016 (r309650) @@ -14,6 +14,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "rand48.h" extern unsigned short _rand48_seed[3]; @@ -21,6 +23,8 @@ extern unsigned short _rand48_seed[3]; long mrand48(void) { + _dorand48(_rand48_seed); - return ((long) _rand48_seed[2] << 16) + (long) _rand48_seed[1]; + return ((int32_t)(((uint32_t)_rand48_seed[2] << 16) | + (uint32_t)_rand48_seed[1])); } From owner-svn-src-head@freebsd.org Tue Dec 6 19:35:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58D81C6A54E for ; Tue, 6 Dec 2016 19:35:49 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC17BB5B for ; Tue, 6 Dec 2016 19:35:48 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 2b9218bf-bbeb-11e6-9673-39b5816e8152 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 2b9218bf-bbeb-11e6-9673-39b5816e8152; Tue, 06 Dec 2016 19:35:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uB6JZY9N016747; Tue, 6 Dec 2016 12:35:34 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1481052934.1889.267.camel@freebsd.org> Subject: Re: svn commit: r309625 - head/sbin/rcorder From: Ian Lepore To: Eric van Gyzen , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 06 Dec 2016 12:35:34 -0700 In-Reply-To: References: <201612061549.uB6Fndxo044249@repo.freebsd.org> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 19:35:49 -0000 On Tue, 2016-12-06 at 13:07 -0600, Eric van Gyzen wrote: > On 12/06/2016 11:30, Ravi Pokala wrote: > > > > For grins, I ran this on my build server. The resulting graph is... > > complex. But one thing was immediately clear: neither > > /etc/rc.d/dhclient and /etc/rc.d/natd depend on anything. That > > seems > > wrong: I would expect them to have some sort of dependency on > > NETWORKING, either BEFORE (since dhclient may be involved in > > bringing > > up the network) or REQUIRE (since it doesn¢t make sense to run a > > networking daemon like natd before networking is up). > I saw that, too.  I'm pretty sure they're not called directly, but > are > called from other scripts, such as network.subr and ipfw, > respectively. > They certainly /look/ like they can be called directly.  Maybe that's > leftover from an older style of configuration?  I defer to the rc > experts. > > Eric > The clue for that is the "nostart" keyword -- scripts flagged with that won't be run automatically because /etc/rc does 'rcorder -s nostart', but they can be run by other scripts or from devd. -- Ian From owner-svn-src-head@freebsd.org Tue Dec 6 20:44:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 649B7C6B309; Tue, 6 Dec 2016 20:44:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 340951ACA; Tue, 6 Dec 2016 20:44:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6KieGn066701; Tue, 6 Dec 2016 20:44:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6KieNT066700; Tue, 6 Dec 2016 20:44:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612062044.uB6KieNT066700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 6 Dec 2016 20:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309656 - head/lib/clang/libllvmminimal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 20:44:41 -0000 Author: dim Date: Tue Dec 6 20:44:40 2016 New Revision: 309656 URL: https://svnweb.freebsd.org/changeset/base/309656 Log: During the bootstrap phase, when building the minimal llvm library on PowerPC, add lib/Support/Atomic.cpp. This is needed because upstream llvm revision r271821 disabled the use of std::call_once, which causes some fallback functions from Atomic.cpp to be used instead. Reported by: Mark Millard PR: 214902 X-MFC-With: 309124 Modified: head/lib/clang/libllvmminimal/Makefile Modified: head/lib/clang/libllvmminimal/Makefile ============================================================================== --- head/lib/clang/libllvmminimal/Makefile Tue Dec 6 19:40:37 2016 (r309655) +++ head/lib/clang/libllvmminimal/Makefile Tue Dec 6 20:44:40 2016 (r309656) @@ -7,6 +7,9 @@ INTERNALLIB= SRCDIR= lib SRCS+= Support/APInt.cpp +.if ${MACHINE_ARCH:Mpowerpc*} != "" +SRCS+= Support/Atomic.cpp +.endif SRCS+= Support/CommandLine.cpp SRCS+= Support/ConvertUTF.c SRCS+= Support/ConvertUTFWrapper.cpp From owner-svn-src-head@freebsd.org Tue Dec 6 20:45:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31A56C6B376; Tue, 6 Dec 2016 20:45:22 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 156C71C92; Tue, 6 Dec 2016 20:45:22 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp003.me.com by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OHS00O003XRFF00@mr11p00im-asmtp003.me.com>; Tue, 06 Dec 2016 19:44:58 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1481053497; bh=wGO0Iry/b/mT1l0sFoYa4CuLekYXw06nmFBimUuMAB8=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=RvsxTFYE3S5Y1fEVfkbrwA5BsGT/KnqJeEf/gWTLEkXPQ4REWwX/aG8ahnkrSgQYq sUfoh3Q4+wvKOoQHnCSDBal3QaGKbjS+4xdKGSO+Dte7Sie/BS/I2mW1E0wvrDEPhD o9DPYRNoH5cYk4gxDn0/f4YCzxtXLstdiDfluhqSWD02OukOrfQi+3RInj93QT3byc IqxI9tR/ugt1Sqg+j8RXrBqZ9xj4x9FGvzuF1ARGj9NF/yHgeD6A44AFlACeIo4jZk M44O2e6uhfCou750Z3aYXsm59drG/FW+NFjkSzYS56Tp+ibKzF7dueQrZdOKldliaM NA20GnL9uTVeA== Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OHS008E346UGT20@mr11p00im-asmtp003.me.com>; Tue, 06 Dec 2016 19:44:56 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-06_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1612060296 User-Agent: Microsoft-MacOutlook/f.1c.1.161117 Date: Tue, 06 Dec 2016 11:44:53 -0800 Subject: Re: svn commit: r309625 - head/sbin/rcorder From: Ravi Pokala Sender: "Pokala, Ravi" To: Ian Lepore , Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <1F947149-E2E6-4B50-BE65-EF426585343E@panasas.com> Thread-topic: svn commit: r309625 - head/sbin/rcorder References: <201612061549.uB6Fndxo044249@repo.freebsd.org> <1481052934.1889.267.camel@freebsd.org> In-reply-to: <1481052934.1889.267.camel@freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 20:45:22 -0000 -----Original Message----- > From: Ian Lepore > Date: 2016-12-06, Tuesday at 11:35 > To: Eric van Gyzen , Ravi Pokala , , , > Subject: Re: svn commit: r309625 - head/sbin/rcorder > > On Tue, 2016-12-06 at 13:07 -0600, Eric van Gyzen wrote: >> On 12/06/2016 11:30, Ravi Pokala wrote: >>> >>> ... >>> >> I saw that, too. I'm pretty sure they're not called directly, but are >> called from other scripts, such as network.subr and ipfw, respectively. >> They certainly /look/ like they can be called directly. Maybe that's >> leftover from an older style of configuration? I defer to the rc experts. >> >> Eric > > The clue for that is the "nostart" keyword -- scripts flagged with that > won't be run automatically because /etc/rc does 'rcorder -s nostart', > but they can be run by other scripts or from devd. > > -- Ian Ahhh! Good to know. Thanks Ian, Ravi (rpokala@) From owner-svn-src-head@freebsd.org Tue Dec 6 22:33:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0FCEC6AEF7; Tue, 6 Dec 2016 22:33:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B058015A9; Tue, 6 Dec 2016 22:33:30 +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 1777A10AA59; Tue, 6 Dec 2016 17:33:12 -0500 (EST) From: John Baldwin To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309531 - head/sys/arm/include Date: Tue, 06 Dec 2016 14:01:43 -0800 Message-ID: <1802951.O895X1uuQH@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201612041527.uB4FRduc064051@repo.freebsd.org> References: <201612041527.uB4FRduc064051@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); Tue, 06 Dec 2016 17:33:12 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 22:33:30 -0000 On Sunday, December 04, 2016 03:27:39 PM Michal Meloun wrote: > Author: mmel > Date: Sun Dec 4 15:27:39 2016 > New Revision: 309531 > URL: https://svnweb.freebsd.org/changeset/base/309531 > > Log: > Implement fake pmap_mapdev_attr() for ARMv6. > This function is referenced, but never called from DRM2 code. Also, > real behavior of pmap_mapdev_attr() in ARM world is unclear as we don't > have any additional attribute for a device memory type. > > MFC after: 2 weeks One more question: why not define this in pmap.c instead of an inline function in the header file? (The inline bit seemed to have led to several followups due to build breakage and the "fixes" require a fair bit of header pollution.) -- John Baldwin From owner-svn-src-head@freebsd.org Tue Dec 6 22:48:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 789ACC69353; Tue, 6 Dec 2016 22:48:29 +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 301111C5F; Tue, 6 Dec 2016 22:48:29 +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 uB6MmSvN015527; Tue, 6 Dec 2016 22:48:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6MmSJc015526; Tue, 6 Dec 2016 22:48:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612062248.uB6MmSJc015526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 22:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309657 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 22:48:29 -0000 Author: markj Date: Tue Dec 6 22:48:28 2016 New Revision: 309657 URL: https://svnweb.freebsd.org/changeset/base/309657 Log: Require the STACK option for code that captures stacks of running threads. stack_machdep.c is compiled if either of the DDB or STACK options is specified, but stack_save_td_running() isn't useable from DDB. Moreover, stack_save_td_running() works by raising an NMI on the CPU running the target thread, and the corresponding handler is compiled only if STACK is configured. Reported by: kib MFC after: 1 week Modified: head/sys/x86/x86/stack_machdep.c Modified: head/sys/x86/x86/stack_machdep.c ============================================================================== --- head/sys/x86/x86/stack_machdep.c Tue Dec 6 20:44:40 2016 (r309656) +++ head/sys/x86/x86/stack_machdep.c Tue Dec 6 22:48:28 2016 (r309657) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_stack.h" + #include #include #include @@ -59,6 +61,7 @@ typedef struct i386_frame *x86_frame_t; typedef struct amd64_frame *x86_frame_t; #endif +#ifdef STACK static struct stack *nmi_stack; static volatile struct thread *nmi_pending; @@ -66,6 +69,7 @@ static volatile struct thread *nmi_pendi static struct mtx nmi_lock; MTX_SYSINIT(nmi_lock, &nmi_lock, "stack_nmi", MTX_SPIN); #endif +#endif static void stack_capture(struct thread *td, struct stack *st, register_t fp) @@ -95,6 +99,7 @@ int stack_nmi_handler(struct trapframe *tf) { +#ifdef STACK /* Don't consume an NMI that wasn't meant for us. */ if (nmi_stack == NULL || curthread != nmi_pending) return (0); @@ -107,6 +112,9 @@ stack_nmi_handler(struct trapframe *tf) atomic_store_rel_ptr((long *)&nmi_pending, (long)NULL); return (1); +#else + return (0); +#endif } void @@ -125,6 +133,7 @@ int stack_save_td_running(struct stack *st, struct thread *td) { +#ifdef STACK THREAD_LOCK_ASSERT(td, MA_OWNED); MPASS(TD_IS_RUNNING(td)); @@ -148,10 +157,13 @@ stack_save_td_running(struct stack *st, if (st->depth == 0) /* We interrupted a thread in user mode. */ return (EAGAIN); -#else +#else /* !SMP */ KASSERT(0, ("curthread isn't running")); -#endif +#endif /* SMP */ return (0); +#else /* !STACK */ + return (EOPNOTSUPP); +#endif /* STACK */ } void From owner-svn-src-head@freebsd.org Tue Dec 6 22:52:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC92AC69813; Tue, 6 Dec 2016 22:52:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C65920E; Tue, 6 Dec 2016 22:52:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6MqjdX019192; Tue, 6 Dec 2016 22:52:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6Mqjhr019191; Tue, 6 Dec 2016 22:52:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612062252.uB6Mqjhr019191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Dec 2016 22:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309658 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 22:52:46 -0000 Author: markj Date: Tue Dec 6 22:52:45 2016 New Revision: 309658 URL: https://svnweb.freebsd.org/changeset/base/309658 Log: Provide dummy sysctls for v_cache_count and v_tcached. Some utilities (notably top(1)) exit if any of their input sysctls don't exist, and the removal of the above-mentioned PG_CACHE-related sysctls makes it difficult to run such utilities on different versions of the kernel without recompiling. Requested by: bde Modified: head/sys/vm/vm_meter.c Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); + +#ifndef BURN_BRIDGES +/* + * Provide compatibility sysctls for the benefit of old utilities which exit + * with an error if they cannot be found. + */ +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, + (u_int *)NULL, 0, "Dummy for compatibility"); +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, + (u_int *)NULL, 0, "Dummy for compatibility"); +#endif From owner-svn-src-head@freebsd.org Tue Dec 6 23:43:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABC94C6ABBD; Tue, 6 Dec 2016 23:43:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 61317BF2; Tue, 6 Dec 2016 23:43:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB6Nh4VH041523; Tue, 6 Dec 2016 23:43:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6Nh4O9041522; Tue, 6 Dec 2016 23:43:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612062343.uB6Nh4O9041522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 6 Dec 2016 23:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309659 - head/lib/libc/tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 23:43:05 -0000 Author: bdrewery Date: Tue Dec 6 23:43:04 2016 New Revision: 309659 URL: https://svnweb.freebsd.org/changeset/base/309659 Log: Support spaces in group names. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libc/tests/nss/getgr_test.c Modified: head/lib/libc/tests/nss/getgr_test.c ============================================================================== --- head/lib/libc/tests/nss/getgr_test.c Tue Dec 6 22:52:45 2016 (r309658) +++ head/lib/libc/tests/nss/getgr_test.c Tue Dec 6 23:43:04 2016 (r309659) @@ -176,7 +176,7 @@ sdump_group(struct group *grp, char *buf char **cp; int written; - written = snprintf(buffer, buflen, "%s %s %d", + written = snprintf(buffer, buflen, "%s:%s:%d:", grp->gr_name, grp->gr_passwd, grp->gr_gid); buffer += written; if (written > buflen) @@ -186,7 +186,8 @@ sdump_group(struct group *grp, char *buf if (grp->gr_mem != NULL) { if (*(grp->gr_mem) != '\0') { for (cp = grp->gr_mem; *cp; ++cp) { - written = snprintf(buffer, buflen, " %s",*cp); + written = snprintf(buffer, buflen, "%s%s", + cp == grp->gr_mem ? "" : ",", *cp); buffer += written; if (written > buflen) return; @@ -196,9 +197,9 @@ sdump_group(struct group *grp, char *buf return; } } else - snprintf(buffer, buflen, " nomem"); + snprintf(buffer, buflen, "nomem"); } else - snprintf(buffer, buflen, " (null)"); + snprintf(buffer, buflen, "(null)"); } static int @@ -206,6 +207,7 @@ group_read_snapshot_func(struct group *g { StringList *sl; char *s, *ps, *ts; + const char *sep; int i; printf("1 line read from snapshot:\n%s\n", line); @@ -213,8 +215,9 @@ group_read_snapshot_func(struct group *g i = 0; sl = NULL; ps = line; + sep = ":"; memset(grp, 0, sizeof(struct group)); - while ((s = strsep(&ps, " ")) != NULL) { + while ((s = strsep(&ps, sep)) != NULL) { switch (i) { case 0: grp->gr_name = strdup(s); @@ -235,6 +238,8 @@ group_read_snapshot_func(struct group *g grp->gr_passwd = NULL; return (-1); } + /* Change to parsing groups. */ + sep = ","; break; default: From owner-svn-src-head@freebsd.org Tue Dec 6 23:52:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B24BC6AF78; Tue, 6 Dec 2016 23:52:57 +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 0ACE8123C; Tue, 6 Dec 2016 23:52:56 +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 uB6NquZa045804; Tue, 6 Dec 2016 23:52:56 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB6NquYS045803; Tue, 6 Dec 2016 23:52:56 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201612062352.uB6NquYS045803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 6 Dec 2016 23:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309660 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 23:52:57 -0000 Author: ae Date: Tue Dec 6 23:52:56 2016 New Revision: 309660 URL: https://svnweb.freebsd.org/changeset/base/309660 Log: Convert result of hash_packet6() into host byte order. For IPv4 similar function uses addresses and ports in host byte order, but for IPv6 it used network byte order. This led to very bad hash distribution for IPv6 flows. Now the result looks similar to IPv4. Reported by: olivier MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Tue Dec 6 23:43:04 2016 (r309659) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Tue Dec 6 23:52:56 2016 (r309660) @@ -256,9 +256,8 @@ hash_packet6(struct ipfw_flow_id *id) i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[3]) ^ - (id->dst_port) ^ (id->src_port); - return i; + (id->src_ip6.__u6_addr.__u6_addr32[3]); + return ntohl(i); } #endif @@ -277,9 +276,9 @@ hash_packet(struct ipfw_flow_id *id, int i = hash_packet6(id); else #endif /* INET6 */ - i = (id->dst_ip) ^ (id->src_ip) ^ (id->dst_port) ^ (id->src_port); - i &= (buckets - 1); - return i; + i = (id->dst_ip) ^ (id->src_ip); + i ^= (id->dst_port) ^ (id->src_port); + return (i & (buckets - 1)); } #if 0 From owner-svn-src-head@freebsd.org Tue Dec 6 23:59:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ABB5C6B2AB; Tue, 6 Dec 2016 23:59:06 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 370CF14C3; Tue, 6 Dec 2016 23:59:06 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id p66so21345478pga.2; Tue, 06 Dec 2016 15:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Y658NjiQsN+HoKa/l/l6PbGF35M0C8A4Ip2vWFVPuCY=; b=R7i6yS6zX/8i1sx2Hlxaq3JtqYxiX8wJBHpxX0mHInTqTe73QnlndxdyqIn7NbKg77 WOP5Xp7aUZ1MKMHlSHzrTyZLmHaAkeQIO3flzv/+6uIxoVrC9cLjQBtL3gSSuY2o+jWV iQCH61OXGDihudz/6z/apPpx+Dk8cwZ0/MjK2kMl8Zk1aBhJVbUaFkkagyG0i+naL2LR 0GXaULm2Uz544IhYBkqmCn33U2GDTt0J0eLU39jdUV2N8qlihhG7tpYYA372xVN53b3P PqT5n4PSbJIgk+ZkFuphnaormY89tjokq8s1TPC5NetaKLxhdPYJ7GY/0w+vmRTgIKAm MK7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Y658NjiQsN+HoKa/l/l6PbGF35M0C8A4Ip2vWFVPuCY=; b=NtDUDjL1tZeyiLbmuodmfOlT3FWRablOfjPkuBh2B26pcOriOYXB07rhY2wPWrq/pS wkMfZZNVjNAEnzqRXkx9+OROfS3CAlA22prPcT8ALmwZNRnMQmGLB+Rl+tBhRD7/cN6S fWaFIFYU42B390MVimrg+fOgr9bnFfcRPl9JlUOlchvNLuys7f+XHnWtjwQcA2fNsuDp qWkCgmp4DYdQ91iGffk2txsY1WMHBIX4UAColhwyNg+vo6CNgGNPrdyDU6dS+zVXSzMP lHOEm1XLohExonuw8xsJxI/7SY3VPaF8UW3TY/RTv8JCdSt8nk+RiKeKrLHp9Lgkkf+v IEXw== X-Gm-Message-State: AKaTC00wb6nFgB0pPo/yptNnnPW4dC6JrFdZb5jXNq/fEMubLSjRWtEwZSRLTNTWtNUfAA== X-Received: by 10.84.129.131 with SMTP id b3mr138357744plb.54.1481068745446; Tue, 06 Dec 2016 15:59:05 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 4sm37449566pgd.32.2016.12.06.15.59.04 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Dec 2016 15:59:04 -0800 (PST) Subject: Re: svn commit: r309659 - head/lib/libc/tests/nss Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_0343C20E-C31B-4298-B26A-7F75CA1FA947"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201612062343.uB6Nh4O9041522@repo.freebsd.org> Date: Tue, 6 Dec 2016 15:59:03 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201612062343.uB6Nh4O9041522@repo.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 23:59:06 -0000 --Apple-Mail=_0343C20E-C31B-4298-B26A-7F75CA1FA947 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Dec 6, 2016, at 15:43, Bryan Drewery wrote: > > Author: bdrewery > Date: Tue Dec 6 23:43:04 2016 > New Revision: 309659 > URL: https://svnweb.freebsd.org/changeset/base/309659 > > Log: > Support spaces in group names. > > MFC after: 2 weeks > Sponsored by: Dell EMC Isilon Thank you for catching this :). -Ngie --Apple-Mail=_0343C20E-C31B-4298-B26A-7F75CA1FA947 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYR1DHAAoJEPWDqSZpMIYVJ3IP/RDv56/cK1170O8Kxtsc/KgM FMVFfl/NAsz38uI647rDbUJwbneSJmO3CdFTzMo9d46HUZ4J7vIMcAm3vp5tSBeB 6VbSDsLdgLMLZn8m2UZrdV+f8tYF/S3NrTYb8gNHWYaorF+SBmBJLMe6yNfjTTdM A8wcZcXE2wtHDDBumF12aU1mbc0yYFLg5147lZc4mQVYpKAsyj2LAPB9ERCzvgAG WKvTaVILh0/8AhB3hS4Kdqio/RQhAy27GJ178+5x1xL1khXW3e15iQjDj/YkHdcW jMi+1mwiEyLPeqU3+zhNShVPzv4yI+cls+vSU1jyV3Hs9BSk7orEgF0z2X8vcLs8 gAuA/k3u5NrUw0M/yV3EDhUdjJttsULnp9BJTq1mW70t3D+glq4SwUZcUCN9lPTO /M2inU9HeKSZesxHAQnhi17F279Tott7tSGTtSKo9H30vxZy2v0L4OlbZs/3dCAN CYfXtI+H2bqXSxHkEsSAyyy5m/ZvIoAMmXqlYimIaQWLZNYraw6Y/fbF55FukdHO fJHjGGYWFvUof2kPD7I+URWJqCHDMga7LfDma4YSJabwuaAq1Ze88acEgy2v/ykH thT/T9GIJPRWNO5HpRFwHTGHHVbEfA9VqHqnG0JxBagL1RBeLhBSCzVA7viifw8M E5VJFeW0Qf/+Cjy5wNH8 =ulXI -----END PGP SIGNATURE----- --Apple-Mail=_0343C20E-C31B-4298-B26A-7F75CA1FA947-- From owner-svn-src-head@freebsd.org Wed Dec 7 00:45:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00FEEC690E6; Wed, 7 Dec 2016 00:45:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id C027DF1E; Wed, 7 Dec 2016 00:45:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 8F1113C13A9; Wed, 7 Dec 2016 11:44:49 +1100 (AEDT) Date: Wed, 7 Dec 2016 11:44:49 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309658 - head/sys/vm In-Reply-To: <201612062252.uB6Mqjhr019191@repo.freebsd.org> Message-ID: <20161207110947.V1119@besplex.bde.org> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=OfRePtsSlY3vNsTKZMEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 00:45:01 -0000 On Tue, 6 Dec 2016, Mark Johnston wrote: > Log: > Provide dummy sysctls for v_cache_count and v_tcached. > > Some utilities (notably top(1)) exit if any of their input sysctls don't > exist, and the removal of the above-mentioned PG_CACHE-related sysctls > makes it difficult to run such utilities on different versions of the > kernel without recompiling. > > Requested by: bde Thanks. > Modified: head/sys/vm/vm_meter.c > ============================================================================== > --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) > +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) > @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec > VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); > VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); > VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); > + > +#ifndef BURN_BRIDGES > +/* > + * Provide compatibility sysctls for the benefit of old utilities which exit > + * with an error if they cannot be found. > + */ > +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, > + (u_int *)NULL, 0, "Dummy for compatibility"); > +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, > + (u_int *)NULL, 0, "Dummy for compatibility"); > +#endif I don't like casting NULL, but SYSCTL_* enforces type safety for pointers to variables in a way that breaks normal use of NULL. You are supposed to obfuscate this by spelling the value as SYSCTL_UINT_NULL. This is actually documented in sysctl(9). Bruc From owner-svn-src-head@freebsd.org Wed Dec 7 01:15:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AD23C69C4F; Wed, 7 Dec 2016 01:15:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A7911FA4; Wed, 7 Dec 2016 01:15:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB71FAgN078474; Wed, 7 Dec 2016 01:15:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB71FA9I078473; Wed, 7 Dec 2016 01:15:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612070115.uB71FA9I078473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Dec 2016 01:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309663 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 01:15:11 -0000 Author: markj Date: Wed Dec 7 01:15:10 2016 New Revision: 309663 URL: https://svnweb.freebsd.org/changeset/base/309663 Log: Use the official spelling for NULL arguments to typed sysctl handlers. Reported by: bde Modified: head/sys/vm/vm_meter.c Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Wed Dec 7 00:57:15 2016 (r309662) +++ head/sys/vm/vm_meter.c Wed Dec 7 01:15:10 2016 (r309663) @@ -321,7 +321,7 @@ VM_STATS_VM(v_kthreadpages, "VM pages af * with an error if they cannot be found. */ SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, - (u_int *)NULL, 0, "Dummy for compatibility"); + SYSCTL_NULL_UINT_PTR, 0, "Dummy for compatibility"); SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, - (u_int *)NULL, 0, "Dummy for compatibility"); + SYSCTL_NULL_UINT_PTR, 0, "Dummy for compatibility"); #endif From owner-svn-src-head@freebsd.org Wed Dec 7 01:18:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8B02C69D2E; Wed, 7 Dec 2016 01:18:24 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 724A81E8; Wed, 7 Dec 2016 01:18:24 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x241.google.com with SMTP id n6so42618775qtd.0; Tue, 06 Dec 2016 17:18:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Yn9kstJyPePnzvITYwyynFC5F2hbcfUwwiCDJbOB4uU=; b=UzskcQ7Z6rpl9f1P18va3L0/okVSelkiJxxAmY0vqGdQQXKaTfGvTLJCZTe5s5eyho bcOZuxeuUTpgRg8QXa5bFxHLL/EXk6HgcrrCpFOniZkMHxT/xpoIGThh6AL+/PBTHR22 gvKSU2t0E9xpIm/beV+x3dkhY5ZRhZCBQm5Bj+4Nm2S24llJeHwRbi/0xkZmSGLwV4fL vwoxzf9LekCdz2s7eLhQ5xCJc2UTyTXOksqYvrTTb9EGEgW1/zxdXNNI3uTIrnI12Qeo Jna8qqVA+I19Px8UYU+THg+28arSQgBHR/ddfZ89Ar7OVCiF6HoKQCPbV+xbuAufUR/r NAtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Yn9kstJyPePnzvITYwyynFC5F2hbcfUwwiCDJbOB4uU=; b=AYXjUOkeH22ThDlD1C6lcbCyhZSSoH+Z9G3//MQ3dsI/YQeaCmGP5UyBzE5/ZYJf9w SfEt/8RlumetKfdkveFBIj7f2jsGHsKjtlGmdw+sJS4idgtu7FD33kYvmMoyq/cAo6C3 pA7DWLQKvYRVXVttYfTxyHRWSF6r9VUfaM3didG8z9tYj7RGDmQkrUFMd8hnDWRdtE5E aV5EIQbfFBiRSGW5mnHiIHlyyK1MHLPzJz7jiLOf2l5VkmNwfLtc+n+i65EU3aN99ogq 0014Y1EXeQPjygd2Qe9buwV/jh9z9LHzQOys8ehjM5SXLjkrXMoufD/wfIe7BwRCdLZw U2dQ== X-Gm-Message-State: AKaTC03ZC1gF4bO0SCpxkT4kzToJR1OpE7ez7J+V6IKNRIj0bCUgDoJx76+kdyVW0Clv8A== X-Received: by 10.237.63.75 with SMTP id q11mr65578576qtf.189.1481073502929; Tue, 06 Dec 2016 17:18:22 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id u13sm13538766qtc.37.2016.12.06.17.18.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 17:18:22 -0800 (PST) Sender: Mark Johnston Date: Tue, 6 Dec 2016 17:24:13 -0800 From: Mark Johnston To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309658 - head/sys/vm Message-ID: <20161207012413.GA47261@wkstn-mjohnston.west.isilon.com> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207110947.V1119@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161207110947.V1119@besplex.bde.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 01:18:24 -0000 On Wed, Dec 07, 2016 at 11:44:49AM +1100, Bruce Evans wrote: > On Tue, 6 Dec 2016, Mark Johnston wrote: > > > Log: > > Provide dummy sysctls for v_cache_count and v_tcached. > > > > Some utilities (notably top(1)) exit if any of their input sysctls don't > > exist, and the removal of the above-mentioned PG_CACHE-related sysctls > > makes it difficult to run such utilities on different versions of the > > kernel without recompiling. > > > > Requested by: bde > > Thanks. > > > Modified: head/sys/vm/vm_meter.c > > ============================================================================== > > --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) > > +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) > > @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec > > VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); > > VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); > > VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); > > + > > +#ifndef BURN_BRIDGES > > +/* > > + * Provide compatibility sysctls for the benefit of old utilities which exit > > + * with an error if they cannot be found. > > + */ > > +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, > > + (u_int *)NULL, 0, "Dummy for compatibility"); > > +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, > > + (u_int *)NULL, 0, "Dummy for compatibility"); > > +#endif > > I don't like casting NULL, but SYSCTL_* enforces type safety for pointers > to variables in a way that breaks normal use of NULL. > > You are supposed to obfuscate this by spelling the value as SYSCTL_UINT_NULL. > This is actually documented in sysctl(9). Fixed, thanks - I somehow managed to miss those #defines when I was looking at sysctl.h to see why a plain "NULL" doesn't work there. From owner-svn-src-head@freebsd.org Wed Dec 7 04:02:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1EEFC67EC1; Wed, 7 Dec 2016 04:02:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6845019E5; Wed, 7 Dec 2016 04:02:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB742fQ8047706; Wed, 7 Dec 2016 04:02:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB742fZH047704; Wed, 7 Dec 2016 04:02:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612070402.uB742fZH047704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 7 Dec 2016 04:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309664 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 04:02:42 -0000 Author: adrian Date: Wed Dec 7 04:02:41 2016 New Revision: 309664 URL: https://svnweb.freebsd.org/changeset/base/309664 Log: [net80211] start refactoring out the "am I a wep / group key!" code. This is a bunch of pointer arithmetic that is copypasta'ed everywhere. Let's undo that copypasta. Modified: head/sys/net80211/ieee80211_crypto.c head/sys/net80211/ieee80211_crypto.h Modified: head/sys/net80211/ieee80211_crypto.c ============================================================================== --- head/sys/net80211/ieee80211_crypto.c Wed Dec 7 01:15:10 2016 (r309663) +++ head/sys/net80211/ieee80211_crypto.c Wed Dec 7 04:02:41 2016 (r309664) @@ -520,6 +520,26 @@ ieee80211_crypto_setkey(struct ieee80211 return dev_key_set(vap, key); } +/* + * Return index if the key is a WEP key (0..3); -1 otherwise. + * + * This is different to "get_keyid" which defaults to returning + * 0 for unicast keys; it assumes that it won't be used for WEP. + */ +int +ieee80211_crypto_get_key_wepidx(const struct ieee80211vap *vap, + const struct ieee80211_key *k) +{ + + if (k >= &vap->iv_nw_keys[0] && + k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) + return (k - vap->iv_nw_keys); + return (-1): +} + +/* + * Note: only supports a single unicast key (0). + */ uint8_t ieee80211_crypto_get_keyid(struct ieee80211vap *vap, struct ieee80211_key *k) { Modified: head/sys/net80211/ieee80211_crypto.h ============================================================================== --- head/sys/net80211/ieee80211_crypto.h Wed Dec 7 01:15:10 2016 (r309663) +++ head/sys/net80211/ieee80211_crypto.h Wed Dec 7 04:02:41 2016 (r309664) @@ -202,6 +202,8 @@ void ieee80211_crypto_register(const str void ieee80211_crypto_unregister(const struct ieee80211_cipher *); int ieee80211_crypto_available(u_int cipher); +int ieee80211_crypto_get_key_wepidx(const struct ieee80211vap *, + const struct ieee80211_key *k); uint8_t ieee80211_crypto_get_keyid(struct ieee80211vap *vap, struct ieee80211_key *k); struct ieee80211_key *ieee80211_crypto_get_txkey(struct ieee80211_node *, From owner-svn-src-head@freebsd.org Wed Dec 7 04:03:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1435DC67F85; Wed, 7 Dec 2016 04:03:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6AB31B92; Wed, 7 Dec 2016 04:03:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB743q9f047788; Wed, 7 Dec 2016 04:03:52 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB743q8d047787; Wed, 7 Dec 2016 04:03:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612070403.uB743q8d047787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 7 Dec 2016 04:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309665 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 04:03:53 -0000 Author: adrian Date: Wed Dec 7 04:03:51 2016 New Revision: 309665 URL: https://svnweb.freebsd.org/changeset/base/309665 Log: [net80211] flesh out more RX phy information. I'm teaching my ath10k port to communicate up the per-rate / channel width information I get from the firmware. The HT40 flag field should just be retired and instead moved to use the PHY bandwidth field. Modified: head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Wed Dec 7 04:02:41 2016 (r309664) +++ head/sys/net80211/ieee80211_freebsd.h Wed Dec 7 04:03:51 2016 (r309665) @@ -658,6 +658,10 @@ int ieee80211_get_xmit_params(struct mbu #define IEEE80211_RX_F_IV_STRIP 0x00000200 /* Decrypted; IV stripped */ #define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; MMIC stripped */ #define IEEE80211_RX_F_SHORTGI 0x00000800 /* This is a short-GI frame */ +#define IEEE80211_RX_F_CCK 0x00001000 +#define IEEE80211_RX_F_OFDM 0x00002000 +#define IEEE80211_RX_F_HT 0x00004000 +#define IEEE80211_RX_F_VHT 0x00008000 /* Channel width */ #define IEEE80211_RX_FW_20MHZ 1 @@ -687,7 +691,7 @@ struct ieee80211_rx_stats { uint8_t c_nf; /* global NF */ uint8_t c_rssi; /* global RSSI */ uint8_t c_chain; /* number of RX chains involved */ - uint8_t c_rate; /* legacy + 11n rate code */ + uint8_t c_rate; /* legacy; 11n rate code; VHT MCS */ /* 32 bits */ uint16_t c_freq; /* Frequency, MHz */ @@ -703,7 +707,8 @@ struct ieee80211_rx_stats { /* 32 bits */ uint8_t c_phytype; /* PHY type, FW flags above */ - uint8_t c_pad2[3]; + uint8_t c_vhtnss; /* VHT - number of spatial streams */ + uint8_t c_pad2[2]; }; struct ieee80211_rx_params { From owner-svn-src-head@freebsd.org Wed Dec 7 04:23:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A735C6B69F; Wed, 7 Dec 2016 04:23:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE7498D6; Wed, 7 Dec 2016 04:23:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB74N9q7055939; Wed, 7 Dec 2016 04:23:09 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB74N9Ud055938; Wed, 7 Dec 2016 04:23:09 GMT (envelope-from np@FreeBSD.org) Message-Id: <201612070423.uB74N9Ud055938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 7 Dec 2016 04:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309666 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 04:23:10 -0000 Author: np Date: Wed Dec 7 04:23:08 2016 New Revision: 309666 URL: https://svnweb.freebsd.org/changeset/base/309666 Log: cxgbe(4): unsigned short isn't large enough to store link speed (which is in Mbps) for 100Gbps links. MFC after: 3 days Modified: head/sys/dev/cxgbe/common/common.h Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Wed Dec 7 04:03:51 2016 (r309665) +++ head/sys/dev/cxgbe/common/common.h Wed Dec 7 04:23:08 2016 (r309666) @@ -392,8 +392,8 @@ struct trace_params { struct link_config { unsigned short supported; /* link capabilities */ unsigned short advertising; /* advertised capabilities */ - unsigned short requested_speed; /* speed user has requested */ - unsigned short speed; /* actual link speed */ + unsigned int requested_speed; /* speed user has requested */ + unsigned int speed; /* actual link speed */ unsigned char requested_fc; /* flow control user has requested */ unsigned char fc; /* actual link flow control */ unsigned char autoneg; /* autonegotiating? */ From owner-svn-src-head@freebsd.org Wed Dec 7 05:35:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E8CFC6BA20; Wed, 7 Dec 2016 05:35:42 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6255920; Wed, 7 Dec 2016 05:35:41 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id g23so25613186wme.1; Tue, 06 Dec 2016 21:35:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:reply-to:subject:references:to:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=N1AS75b96Blx9XqF+7TWQ237lQgtfMtXJr/qQR6eqy0=; b=HbdG7RAe2E1Hwm1mFAva3XWi3AorvkKFTXz4X1WkR0y44zoKi+wGr6uzv1qw5S7Jqc 5QgbuAmh5jheKzJDl2U5b7ZOKSDMY1cYBWD/+2c9sPF6tenBFgEO6IpNZKawjZevuOPW CDmGn0xhZ8XFwgVr656kNgWgnMQhjdZowlY2zgkRkr3NptPTJo9j1K8zJzfMKWaPUAWJ UdZBRVG+sUHdsDfpSkr7m0ES9tsX7YCz31a5BWaMGVkT4zB3iW4iXMZfhZ9KY3wjl40n EsAx6VeQjU7ZxMPv2ggLouAmuOud5ev5zjTVw5QCOGJhnT3s6f/CZv6Cq2/gBG4JdNH4 jr5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:reply-to:subject:references:to:cc :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=N1AS75b96Blx9XqF+7TWQ237lQgtfMtXJr/qQR6eqy0=; b=Chr398oxdGj9mAnuUPsihKPrHWU0syTg95G9mgZLaPmR0k6hz7zvHpqkjmPx/wu+SX /kq4rkDjxHn0HgR25rdPsa37R1jyUW5JFJ7VIRyXgk5I0Hl8shntqLnaiym4uVensl6U lOxfx4Vey4AAuVTodNUqW0ADFJD+TxeyIPvp/XJxqRwJe2gGGv6Q5RjfegrttyFP0E+F udxVoepU7uZ1L6OkTru56pLkD2GNG2g5V1O75vIW6UIW7W/VB+uaOXmu79PJrQgcbT/z LASBbwuT0WoucBJlkqSkJPQHF/YTyqAb2yo706ZXOM71m0Y455bj8Vbca7fD0MBdHi+5 3wdQ== X-Gm-Message-State: AKaTC01s/MCzSzPcxysMJDa1d/gXtEoXE8ioJ/LHlZztdMNb+gbfFW6JdOlGWDpGq+l0tQ== X-Received: by 10.28.69.130 with SMTP id l2mr817719wmi.123.1481088939410; Tue, 06 Dec 2016 21:35:39 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id u81sm7550319wmu.10.2016.12.06.21.35.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 21:35:38 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r309531 - head/sys/arm/include References: <201612041527.uB4FRduc064051@repo.freebsd.org> <1802951.O895X1uuQH@ralph.baldwin.cx> To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <7ed22afe-65de-f6b0-22fe-7c34e2663694@freebsd.org> Date: Wed, 7 Dec 2016 06:35:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1802951.O895X1uuQH@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 05:35:42 -0000 Because I'm stupid enough to not remember that we have code which is compiled only as module. So my standard 'make buildkernel -DNO_CLEAN -DNO_MODULES' is not a best option how to test this new code. And rest is only natural result of panic caused by 'I break a kernel build' and 'I have scheduled a meeting @work at now'. You are right of course, I will fix it later today. Michal On 06.12.2016 23:01, John Baldwin wrote: > On Sunday, December 04, 2016 03:27:39 PM Michal Meloun wrote: >> Author: mmel >> Date: Sun Dec 4 15:27:39 2016 >> New Revision: 309531 >> URL: https://svnweb.freebsd.org/changeset/base/309531 >> >> Log: >> Implement fake pmap_mapdev_attr() for ARMv6. >> This function is referenced, but never called from DRM2 code. Also, >> real behavior of pmap_mapdev_attr() in ARM world is unclear as we don't >> have any additional attribute for a device memory type. >> >> MFC after: 2 weeks > One more question: why not define this in pmap.c instead of an inline > function in the header file? (The inline bit seemed to have led to several > followups due to build breakage and the "fixes" require a fair bit of header > pollution.) > From owner-svn-src-head@freebsd.org Wed Dec 7 06:29:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A9EAC6B5FE; Wed, 7 Dec 2016 06:29:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A49D1CD8; Wed, 7 Dec 2016 06:29:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB76T1KW003850; Wed, 7 Dec 2016 06:29:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB76T1PG003849; Wed, 7 Dec 2016 06:29:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201612070629.uB76T1PG003849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 7 Dec 2016 06:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309667 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 06:29:02 -0000 Author: delphij Date: Wed Dec 7 06:29:01 2016 New Revision: 309667 URL: https://svnweb.freebsd.org/changeset/base/309667 Log: Fix typo. Modified: head/sys/net80211/ieee80211_crypto.c Modified: head/sys/net80211/ieee80211_crypto.c ============================================================================== --- head/sys/net80211/ieee80211_crypto.c Wed Dec 7 04:23:08 2016 (r309666) +++ head/sys/net80211/ieee80211_crypto.c Wed Dec 7 06:29:01 2016 (r309667) @@ -534,7 +534,7 @@ ieee80211_crypto_get_key_wepidx(const st if (k >= &vap->iv_nw_keys[0] && k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) return (k - vap->iv_nw_keys); - return (-1): + return (-1); } /* From owner-svn-src-head@freebsd.org Wed Dec 7 07:27:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B53CCC6B951; Wed, 7 Dec 2016 07:27:48 +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 86E8A1E37; Wed, 7 Dec 2016 07:27:48 +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 uB77Rlsd028661; Wed, 7 Dec 2016 07:27:47 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB77RlHP028659; Wed, 7 Dec 2016 07:27:47 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201612070727.uB77RlHP028659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 7 Dec 2016 07:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309669 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 07:27:48 -0000 Author: gnn Date: Wed Dec 7 07:27:47 2016 New Revision: 309669 URL: https://svnweb.freebsd.org/changeset/base/309669 Log: Fix a kernel panic in DTrace's rw_iswriter subroutine. On FreeBSD the sense of rw_write_held() and rw_iswriter() were reversed, probably due to a cut and paste error. Using rw_iswriter() would cause the kernel to panic. Reviewed by: markj MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8718 Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Dec 7 06:57:08 2016 (r309668) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Dec 7 07:27:47 2016 (r309669) @@ -4391,8 +4391,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr(tupregs[0].dttk_value); - LOCK_CLASS(l.li)->lc_owner(l.li, &lowner); - regs[rd] = (lowner == curthread); + regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, &lowner) && + lowner != NULL; break; case DIF_SUBR_RW_ISWRITER: @@ -4403,8 +4403,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } l.lx = dtrace_loadptr(tupregs[0].dttk_value); - regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, &lowner) && - lowner != NULL; + LOCK_CLASS(l.li)->lc_owner(l.li, &lowner); + regs[rd] = (lowner == curthread); break; #endif /* illumos */ From owner-svn-src-head@freebsd.org Wed Dec 7 08:12:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31D23C6B9EB; Wed, 7 Dec 2016 08:12:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D9FA91887; Wed, 7 Dec 2016 08:12:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB78C3YI047957; Wed, 7 Dec 2016 08:12:03 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB78C3go047956; Wed, 7 Dec 2016 08:12:03 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612070812.uB78C3go047956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 7 Dec 2016 08:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309670 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 08:12:04 -0000 Author: sephe Date: Wed Dec 7 08:12:02 2016 New Revision: 309670 URL: https://svnweb.freebsd.org/changeset/base/309670 Log: hyperv/vmbus: Use pause if possible. This makes booting on Hyper-V w/ small # of vCPUs work properly. Reported by: Hongxiong Xian , Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Dec 7 07:27:47 2016 (r309669) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Dec 7 08:12:02 2016 (r309670) @@ -67,7 +67,7 @@ static void vmbus_chan_set_chmap(struc static void vmbus_chan_clear_chmap(struct vmbus_channel *); static void vmbus_chan_detach(struct vmbus_channel *); static bool vmbus_chan_wait_revoke( - const struct vmbus_channel *); + const struct vmbus_channel *, bool); static void vmbus_chan_ins_prilist(struct vmbus_softc *, struct vmbus_channel *); @@ -478,14 +478,14 @@ vmbus_chan_open_br(struct vmbus_channel msg = vmbus_msghc_poll_result(sc, mh); if (msg != NULL) break; - DELAY(1000); + pause("rchopen", 1); } #undef REVOKE_LINGER if (msg == NULL) vmbus_msghc_exec_cancel(sc, mh); break; } - DELAY(1000); + pause("chopen", 1); } if (msg != NULL) { status = ((const struct vmbus_chanmsg_chopen_resp *) @@ -658,7 +658,7 @@ vmbus_chan_gpadl_connect(struct vmbus_ch } static bool -vmbus_chan_wait_revoke(const struct vmbus_channel *chan) +vmbus_chan_wait_revoke(const struct vmbus_channel *chan, bool can_sleep) { #define WAIT_COUNT 200 /* 200ms */ @@ -667,8 +667,10 @@ vmbus_chan_wait_revoke(const struct vmbu for (i = 0; i < WAIT_COUNT; ++i) { if (vmbus_chan_is_revoked(chan)) return (true); - /* Not sure about the context; use busy-wait. */ - DELAY(1000); + if (can_sleep) + pause("wchrev", 1); + else + DELAY(1000); } return (false); @@ -705,7 +707,7 @@ vmbus_chan_gpadl_disconnect(struct vmbus if (error) { vmbus_msghc_put(sc, mh); - if (vmbus_chan_wait_revoke(chan)) { + if (vmbus_chan_wait_revoke(chan, true)) { /* * Error is benign; this channel is revoked, * so this GPADL will not be touched anymore. From owner-svn-src-head@freebsd.org Wed Dec 7 13:19:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36A4DC6B383; Wed, 7 Dec 2016 13:19:21 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 061DF7E1; Wed, 7 Dec 2016 13:19:20 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7DJK06070989; Wed, 7 Dec 2016 13:19:20 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7DJKvi070987; Wed, 7 Dec 2016 13:19:20 GMT (envelope-from br@FreeBSD.org) Message-Id: <201612071319.uB7DJKvi070987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 7 Dec 2016 13:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309673 - head/sys/dev/sound/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 13:19:21 -0000 Author: br Date: Wed Dec 7 13:19:19 2016 New Revision: 309673 URL: https://svnweb.freebsd.org/changeset/base/309673 Log: Style fix. Sponsored by: DARPA, AFRL Modified: head/sys/dev/sound/pci/hdspe-pcm.c head/sys/dev/sound/pci/hdspe.c Modified: head/sys/dev/sound/pci/hdspe-pcm.c ============================================================================== --- head/sys/dev/sound/pci/hdspe-pcm.c Wed Dec 7 09:40:06 2016 (r309672) +++ head/sys/dev/sound/pci/hdspe-pcm.c Wed Dec 7 13:19:19 2016 (r309673) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ruslan Bukin + * Copyright (c) 2012-2016 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,10 +83,14 @@ static int hdspe_hw_mixer(struct sc_chinfo *ch, unsigned int dst, unsigned int src, unsigned short data) { - struct sc_pcminfo *scp = ch->parent; - struct sc_info *sc = scp->sc; - int offs = 0; + struct sc_pcminfo *scp; + struct sc_info *sc; + int offs; + scp = ch->parent; + sc = scp->sc; + + offs = 0; if (ch->dir == PCMDIR_PLAY) offs = 64; @@ -94,7 +98,7 @@ hdspe_hw_mixer(struct sc_chinfo *ch, uns ((offs + src + 128 * dst) * sizeof(uint32_t)), data & 0xFFFF); - return 0; + return (0); }; static int @@ -106,18 +110,20 @@ hdspechan_setgain(struct sc_chinfo *ch) hdspe_hw_mixer(ch, ch->rslot, ch->rslot, ch->rvol * HDSPE_MAX_GAIN / 100); - return 0; + return (0); } static int hdspemixer_init(struct snd_mixer *m) { - struct sc_pcminfo *scp = mix_getdevinfo(m); - struct sc_info *sc = scp->sc; + struct sc_pcminfo *scp; + struct sc_info *sc; int mask; + scp = mix_getdevinfo(m); + sc = scp->sc; if (sc == NULL) - return -1; + return (-1); mask = SOUND_MASK_PCM; @@ -132,20 +138,22 @@ hdspemixer_init(struct snd_mixer *m) mix_setdevs(m, mask); snd_mtxunlock(sc->lock); - return 0; + return (0); } static int hdspemixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) { - struct sc_pcminfo *scp = mix_getdevinfo(m); + struct sc_pcminfo *scp; struct sc_chinfo *ch; int i; + scp = mix_getdevinfo(m); + #if 0 device_printf(scp->dev, "hdspemixer_set() %d %d\n", - left,right); + left, right); #endif for (i = 0; i < scp->chnum; i++) { @@ -159,7 +167,7 @@ hdspemixer_set(struct snd_mixer *m, unsi } } - return 0; + return (0); } static kobj_method_t hdspemixer_methods[] = { @@ -172,10 +180,13 @@ MIXER_DECLARE(hdspemixer); static void hdspechan_enable(struct sc_chinfo *ch, int value) { - struct sc_pcminfo *scp = ch->parent; - struct sc_info *sc = scp->sc; + struct sc_pcminfo *scp; + struct sc_info *sc; int reg; + scp = ch->parent; + sc = scp->sc; + if (ch->dir == PCMDIR_PLAY) reg = HDSPE_OUT_ENABLE_BASE; else @@ -192,8 +203,10 @@ hdspe_running(struct sc_info *sc) { struct sc_pcminfo *scp; struct sc_chinfo *ch; - int i, j, devcount, err; device_t *devlist; + int devcount; + int i, j; + int err; if ((err = device_get_children(sc->dev, &devlist, &devcount)) != 0) goto bad; @@ -208,15 +221,17 @@ hdspe_running(struct sc_info *sc) } free(devlist, M_TEMP); - return 0; + + return (0); bad: #if 0 - device_printf(sc->dev,"hdspe is running\n"); + device_printf(sc->dev, "hdspe is running\n"); #endif free(devlist, M_TEMP); - return 1; + + return (1); } static void @@ -242,12 +257,16 @@ hdspe_stop_audio(struct sc_info *sc) static void buffer_copy(struct sc_chinfo *ch) { - struct sc_pcminfo *scp = ch->parent; - struct sc_info *sc = scp->sc; - int length,src,dst; + struct sc_pcminfo *scp; + struct sc_info *sc; int ssize, dsize; + int src, dst; + int length; int i; + scp = ch->parent; + sc = scp->sc; + length = sndbuf_getready(ch->buffer) / (4 /* Bytes per sample. */ * 2 /* channels */); @@ -289,10 +308,15 @@ buffer_copy(struct sc_chinfo *ch) } static int -clean(struct sc_chinfo *ch){ - struct sc_pcminfo *scp = ch->parent; - struct sc_info *sc = scp->sc; - uint32_t *buf = sc->rbuf; +clean(struct sc_chinfo *ch) +{ + struct sc_pcminfo *scp; + struct sc_info *sc; + uint32_t *buf; + + scp = ch->parent; + sc = scp->sc; + buf = sc->rbuf; if (ch->dir == PCMDIR_PLAY) { buf = sc->pbuf; @@ -301,20 +325,23 @@ clean(struct sc_chinfo *ch){ bzero(buf + HDSPE_CHANBUF_SAMPLES * ch->lslot, HDSPE_CHANBUF_SIZE); bzero(buf + HDSPE_CHANBUF_SAMPLES * ch->rslot, HDSPE_CHANBUF_SIZE); - return 0; + return (0); } /* Channel interface. */ static void * hdspechan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, - struct pcm_channel *c, int dir) + struct pcm_channel *c, int dir) { - struct sc_pcminfo *scp = devinfo; - struct sc_info *sc = scp->sc; + struct sc_pcminfo *scp; struct sc_chinfo *ch; + struct sc_info *sc; int num; + scp = devinfo; + sc = scp->sc; + snd_mtxlock(sc->lock); num = scp->chnum; @@ -338,18 +365,22 @@ hdspechan_init(kobj_t obj, void *devinfo if (sndbuf_setup(ch->buffer, ch->data, ch->size) != 0) { device_printf(scp->dev, "Can't setup sndbuf.\n"); - return NULL; + return (NULL); } - return ch; + return (ch); } static int hdspechan_trigger(kobj_t obj, void *data, int go) { - struct sc_chinfo *ch = data; - struct sc_pcminfo *scp = ch->parent; - struct sc_info *sc = scp->sc; + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sc_info *sc; + + ch = data; + scp = ch->parent; + sc = scp->sc; snd_mtxlock(sc->lock); switch (go) { @@ -381,17 +412,21 @@ hdspechan_trigger(kobj_t obj, void *data snd_mtxunlock(sc->lock); - return 0; + return (0); } static uint32_t hdspechan_getptr(kobj_t obj, void *data) { - struct sc_chinfo *ch = data; - struct sc_pcminfo *scp = ch->parent; - struct sc_info *sc = scp->sc; + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sc_info *sc; uint32_t ret, pos; + ch = data; + scp = ch->parent; + sc = scp->sc; + snd_mtxlock(sc->lock); ret = hdspe_read_2(sc, HDSPE_STATUS_REG); snd_mtxunlock(sc->lock); @@ -399,19 +434,24 @@ hdspechan_getptr(kobj_t obj, void *data) pos = ret & HDSPE_BUF_POSITION_MASK; pos *= 2; /* Hardbuf twice bigger. */ - return pos; + return (pos); } static int hdspechan_free(kobj_t obj, void *data) { - struct sc_chinfo *ch = data; - struct sc_pcminfo *scp = ch->parent; - struct sc_info *sc = scp->sc; + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sc_info *sc; + + ch = data; + scp = ch->parent; + sc = scp->sc; #if 0 device_printf(scp->dev, "hdspechan_free()\n"); #endif + snd_mtxlock(sc->lock); if (ch->data != NULL) { free(ch->data, M_HDSPE); @@ -419,13 +459,15 @@ hdspechan_free(kobj_t obj, void *data) } snd_mtxunlock(sc->lock); - return 0; + return (0); } static int hdspechan_setformat(kobj_t obj, void *data, uint32_t format) { - struct sc_chinfo *ch = data; + struct sc_chinfo *ch; + + ch = data; #if 0 struct sc_pcminfo *scp = ch->parent; @@ -434,20 +476,25 @@ hdspechan_setformat(kobj_t obj, void *da ch->format = format; - return 0; + return (0); } static uint32_t hdspechan_setspeed(kobj_t obj, void *data, uint32_t speed) { - struct sc_chinfo *ch = data; - struct sc_pcminfo *scp = ch->parent; - struct sc_info *sc = scp->sc; - struct hdspe_rate *hr = NULL; + struct sc_pcminfo *scp; + struct hdspe_rate *hr; + struct sc_chinfo *ch; + struct sc_info *sc; long long period; int threshold; int i; + ch = data; + scp = ch->parent; + sc = scp->sc; + hr = NULL; + #if 0 device_printf(scp->dev, "hdspechan_setspeed(%d)\n", speed); #endif @@ -499,19 +546,25 @@ hdspechan_setspeed(kobj_t obj, void *dat sc->speed = hr->speed; end: - return sc->speed; + + return (sc->speed); } static uint32_t hdspechan_setblocksize(kobj_t obj, void *data, uint32_t blocksize) { - struct sc_chinfo *ch = data; - struct sc_pcminfo *scp = ch->parent; - struct sc_info *sc = scp->sc; - struct hdspe_latency *hl = NULL; + struct hdspe_latency *hl; + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sc_info *sc; int threshold; int i; + ch = data; + scp = ch->parent; + sc = scp->sc; + hl = NULL; + #if 0 device_printf(scp->dev, "hdspechan_setblocksize(%d)\n", blocksize); #endif @@ -558,7 +611,8 @@ hdspechan_setblocksize(kobj_t obj, void sndbuf_resize(ch->buffer, (HDSPE_CHANBUF_SIZE * 2) / (sc->period * 4), (sc->period * 4)); end: - return sndbuf_getblksz(ch->buffer); + + return (sndbuf_getblksz(ch->buffer)); } static uint32_t hdspe_rfmt[] = { @@ -578,15 +632,17 @@ static struct pcmchan_caps hdspe_pcaps = static struct pcmchan_caps * hdspechan_getcaps(kobj_t obj, void *data) { - struct sc_chinfo *ch = data; + struct sc_chinfo *ch; + + ch = data; #if 0 struct sc_pcminfo *scl = ch->parent; device_printf(scp->dev, "hdspechan_getcaps()\n"); #endif - return (ch->dir == PCMDIR_PLAY) ? - &hdspe_pcaps : &hdspe_rcaps; + return ((ch->dir == PCMDIR_PLAY) ? + &hdspe_pcaps : &hdspe_rcaps); } static kobj_method_t hdspechan_methods[] = { @@ -611,15 +667,18 @@ hdspe_pcm_probe(device_t dev) device_printf(dev,"hdspe_pcm_probe()\n"); #endif - return 0; + return (0); } static uint32_t -hdspe_pcm_intr(struct sc_pcminfo *scp) { +hdspe_pcm_intr(struct sc_pcminfo *scp) +{ struct sc_chinfo *ch; - struct sc_info *sc = scp->sc; + struct sc_info *sc; int i; + sc = scp->sc; + for (i = 0; i < scp->chnum; i++) { ch = &scp->chan[i]; snd_mtxunlock(sc->lock); @@ -627,14 +686,14 @@ hdspe_pcm_intr(struct sc_pcminfo *scp) { snd_mtxlock(sc->lock); } - return 0; + return (0); } static int hdspe_pcm_attach(device_t dev) { - struct sc_pcminfo *scp; char status[SND_STATUSLEN]; + struct sc_pcminfo *scp; char desc[64]; int i, err; @@ -654,7 +713,7 @@ hdspe_pcm_attach(device_t dev) err = pcm_register(dev, scp, scp->hc->play, scp->hc->rec); if (err) { device_printf(dev, "Can't register pcm.\n"); - return ENXIO; + return (ENXIO); } scp->chnum = 0; @@ -676,7 +735,7 @@ hdspe_pcm_attach(device_t dev) mixer_init(dev, &hdspemixer_class, scp); - return 0; + return (0); } static int @@ -687,10 +746,10 @@ hdspe_pcm_detach(device_t dev) err = pcm_unregister(dev); if (err) { device_printf(dev, "Can't unregister device.\n"); - return err; + return (err); } - return 0; + return (0); } static device_method_t hdspe_pcm_methods[] = { Modified: head/sys/dev/sound/pci/hdspe.c ============================================================================== --- head/sys/dev/sound/pci/hdspe.c Wed Dec 7 09:40:06 2016 (r309672) +++ head/sys/dev/sound/pci/hdspe.c Wed Dec 7 13:19:19 2016 (r309673) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ruslan Bukin + * Copyright (c) 2012-2016 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -87,11 +87,15 @@ static struct hdspe_channel chan_map_rd[ static void hdspe_intr(void *p) { - struct sc_info *sc = (struct sc_info *)p; struct sc_pcminfo *scp; + struct sc_info *sc; device_t *devlist; - int devcount, status; - int i, err; + int devcount; + int status; + int err; + int i; + + sc = (struct sc_info *)p; snd_mtxlock(sc->lock); @@ -116,8 +120,11 @@ hdspe_intr(void *p) static void hdspe_dmapsetmap(void *arg, bus_dma_segment_t *segs, int nseg, int error) { + struct sc_info *sc; + + sc = (struct sc_info *)arg; + #if 0 - struct sc_info *sc = (struct sc_info *)arg; device_printf(sc->dev, "hdspe_dmapsetmap()\n"); #endif } @@ -135,10 +142,10 @@ hdspe_alloc_resources(struct sc_info *sc device_printf(sc->dev, "Unable to map SYS_RES_MEMORY.\n"); return (ENXIO); } + sc->cst = rman_get_bustag(sc->cs); sc->csh = rman_get_bushandle(sc->cs); - /* Allocate interrupt resource. */ sc->irqid = 0; sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid, @@ -207,7 +214,7 @@ hdspe_alloc_resources(struct sc_info *sc static void hdspe_map_dmabuf(struct sc_info *sc) { - uint32_t paddr,raddr; + uint32_t paddr, raddr; int i; paddr = vtophys(sc->pbuf); @@ -232,10 +239,10 @@ hdspe_probe(device_t dev) switch (rev) { case PCI_REVISION_AIO: device_set_desc(dev, "RME HDSPe AIO"); - return 0; + return (0); case PCI_REVISION_RAYDAT: device_set_desc(dev, "RME HDSPe RayDAT"); - return 0; + return (0); } } @@ -277,15 +284,15 @@ hdspe_init(struct sc_info *sc) sc->settings_register = 0; hdspe_write_4(sc, HDSPE_SETTINGS_REG, sc->settings_register); - return 0; + return (0); } static int hdspe_attach(device_t dev) { - struct sc_info *sc; - struct sc_pcminfo *scp; struct hdspe_channel *chan_map; + struct sc_pcminfo *scp; + struct sc_info *sc; uint32_t rev; int i, err; @@ -310,18 +317,18 @@ hdspe_attach(device_t dev) chan_map = chan_map_rd; break; default: - return ENXIO; + return (ENXIO); } /* Allocate resources. */ err = hdspe_alloc_resources(sc); if (err) { device_printf(dev, "Unable to allocate system resources.\n"); - return ENXIO; + return (ENXIO); } if (hdspe_init(sc) != 0) - return ENXIO; + return (ENXIO); for (i = 0; i < HDSPE_MAX_CHANS && chan_map[i].descr != NULL; i++) { scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); @@ -356,7 +363,7 @@ hdspe_detach(device_t dev) sc = device_get_softc(dev); if (sc == NULL) { device_printf(dev,"Can't detach: softc is null.\n"); - return 0; + return (0); } err = device_delete_children(dev); @@ -376,7 +383,7 @@ hdspe_detach(device_t dev) if (sc->lock) snd_mtxfree(sc->lock); - return 0; + return (0); } static device_method_t hdspe_methods[] = { From owner-svn-src-head@freebsd.org Wed Dec 7 14:24:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A581BC6A9D4; Wed, 7 Dec 2016 14:24:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75368C25; Wed, 7 Dec 2016 14:24:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7EOrPa003993; Wed, 7 Dec 2016 14:24:53 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7EOrJk003991; Wed, 7 Dec 2016 14:24:53 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201612071424.uB7EOrJk003991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 7 Dec 2016 14:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309674 - in head/sys: conf dev/psci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 14:24:54 -0000 Author: andrew Date: Wed Dec 7 14:24:53 2016 New Revision: 309674 URL: https://svnweb.freebsd.org/changeset/base/309674 Log: Add ACPI support to the PSCI driver. This checks the Fixed ACPI Description Table to find if the hardware supports PSCI, and if so what method the kernel should use to interact with it. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files.arm64 head/sys/dev/psci/psci.c Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Dec 7 13:19:19 2016 (r309673) +++ head/sys/conf/files.arm64 Wed Dec 7 14:24:53 2016 (r309674) @@ -156,7 +156,7 @@ dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofwpci.c optional fdt pci dev/pci/pci_host_generic.c optional pci dev/pci/pci_host_generic_fdt.c optional pci fdt -dev/psci/psci.c optional psci fdt +dev/psci/psci.c optional psci dev/psci/psci_arm64.S optional psci dev/uart/uart_cpu_arm64.c optional uart dev/uart/uart_dev_pl011.c optional uart pl011 Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Wed Dec 7 13:19:19 2016 (r309673) +++ head/sys/dev/psci/psci.c Wed Dec 7 14:24:53 2016 (r309674) @@ -43,6 +43,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" +#include "opt_platform.h" + #include #include #include @@ -52,11 +55,19 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#ifdef DEV_ACPI +#include +#include +#endif +#ifdef FDT #include #include #include #include +#endif #include @@ -67,43 +78,60 @@ struct psci_softc { uint32_t psci_fnids[PSCI_FN_MAX]; }; +#ifdef FDT static int psci_v0_1_init(device_t dev); +#endif static int psci_v0_2_init(device_t dev); struct psci_softc *psci_softc = NULL; +#ifdef __arm__ +#define USE_ACPI 0 +#define USE_FDT 1 +#elif defined(__aarch64__) +#define USE_ACPI (arm64_bus_method == ARM64_BUS_ACPI) +#define USE_FDT (arm64_bus_method == ARM64_BUS_FDT) +#else +#error Unknown architecture +#endif + +#ifdef FDT static struct ofw_compat_data compat_data[] = { {"arm,psci-0.2", (uintptr_t)psci_v0_2_init}, {"arm,psci", (uintptr_t)psci_v0_1_init}, {NULL, 0} }; +#endif -static int psci_probe(device_t dev); -static int psci_attach(device_t dev); +static int psci_attach(device_t, psci_initfn_t); static void psci_shutdown(void *, int); -static device_method_t psci_methods[] = { - DEVMETHOD(device_probe, psci_probe), - DEVMETHOD(device_attach, psci_attach), +#ifdef FDT +static int psci_fdt_probe(device_t dev); +static int psci_fdt_attach(device_t dev); + +static device_method_t psci_fdt_methods[] = { + DEVMETHOD(device_probe, psci_fdt_probe), + DEVMETHOD(device_attach, psci_fdt_attach), DEVMETHOD_END }; -static driver_t psci_driver = { +static driver_t psci_fdt_driver = { "psci", - psci_methods, + psci_fdt_methods, sizeof(struct psci_softc), }; -static devclass_t psci_devclass; +static devclass_t psci_fdt_devclass; -EARLY_DRIVER_MODULE(psci, simplebus, psci_driver, psci_devclass, 0, 0, +EARLY_DRIVER_MODULE(psci, simplebus, psci_fdt_driver, psci_fdt_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); -EARLY_DRIVER_MODULE(psci, ofwbus, psci_driver, psci_devclass, 0, 0, +EARLY_DRIVER_MODULE(psci, ofwbus, psci_fdt_driver, psci_fdt_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); static psci_callfn_t -psci_get_callfn(phandle_t node) +psci_fdt_get_callfn(phandle_t node) { char method[16]; @@ -121,7 +149,7 @@ psci_get_callfn(phandle_t node) } static int -psci_probe(device_t dev) +psci_fdt_probe(device_t dev) { const struct ofw_compat_data *ocd; @@ -138,25 +166,144 @@ psci_probe(device_t dev) } static int -psci_attach(device_t dev) +psci_fdt_attach(device_t dev) { struct psci_softc *sc = device_get_softc(dev); const struct ofw_compat_data *ocd; psci_initfn_t psci_init; phandle_t node; - if (psci_softc != NULL) - return (ENXIO); - ocd = ofw_bus_search_compatible(dev, compat_data); psci_init = (psci_initfn_t)ocd->ocd_data; - KASSERT(psci_init != NULL, ("PSCI init function cannot be NULL")); node = ofw_bus_get_node(dev); - sc->psci_call = psci_get_callfn(node); + sc->psci_call = psci_fdt_get_callfn(node); + + return (psci_attach(dev, psci_init)); +} +#endif + +#ifdef DEV_ACPI +static void psci_acpi_identify(driver_t *, device_t); +static int psci_acpi_probe(device_t); +static int psci_acpi_attach(device_t); + +static device_method_t psci_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, psci_acpi_identify), + DEVMETHOD(device_probe, psci_acpi_probe), + DEVMETHOD(device_attach, psci_acpi_attach), + + DEVMETHOD_END +}; + +static driver_t psci_acpi_driver = { + "psci", + psci_acpi_methods, + sizeof(struct psci_softc), +}; + +static devclass_t psci_acpi_devclass; + +EARLY_DRIVER_MODULE(psci, acpi, psci_acpi_driver, psci_acpi_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); + +static int +psci_acpi_bootflags(void) +{ + ACPI_TABLE_FADT *fadt; + vm_paddr_t physaddr; + int flags; + + physaddr = acpi_find_table(ACPI_SIG_FADT); + if (physaddr == 0) + return (0); + + fadt = acpi_map_table(physaddr, ACPI_SIG_FADT); + if (fadt == NULL) { + printf("psci: Unable to map the FADT\n"); + return (0); + } + + flags = fadt->ArmBootFlags; + + acpi_unmap_table(fadt); + return (flags); +} + +static psci_callfn_t +psci_acpi_get_callfn(int flags) +{ + + if ((flags & ACPI_FADT_PSCI_COMPLIANT) != 0) { + if ((flags & ACPI_FADT_PSCI_USE_HVC) != 0) + return (psci_hvc_despatch); + else + return (psci_smc_despatch); + } else { + printf("psci: PSCI conduit not supplied in the device tree\n"); + } + + return (NULL); +} + +static void +psci_acpi_identify(driver_t *driver, device_t parent) +{ + device_t dev; + int flags; + + flags = psci_acpi_bootflags(); + if ((flags & ACPI_FADT_PSCI_COMPLIANT) != 0) { + dev = BUS_ADD_CHILD(parent, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST, "psci", -1); + + if (dev != NULL) + acpi_set_private(dev, (void *)(uintptr_t)flags); + } +} + +static int +psci_acpi_probe(device_t dev) +{ + uintptr_t flags; + + flags = (uintptr_t)acpi_get_private(dev); + if ((flags & ACPI_FADT_PSCI_COMPLIANT) == 0) + return (ENXIO); + + device_set_desc(dev, "ARM Power State Co-ordination Interface Driver"); + return (BUS_PROBE_SPECIFIC); +} + +static int +psci_acpi_attach(device_t dev) +{ + struct psci_softc *sc = device_get_softc(dev); + uintptr_t flags; + + flags = (uintptr_t)acpi_get_private(dev); + if ((flags & ACPI_FADT_PSCI_USE_HVC) != 0) + sc->psci_call = psci_hvc_despatch; + else + sc->psci_call = psci_smc_despatch; + + return (psci_attach(dev, psci_v0_2_init)); +} +#endif + +static int +psci_attach(device_t dev, psci_initfn_t psci_init) +{ + struct psci_softc *sc = device_get_softc(dev); + + if (psci_softc != NULL) + return (ENXIO); + if (sc->psci_call == NULL) return (ENXIO); + KASSERT(psci_init != NULL, ("PSCI init function cannot be NULL")); if (psci_init(dev)) return (ENXIO); @@ -178,21 +325,62 @@ psci_get_version(struct psci_softc *sc) return (PSCI_RETVAL_NOT_SUPPORTED); } +#ifdef FDT +static int +psci_fdt_callfn(psci_callfn_t *callfn) +{ + phandle_t node; + + node = ofw_bus_find_compatible(OF_peer(0), "arm,psci-0.2"); + if (node == 0) + /* TODO: Handle psci 0.1 */ + return (PSCI_MISSING); + + *callfn = psci_fdt_get_callfn(node); + return (0); +} +#endif + +#ifdef DEV_ACPI +static int +psci_acpi_callfn(psci_callfn_t *callfn) +{ + int flags; + + flags = psci_acpi_bootflags(); + if ((flags & ACPI_FADT_PSCI_COMPLIANT) == 0) + return (PSCI_MISSING); + + *callfn = psci_acpi_get_callfn(flags); + return (0); +} +#endif + int psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id) { psci_callfn_t callfn; - phandle_t node; uint32_t fnid; + int error; if (psci_softc == NULL) { - node = ofw_bus_find_compatible(OF_peer(0), "arm,psci-0.2"); - if (node == 0) - /* TODO: Handle psci 0.1 */ - return (PSCI_MISSING); - fnid = PSCI_FNID_CPU_ON; - callfn = psci_get_callfn(node); + callfn = NULL; +#ifdef FDT + if (USE_FDT) { + error = psci_fdt_callfn(&callfn); + if (error != 0) + return (error); + } +#endif +#ifdef DEV_ACPI + if (callfn == NULL && USE_ACPI) { + error = psci_acpi_callfn(&callfn); + if (error != 0) + return (error); + } +#endif + if (callfn == NULL) return (PSCI_MISSING); } else { @@ -209,6 +397,9 @@ psci_shutdown(void *xsc, int howto) { uint32_t fn = 0; + if (psci_softc == NULL) + return; + /* PSCI system_off and system_reset werent't supported in v0.1. */ if ((howto & RB_POWEROFF) != 0) fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_OFF]; @@ -221,6 +412,8 @@ psci_shutdown(void *xsc, int howto) /* System reset and off do not return. */ } +#ifdef FDT +/* Only support PSCI 0.1 on FDT */ static int psci_v0_1_init(device_t dev) { @@ -264,6 +457,7 @@ psci_v0_1_init(device_t dev) return(0); } +#endif static int psci_v0_2_init(device_t dev) From owner-svn-src-head@freebsd.org Wed Dec 7 14:35:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41A6AC6AE35; Wed, 7 Dec 2016 14:35:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C0EF1578; Wed, 7 Dec 2016 14:35:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7EZ5g2008250; Wed, 7 Dec 2016 14:35:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7EZ5qc008249; Wed, 7 Dec 2016 14:35:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201612071435.uB7EZ5qc008249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 7 Dec 2016 14:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309675 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 14:35:06 -0000 Author: andrew Date: Wed Dec 7 14:35:05 2016 New Revision: 309675 URL: https://svnweb.freebsd.org/changeset/base/309675 Log: Add ACPI support to the arm64 mp code. We use the Multiple APIC Description Table to find the CPUs to find the CPUs to start. Currently we assume PSCI, however this assumption is shared with the FDT code. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Wed Dec 7 14:24:53 2016 (r309674) +++ head/sys/arm64/arm64/mp_machdep.c Wed Dec 7 14:35:05 2016 (r309675) @@ -28,6 +28,7 @@ * */ +#include "opt_acpi.h" #include "opt_kstack_pages.h" #include "opt_platform.h" @@ -59,6 +60,11 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef DEV_ACPI +#include +#include +#endif + #ifdef FDT #include #include @@ -106,14 +112,12 @@ struct pcb stoppcbs[MAXCPU]; static device_t cpu_list[MAXCPU]; -#ifdef FDT /* * Not all systems boot from the first CPU in the device tree. To work around * this we need to find which CPU we have booted from so when we later * enable the secondary CPUs we skip this one. */ static int cpu0 = -1; -#endif void mpentry(unsigned long cpuid); void init_secondary(uint64_t); @@ -416,11 +420,9 @@ cpu_mp_probe(void) return (1); } -#ifdef FDT -static boolean_t -cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) +static bool +start_cpu(u_int id, uint64_t target_cpu) { - uint64_t target_cpu; struct pcpu *pcpup; vm_paddr_t pa; u_int cpuid; @@ -428,13 +430,13 @@ cpu_init_fdt(u_int id, phandle_t node, u /* Check we are able to start this cpu */ if (id > mp_maxid) - return (0); + return (false); KASSERT(id < MAXCPU, ("Too many CPUs")); /* We are already running on cpu 0 */ if (id == cpu0) - return (1); + return (true); /* * Rotate the CPU IDs to put the boot CPU as CPU 0. We keep the other @@ -454,12 +456,6 @@ cpu_init_fdt(u_int id, phandle_t node, u M_WAITOK | M_ZERO); dpcpu_init(dpcpu[cpuid - 1], cpuid); - target_cpu = reg[0]; - if (addr_size == 2) { - target_cpu <<= 32; - target_cpu |= reg[1]; - } - printf("Starting CPU %u (%lx)\n", cpuid, target_cpu); pa = pmap_extract(kernel_pmap, (vm_offset_t)mpentry); @@ -482,7 +478,67 @@ cpu_init_fdt(u_int id, phandle_t node, u } else CPU_SET(cpuid, &all_cpus); - return (1); + return (true); +} + +#ifdef DEV_ACPI +static void +madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) +{ + ACPI_MADT_GENERIC_INTERRUPT *intr; + u_int *cpuid; + + switch(entry->Type) { + case ACPI_MADT_TYPE_GENERIC_INTERRUPT: + intr = (ACPI_MADT_GENERIC_INTERRUPT *)entry; + cpuid = arg; + + start_cpu((*cpuid), intr->ArmMpidr); + (*cpuid)++; + break; + default: + break; + } +} + +static void +cpu_init_acpi(void) +{ + ACPI_TABLE_MADT *madt; + vm_paddr_t physaddr; + u_int cpuid; + + physaddr = acpi_find_table(ACPI_SIG_MADT); + if (physaddr == 0) + return; + + madt = acpi_map_table(physaddr, ACPI_SIG_MADT); + if (madt == NULL) { + printf("Unable to map the MADT, not starting APs\n"); + return; + } + + cpuid = 0; + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + madt_handler, &cpuid); + + acpi_unmap_table(madt); +} +#endif + +#ifdef FDT +static boolean_t +cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) +{ + uint64_t target_cpu; + + target_cpu = reg[0]; + if (addr_size == 2) { + target_cpu <<= 32; + target_cpu |= reg[1]; + } + + return (start_cpu(id, target_cpu) ? TRUE : FALSE); } #endif @@ -496,6 +552,12 @@ cpu_mp_start(void) CPU_SET(0, &all_cpus); switch(arm64_bus_method) { +#ifdef DEV_ACPI + case ARM64_BUS_ACPI: + KASSERT(cpu0 >= 0, ("Current CPU was not found")); + cpu_init_acpi(); + break; +#endif #ifdef FDT case ARM64_BUS_FDT: KASSERT(cpu0 >= 0, ("Current CPU was not found")); @@ -513,6 +575,56 @@ cpu_mp_announce(void) { } +#ifdef DEV_ACPI +static void +cpu_count_acpi_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) +{ + ACPI_MADT_GENERIC_INTERRUPT *intr; + u_int *cores = arg; + uint64_t mpidr_reg; + + switch(entry->Type) { + case ACPI_MADT_TYPE_GENERIC_INTERRUPT: + intr = (ACPI_MADT_GENERIC_INTERRUPT *)entry; + if (cpu0 < 0) { + mpidr_reg = READ_SPECIALREG(mpidr_el1); + if ((mpidr_reg & 0xff00fffffful) == intr->ArmMpidr) + cpu0 = *cores; + } + (*cores)++; + break; + default: + break; + } +} + +static u_int +cpu_count_acpi(void) +{ + ACPI_TABLE_MADT *madt; + vm_paddr_t physaddr; + u_int cores; + + physaddr = acpi_find_table(ACPI_SIG_MADT); + if (physaddr == 0) + return (0); + + madt = acpi_map_table(physaddr, ACPI_SIG_MADT); + if (madt == NULL) { + printf("Unable to map the MADT, not starting APs\n"); + return (0); + } + + cores = 0; + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + cpu_count_acpi_handler, &cores); + + acpi_unmap_table(madt); + + return (cores); +} +#endif + #ifdef FDT static boolean_t cpu_find_cpu0_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) @@ -539,10 +651,27 @@ cpu_find_cpu0_fdt(u_int id, phandle_t no void cpu_mp_setmaxid(void) { -#ifdef FDT +#if defined(DEV_ACPI) || defined(FDT) int cores; +#endif - if (arm64_bus_method == ARM64_BUS_FDT) { + switch(arm64_bus_method) { +#ifdef DEV_ACPI + case ARM64_BUS_ACPI: + cores = cpu_count_acpi(); + if (cores > 0) { + cores = MIN(cores, MAXCPU); + if (bootverbose) + printf("Found %d CPUs in the ACPI tables\n", + cores); + mp_ncpus = cores; + mp_maxid = cores - 1; + return; + } + break; +#endif +#ifdef FDT + case ARM64_BUS_FDT: cores = ofw_cpu_early_foreach(cpu_find_cpu0_fdt, false); if (cores > 0) { cores = MIN(cores, MAXCPU); @@ -553,8 +682,11 @@ cpu_mp_setmaxid(void) mp_maxid = cores - 1; return; } - } + break; #endif + default: + break; + } if (bootverbose) printf("No CPU data, limiting to 1 core\n"); From owner-svn-src-head@freebsd.org Wed Dec 7 14:43:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E0BEC6B399 for ; Wed, 7 Dec 2016 14:43:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 140E11C06 for ; Wed, 7 Dec 2016 14:43:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x230.google.com with SMTP id p16so379050738qta.0 for ; Wed, 07 Dec 2016 06:43:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5FkVwb/hYsVWEAxiAffFxWDEEBoQtAWtg+XA3AHhGSM=; b=Nk8i58Hy4GeDm691nLZHD5zkc2uuvZ6jQAHyndZyV4xdBKdTmnTQQ8yaRXVVHlIyHL 9TLYeDXl0t15FO8u3wigi/oP2PjfB2qp8CACIl2mWUVxZcICo1NjG7oRCBD4zJxio1xI c09ATywCxTd+WbVB6zCYT6ClrgOvm//MnbMAoKw0vo7EAJH/Q/Y4rcs9I7rbYW6618Pi CplR+62Wdt6s1MT1vlzpDQAVRo0DHHVizQh9VRMiZq5rHxRuoKo2T3Zdyvtw0HoV8GwM nQag7tmWWn3mRb+R5iG/P+hut+FtX667hSv8BsQoFhhL4s6L3K39wZfv/lQ8ip0MU6SE 1H6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5FkVwb/hYsVWEAxiAffFxWDEEBoQtAWtg+XA3AHhGSM=; b=h0/h/1nLHvp3P57nqVb8Lc+D8uoSTnRAK8RUSLlWJAL1OXs4lqZGRuIA/TH0o+TDv/ Q8ht9/WEZ223tYB4VHmLLuhuCXqDklwhqrBTs8Tdx628GiKOD9ZrQswF6OBx8WIv65yc oeruv4JkqOUa4p9xWADFAvJtDtP3bjEYRin6Xj6ndSA8/THDhI7k3eijEEnQKMR+FJCS vfMZj9QgqIdrHf9F5u76zjckwJKzYtF/u8tsUW5cNYJbhaIRjEqBktuup+4TfWJSKALQ HXH+POwOe6a8jnXUdoy/5IRUXY3F25JvwqgcdMXUkOa52ix4Nl0luzyVbMRiT81d3LlY Yuow== X-Gm-Message-State: AKaTC03tU7l5yT3QgnQ3Qb/CH2nFTmJ8bb+tjmYlvAlTagJQXDCzPc9VI8z59NTJpb961oEK X-Received: by 10.200.40.55 with SMTP id 52mr69230465qtq.283.1481121800048; Wed, 07 Dec 2016 06:43:20 -0800 (PST) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id i187sm4213880qkd.20.2016.12.07.06.43.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Dec 2016 06:43:18 -0800 (PST) Date: Wed, 7 Dec 2016 09:43:17 -0500 From: Shawn Webb To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309639 - head/lib/libc/net Message-ID: <20161207144317.GB29174@mutt-hardenedbsd> References: <201612061850.uB6IoY1U017268@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Bn2rw/3z4jIqBvZU" Content-Disposition: inline In-Reply-To: <201612061850.uB6IoY1U017268@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 14:43:21 -0000 --Bn2rw/3z4jIqBvZU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 06, 2016 at 06:50:34PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Dec 6 18:50:33 2016 > New Revision: 309639 > URL: https://svnweb.freebsd.org/changeset/base/309639 >=20 > Log: > Fix possible buffer overflow(s) in link_ntoa(3). > =20 > A specially crafted sockaddr_dl argument can trigger a static buffer ov= erflow > in the libc library, with possibility to rewrite with arbitrary data fo= llowing > static buffers that belong to other library functions. > =20 > Reviewed by: kib > Security: FreeBSD-SA-16:37.libc >=20 > Modified: > head/lib/libc/net/linkaddr.c >=20 > Modified: head/lib/libc/net/linkaddr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/net/linkaddr.c Tue Dec 6 18:50:22 2016 (r309638) > +++ head/lib/libc/net/linkaddr.c Tue Dec 6 18:50:33 2016 (r309639) > @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); > =20 > #include > #include > +#include > #include > #include > =20 > @@ -122,31 +123,47 @@ char * > link_ntoa(const struct sockaddr_dl *sdl) > { > static char obuf[64]; > - char *out =3D obuf; > - int i; > - u_char *in =3D (u_char *)LLADDR(sdl); > - u_char *inlim =3D in + sdl->sdl_alen; > - int firsttime =3D 1; > - > - if (sdl->sdl_nlen) { > - bcopy(sdl->sdl_data, obuf, sdl->sdl_nlen); > - out +=3D sdl->sdl_nlen; > - if (sdl->sdl_alen) > + _Static_assert(sizeof(obuf) >=3D IFNAMSIZ + 20, "obuf is too small"); > + char *out; > + const char *in, *inlim; > + int namelen, i, rem; > + > + namelen =3D (sdl->sdl_nlen <=3D IFNAMSIZ) ? sdl->sdl_nlen : IFNAMSIZ; > + > + out =3D obuf; > + rem =3D sizeof(obuf); > + if (namelen > 0) { > + bcopy(sdl->sdl_data, out, namelen); > + out +=3D namelen; > + rem -=3D namelen; > + if (sdl->sdl_alen > 0) { > *out++ =3D ':'; > + rem--; > + } > } > - while (in < inlim) { > - if (firsttime) > - firsttime =3D 0; > - else > + > + in =3D (const char *)sdl->sdl_data + sdl->sdl_nlen; > + inlim =3D in + sdl->sdl_alen; > + > + while (in < inlim && rem > 1) { > + if (in !=3D (const char *)sdl->sdl_data + sdl->sdl_nlen) { > *out++ =3D '.'; > + rem--; > + } > i =3D *in++; > if (i > 0xf) { > - out[1] =3D hexlist[i & 0xf]; > + if (rem < 3) > + break; > + *out++ =3D hexlist[i & 0xf]; > i >>=3D 4; > - out[0] =3D hexlist[i]; > - out +=3D 2; > - } else > *out++ =3D hexlist[i]; > + rem -=3D 2; > + } else { > + if (rem < 2) > + break; > + *out++ =3D hexlist[i]; > + rem++; rem++ is incorrect. It should be rem--. HardenedBSD has a fix here: https://github.com/HardenedBSD/hardenedBSD/commit/fb823297fbced336b6beeeb62= 4e2dc65b67aa0eb > + } > } > *out =3D 0; > return (obuf); Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --Bn2rw/3z4jIqBvZU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYSCACAAoJEGqEZY9SRW7u2HIQAJhX8ipRbKj519S+YzM8qe8s 0TU2Me3OVjYzH74DQm5OeS8y67G/mx4cjdwtUeSG59fUCT/Q7hXcGLeo3MV9BUAI md/VWhD8e/0cvPC+CctbOHPrrTjOEtydjAF6Xx2osme5XLFFRiq4kw1bUq0KrupI Ql/ILSktviMk8hyqgp+UgKZXytREQMn7nvPPXqdvduEEHr//Pj30sAD9FofFCuUE B4MzCpKpRL14HL5GYv1ocOrPpKBG2rjF7q/nN3o3YO/kKKATa9o7iPyw0l6WMJC9 a39fC107vRwvkPoENApLsXhQv2Gcsh0jSMfnaFGw3BQw7UmFCeSqEoff20gCEp7r ye4T0LARICm86SS5qSgPugMgiYNoCESKbiark06LlhNRrCelmXXuRKC1OwvJkRB5 V4beg2rfrmz9z5xyyfDoLbohn1gLcmwKqBLn8D5Du8ERX0RrYOHzFQLu50RUcXXy gOV9cfzA7vUfpPS72YEqDcRbj7zBtfxLLyCM0e5Q+AagsM7MilUG2VWjpYg6FWuN lUhNwwwTU/qwXXGvZaiaxauE3b8kqzPMYOg7CQMdqQKHL3uBp35YlaKTLgFYHJ1P 0veh56TSIEstWnYD36ekvyACUJ2rytwpI32Sn2Z4rgIyUN2Bnn+qnbgtHWnqpt3h hZAOl/J1yH17uQD7Z36c =Bnls -----END PGP SIGNATURE----- --Bn2rw/3z4jIqBvZU-- From owner-svn-src-head@freebsd.org Wed Dec 7 15:04:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D06BC6B98F; Wed, 7 Dec 2016 15:04:25 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CF328789; Wed, 7 Dec 2016 15:04:24 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7F4OR1020394; Wed, 7 Dec 2016 15:04:24 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7F4MCi020382; Wed, 7 Dec 2016 15:04:22 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201612071504.uB7F4MCi020382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 7 Dec 2016 15:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309676 - in head: bin/ps lib/libkvm sys/compat/freebsd32 sys/kern sys/sys usr.bin/procstat usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 15:04:25 -0000 Author: vangyzen Date: Wed Dec 7 15:04:22 2016 New Revision: 309676 URL: https://svnweb.freebsd.org/changeset/base/309676 Log: Export the whole thread name in kinfo_proc kinfo_proc::ki_tdname is three characters shorter than thread::td_name. Add a ki_moretdname field for these three extra characters. Add the new field to kinfo_proc32, as well. Update all in-tree consumers to read the new field and assemble the full name, except for lldb's HostThreadFreeBSD.cpp, which I will handle separately. Bump __FreeBSD_version. Reviewed by: kib MFC after: 1 week Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D8722 Modified: head/bin/ps/print.c head/lib/libkvm/kvm_proc.c head/sys/compat/freebsd32/freebsd32.h head/sys/kern/kern_proc.c head/sys/sys/param.h head/sys/sys/user.h head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_cs.c head/usr.bin/procstat/procstat_kstack.c head/usr.bin/procstat/procstat_threads.c head/usr.bin/top/machine.c Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Wed Dec 7 14:35:05 2016 (r309675) +++ head/bin/ps/print.c Wed Dec 7 15:04:22 2016 (r309676) @@ -120,11 +120,12 @@ command(KINFO *k, VARENT *ve) if (cflag) { /* If it is the last field, then don't pad */ if (STAILQ_NEXT(ve, next_ve) == NULL) { - asprintf(&str, "%s%s%s%s", + asprintf(&str, "%s%s%s%s%s", k->ki_d.prefix ? k->ki_d.prefix : "", k->ki_p->ki_comm, (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", - (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "", + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : ""); } else str = strdup(k->ki_p->ki_comm); @@ -172,14 +173,16 @@ ucomm(KINFO *k, VARENT *ve) char *str; if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field, don't pad */ - asprintf(&str, "%s%s%s%s", + asprintf(&str, "%s%s%s%s%s", k->ki_d.prefix ? k->ki_d.prefix : "", k->ki_p->ki_comm, (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", - (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "", + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : ""); } else { if (showthreads && k->ki_p->ki_numthreads > 1) - asprintf(&str, "%s/%s", k->ki_p->ki_comm, k->ki_p->ki_tdname); + asprintf(&str, "%s/%s%s", k->ki_p->ki_comm, + k->ki_p->ki_tdname, k->ki_p->ki_moretdname); else str = strdup(k->ki_p->ki_comm); } @@ -192,7 +195,8 @@ tdnam(KINFO *k, VARENT *ve __unused) char *str; if (showthreads && k->ki_p->ki_numthreads > 1) - str = strdup(k->ki_p->ki_tdname); + asprintf(&str, "%s%s", k->ki_p->ki_tdname, + k->ki_p->ki_moretdname); else str = strdup(" "); Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Wed Dec 7 14:35:05 2016 (r309675) +++ head/lib/libkvm/kvm_proc.c Wed Dec 7 15:04:22 2016 (r309676) @@ -426,8 +426,6 @@ nopgrp: kp->ki_pri.pri_native = mtd.td_base_pri; kp->ki_lastcpu = mtd.td_lastcpu; kp->ki_wchan = mtd.td_wchan; - if (mtd.td_name[0] != 0) - strlcpy(kp->ki_tdname, mtd.td_name, MAXCOMLEN); kp->ki_oncpu = mtd.td_oncpu; if (mtd.td_name[0] != '\0') strlcpy(kp->ki_tdname, mtd.td_name, sizeof(kp->ki_tdname)); Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Wed Dec 7 14:35:05 2016 (r309675) +++ head/sys/compat/freebsd32/freebsd32.h Wed Dec 7 15:04:22 2016 (r309676) @@ -315,7 +315,8 @@ struct kinfo_proc32 { char ki_comm[COMMLEN+1]; char ki_emul[KI_EMULNAMELEN+1]; char ki_loginclass[LOGINCLASSLEN+1]; - char ki_sparestrings[50]; + char ki_moretdname[MAXCOMLEN-TDNAMLEN+1]; + char ki_sparestrings[46]; int ki_spareints[KI_NSPARE_INT]; int ki_oncpu; int ki_lastcpu; Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Dec 7 14:35:05 2016 (r309675) +++ head/sys/kern/kern_proc.c Wed Dec 7 15:04:22 2016 (r309676) @@ -1020,7 +1020,14 @@ fill_kinfo_thread(struct thread *td, str strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg)); else bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg)); - strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname)); + if (strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname)) >= + sizeof(kp->ki_tdname)) { + strlcpy(kp->ki_moretdname, + td->td_name + sizeof(kp->ki_tdname) - 1, + sizeof(kp->ki_moretdname)); + } else { + bzero(kp->ki_moretdname, sizeof(kp->ki_moretdname)); + } if (TD_ON_LOCK(td)) { kp->ki_kiflag |= KI_LOCKBLOCK; strlcpy(kp->ki_lockname, td->td_lockname, @@ -1265,6 +1272,7 @@ freebsd32_kinfo_proc_out(const struct ki bcopy(ki->ki_comm, ki32->ki_comm, COMMLEN + 1); bcopy(ki->ki_emul, ki32->ki_emul, KI_EMULNAMELEN + 1); bcopy(ki->ki_loginclass, ki32->ki_loginclass, LOGINCLASSLEN + 1); + bcopy(ki->ki_moretdname, ki32->ki_moretdname, MAXCOMLEN - TDNAMLEN + 1); CP(*ki, *ki32, ki_tracer); CP(*ki, *ki32, ki_flag2); CP(*ki, *ki32, ki_fibnum); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Dec 7 14:35:05 2016 (r309675) +++ head/sys/sys/param.h Wed Dec 7 15:04:22 2016 (r309676) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200017 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200018 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Wed Dec 7 14:35:05 2016 (r309675) +++ head/sys/sys/user.h Wed Dec 7 15:04:22 2016 (r309676) @@ -180,12 +180,13 @@ struct kinfo_proc { char ki_comm[COMMLEN+1]; /* command name */ char ki_emul[KI_EMULNAMELEN+1]; /* emulation name */ char ki_loginclass[LOGINCLASSLEN+1]; /* login class */ + char ki_moretdname[MAXCOMLEN-TDNAMLEN+1]; /* more thread name */ /* * When adding new variables, take space for char-strings from the * front of ki_sparestrings, and ints from the end of ki_spareints. * That way the spare room from both arrays will remain contiguous. */ - char ki_sparestrings[50]; /* spare string space */ + char ki_sparestrings[46]; /* spare string space */ int ki_spareints[KI_NSPARE_INT]; /* spare room for growth */ int ki_oncpu; /* Which cpu we are on */ int ki_lastcpu; /* Last cpu we were on */ Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Wed Dec 7 14:35:05 2016 (r309675) +++ head/usr.bin/procstat/procstat.c Wed Dec 7 15:04:22 2016 (r309676) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -126,6 +127,21 @@ kinfo_proc_sort(struct kinfo_proc *kipp, qsort(kipp, count, sizeof(*kipp), kinfo_proc_compare); } +const char * +kinfo_proc_thread_name(const struct kinfo_proc *kipp) +{ + static char name[MAXCOMLEN+1]; + + strlcpy(name, kipp->ki_tdname, sizeof(name)); + strlcat(name, kipp->ki_moretdname, sizeof(name)); + if (name[0] == '\0' || strcmp(kipp->ki_comm, name) == 0) { + name[0] = '-'; + name[1] = '\0'; + } + + return (name); +} + int main(int argc, char *argv[]) { Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Wed Dec 7 14:35:05 2016 (r309675) +++ head/usr.bin/procstat/procstat.h Wed Dec 7 15:04:22 2016 (r309676) @@ -38,6 +38,7 @@ extern int hflag, nflag, Cflag, Hflag; struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); +const char * kinfo_proc_thread_name(const struct kinfo_proc *kipp); void procstat_args(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_auxv(struct procstat *prstat, struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_cs.c ============================================================================== --- head/usr.bin/procstat/procstat_cs.c Wed Dec 7 14:35:05 2016 (r309675) +++ head/usr.bin/procstat/procstat_cs.c Wed Dec 7 15:04:22 2016 (r309676) @@ -53,7 +53,7 @@ procstat_cs(struct procstat *procstat, s int once, twice, lastcpu, cpu; if (!hflag) - xo_emit("{T:/%5s %6s %-16s %-16s %2s %4s %-7s}\n", "PID", + xo_emit("{T:/%5s %6s %-19s %-19s %2s %4s %-7s}\n", "PID", "TID", "COMM", "TDNAME", "CPU", "CSID", "CPU MASK"); kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, @@ -65,11 +65,10 @@ procstat_cs(struct procstat *procstat, s kipp = &kip[i]; xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); xo_emit("{:thread_id/%6d/%d} ", kipp->ki_tid); - xo_emit("{:command/%-16s/%s} ", strlen(kipp->ki_comm) ? + xo_emit("{:command/%-19s/%s} ", strlen(kipp->ki_comm) ? kipp->ki_comm : "-"); - xo_emit("{:thread_name/%-16s/%s} ", (strlen(kipp->ki_tdname) && - (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? - kipp->ki_tdname : "-"); + xo_emit("{:thread_name/%-19s/%s} ", + kinfo_proc_thread_name(kipp)); if (kipp->ki_oncpu != 255) xo_emit("{:cpu/%3d/%d} ", kipp->ki_oncpu); else if (kipp->ki_lastcpu != 255) Modified: head/usr.bin/procstat/procstat_kstack.c ============================================================================== --- head/usr.bin/procstat/procstat_kstack.c Wed Dec 7 14:35:05 2016 (r309675) +++ head/usr.bin/procstat/procstat_kstack.c Wed Dec 7 15:04:22 2016 (r309676) @@ -171,7 +171,7 @@ procstat_kstack(struct procstat *procsta unsigned int kip_count, kstk_count; if (!hflag) - xo_emit("{T:/%5s %6s %-16s %-16s %-29s}\n", "PID", "TID", "COMM", + xo_emit("{T:/%5s %6s %-19s %-19s %-29s}\n", "PID", "TID", "COMM", "TDNAME", "KSTACK"); kkstp = kkstp_free = procstat_getkstack(procstat, kipp, &kstk_count); @@ -208,10 +208,9 @@ procstat_kstack(struct procstat *procsta xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); xo_emit("{:thread_id/%6d/%d} ", kkstp->kkst_tid); - xo_emit("{:command/%-16s/%s} ", kipp->ki_comm); - xo_emit("{:thread_name/%-16s/%s} ", (strlen(kipp->ki_tdname) && - (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? - kipp->ki_tdname : "-"); + xo_emit("{:command/%-19s/%s} ", kipp->ki_comm); + xo_emit("{:thread_name/%-19s/%s} ", + kinfo_proc_thread_name(kipp)); switch (kkstp->kkst_state) { case KKST_STATE_RUNNING: Modified: head/usr.bin/procstat/procstat_threads.c ============================================================================== --- head/usr.bin/procstat/procstat_threads.c Wed Dec 7 14:35:05 2016 (r309675) +++ head/usr.bin/procstat/procstat_threads.c Wed Dec 7 15:04:22 2016 (r309676) @@ -49,7 +49,7 @@ procstat_threads(struct procstat *procst char *threadid; if (!hflag) - xo_emit("{T:/%5s %6s %-16s %-16s %2s %4s %-7s %-9s}\n", "PID", + xo_emit("{T:/%5s %6s %-19s %-19s %2s %4s %-7s %-9s}\n", "PID", "TID", "COMM", "TDNAME", "CPU", "PRI", "STATE", "WCHAN"); xo_emit("{ek:process_id/%d}", kipp->ki_pid); @@ -71,11 +71,10 @@ procstat_threads(struct procstat *procst xo_open_container(threadid); xo_emit("{dk:process_id/%5d/%d} ", kipp->ki_pid); xo_emit("{:thread_id/%6d/%d} ", kipp->ki_tid); - xo_emit("{d:command/%-16s/%s} ", strlen(kipp->ki_comm) ? + xo_emit("{d:command/%-19s/%s} ", strlen(kipp->ki_comm) ? kipp->ki_comm : "-"); - xo_emit("{:thread_name/%-16s/%s} ", (strlen(kipp->ki_tdname) && - (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? - kipp->ki_tdname : "-"); + xo_emit("{:thread_name/%-19s/%s} ", + kinfo_proc_thread_name(kipp)); if (kipp->ki_oncpu != 255) xo_emit("{:cpu/%3d/%d} ", kipp->ki_oncpu); else if (kipp->ki_lastcpu != 255) Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Dec 7 14:35:05 2016 (r309675) +++ head/usr.bin/top/machine.c Wed Dec 7 15:04:22 2016 (r309676) @@ -991,8 +991,8 @@ format_next_process(caddr_t handle, char if (!(flags & FMT_SHOWARGS)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { - snprintf(cmdbuf, cmdlen, "%s{%s}", pp->ki_comm, - pp->ki_tdname); + snprintf(cmdbuf, cmdlen, "%s{%s%s}", pp->ki_comm, + pp->ki_tdname, pp->ki_moretdname); } else { snprintf(cmdbuf, cmdlen, "%s", pp->ki_comm); } @@ -1004,7 +1004,8 @@ format_next_process(caddr_t handle, char if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { snprintf(cmdbuf, cmdlen, - "[%s{%s}]", pp->ki_comm, pp->ki_tdname); + "[%s{%s%s}]", pp->ki_comm, pp->ki_tdname, + pp->ki_moretdname); } else { snprintf(cmdbuf, cmdlen, "[%s]", pp->ki_comm); @@ -1052,8 +1053,9 @@ format_next_process(caddr_t handle, char if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) snprintf(cmdbuf, cmdlen, - "%s (%s){%s}", argbuf, pp->ki_comm, - pp->ki_tdname); + "%s (%s){%s%s}", argbuf, + pp->ki_comm, pp->ki_tdname, + pp->ki_moretdname); else snprintf(cmdbuf, cmdlen, "%s (%s)", argbuf, pp->ki_comm); @@ -1061,7 +1063,8 @@ format_next_process(caddr_t handle, char if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) snprintf(cmdbuf, cmdlen, - "%s{%s}", argbuf, pp->ki_tdname); + "%s{%s%s}", argbuf, pp->ki_tdname, + pp->ki_moretdname); else strlcpy(cmdbuf, argbuf, cmdlen); } From owner-svn-src-head@freebsd.org Wed Dec 7 16:11:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD091C6BE88; Wed, 7 Dec 2016 16:11:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BECCA21; Wed, 7 Dec 2016 16:11:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7GBti3046346; Wed, 7 Dec 2016 16:11:55 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7GBtDE046345; Wed, 7 Dec 2016 16:11:55 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201612071611.uB7GBtDE046345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Wed, 7 Dec 2016 16:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309677 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 16:11:56 -0000 Author: rwatson Date: Wed Dec 7 16:11:55 2016 New Revision: 309677 URL: https://svnweb.freebsd.org/changeset/base/309677 Log: Replace spaces with tabs in definition of SCTP system calls, for consistency with the remainder of the syscalls.master file. This problem does not occur in the freebsd32 version of the same system calls. Modified: head/sys/kern/syscalls.master Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Dec 7 15:04:22 2016 (r309676) +++ head/sys/kern/syscalls.master Wed Dec 7 16:11:55 2016 (r309677) @@ -838,13 +838,13 @@ 469 AUE_NULL UNIMPL __getpath_fromfd 470 AUE_NULL UNIMPL __getpath_fromaddr 471 AUE_NULL NOSTD { int sctp_peeloff(int sd, uint32_t name); } -472 AUE_NULL NOSTD { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ - caddr_t to, __socklen_t tolen, \ +472 AUE_NULL NOSTD { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ + caddr_t to, __socklen_t tolen, \ struct sctp_sndrcvinfo *sinfo, int flags); } -473 AUE_NULL NOSTD { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ - caddr_t to, __socklen_t tolen, \ +473 AUE_NULL NOSTD { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ + caddr_t to, __socklen_t tolen, \ struct sctp_sndrcvinfo *sinfo, int flags); } -474 AUE_NULL NOSTD { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ +474 AUE_NULL NOSTD { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ struct sockaddr * from, __socklen_t *fromlenaddr, \ struct sctp_sndrcvinfo *sinfo, int *msg_flags); } 475 AUE_PREAD STD { ssize_t pread(int fd, void *buf, \ From owner-svn-src-head@freebsd.org Wed Dec 7 16:12:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77CA0C6BF47; Wed, 7 Dec 2016 16:12:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38DA5C1B; Wed, 7 Dec 2016 16:12:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7GCSAI048683; Wed, 7 Dec 2016 16:12:28 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7GCR9L048678; Wed, 7 Dec 2016 16:12:27 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201612071612.uB7GCR9L048678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Wed, 7 Dec 2016 16:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309678 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 16:12:29 -0000 Author: rwatson Date: Wed Dec 7 16:12:27 2016 New Revision: 309678 URL: https://svnweb.freebsd.org/changeset/base/309678 Log: Regnerate system-call definitions following r309677 correcting a whitespace glitch in syscalls.master. Modified: head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed Dec 7 16:11:55 2016 (r309677) +++ head/sys/kern/init_sysent.c Wed Dec 7 16:12:27 2016 (r309678) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn + * created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson */ #include "opt_compat.h" Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Wed Dec 7 16:11:55 2016 (r309677) +++ head/sys/kern/syscalls.c Wed Dec 7 16:12:27 2016 (r309678) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn + * created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson */ const char *syscallnames[] = { Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Wed Dec 7 16:11:55 2016 (r309677) +++ head/sys/sys/syscall.h Wed Dec 7 16:12:27 2016 (r309678) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn + * created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson */ #define SYS_syscall 0 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Wed Dec 7 16:11:55 2016 (r309677) +++ head/sys/sys/syscall.mk Wed Dec 7 16:12:27 2016 (r309678) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn +# created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson MIASM = \ syscall.o \ exit.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Dec 7 16:11:55 2016 (r309677) +++ head/sys/sys/sysproto.h Wed Dec 7 16:12:27 2016 (r309678) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn + * created from FreeBSD: head/sys/kern/syscalls.master 309677 2016-12-07 16:11:55Z rwatson */ #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-head@freebsd.org Wed Dec 7 18:33:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CD84C6CB82; Wed, 7 Dec 2016 18:33:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C01A1F85; Wed, 7 Dec 2016 18:33:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7IXeAf006685; Wed, 7 Dec 2016 18:33:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7IXeCO006684; Wed, 7 Dec 2016 18:33:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201612071833.uB7IXeCO006684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 7 Dec 2016 18:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309679 - head/contrib/elftoolchain/readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 18:33:41 -0000 Author: cem Date: Wed Dec 7 18:33:40 2016 New Revision: 309679 URL: https://svnweb.freebsd.org/changeset/base/309679 Log: readelf(1) -S: Include zero index and match binutils' no-name Include the SHN_UNDEF (zero) index special section in extended-attribute ELF files, like GNU binutils' readelf. Additionally, print "" for sections without names, like GNU binutils. Reviewed by: kaiw@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8707 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Dec 7 16:12:27 2016 (r309678) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Dec 7 18:33:40 2016 (r309679) @@ -6557,13 +6557,14 @@ load_sections(struct readelf *re) } if ((name = elf_strptr(re->elf, shstrndx, sh.sh_name)) == NULL) { (void) elf_errno(); - name = "ERROR"; + name = ""; } if ((ndx = elf_ndxscn(scn)) == SHN_UNDEF) { - if ((elferr = elf_errno()) != 0) + if ((elferr = elf_errno()) != 0) { warnx("elf_ndxscn failed: %s", elf_errmsg(elferr)); - continue; + continue; + } } if (ndx >= re->shnum) { warnx("section index of '%s' out of range", name); From owner-svn-src-head@freebsd.org Wed Dec 7 19:31:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5084C6CEC0; Wed, 7 Dec 2016 19:31:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7261186A; Wed, 7 Dec 2016 19:31:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7JUxmL028189; Wed, 7 Dec 2016 19:30:59 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7JUx9w028184; Wed, 7 Dec 2016 19:30:59 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612071930.uB7JUx9w028184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 7 Dec 2016 19:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309682 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 19:31:01 -0000 Author: tuexen Date: Wed Dec 7 19:30:59 2016 New Revision: 309682 URL: https://svnweb.freebsd.org/changeset/base/309682 Log: Cleanup the names of SSN, SID, TSN, FSN, PPID and MID. This made a couple of bugs visible in handling SSN wrap-arounds when using DATA chunks. Now bulk transfer seems to work fine... This fixes the issue reported in https://github.com/sctplab/usrsctp/issues/111 MFC after: 1 week Modified: head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_header.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_ss_functions.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Dec 7 19:01:38 2016 (r309681) +++ head/sys/netinet/sctp_cc_functions.c Wed Dec 7 19:30:59 2016 (r309682) @@ -205,7 +205,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc /* Mark end of the window */ asoc->fast_recovery_tsn = asoc->sending_seq - 1; } else { - asoc->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; + asoc->fast_recovery_tsn = lchk->rec.data.tsn - 1; } /* @@ -218,7 +218,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc /* Mark end of the window */ net->fast_recovery_tsn = asoc->sending_seq - 1; } else { - net->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; + net->fast_recovery_tsn = lchk->rec.data.tsn - 1; } sctp_timer_stop(SCTP_TIMER_TYPE_SEND, @@ -1698,7 +1698,7 @@ sctp_hs_cwnd_update_after_fr(struct sctp /* Mark end of the window */ asoc->fast_recovery_tsn = asoc->sending_seq - 1; } else { - asoc->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; + asoc->fast_recovery_tsn = lchk->rec.data.tsn - 1; } /* @@ -1711,7 +1711,7 @@ sctp_hs_cwnd_update_after_fr(struct sctp /* Mark end of the window */ net->fast_recovery_tsn = asoc->sending_seq - 1; } else { - net->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; + net->fast_recovery_tsn = lchk->rec.data.tsn - 1; } sctp_timer_stop(SCTP_TIMER_TYPE_SEND, @@ -2228,7 +2228,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc /* Mark end of the window */ asoc->fast_recovery_tsn = asoc->sending_seq - 1; } else { - asoc->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; + asoc->fast_recovery_tsn = lchk->rec.data.tsn - 1; } /* @@ -2241,7 +2241,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc /* Mark end of the window */ net->fast_recovery_tsn = asoc->sending_seq - 1; } else { - net->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; + net->fast_recovery_tsn = lchk->rec.data.tsn - 1; } sctp_timer_stop(SCTP_TIMER_TYPE_SEND, Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Wed Dec 7 19:01:38 2016 (r309681) +++ head/sys/netinet/sctp_constants.h Wed Dec 7 19:30:59 2016 (r309682) @@ -898,8 +898,9 @@ __FBSDID("$FreeBSD$"); #define SCTP_SSN_GE(a, b) SCTP_UINT16_GE(a, b) #define SCTP_TSN_GT(a, b) SCTP_UINT32_GT(a, b) #define SCTP_TSN_GE(a, b) SCTP_UINT32_GE(a, b) -#define SCTP_MSGID_GT(o, a, b) ((o == 1) ? SCTP_UINT16_GT((uint16_t)a, (uint16_t)b) : SCTP_UINT32_GT(a, b)) -#define SCTP_MSGID_GE(o, a, b) ((o == 1) ? SCTP_UINT16_GE((uint16_t)a, (uint16_t)b) : SCTP_UINT32_GE(a, b)) +#define SCTP_MID_GT(i, a, b) (((i) == 1) ? SCTP_UINT32_GT(a, b) : SCTP_UINT16_GT((uint16_t)a, (uint16_t)b)) +#define SCTP_MID_GE(i, a, b) (((i) == 1) ? SCTP_UINT32_GE(a, b) : SCTP_UINT16_GE((uint16_t)a, (uint16_t)b)) +#define SCTP_MID_EQ(i, a, b) (((i) == 1) ? a == b : (uint16_t)a == (uint16_t)b) /* Mapping array manipulation routines */ #define SCTP_IS_TSN_PRESENT(arry, gap) ((arry[(gap >> 3)] >> (gap & 0x07)) & 0x01) Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Wed Dec 7 19:01:38 2016 (r309681) +++ head/sys/netinet/sctp_header.h Wed Dec 7 19:30:59 2016 (r309682) @@ -141,9 +141,9 @@ struct sctp_supported_chunk_types_param */ struct sctp_data { uint32_t tsn; - uint16_t stream_id; - uint16_t stream_sequence; - uint32_t protocol_id; + uint16_t sid; + uint16_t ssn; + uint32_t ppid; /* user data follows */ } SCTP_PACKED; @@ -154,11 +154,11 @@ struct sctp_data_chunk { struct sctp_idata { uint32_t tsn; - uint16_t stream_id; + uint16_t sid; uint16_t reserved; /* Where does the SSN go? */ - uint32_t msg_id; + uint32_t mid; union { - uint32_t protocol_id; + uint32_t ppid; uint32_t fsn; /* Fragment Sequence Number */ } ppid_fsn; /* user data follows */ @@ -390,14 +390,14 @@ struct sctp_forward_tsn_chunk { } SCTP_PACKED; struct sctp_strseq { - uint16_t stream; - uint16_t sequence; + uint16_t sid; + uint16_t ssn; } SCTP_PACKED; struct sctp_strseq_mid { - uint16_t stream; + uint16_t sid; uint16_t flags; - uint32_t msg_id; + uint32_t mid; }; struct sctp_forward_tsn_msg { Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Dec 7 19:01:38 2016 (r309681) +++ head/sys/netinet/sctp_indata.c Wed Dec 7 19:30:59 2016 (r309682) @@ -130,8 +130,8 @@ struct sctp_queued_to_read * sctp_build_readq_entry(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t tsn, uint32_t ppid, - uint32_t context, uint16_t stream_no, - uint32_t stream_seq, uint8_t flags, + uint32_t context, uint16_t sid, + uint32_t mid, uint8_t flags, struct mbuf *dm) { struct sctp_queued_to_read *read_queue_e = NULL; @@ -141,14 +141,14 @@ sctp_build_readq_entry(struct sctp_tcb * goto failed_build; } memset(read_queue_e, 0, sizeof(struct sctp_queued_to_read)); - read_queue_e->sinfo_stream = stream_no; - read_queue_e->sinfo_ssn = stream_seq; + read_queue_e->sinfo_stream = sid; read_queue_e->sinfo_flags = (flags << 8); read_queue_e->sinfo_ppid = ppid; read_queue_e->sinfo_context = context; read_queue_e->sinfo_tsn = tsn; read_queue_e->sinfo_cumtsn = tsn; read_queue_e->sinfo_assoc_id = sctp_get_associd(stcb); + read_queue_e->mid = mid; read_queue_e->top_fsn = read_queue_e->fsn_included = 0xffffffff; TAILQ_INIT(&read_queue_e->reasm); read_queue_e->whoFrom = net; @@ -366,7 +366,7 @@ sctp_place_control_in_stream(struct sctp return (0); } else { TAILQ_FOREACH(at, q, next_instrm) { - if (SCTP_TSN_GT(at->msg_id, control->msg_id)) { + if (SCTP_MID_GT(asoc->idata_supported, at->mid, control->mid)) { /* * one in queue is bigger than the new one, * insert before this one @@ -378,7 +378,7 @@ sctp_place_control_in_stream(struct sctp control->on_strm_q = SCTP_ON_ORDERED; } break; - } else if (at->msg_id == control->msg_id) { + } else if (SCTP_MID_EQ(asoc->idata_supported, at->mid, control->mid)) { /* * Gak, He sent me a duplicate msg id * number?? return -1 to abort. @@ -423,18 +423,18 @@ sctp_abort_in_reasm(struct sctp_tcb *stc "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", opspot, control->fsn_included, - chk->rec.data.TSN_seq, - chk->rec.data.stream_number, - chk->rec.data.fsn_num, chk->rec.data.stream_seq); + chk->rec.data.tsn, + chk->rec.data.sid, + chk->rec.data.fsn, chk->rec.data.mid); } else { snprintf(msg, sizeof(msg), "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", opspot, control->fsn_included, - chk->rec.data.TSN_seq, - chk->rec.data.stream_number, - chk->rec.data.fsn_num, - (uint16_t) chk->rec.data.stream_seq); + chk->rec.data.tsn, + chk->rec.data.sid, + chk->rec.data.fsn, + (uint16_t) chk->rec.data.mid); } oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_m_freem(chk->data); @@ -502,19 +502,27 @@ sctp_queue_data_to_stream(struct sctp_tc if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_STR_LOGGING_ENABLE) { sctp_log_strm_del(control, NULL, SCTP_STR_LOG_FROM_INTO_STRD); } - if (SCTP_MSGID_GT((!asoc->idata_supported), strm->last_sequence_delivered, control->sinfo_ssn)) { + if (SCTP_MID_GT((asoc->idata_supported), strm->last_mid_delivered, control->mid)) { /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ: %u delivered: %u from peer, Abort association\n", - control->sinfo_ssn, strm->last_sequence_delivered); + control->mid, strm->last_mid_delivered); protocol_error: /* * throw it in the stream so it gets cleaned up in * association destruction */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", - strm->last_sequence_delivered, control->sinfo_tsn, - control->sinfo_stream, control->sinfo_ssn); + if (asoc->idata_supported) { + snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + strm->last_mid_delivered, control->sinfo_tsn, + control->sinfo_stream, control->mid); + } else { + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + (uint16_t) strm->last_mid_delivered, + control->sinfo_tsn, + control->sinfo_stream, + (uint16_t) control->mid); + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -528,8 +536,8 @@ protocol_error: queue_needed = 1; asoc->size_on_all_streams += control->length; sctp_ucount_incr(asoc->cnt_on_all_streams); - nxt_todel = strm->last_sequence_delivered + 1; - if (nxt_todel == control->sinfo_ssn) { + nxt_todel = strm->last_mid_delivered + 1; + if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid)) { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; @@ -552,7 +560,7 @@ protocol_error: queue_needed = 0; asoc->size_on_all_streams -= control->length; sctp_ucount_decr(asoc->cnt_on_all_streams); - strm->last_sequence_delivered++; + strm->last_mid_delivered++; sctp_mark_non_revokable(asoc, control->sinfo_tsn); sctp_add_to_readq(stcb->sctp_ep, stcb, control, @@ -560,8 +568,8 @@ protocol_error: SCTP_READ_LOCK_NOT_HELD, SCTP_SO_LOCKED); TAILQ_FOREACH_SAFE(control, &strm->inqueue, next_instrm, at) { /* all delivered */ - nxt_todel = strm->last_sequence_delivered + 1; - if ((nxt_todel == control->sinfo_ssn) && + nxt_todel = strm->last_mid_delivered + 1; + if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid) && (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG)) { asoc->size_on_all_streams -= control->length; sctp_ucount_decr(asoc->cnt_on_all_streams); @@ -574,7 +582,7 @@ protocol_error: #endif } control->on_strm_q = 0; - strm->last_sequence_delivered++; + strm->last_mid_delivered++; /* * We ignore the return of deliver_data here * since we always can hold the chunk on the @@ -592,7 +600,7 @@ protocol_error: SCTP_READ_LOCK_NOT_HELD, SCTP_SO_LOCKED); continue; - } else if (nxt_todel == control->sinfo_ssn) { + } else if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid)) { *need_reasm = 1; } break; @@ -608,8 +616,8 @@ protocol_error: */ if (sctp_place_control_in_stream(strm, asoc, control)) { snprintf(msg, sizeof(msg), - "Queue to str msg_id: %u duplicate", - control->msg_id); + "Queue to str MID: %u duplicate", + control->mid); sctp_clean_up_control(stcb, control); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; @@ -720,10 +728,10 @@ sctp_build_readq_entry_from_ctl(struct s { memset(nc, 0, sizeof(struct sctp_queued_to_read)); nc->sinfo_stream = control->sinfo_stream; - nc->sinfo_ssn = control->sinfo_ssn; + nc->mid = control->mid; TAILQ_INIT(&nc->reasm); nc->top_fsn = control->top_fsn; - nc->msg_id = control->msg_id; + nc->mid = control->mid; nc->sinfo_flags = control->sinfo_flags; nc->sinfo_ppid = control->sinfo_ppid; nc->sinfo_context = control->sinfo_context; @@ -762,11 +770,11 @@ sctp_handle_old_unordered_data(struct sc { /* * Special handling for the old un-ordered data chunk. All the - * chunks/TSN's go to msg_id 0. So we have to do the old style - * watching to see if we have it all. If you return one, no other - * control entries on the un-ordered queue will be looked at. In - * theory there should be no others entries in reality, unless the - * guy is sending both unordered NDATA and unordered DATA... + * chunks/TSN's go to mid 0. So we have to do the old style watching + * to see if we have it all. If you return one, no other control + * entries on the un-ordered queue will be looked at. In theory + * there should be no others entries in reality, unless the guy is + * sending both unordered NDATA and unordered DATA... */ struct sctp_tmit_chunk *chk, *lchk, *tchk; uint32_t fsn; @@ -783,7 +791,7 @@ restart: fsn = control->fsn_included + 1; /* Now what can we add? */ TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, lchk) { - if (chk->rec.data.fsn_num == fsn) { + if (chk->rec.data.fsn == fsn) { /* Ok lets add it */ sctp_alloc_a_readq(stcb, nc); if (nc == NULL) { @@ -810,11 +818,11 @@ restart: asoc->size_on_reasm_queue -= tchk->send_size; sctp_ucount_decr(asoc->cnt_on_reasm_queue); nc->first_frag_seen = 1; - nc->fsn_included = tchk->rec.data.fsn_num; + nc->fsn_included = tchk->rec.data.fsn; nc->data = tchk->data; - nc->sinfo_ppid = tchk->rec.data.payloadtype; - nc->sinfo_tsn = tchk->rec.data.TSN_seq; - sctp_mark_non_revokable(asoc, tchk->rec.data.TSN_seq); + nc->sinfo_ppid = tchk->rec.data.ppid; + nc->sinfo_tsn = tchk->rec.data.tsn; + sctp_mark_non_revokable(asoc, tchk->rec.data.tsn); tchk->data = NULL; sctp_free_a_chunk(stcb, tchk, SCTP_SO_NOT_LOCKED); sctp_setup_tail_pointer(nc); @@ -900,7 +908,7 @@ sctp_inject_old_unordered_data(struct sc /* Its the very first one. */ SCTPDBG(SCTP_DEBUG_XXX, "chunk is a first fsn: %u becomes fsn_included\n", - chk->rec.data.fsn_num); + chk->rec.data.fsn); if (control->first_frag_seen) { /* * In old un-ordered we can reassembly on one @@ -911,12 +919,12 @@ sctp_inject_old_unordered_data(struct sc struct mbuf *tdata; uint32_t tmp; - if (SCTP_TSN_GT(chk->rec.data.fsn_num, control->fsn_included)) { + if (SCTP_TSN_GT(chk->rec.data.fsn, control->fsn_included)) { /* Easy way the start of a new guy beyond * the lowest */ goto place_chunk; } - if ((chk->rec.data.fsn_num == control->fsn_included) || + if ((chk->rec.data.fsn == control->fsn_included) || (control->pdapi_started)) { /* * Ok this should not happen, if it does we @@ -950,25 +958,25 @@ sctp_inject_old_unordered_data(struct sc sctp_setup_tail_pointer(control); /* Fix the FSN included */ tmp = control->fsn_included; - control->fsn_included = chk->rec.data.fsn_num; - chk->rec.data.fsn_num = tmp; + control->fsn_included = chk->rec.data.fsn; + chk->rec.data.fsn = tmp; /* Fix the TSN included */ tmp = control->sinfo_tsn; - control->sinfo_tsn = chk->rec.data.TSN_seq; - chk->rec.data.TSN_seq = tmp; + control->sinfo_tsn = chk->rec.data.tsn; + chk->rec.data.tsn = tmp; /* Fix the PPID included */ tmp = control->sinfo_ppid; - control->sinfo_ppid = chk->rec.data.payloadtype; - chk->rec.data.payloadtype = tmp; + control->sinfo_ppid = chk->rec.data.ppid; + chk->rec.data.ppid = tmp; /* Fix tail pointer */ goto place_chunk; } control->first_frag_seen = 1; - control->top_fsn = control->fsn_included = chk->rec.data.fsn_num; - control->sinfo_tsn = chk->rec.data.TSN_seq; - control->sinfo_ppid = chk->rec.data.payloadtype; + control->top_fsn = control->fsn_included = chk->rec.data.fsn; + control->sinfo_tsn = chk->rec.data.tsn; + control->sinfo_ppid = chk->rec.data.ppid; control->data = chk->data; - sctp_mark_non_revokable(asoc, chk->rec.data.TSN_seq); + sctp_mark_non_revokable(asoc, chk->rec.data.tsn); chk->data = NULL; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); sctp_setup_tail_pointer(control); @@ -977,7 +985,7 @@ sctp_inject_old_unordered_data(struct sc place_chunk: inserted = 0; TAILQ_FOREACH(at, &control->reasm, sctp_next) { - if (SCTP_TSN_GT(at->rec.data.fsn_num, chk->rec.data.fsn_num)) { + if (SCTP_TSN_GT(at->rec.data.fsn, chk->rec.data.fsn)) { /* * This one in queue is bigger than the new one, * insert the new one before at. @@ -987,7 +995,7 @@ place_chunk: inserted = 1; TAILQ_INSERT_BEFORE(at, chk, sctp_next); break; - } else if (at->rec.data.fsn_num == chk->rec.data.fsn_num) { + } else if (at->rec.data.fsn == chk->rec.data.fsn) { /* * They sent a duplicate fsn number. This really * should not happen since the FSN is a TSN and it @@ -1003,7 +1011,7 @@ place_chunk: /* Its at the end */ asoc->size_on_reasm_queue += chk->send_size; sctp_ucount_incr(asoc->cnt_on_reasm_queue); - control->top_fsn = chk->rec.data.fsn_num; + control->top_fsn = chk->rec.data.fsn; TAILQ_INSERT_TAIL(&control->reasm, chk, sctp_next); } } @@ -1044,7 +1052,7 @@ sctp_deliver_reasm_check(struct sctp_tcb } while (control) { SCTPDBG(SCTP_DEBUG_XXX, "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u -uo\n", - control, control->end_added, control->sinfo_ssn, control->top_fsn, control->fsn_included); + control, control->end_added, control->mid, control->top_fsn, control->fsn_included); nctl = TAILQ_NEXT(control, next_instrm); if (control->end_added) { /* We just put the last bit on */ @@ -1089,7 +1097,7 @@ done_un: if (control == NULL) { return (ret); } - if (strm->last_sequence_delivered == control->sinfo_ssn) { + if (SCTP_MID_EQ(asoc->idata_supported, strm->last_mid_delivered, control->mid)) { /* * Ok the guy at the top was being partially delivered * completed, so we remove it. Note the pd_api flag was @@ -1099,9 +1107,9 @@ done_un: nctl = TAILQ_NEXT(control, next_instrm); SCTPDBG(SCTP_DEBUG_XXX, "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u (lastdel: %u)- o\n", - control, control->end_added, control->sinfo_ssn, + control, control->end_added, control->mid, control->top_fsn, control->fsn_included, - strm->last_sequence_delivered); + strm->last_mid_delivered); if (control->end_added) { if (control->on_strm_q) { #ifdef INVARIANTS @@ -1133,14 +1141,14 @@ done_un: return (0); } deliver_more: - next_to_del = strm->last_sequence_delivered + 1; + next_to_del = strm->last_mid_delivered + 1; if (control) { SCTPDBG(SCTP_DEBUG_XXX, "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u (nxtdel: %u)- o\n", - control, control->end_added, control->sinfo_ssn, control->top_fsn, control->fsn_included, + control, control->end_added, control->mid, control->top_fsn, control->fsn_included, next_to_del); nctl = TAILQ_NEXT(control, next_instrm); - if ((control->sinfo_ssn == next_to_del) && + if (SCTP_MID_EQ(asoc->idata_supported, control->mid, next_to_del) && (control->first_frag_seen)) { int done; @@ -1180,7 +1188,7 @@ deliver_more: &stcb->sctp_socket->so_rcv, control->end_added, inp_read_lock_held, SCTP_SO_NOT_LOCKED); } - strm->last_sequence_delivered = next_to_del; + strm->last_mid_delivered = next_to_del; if (done) { control = nctl; goto deliver_more; @@ -1221,10 +1229,10 @@ sctp_add_chk_to_control(struct sctp_queu } else { sctp_add_to_tail_pointer(control, chk->data); } - control->fsn_included = chk->rec.data.fsn_num; + control->fsn_included = chk->rec.data.fsn; asoc->size_on_reasm_queue -= chk->send_size; sctp_ucount_decr(asoc->cnt_on_reasm_queue); - sctp_mark_non_revokable(asoc, chk->rec.data.TSN_seq); + sctp_mark_non_revokable(asoc, chk->rec.data.tsn); chk->data = NULL; if (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) { control->first_frag_seen = 1; @@ -1325,7 +1333,7 @@ sctp_queue_data_for_reasm(struct sctp_tc /* Its the very first one. */ SCTPDBG(SCTP_DEBUG_XXX, "chunk is a first fsn: %u becomes fsn_included\n", - chk->rec.data.fsn_num); + chk->rec.data.fsn); if (control->first_frag_seen) { /* * Error on senders part, they either sent us two @@ -1339,9 +1347,9 @@ sctp_queue_data_for_reasm(struct sctp_tc return; } control->first_frag_seen = 1; - control->fsn_included = chk->rec.data.fsn_num; + control->fsn_included = chk->rec.data.fsn; control->data = chk->data; - sctp_mark_non_revokable(asoc, chk->rec.data.TSN_seq); + sctp_mark_non_revokable(asoc, chk->rec.data.tsn); chk->data = NULL; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); sctp_setup_tail_pointer(control); @@ -1351,16 +1359,16 @@ sctp_queue_data_for_reasm(struct sctp_tc if (control->last_frag_seen == 0) { /* Still willing to raise highest FSN seen */ - if (SCTP_TSN_GT(chk->rec.data.fsn_num, control->top_fsn)) { + if (SCTP_TSN_GT(chk->rec.data.fsn, control->top_fsn)) { SCTPDBG(SCTP_DEBUG_XXX, "We have a new top_fsn: %u\n", - chk->rec.data.fsn_num); - control->top_fsn = chk->rec.data.fsn_num; + chk->rec.data.fsn); + control->top_fsn = chk->rec.data.fsn; } if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) { SCTPDBG(SCTP_DEBUG_XXX, "The last fsn is now in place fsn: %u\n", - chk->rec.data.fsn_num); + chk->rec.data.fsn); control->last_frag_seen = 1; } if (asoc->idata_supported || control->first_frag_seen) { @@ -1370,7 +1378,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * DATA we have to receive the first before * we know the first FSN (which is the TSN). */ - if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn_num)) { + if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn)) { /* We have already delivered up to * this so its a dup */ sctp_abort_in_reasm(stcb, control, chk, @@ -1384,7 +1392,7 @@ sctp_queue_data_for_reasm(struct sctp_tc /* Second last? huh? */ SCTPDBG(SCTP_DEBUG_XXX, "Duplicate last fsn: %u (top: %u) -- abort\n", - chk->rec.data.fsn_num, control->top_fsn); + chk->rec.data.fsn, control->top_fsn); sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_10); @@ -1398,12 +1406,12 @@ sctp_queue_data_for_reasm(struct sctp_tc * we know the first FSN (which is the TSN). */ - if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn_num)) { + if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn)) { /* We have already delivered up to * this so its a dup */ SCTPDBG(SCTP_DEBUG_XXX, "New fsn: %u is already seen in included_fsn: %u -- abort\n", - chk->rec.data.fsn_num, control->fsn_included); + chk->rec.data.fsn, control->fsn_included); sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_11); @@ -1412,10 +1420,10 @@ sctp_queue_data_for_reasm(struct sctp_tc } /* validate not beyond top FSN if we have seen last * one */ - if (SCTP_TSN_GT(chk->rec.data.fsn_num, control->top_fsn)) { + if (SCTP_TSN_GT(chk->rec.data.fsn, control->top_fsn)) { SCTPDBG(SCTP_DEBUG_XXX, "New fsn: %u is beyond or at top_fsn: %u -- abort\n", - chk->rec.data.fsn_num, + chk->rec.data.fsn, control->top_fsn); sctp_abort_in_reasm(stcb, control, chk, abort_flag, @@ -1429,22 +1437,22 @@ sctp_queue_data_for_reasm(struct sctp_tc */ SCTPDBG(SCTP_DEBUG_XXX, "chunk is a not first fsn: %u needs to be inserted\n", - chk->rec.data.fsn_num); + chk->rec.data.fsn); TAILQ_FOREACH(at, &control->reasm, sctp_next) { - if (SCTP_TSN_GT(at->rec.data.fsn_num, chk->rec.data.fsn_num)) { + if (SCTP_TSN_GT(at->rec.data.fsn, chk->rec.data.fsn)) { /* * This one in queue is bigger than the new * one, insert the new one before at. */ SCTPDBG(SCTP_DEBUG_XXX, "Insert it before fsn: %u\n", - at->rec.data.fsn_num); + at->rec.data.fsn); asoc->size_on_reasm_queue += chk->send_size; sctp_ucount_incr(asoc->cnt_on_reasm_queue); TAILQ_INSERT_BEFORE(at, chk, sctp_next); inserted = 1; break; - } else if (at->rec.data.fsn_num == chk->rec.data.fsn_num) { + } else if (at->rec.data.fsn == chk->rec.data.fsn) { /* Gak, He sent me a duplicate str seq * number */ /* @@ -1457,7 +1465,7 @@ sctp_queue_data_for_reasm(struct sctp_tc */ SCTPDBG(SCTP_DEBUG_XXX, "Duplicate to fsn: %u -- abort\n", - at->rec.data.fsn_num); + at->rec.data.fsn); sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_13); @@ -1467,7 +1475,7 @@ sctp_queue_data_for_reasm(struct sctp_tc if (inserted == 0) { /* Goes on the end */ SCTPDBG(SCTP_DEBUG_XXX, "Inserting at tail of list fsn: %u\n", - chk->rec.data.fsn_num); + chk->rec.data.fsn); asoc->size_on_reasm_queue += chk->send_size; sctp_ucount_incr(asoc->cnt_on_reasm_queue); TAILQ_INSERT_TAIL(&control->reasm, chk, sctp_next); @@ -1485,12 +1493,12 @@ sctp_queue_data_for_reasm(struct sctp_tc if (control->first_frag_seen) { next_fsn = control->fsn_included + 1; TAILQ_FOREACH_SAFE(at, &control->reasm, sctp_next, nat) { - if (at->rec.data.fsn_num == next_fsn) { + if (at->rec.data.fsn == next_fsn) { /* We can add this one now to the control */ SCTPDBG(SCTP_DEBUG_XXX, "Adding more to control: %p at: %p fsn: %u next_fsn: %u included: %u\n", control, at, - at->rec.data.fsn_num, + at->rec.data.fsn, next_fsn, control->fsn_included); TAILQ_REMOVE(&control->reasm, at, sctp_next); sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD); @@ -1524,25 +1532,25 @@ sctp_queue_data_for_reasm(struct sctp_tc } static struct sctp_queued_to_read * -sctp_find_reasm_entry(struct sctp_stream_in *strm, uint32_t msg_id, int ordered, int old) +sctp_find_reasm_entry(struct sctp_stream_in *strm, uint32_t mid, int ordered, int idata_supported) { struct sctp_queued_to_read *control; if (ordered) { TAILQ_FOREACH(control, &strm->inqueue, next_instrm) { - if (control->msg_id == msg_id) { + if (SCTP_MID_EQ(idata_supported, control->mid, mid)) { break; } } } else { - if (old) { - control = TAILQ_FIRST(&strm->uno_inqueue); - return (control); - } - TAILQ_FOREACH(control, &strm->uno_inqueue, next_instrm) { - if (control->msg_id == msg_id) { - break; + if (idata_supported) { + TAILQ_FOREACH(control, &strm->uno_inqueue, next_instrm) { + if (SCTP_MID_EQ(idata_supported, control->mid, mid)) { + break; + } } + } else { + control = TAILQ_FIRST(&strm->uno_inqueue); } } return (control); @@ -1559,22 +1567,21 @@ sctp_process_a_data_chunk(struct sctp_tc struct sctp_data_chunk *ch; struct sctp_idata_chunk *nch, chunk_buf; struct sctp_tmit_chunk *chk; - uint32_t tsn, fsn, gap, msg_id; + uint32_t tsn, fsn, gap, mid; struct mbuf *dmbuf; int the_len; int need_reasm_check = 0; - uint16_t strmno; + uint16_t sid; struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; struct sctp_queued_to_read *control = NULL; - uint32_t protocol_id; + uint32_t ppid; uint8_t chunk_flags; struct sctp_stream_reset_list *liste; struct sctp_stream_in *strm; int ordered; size_t clen; int created_control = 0; - uint8_t old_data; chk = NULL; if (chtype == SCTP_IDATA) { @@ -1583,23 +1590,21 @@ sctp_process_a_data_chunk(struct sctp_tc ch = (struct sctp_data_chunk *)nch; clen = sizeof(struct sctp_idata_chunk); tsn = ntohl(ch->dp.tsn); - msg_id = ntohl(nch->dp.msg_id); - protocol_id = nch->dp.ppid_fsn.protocol_id; + mid = ntohl(nch->dp.mid); + ppid = nch->dp.ppid_fsn.ppid; if (ch->ch.chunk_flags & SCTP_DATA_FIRST_FRAG) fsn = 0; else fsn = ntohl(nch->dp.ppid_fsn.fsn); - old_data = 0; } else { ch = (struct sctp_data_chunk *)sctp_m_getptr(*m, offset, sizeof(struct sctp_data_chunk), (uint8_t *) & chunk_buf); tsn = ntohl(ch->dp.tsn); - protocol_id = ch->dp.protocol_id; + ppid = ch->dp.ppid; clen = sizeof(struct sctp_data_chunk); fsn = tsn; - msg_id = (uint32_t) (ntohs(ch->dp.stream_sequence)); + mid = (uint32_t) (ntohs(ch->dp.ssn)); nch = NULL; - old_data = 1; } chunk_flags = ch->ch.chunk_flags; if ((size_t)chk_length == clen) { @@ -1685,9 +1690,9 @@ sctp_process_a_data_chunk(struct sctp_tc */ /* Is the stream valid? */ - strmno = ntohs(ch->dp.stream_id); + sid = ntohs(ch->dp.sid); - if (strmno >= asoc->streamincnt) { + if (sid >= asoc->streamincnt) { struct sctp_error_invalid_stream *cause; op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_error_invalid_stream), @@ -1704,7 +1709,7 @@ sctp_process_a_data_chunk(struct sctp_tc SCTP_BUF_LEN(op_err) = sizeof(struct sctp_error_invalid_stream); cause->cause.code = htons(SCTP_CAUSE_INVALID_STREAM); cause->cause.length = htons(sizeof(struct sctp_error_invalid_stream)); - cause->stream_id = ch->dp.stream_id; + cause->stream_id = ch->dp.sid; cause->reserved = htons(0); sctp_queue_op_err(stcb, op_err); } @@ -1720,7 +1725,7 @@ sctp_process_a_data_chunk(struct sctp_tc } return (0); } - strm = &asoc->strmin[strmno]; + strm = &asoc->strmin[sid]; /* * If its a fragmented message, lets see if we can find the control * on the reassembly queues. @@ -1734,18 +1739,18 @@ sctp_process_a_data_chunk(struct sctp_tc * wrap around. Ignore is for now. */ snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", - msg_id, chunk_flags); + mid, chunk_flags); goto err_out; } - control = sctp_find_reasm_entry(strm, msg_id, ordered, old_data); + control = sctp_find_reasm_entry(strm, mid, ordered, asoc->idata_supported); SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n", chunk_flags, control); if ((chunk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) { /* See if we can find the re-assembly entity */ if (control != NULL) { /* We found something, does it belong? */ - if (ordered && (msg_id != control->sinfo_ssn)) { - snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", msg_id); + if (ordered && (mid != control->mid)) { + snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; @@ -1775,10 +1780,10 @@ sctp_process_a_data_chunk(struct sctp_tc * ordered) or in the same Stream for unordered. */ if (control != NULL) { - if (ordered || (old_data == 0)) { - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on msg_id: %u\n", - chunk_flags, msg_id); - snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", msg_id); + if (ordered || asoc->idata_supported) { + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", + chunk_flags, mid); + snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); goto err_out; } else { if ((tsn == control->fsn_included + 1) && @@ -1855,8 +1860,8 @@ sctp_process_a_data_chunk(struct sctp_tc asoc->tsn_in_wrapped = 1; } asoc->in_tsnlog[asoc->tsn_in_at].tsn = tsn; - asoc->in_tsnlog[asoc->tsn_in_at].strm = strmno; - asoc->in_tsnlog[asoc->tsn_in_at].seq = msg_id; + asoc->in_tsnlog[asoc->tsn_in_at].strm = sid; + asoc->in_tsnlog[asoc->tsn_in_at].seq = mid; asoc->in_tsnlog[asoc->tsn_in_at].sz = chk_length; asoc->in_tsnlog[asoc->tsn_in_at].flgs = chunk_flags; asoc->in_tsnlog[asoc->tsn_in_at].stcb = (void *)stcb; @@ -1874,14 +1879,24 @@ sctp_process_a_data_chunk(struct sctp_tc if ((chunk_flags & SCTP_DATA_FIRST_FRAG) && (TAILQ_EMPTY(&asoc->resetHead)) && (chunk_flags & SCTP_DATA_UNORDERED) == 0 && - SCTP_MSGID_GE(old_data, asoc->strmin[strmno].last_sequence_delivered, msg_id)) { + SCTP_MID_GE(asoc->idata_supported, asoc->strmin[sid].last_mid_delivered, mid)) { /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ: %u delivered: %u from peer, Abort!\n", - msg_id, asoc->strmin[strmno].last_sequence_delivered); + mid, asoc->strmin[sid].last_mid_delivered); - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", - asoc->strmin[strmno].last_sequence_delivered, - tsn, strmno, msg_id); + if (asoc->idata_supported) { + snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + asoc->strmin[sid].last_mid_delivered, + tsn, + sid, + mid); + } else { + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + (uint16_t) asoc->strmin[sid].last_mid_delivered, + tsn, + sid, + (uint16_t) mid); + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -1954,10 +1969,10 @@ sctp_process_a_data_chunk(struct sctp_tc if (control == NULL) { sctp_alloc_a_readq(stcb, control); sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, - protocol_id, - strmno, msg_id, + ppid, + sid, chunk_flags, - NULL, fsn, msg_id); + NULL, fsn, mid); if (control == NULL) { SCTP_STAT_INCR(sctps_nomem); return (0); @@ -1970,13 +1985,13 @@ sctp_process_a_data_chunk(struct sctp_tc } created_control = 1; } - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x ordered: %d msgid: %u control: %p\n", - chunk_flags, ordered, msg_id, control); + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x ordered: %d MID: %u control: %p\n", + chunk_flags, ordered, mid, control); if ((chunk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG && TAILQ_EMPTY(&asoc->resetHead) && ((ordered == 0) || - ((uint16_t) (asoc->strmin[strmno].last_sequence_delivered + 1) == msg_id && - TAILQ_EMPTY(&asoc->strmin[strmno].inqueue)))) { + (SCTP_MID_EQ(asoc->idata_supported, asoc->strmin[sid].last_mid_delivered + 1, mid) && + TAILQ_EMPTY(&asoc->strmin[sid].inqueue)))) { /* Candidate for express delivery */ /* * Its not fragmented, No PD-API is up, Nothing in the @@ -1989,8 +2004,8 @@ sctp_process_a_data_chunk(struct sctp_tc if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } - SCTPDBG(SCTP_DEBUG_XXX, "Injecting control: %p to be read (msg_id: %u)\n", - control, msg_id); + SCTPDBG(SCTP_DEBUG_XXX, "Injecting control: %p to be read (MID: %u)\n", + control, mid); sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, @@ -1998,11 +2013,11 @@ sctp_process_a_data_chunk(struct sctp_tc if ((chunk_flags & SCTP_DATA_UNORDERED) == 0) { /* for ordered, bump what we delivered */ - strm->last_sequence_delivered++; + strm->last_mid_delivered++; } SCTP_STAT_INCR(sctps_recvexpress); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_STR_LOGGING_ENABLE) { - sctp_log_strm_del_alt(stcb, tsn, msg_id, strmno, + sctp_log_strm_del_alt(stcb, tsn, mid, sid, SCTP_STR_LOG_FROM_EXPRS_DEL); } control = NULL; @@ -2020,21 +2035,21 @@ sctp_process_a_data_chunk(struct sctp_tc } return (0); } - chk->rec.data.TSN_seq = tsn; + chk->rec.data.tsn = tsn; chk->no_fr_allowed = 0; - chk->rec.data.fsn_num = fsn; - chk->rec.data.stream_seq = msg_id; - chk->rec.data.stream_number = strmno; - chk->rec.data.payloadtype = protocol_id; + chk->rec.data.fsn = fsn; + chk->rec.data.mid = mid; + chk->rec.data.sid = sid; + chk->rec.data.ppid = ppid; chk->rec.data.context = stcb->asoc.context; chk->rec.data.doing_fast_retransmit = 0; chk->rec.data.rcv_flags = chunk_flags; chk->asoc = asoc; chk->send_size = the_len; chk->whoTo = net; - SCTPDBG(SCTP_DEBUG_XXX, "Building ck: %p for control: %p to be read (msg_id: %u)\n", + SCTPDBG(SCTP_DEBUG_XXX, "Building ck: %p for control: %p to be read (MID: %u)\n", chk, - control, msg_id); + control, mid); atomic_add_int(&net->ref_count, 1); chk->data = dmbuf; } @@ -2097,8 +2112,8 @@ sctp_process_a_data_chunk(struct sctp_tc } if (chunk_flags & SCTP_DATA_UNORDERED) { /* queue directly into socket buffer */ - SCTPDBG(SCTP_DEBUG_XXX, "Unordered data to be read control: %p msg_id: %u\n", - control, msg_id); + SCTPDBG(SCTP_DEBUG_XXX, "Unordered data to be read control: %p MID: %u\n", + control, mid); sctp_mark_non_revokable(asoc, control->sinfo_tsn); sctp_add_to_readq(stcb->sctp_ep, stcb, control, @@ -2106,8 +2121,8 @@ sctp_process_a_data_chunk(struct sctp_tc SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } else { - SCTPDBG(SCTP_DEBUG_XXX, "Queue control: %p for reordering msg_id: %u\n", control, - msg_id); + SCTPDBG(SCTP_DEBUG_XXX, "Queue control: %p for reordering MID: %u\n", control, + mid); sctp_queue_data_to_stream(stcb, strm, asoc, control, abort_flag, &need_reasm_check); if (*abort_flag) { if (last_chunk) { @@ -2121,8 +2136,8 @@ sctp_process_a_data_chunk(struct sctp_tc /* If we reach here its a reassembly */ need_reasm_check = 1; SCTPDBG(SCTP_DEBUG_XXX, - "Queue data to stream for reasm control: %p msg_id: %u\n", - control, msg_id); + "Queue data to stream for reasm control: %p MID: %u\n", + control, mid); sctp_queue_data_for_reasm(stcb, asoc, strm, control, chk, created_control, abort_flag, tsn); if (*abort_flag) { /* @@ -2151,7 +2166,7 @@ finish_express_del: SCTP_STAT_INCR(sctps_recvdata); /* Set it present please */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_STR_LOGGING_ENABLE) { - sctp_log_strm_del_alt(stcb, tsn, msg_id, strmno, SCTP_STR_LOG_FROM_MARK_TSN); + sctp_log_strm_del_alt(stcb, tsn, mid, sid, SCTP_STR_LOG_FROM_MARK_TSN); } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { sctp_log_map(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, @@ -2813,16 +2828,16 @@ sctp_process_segment_range(struct sctp_t if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (tp1->whoTo->find_pseudo_cumack == 1) && (tp1->snd_count == 1)) { - tp1->whoTo->pseudo_cumack = tp1->rec.data.TSN_seq; + tp1->whoTo->pseudo_cumack = tp1->rec.data.tsn; tp1->whoTo->find_pseudo_cumack = 0; } if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (tp1->whoTo->find_rtx_pseudo_cumack == 1) && (tp1->snd_count > 1)) { - tp1->whoTo->rtx_pseudo_cumack = tp1->rec.data.TSN_seq; + tp1->whoTo->rtx_pseudo_cumack = tp1->rec.data.tsn; tp1->whoTo->find_rtx_pseudo_cumack = 0; } - if (tp1->rec.data.TSN_seq == theTSN) { + if (tp1->rec.data.tsn == theTSN) { if (tp1->sent != SCTP_DATAGRAM_UNSENT) { /*- * must be held until @@ -2836,9 +2851,9 @@ sctp_process_segment_range(struct sctp_t * via previous Gap Ack Blocks... * i.e. ACKED or RESEND. */ - if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + if (SCTP_TSN_GT(tp1->rec.data.tsn, *biggest_newly_acked_tsn)) { - *biggest_newly_acked_tsn = tp1->rec.data.TSN_seq; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Dec 7 19:41:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E36CC6C2F9; Wed, 7 Dec 2016 19:41:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C1001170; Wed, 7 Dec 2016 19:41:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id uB7JfLUb021130 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Dec 2016 11:41:21 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id uB7JfLVh021129; Wed, 7 Dec 2016 11:41:21 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Dec 2016 11:41:21 -0800 From: Gleb Smirnoff To: Mateusz Guzik Cc: Fabien Thomas , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r309143 - head/sys/libkern Message-ID: <20161207194121.GM27748@FreeBSD.org> References: <201611251349.uAPDnX09042110@repo.freebsd.org> <20161125160010.GA3307@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161125160010.GA3307@dft-labs.eu> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 19:41:29 -0000 On Fri, Nov 25, 2016 at 05:00:10PM +0100, Mateusz Guzik wrote: M> On Fri, Nov 25, 2016 at 01:49:33PM +0000, Fabien Thomas wrote: M> > Author: fabient M> > Date: Fri Nov 25 13:49:33 2016 M> > New Revision: 309143 M> > URL: https://svnweb.freebsd.org/changeset/base/309143 M> > M> > Log: M> > In a dual processor system (2*6 cores) during IPSec throughput tests, M> > we see a lot of contention on the arc4 lock, used to generate the IV M> > of the ESP output packets. M> > M> > The idea of this patch is to split this mutex in order to reduce the M> > contention on this lock. M> > M> > +MALLOC_DEFINE(M_ARC4RANDOM, "arc4random", "arc4random structures"); M> > M> > -static u_int8_t arc4_randbyte(void); M> > +struct arc4_s { M> > + u_int8_t i, j; M> > + int numruns; M> > + u_int8_t sbox[256]; M> > + time_t t_reseed; M> > + M> > + struct mtx mtx; M> > +}; M> > + M> M> Why is the lock at the end? Right now you got false sharing with the M> next entry. M> M> That said, I suggest: M> 1. moving thelock to the beginning M> 2. annotating the struct with __aligned(CACHE_LINE_SIZE) It could be even better not to allocate them with regular malloc at all, but to put them into the per cpu areas. I haven't tried, but looks like the DPCPU mechanism defined in sys/pcpu.h would fit that well. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Dec 7 21:08:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 067FFC6B9F1; Wed, 7 Dec 2016 21:08:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D71321FB2; Wed, 7 Dec 2016 21:08:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id uB7L8PJS021523 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Dec 2016 13:08:25 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id uB7L8Ocv021522; Wed, 7 Dec 2016 13:08:24 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Dec 2016 13:08:24 -0800 From: Gleb Smirnoff To: Marcel Moolenaar Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309394 - head/sys/netpfil/pf Message-ID: <20161207210824.GN27748@FreeBSD.org> References: <201612020615.uB26Fxs1049431@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612020615.uB26Fxs1049431@repo.freebsd.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 21:08:27 -0000 Marcel, thanks for the fixes. While the problem with the first chunk in pfsync_sendout() is obvious, the problem you are fixing in th second chunk in the pfsync_delete_state() is not clear to me. Can you please explain what scenario are you fixing there? On Fri, Dec 02, 2016 at 06:15:59AM +0000, Marcel Moolenaar wrote: M> Author: marcel M> Date: Fri Dec 2 06:15:59 2016 M> New Revision: 309394 M> URL: https://svnweb.freebsd.org/changeset/base/309394 M> M> Log: M> Fix use-after-free bugs in pfsync(4) M> M> Use after free happens for state that is deleted. The reference M> count is what prevents the state from being freed. When the M> state is dequeued, the reference count is dropped and the memory M> freed. We can't dereference the next pointer or re-queue the M> state. M> M> MFC after: 1 week M> Differential Revision: https://reviews.freebsd.org/D8671 M> M> Modified: M> head/sys/netpfil/pf/if_pfsync.c M> M> Modified: head/sys/netpfil/pf/if_pfsync.c M> ============================================================================== M> --- head/sys/netpfil/pf/if_pfsync.c Fri Dec 2 06:07:27 2016 (r309393) M> +++ head/sys/netpfil/pf/if_pfsync.c Fri Dec 2 06:15:59 2016 (r309394) M> @@ -1509,7 +1509,7 @@ pfsync_sendout(int schedswi) M> struct ip *ip; M> struct pfsync_header *ph; M> struct pfsync_subheader *subh; M> - struct pf_state *st; M> + struct pf_state *st, *st_next; M> struct pfsync_upd_req_item *ur; M> int offset; M> int q, count = 0; M> @@ -1559,7 +1559,7 @@ pfsync_sendout(int schedswi) M> offset += sizeof(*subh); M> M> count = 0; M> - TAILQ_FOREACH(st, &sc->sc_qs[q], sync_list) { M> + TAILQ_FOREACH_SAFE(st, &sc->sc_qs[q], sync_list, st_next) { M> KASSERT(st->sync_state == q, M> ("%s: st->sync_state == q", M> __func__)); M> @@ -1931,6 +1931,8 @@ pfsync_delete_state(struct pf_state *st) M> if (sc->sc_len == PFSYNC_MINPKT) M> callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); M> M> + pf_ref_state(st); M> + M> switch (st->sync_state) { M> case PFSYNC_S_INS: M> /* We never got to tell the world so just forget about it. */ M> @@ -1950,6 +1952,9 @@ pfsync_delete_state(struct pf_state *st) M> default: M> panic("%s: unexpected sync state %d", __func__, st->sync_state); M> } M> + M> + pf_release_state(st); M> + M> PFSYNC_UNLOCK(sc); M> } M> M> _______________________________________________ M> svn-src-all@freebsd.org mailing list M> https://lists.freebsd.org/mailman/listinfo/svn-src-all M> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Dec 7 21:24:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC552C6BDC7; Wed, 7 Dec 2016 21:24:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E8B0A72; Wed, 7 Dec 2016 21:24:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7LOnD7075630; Wed, 7 Dec 2016 21:24:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7LOn1U075629; Wed, 7 Dec 2016 21:24:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612072124.uB7LOn1U075629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 7 Dec 2016 21:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309683 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 21:24:51 -0000 Author: tuexen Date: Wed Dec 7 21:24:49 2016 New Revision: 309683 URL: https://svnweb.freebsd.org/changeset/base/309683 Log: Fix a bug in sctp_sendmsgx(), where the sid provided by the user was hot honored. MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Wed Dec 7 19:30:59 2016 (r309682) +++ head/lib/libc/net/sctp_sys_calls.c Wed Dec 7 21:24:49 2016 (r309683) @@ -797,7 +797,7 @@ sctp_sendmsgx(int sd, memset((void *)&sinfo, 0, sizeof(struct sctp_sndrcvinfo)); sinfo.sinfo_ppid = ppid; sinfo.sinfo_flags = flags; - sinfo.sinfo_ssn = stream_no; + sinfo.sinfo_stream = stream_no; sinfo.sinfo_timetolive = timetolive; sinfo.sinfo_context = context; return (sctp_sendx(sd, msg, len, addrs, addrcnt, &sinfo, 0)); From owner-svn-src-head@freebsd.org Wed Dec 7 21:26:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43329C6BE61; Wed, 7 Dec 2016 21:26:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D868C2B; Wed, 7 Dec 2016 21:26:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id uB7LQlBW021618 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Dec 2016 13:26:47 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id uB7LQlNC021617; Wed, 7 Dec 2016 13:26:47 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Dec 2016 13:26:47 -0800 From: Gleb Smirnoff To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309658 - head/sys/vm Message-ID: <20161207212647.GO27748@FreeBSD.org> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612062252.uB6Mqjhr019191@repo.freebsd.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 21:26:49 -0000 On Tue, Dec 06, 2016 at 10:52:45PM +0000, Mark Johnston wrote: M> Author: markj M> Date: Tue Dec 6 22:52:45 2016 M> New Revision: 309658 M> URL: https://svnweb.freebsd.org/changeset/base/309658 M> M> Log: M> Provide dummy sysctls for v_cache_count and v_tcached. M> M> Some utilities (notably top(1)) exit if any of their input sysctls don't M> exist, and the removal of the above-mentioned PG_CACHE-related sysctls M> makes it difficult to run such utilities on different versions of the M> kernel without recompiling. M> M> Requested by: bde M> M> Modified: M> head/sys/vm/vm_meter.c M> M> Modified: head/sys/vm/vm_meter.c M> ============================================================================== M> --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) M> +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) M> @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec M> VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); M> VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); M> VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); M> + M> +#ifndef BURN_BRIDGES M> +/* M> + * Provide compatibility sysctls for the benefit of old utilities which exit M> + * with an error if they cannot be found. M> + */ M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, M> + (u_int *)NULL, 0, "Dummy for compatibility"); M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, M> + (u_int *)NULL, 0, "Dummy for compatibility"); M> +#endif IMHO, there should be some garbage collecting timeout for them. I'd suggest to delete them from head after stable/12 branch is forked. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Dec 7 21:30:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E4FC6BF88; Wed, 7 Dec 2016 21:30:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4C08F9D; Wed, 7 Dec 2016 21:30:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id c21so677412417ioj.1; Wed, 07 Dec 2016 13:30:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8w1DPgzzpoYXS6zap5prBtnSO53Eze4QJgruFWDLcqc=; b=HyK30zW2FqOYviSTZvSLRfLft4AE/N+OAb7g2nUCwFRJVqEyGGaPGyrKhj0ZgYWOUo UQm8ktph0v3MqTpBS0VpVNSncjMha+OWT0PbuJyp58qngbYriJLtd1Sz/4kphtYfkiE+ aW5poPSUU1DhSCcI+1yrBF3Y8+DZAZhvyNTG8fbUXAK2NLNNwOpuhyHQ6K5xAojHj54l 1NY7M9n33li0xJKugrrzVtpE3ciW+Ng8QR/8Ec0v0l8qYJ0U/ms89dxkUYsxjymgccr1 ipiIPN0I+Jo2ZTg74lwWabxplPIiaxW/+I2KaJctjMxV+n8hLPO2rwjtGyBEPak9ZvtD ZtBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8w1DPgzzpoYXS6zap5prBtnSO53Eze4QJgruFWDLcqc=; b=dIgqu0DNUleaRe5S0Lh9M0ZAKzgKSQBVVTD4Eqad2d1w5JSMr2PU5fk3KlqjXuSxd+ oRCQWbTcGmDWZKH1zD2X24xKNlCu7YxwvHmthIfq8ZFNXDapYA8Q5nhGlq5gEO+57Jjq 6c5J4+2bSv5mpHspF20MvaeXk4QiMDxBacB1JRrIPmDJK8BPoy8GEeWXc06e6k4y0x71 4WMsSBeYk9bCVw+2E3awwEIoApfCBgkGifLUw2PLKWHgl3YBlDjI4XcQmTaRn9dqVxAD FdzrYPO9X9WmZvEfLnZ5DYYAOW44mMq1Tx6sbyKs/CRCpQdc2j2Usl6YUrbmH+sorqfj GDKw== X-Gm-Message-State: AKaTC00M+ezmQsDBDmLSF6bXkXGH8+NWN2FixijxYd2GLCyVWwG8aOwnX2qDqVmfh5FAyYCzg4oxo9jWny+xaQ== X-Received: by 10.36.43.193 with SMTP id h184mr3968232ita.29.1481146205802; Wed, 07 Dec 2016 13:30:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.150.129 with HTTP; Wed, 7 Dec 2016 13:30:05 -0800 (PST) In-Reply-To: <201612070629.uB76T1PG003849@repo.freebsd.org> References: <201612070629.uB76T1PG003849@repo.freebsd.org> From: Adrian Chadd Date: Wed, 7 Dec 2016 13:30:05 -0800 Message-ID: Subject: Re: svn commit: r309667 - head/sys/net80211 To: Xin LI Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 21:30:07 -0000 grrrrr.... :( -a On 6 December 2016 at 22:29, Xin LI wrote: > Author: delphij > Date: Wed Dec 7 06:29:01 2016 > New Revision: 309667 > URL: https://svnweb.freebsd.org/changeset/base/309667 > > Log: > Fix typo. > > Modified: > head/sys/net80211/ieee80211_crypto.c > > Modified: head/sys/net80211/ieee80211_crypto.c > ============================================================================== > --- head/sys/net80211/ieee80211_crypto.c Wed Dec 7 04:23:08 2016 (r309666) > +++ head/sys/net80211/ieee80211_crypto.c Wed Dec 7 06:29:01 2016 (r309667) > @@ -534,7 +534,7 @@ ieee80211_crypto_get_key_wepidx(const st > if (k >= &vap->iv_nw_keys[0] && > k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) > return (k - vap->iv_nw_keys); > - return (-1): > + return (-1); > } > > /* > From owner-svn-src-head@freebsd.org Wed Dec 7 21:32:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5EB1C6C234 for ; Wed, 7 Dec 2016 21:32:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9032115C8 for ; Wed, 7 Dec 2016 21:32:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id j92so16534929ioi.0 for ; Wed, 07 Dec 2016 13:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9XMgmbKOt8xTmqxZInPDk/XdJVWzGiTXPARFpOIZ60Y=; b=hDMH5wcH6aDQkvxLIjHReCyCrPYcBEfubnXY4zSrEghThqf8Pna7f0vSvPlec6hwa3 Alc1phzxBnCWJ3+cylZq+YhDThHShKWtxjshMRZGwxrWa5HZTZcNxJV3t+HJMAFF2GBd 0pRu0cccM3IDwhh6SThC8CUjk9pAU7o/g+dkypgfgUaq8GuEfUhnwFWsguwh+QYgT+U0 61gQ1mjX3IrFZrAOs73+Z7Rt8CtdT5mtlelVDhUFPIn8l3eeu8enH59y5F+qAQv47XZf bK46gldRORiJ39roWdUJiS/T3bxrECEAd5nJoGrqDVdgYV0g87QrXCXNba39HAqXgTXb sdlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9XMgmbKOt8xTmqxZInPDk/XdJVWzGiTXPARFpOIZ60Y=; b=Pa4zw5t8/EJyQaG8kExmCc7I1cGPfOOFyAnM+0+F/no7gngklE2uPZljWTzkxD8fjO UgSwt32NcUJNYcwLW0T6ilI1N3zBel75PfN9NjOTaXInSKJdleSnnliU3uZ+p5hEmEBI rcTQ/INR7scTlaeCIMot/o2sUY9Z+LPawxH2SYzcpAm2acgP6QFWV0pex168H2mL+76v oR63d3YYs2NBfh6EEuQXtRij4KWeO5xYhB/ZBEgSHzSeUaqlQ1z5qXIzatfwm2Yik5VC qwmyLVuj7tQEoxUx5G20YeoWV60nRg/vcDHx/qcQu4OKMdykZf7hvRRkehjh1kyZMPcB r93w== X-Gm-Message-State: AKaTC00ibNuUZ+Bk6SHU+9M6zlRk/egilYPYbd7kkQ79taT4Iy0u2NZLvMN6euTCireyBUkrLpQ6fV9Bmp8XrQ== X-Received: by 10.36.122.135 with SMTP id a129mr4060289itc.103.1481146373948; Wed, 07 Dec 2016 13:32:53 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.31.199 with HTTP; Wed, 7 Dec 2016 13:32:53 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <20161207212647.GO27748@FreeBSD.org> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207212647.GO27748@FreeBSD.org> From: Warner Losh Date: Wed, 7 Dec 2016 14:32:53 -0700 X-Google-Sender-Auth: etM92BqjYqGFPTqXdsZBK6EqA_A Message-ID: Subject: Re: svn commit: r309658 - head/sys/vm To: Gleb Smirnoff Cc: Mark Johnston , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 21:32:54 -0000 On Wed, Dec 7, 2016 at 2:26 PM, Gleb Smirnoff wrote: > On Tue, Dec 06, 2016 at 10:52:45PM +0000, Mark Johnston wrote: > M> Author: markj > M> Date: Tue Dec 6 22:52:45 2016 > M> New Revision: 309658 > M> URL: https://svnweb.freebsd.org/changeset/base/309658 > M> > M> Log: > M> Provide dummy sysctls for v_cache_count and v_tcached. > M> > M> Some utilities (notably top(1)) exit if any of their input sysctls don't > M> exist, and the removal of the above-mentioned PG_CACHE-related sysctls > M> makes it difficult to run such utilities on different versions of the > M> kernel without recompiling. > M> > M> Requested by: bde > M> > M> Modified: > M> head/sys/vm/vm_meter.c > M> > M> Modified: head/sys/vm/vm_meter.c > M> ============================================================================== > M> --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) > M> +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) > M> @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec > M> VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); > M> VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); > M> VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); > M> + > M> +#ifndef BURN_BRIDGES > M> +/* > M> + * Provide compatibility sysctls for the benefit of old utilities which exit > M> + * with an error if they cannot be found. > M> + */ > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, > M> + (u_int *)NULL, 0, "Dummy for compatibility"); > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, > M> + (u_int *)NULL, 0, "Dummy for compatibility"); > M> +#endif > > IMHO, there should be some garbage collecting timeout for them. I'd suggest to > delete them from head after stable/12 branch is forked. Other places define #if BURN_BRUDGES < 1200000 to make this automatic. Warner From owner-svn-src-head@freebsd.org Wed Dec 7 21:47:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D9DCC6C678; Wed, 7 Dec 2016 21:47:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B2C1BCA; Wed, 7 Dec 2016 21:47:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7LlF6M083876; Wed, 7 Dec 2016 21:47:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7LlFR5083875; Wed, 7 Dec 2016 21:47:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612072147.uB7LlFR5083875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Dec 2016 21:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309684 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 21:47:16 -0000 Author: imp Date: Wed Dec 7 21:47:14 2016 New Revision: 309684 URL: https://svnweb.freebsd.org/changeset/base/309684 Log: Fix Typo Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Wed Dec 7 21:24:49 2016 (r309683) +++ head/sbin/nvmecontrol/logpage.c Wed Dec 7 21:47:14 2016 (r309684) @@ -113,7 +113,7 @@ uint128_to_str(uint128_t u, char *buf, s return end; } -/* "fMissing" from endian.h */ +/* "Missing" from endian.h */ static __inline uint64_t le48dec(const void *pp) { From owner-svn-src-head@freebsd.org Wed Dec 7 22:01:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AD5CC6C9A3; Wed, 7 Dec 2016 22:01:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A7C861C; Wed, 7 Dec 2016 22:01:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7M19Pm090535; Wed, 7 Dec 2016 22:01:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7M19aX090534; Wed, 7 Dec 2016 22:01:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612072201.uB7M19aX090534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 7 Dec 2016 22:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309685 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 22:01:10 -0000 Author: tuexen Date: Wed Dec 7 22:01:09 2016 New Revision: 309685 URL: https://svnweb.freebsd.org/changeset/base/309685 Log: Silence a warning produced by newer versions of gcc. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Dec 7 21:47:14 2016 (r309684) +++ head/sys/netinet/sctp_output.c Wed Dec 7 22:01:09 2016 (r309685) @@ -10350,8 +10350,10 @@ sctp_fill_in_rest: */ if (asoc->idata_supported) { strseq_m = (struct sctp_strseq_mid *)fwdtsn; + strseq = NULL; } else { strseq = (struct sctp_strseq *)fwdtsn; + strseq_m = NULL; } /*- * Now populate the strseq list. This is done blindly From owner-svn-src-head@freebsd.org Wed Dec 7 22:10:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B0AEC6CB85; Wed, 7 Dec 2016 22:10:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 398E7AE8; Wed, 7 Dec 2016 22:10:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x242.google.com with SMTP id n204so50505011qke.2; Wed, 07 Dec 2016 14:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qyuyOx2WRLgDF+Zw4r9mFRrtvmhty3hWABH0uE1EhAY=; b=VuicaetKoiihbjWlt6tdpbVdu3Z+LoDL7C7xntMxMJYtnQ92hFqbyQzQ++hkrpQX0l SQ/gi74nhE1huu9OBZiqtz2g+T/Et/wGqKNr79n6jZ18GDH3Fh12U3D2Ga7TYua1PGoA zJQ3cEmKimxkbJ3p10Yh9nqT5jiSAzEb5sk6r9+cYpWMzYY9dbNao0iwRN/iaVIVNrCc VQI1IML1PLuoLnSPZVlfMz/rDi/9IeP3BFOStuwDURNu4l90QcGLC5eIaqyzfRqwpCHJ g66Ny1x62BCeuOj23A90fXlYLE0g+juCtSf8tF7ILm0mUKaNqi8a80njn6WNvq1M+cpA tKkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=qyuyOx2WRLgDF+Zw4r9mFRrtvmhty3hWABH0uE1EhAY=; b=blLNNKXnqmWi/SW+KYHnVVGsh3IUsLzDY0vF1lFDO8kcNaWJV8xhNIgE6jw0aWJGdE Rh8jyzVA09yQXEgtx/1ABfdhQvQXnJ/0TMULivYDrh+2TxXoX252c0ucVDNltxAcB45f sJbrKxn2yC6To8Tiujdtage8jfkA2TN9galA+iZo1sHc9W3K9ZCBcQq/9dKFqzn5z0t1 R7H+MsQ9MJi0dTAB2IBIq+j+t8PjRLKAdjWhOMgQZs1ZWKicI19APYskbR/SIVD9qYxa zsMVd2JcQj3qngSjhfKpM0rLthm4NL7NGyyr1nhRib7+2phene0fHvoXh+OXej1R8Lu5 TF9Q== X-Gm-Message-State: AKaTC00AgzUISaH77aNBvC10BW3DxvZ1I35yRwc44UPuJDGXbzXLaDxjvptpPcrJ8NLbcQ== X-Received: by 10.55.177.5 with SMTP id a5mr67166572qkf.229.1481148600083; Wed, 07 Dec 2016 14:10:00 -0800 (PST) Received: from wkstn-mjohnston (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id q128sm15812974qka.1.2016.12.07.14.09.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 14:09:59 -0800 (PST) Sender: Mark Johnston Date: Wed, 7 Dec 2016 14:15:49 -0800 From: Mark Johnston To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309658 - head/sys/vm Message-ID: <20161207221548.GA33409@wkstn-mjohnston> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207212647.GO27748@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161207212647.GO27748@FreeBSD.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 22:10:01 -0000 On Wed, Dec 07, 2016 at 01:26:47PM -0800, Gleb Smirnoff wrote: > On Tue, Dec 06, 2016 at 10:52:45PM +0000, Mark Johnston wrote: > M> Author: markj > M> Date: Tue Dec 6 22:52:45 2016 > M> New Revision: 309658 > M> URL: https://svnweb.freebsd.org/changeset/base/309658 > M> > M> Log: > M> Provide dummy sysctls for v_cache_count and v_tcached. > M> > M> Some utilities (notably top(1)) exit if any of their input sysctls don't > M> exist, and the removal of the above-mentioned PG_CACHE-related sysctls > M> makes it difficult to run such utilities on different versions of the > M> kernel without recompiling. > M> > M> Requested by: bde > M> > M> Modified: > M> head/sys/vm/vm_meter.c > M> > M> Modified: head/sys/vm/vm_meter.c > M> ============================================================================== > M> --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) > M> +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) > M> @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec > M> VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); > M> VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); > M> VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); > M> + > M> +#ifndef BURN_BRIDGES > M> +/* > M> + * Provide compatibility sysctls for the benefit of old utilities which exit > M> + * with an error if they cannot be found. > M> + */ > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, > M> + (u_int *)NULL, 0, "Dummy for compatibility"); > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, > M> + (u_int *)NULL, 0, "Dummy for compatibility"); > M> +#endif > > IMHO, there should be some garbage collecting timeout for them. I'd suggest to > delete them from head after stable/12 branch is forked. The intent was to improve compatibility with old userlands, not just to help bridge the transition from 11.0 to 12.0. In general I'm all for removing cruft, but these sysctls are unobtrusive and I don't see any reason to remove them in a specific time frame provided that nothing else breaks compatibility for top(1) (and vmstat(8)). Please feel free to add a timeout if you still disagree, though. From owner-svn-src-head@freebsd.org Wed Dec 7 22:16:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05C4FC6CEE4; Wed, 7 Dec 2016 22:16:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D494E10E9; Wed, 7 Dec 2016 22:16:08 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7MG8va096679; Wed, 7 Dec 2016 22:16:08 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7MG7vT096673; Wed, 7 Dec 2016 22:16:07 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612072216.uB7MG7vT096673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 7 Dec 2016 22:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309686 - in head/sys: dev/ath dev/mwl dev/rtwn dev/usb/wlan net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 22:16:09 -0000 Author: avos Date: Wed Dec 7 22:16:07 2016 New Revision: 309686 URL: https://svnweb.freebsd.org/changeset/base/309686 Log: net80211 + drivers: convert to ieee80211_crypto_get_key_wepidx(). Proposed by: adrian Modified: head/sys/dev/ath/if_ath_keycache.c head/sys/dev/mwl/if_mwl.c head/sys/dev/rtwn/if_rtwn_cam.c head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/net80211/ieee80211_crypto.c Modified: head/sys/dev/ath/if_ath_keycache.c ============================================================================== --- head/sys/dev/ath/if_ath_keycache.c Wed Dec 7 22:01:09 2016 (r309685) +++ head/sys/dev/ath/if_ath_keycache.c Wed Dec 7 22:16:07 2016 (r309686) @@ -449,7 +449,8 @@ ath_key_alloc(struct ieee80211vap *vap, * have no way to check if they've already * been allocated. */ - *keyix = *rxkeyix = k - vap->iv_nw_keys; + *keyix = *rxkeyix = + ieee80211_crypto_get_key_wepidx(vap, k); return 1; } /* Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Wed Dec 7 22:01:09 2016 (r309685) +++ head/sys/dev/mwl/if_mwl.c Wed Dec 7 22:16:07 2016 (r309686) @@ -1529,7 +1529,7 @@ mwl_key_alloc(struct ieee80211vap *vap, return 0; } /* give the caller what they requested */ - *keyix = *rxkeyix = k - vap->iv_nw_keys; + *keyix = *rxkeyix = ieee80211_crypto_get_key_wepidx(vap, k); } else { /* * Firmware handles key allocation. Modified: head/sys/dev/rtwn/if_rtwn_cam.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn_cam.c Wed Dec 7 22:01:09 2016 (r309685) +++ head/sys/dev/rtwn/if_rtwn_cam.c Wed Dec 7 22:16:07 2016 (r309686) @@ -118,7 +118,11 @@ rtwn_key_alloc(struct ieee80211vap *vap, if (&vap->iv_nw_keys[0] <= k && k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) { +#if __FreeBSD_version > 1200018 + *keyix = ieee80211_crypto_get_key_wepidx(vap, k); +#else *keyix = k - vap->iv_nw_keys; +#endif if (sc->sc_hwcrypto != RTWN_CRYPTO_FULL) k->wk_flags |= IEEE80211_KEY_SWCRYPT; else { Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed Dec 7 22:01:09 2016 (r309685) +++ head/sys/dev/usb/wlan/if_rsu.c Wed Dec 7 22:16:07 2016 (r309686) @@ -1428,7 +1428,7 @@ rsu_key_alloc(struct ieee80211vap *vap, if (&vap->iv_nw_keys[0] <= k && k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) { - *keyix = k - vap->iv_nw_keys; + *keyix = ieee80211_crypto_get_key_wepidx(vap, k); } else { if (vap->iv_opmode != IEEE80211_M_STA) { *keyix = 0; Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Wed Dec 7 22:01:09 2016 (r309685) +++ head/sys/dev/usb/wlan/if_rum.c Wed Dec 7 22:16:07 2016 (r309686) @@ -3046,7 +3046,7 @@ rum_key_alloc(struct ieee80211vap *vap, } else *keyix = 0; } else { - *keyix = k - vap->iv_nw_keys; + *keyix = ieee80211_crypto_get_key_wepidx(vap, k); } *rxkeyix = *keyix; return 1; Modified: head/sys/net80211/ieee80211_crypto.c ============================================================================== --- head/sys/net80211/ieee80211_crypto.c Wed Dec 7 22:01:09 2016 (r309685) +++ head/sys/net80211/ieee80211_crypto.c Wed Dec 7 22:16:07 2016 (r309686) @@ -78,7 +78,7 @@ null_key_alloc(struct ieee80211vap *vap, return 0; *keyix = 0; /* NB: use key index 0 for ucast key */ } else { - *keyix = k - vap->iv_nw_keys; + *keyix = ieee80211_crypto_get_key_wepidx(vap, k); } *rxkeyix = IEEE80211_KEYIX_NONE; /* XXX maybe *keyix? */ return 1; From owner-svn-src-head@freebsd.org Wed Dec 7 22:34:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B250C6CA76; Wed, 7 Dec 2016 22:34:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48F67137; Wed, 7 Dec 2016 22:34:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id uB7MYokc022057 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Dec 2016 14:34:51 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id uB7MYoqo022056; Wed, 7 Dec 2016 14:34:50 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Dec 2016 14:34:50 -0800 From: Gleb Smirnoff To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309658 - head/sys/vm Message-ID: <20161207223450.GP27748@FreeBSD.org> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207212647.GO27748@FreeBSD.org> <20161207221548.GA33409@wkstn-mjohnston> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161207221548.GA33409@wkstn-mjohnston> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 22:34:52 -0000 On Wed, Dec 07, 2016 at 02:15:49PM -0800, Mark Johnston wrote: M> On Wed, Dec 07, 2016 at 01:26:47PM -0800, Gleb Smirnoff wrote: M> > On Tue, Dec 06, 2016 at 10:52:45PM +0000, Mark Johnston wrote: M> > M> Author: markj M> > M> Date: Tue Dec 6 22:52:45 2016 M> > M> New Revision: 309658 M> > M> URL: https://svnweb.freebsd.org/changeset/base/309658 M> > M> M> > M> Log: M> > M> Provide dummy sysctls for v_cache_count and v_tcached. M> > M> M> > M> Some utilities (notably top(1)) exit if any of their input sysctls don't M> > M> exist, and the removal of the above-mentioned PG_CACHE-related sysctls M> > M> makes it difficult to run such utilities on different versions of the M> > M> kernel without recompiling. M> > M> M> > M> Requested by: bde M> > M> M> > M> Modified: M> > M> head/sys/vm/vm_meter.c M> > M> M> > M> Modified: head/sys/vm/vm_meter.c M> > M> ============================================================================== M> > M> --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) M> > M> +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) M> > M> @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec M> > M> VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); M> > M> VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); M> > M> VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); M> > M> + M> > M> +#ifndef BURN_BRIDGES M> > M> +/* M> > M> + * Provide compatibility sysctls for the benefit of old utilities which exit M> > M> + * with an error if they cannot be found. M> > M> + */ M> > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, M> > M> + (u_int *)NULL, 0, "Dummy for compatibility"); M> > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, M> > M> + (u_int *)NULL, 0, "Dummy for compatibility"); M> > M> +#endif M> > M> > IMHO, there should be some garbage collecting timeout for them. I'd suggest to M> > delete them from head after stable/12 branch is forked. M> M> The intent was to improve compatibility with old userlands, not just to M> help bridge the transition from 11.0 to 12.0. In general I'm all for M> removing cruft, but these sysctls are unobtrusive and I don't see any M> reason to remove them in a specific time frame provided that nothing M> else breaks compatibility for top(1) (and vmstat(8)). Please feel free M> to add a timeout if you still disagree, though. I'm fine with a bigger timeout. 130000, 140000 or 150000. Anything but the infinity :) -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Dec 7 22:52:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8250CC6CF57; Wed, 7 Dec 2016 22:52:13 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3063DD81; Wed, 7 Dec 2016 22:52:13 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7MqCFW012649; Wed, 7 Dec 2016 22:52:12 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7MqCb6012648; Wed, 7 Dec 2016 22:52:12 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201612072252.uB7MqCb6012648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 7 Dec 2016 22:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309687 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 22:52:13 -0000 Author: gavin Date: Wed Dec 7 22:52:12 2016 New Revision: 309687 URL: https://svnweb.freebsd.org/changeset/base/309687 Log: Switch if_run.c to use a bitmap for debug levels rather than arbitrary values. This more closely matches other wifi drivers in the tree. The bitmap levels have been based closely on other drivers (primarily [u]rtwn(4)) in the hope that one day these can be unified into a shared wifi-debug framework. This is the first step of several pieces of work I'm planning on doing with the run(4) driver. I may well adjust and refine some of the debug bitmaps at a later date. Reviewed by: adrian, avos Differential Revision: https://reviews.freebsd.org/D8704 Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Dec 7 22:16:07 2016 (r309686) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 7 22:52:12 2016 (r309687) @@ -86,6 +86,35 @@ int run_debug = 0; static SYSCTL_NODE(_hw_usb, OID_AUTO, run, CTLFLAG_RW, 0, "USB run"); SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, CTLFLAG_RWTUN, &run_debug, 0, "run debug level"); + +enum { + RUN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ + RUN_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ + RUN_DEBUG_RECV = 0x00000004, /* basic recv operation */ + RUN_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */ + RUN_DEBUG_STATE = 0x00000010, /* 802.11 state transitions */ + RUN_DEBUG_RATE = 0x00000020, /* rate adaptation */ + RUN_DEBUG_USB = 0x00000040, /* usb requests */ + RUN_DEBUG_FIRMWARE = 0x00000080, /* firmware(9) loading debug */ + RUN_DEBUG_BEACON = 0x00000100, /* beacon handling */ + RUN_DEBUG_INTR = 0x00000200, /* ISR */ + RUN_DEBUG_TEMP = 0x00000400, /* temperature calibration */ + RUN_DEBUG_ROM = 0x00000800, /* various ROM info */ + RUN_DEBUG_KEY = 0x00001000, /* crypto keys management */ + RUN_DEBUG_TXPWR = 0x00002000, /* dump Tx power values */ + RUN_DEBUG_RSSI = 0x00004000, /* dump RSSI lookups */ + RUN_DEBUG_RESET = 0x00008000, /* initialization progress */ + RUN_DEBUG_CALIB = 0x00010000, /* calibration progress */ + RUN_DEBUG_CMD = 0x00010000, /* command queue */ + RUN_DEBUG_ANY = 0xffffffff +}; + +#define RUN_DPRINTF(_sc, _m, ...) do { \ + if (run_debug & (_m)) \ + device_printf((_sc)->sc_dev, __VA_ARGS__); \ +} while(0) +#else +#define RUN_DPRINTF(_sc, _m, ...) do { (void) _sc; } while (0) #endif #define IEEE80211_HAS_ADDR4(wh) IEEE80211_IS_DSTODS(wh) @@ -980,7 +1009,7 @@ run_vap_create(struct ieee80211com *ic, if (opmode == IEEE80211_M_HOSTAP) sc->cmdq_run = RUN_CMDQ_GO; - DPRINTF("rvp_id=%d bmap=%x rvp_cnt=%d\n", + RUN_DPRINTF(sc, RUN_DEBUG_STATE, "rvp_id=%d bmap=%x rvp_cnt=%d\n", rvp->rvp_id, sc->rvp_bmap, sc->rvp_cnt); return (vap); @@ -1012,7 +1041,8 @@ run_vap_delete(struct ieee80211vap *vap) run_set_region_4(sc, RT2860_BCN_BASE(rvp_id), 0, 512); --sc->rvp_cnt; - DPRINTF("vap=%p rvp_id=%d bmap=%x rvp_cnt=%d\n", + RUN_DPRINTF(sc, RUN_DEBUG_STATE, + "vap=%p rvp_id=%d bmap=%x rvp_cnt=%d\n", vap, rvp_id, sc->rvp_bmap, sc->rvp_cnt); RUN_UNLOCK(sc); @@ -1040,7 +1070,8 @@ run_cmdq_cb(void *arg, int pending) RUN_LOCK(sc); for (i = sc->cmdq_exec; sc->cmdq[i].func && pending; i = sc->cmdq_exec, pending--) { - DPRINTFN(6, "cmdq_exec=%d pending=%d\n", i, pending); + RUN_DPRINTF(sc, RUN_DEBUG_CMD, "cmdq_exec=%d pending=%d\n", + i, pending); if (sc->cmdq_run == RUN_CMDQ_GO) { /* * If arg0 is NULL, callback func needs more @@ -1226,7 +1257,8 @@ run_do_request(struct run_softc *sc, req, data, 0, NULL, 250 /* ms */); if (err == 0) break; - DPRINTFN(1, "Control request failed, %s (retrying)\n", + RUN_DPRINTF(sc, RUN_DEBUG_USB, + "Control request failed, %s (retrying)\n", usbd_errstr(err)); run_delay(sc, 10); } @@ -1702,7 +1734,8 @@ run_get_txpower(struct run_softc *sc) if (sc->txpow2[i] < 0 || sc->txpow2[i] > 31) sc->txpow2[i] = 5; } - DPRINTF("chan %d: power1=%d, power2=%d\n", + RUN_DPRINTF(sc, RUN_DEBUG_TXPWR, + "chan %d: power1=%d, power2=%d\n", rt2860_rf2850[i].chan, sc->txpow1[i], sc->txpow2[i]); } /* Read power settings for 5GHz channels. */ @@ -1723,7 +1756,8 @@ run_get_txpower(struct run_softc *sc) if (sc->txpow2[14 + i] < -7 || sc->txpow2[14 + i] > 15) sc->txpow2[14 + i] = 5; } - DPRINTF("chan %d: power1=%d, power2=%d\n", + RUN_DPRINTF(sc, RUN_DEBUG_TXPWR, + "chan %d: power1=%d, power2=%d\n", rt2860_rf2850[14 + i].chan, sc->txpow1[14 + i], sc->txpow2[14 + i]); } @@ -1742,14 +1776,15 @@ run_read_eeprom(struct run_softc *sc) sc->sc_srom_read = run_eeprom_read_2; if (sc->mac_ver >= 0x3070) { run_read(sc, RT3070_EFUSE_CTRL, &tmp); - DPRINTF("EFUSE_CTRL=0x%08x\n", tmp); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, "EFUSE_CTRL=0x%08x\n", tmp); if ((tmp & RT3070_SEL_EFUSE) || sc->mac_ver == 0x3593) sc->sc_srom_read = run_efuse_read_2; } /* read ROM version */ run_srom_read(sc, RT2860_EEPROM_VERSION, &val); - DPRINTF("EEPROM rev=%d, FAE=%d\n", val >> 8, val & 0xff); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, + "EEPROM rev=%d, FAE=%d\n", val >> 8, val & 0xff); /* read MAC address */ run_srom_read(sc, RT2860_EEPROM_MAC01, &val); @@ -1768,8 +1803,8 @@ run_read_eeprom(struct run_softc *sc) run_srom_read(sc, RT2860_EEPROM_BBP_BASE + i, &val); sc->bbp[i].val = val & 0xff; sc->bbp[i].reg = val >> 8; - DPRINTF("BBP%d=0x%02x\n", sc->bbp[i].reg, - sc->bbp[i].val); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, + "BBP%d=0x%02x\n", sc->bbp[i].reg, sc->bbp[i].val); } if (sc->mac_ver >= 0x3071) { /* read vendor RF settings */ @@ -1778,8 +1813,8 @@ run_read_eeprom(struct run_softc *sc) &val); sc->rf[i].val = val & 0xff; sc->rf[i].reg = val >> 8; - DPRINTF("RF%d=0x%02x\n", sc->rf[i].reg, - sc->rf[i].val); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, "RF%d=0x%02x\n", + sc->rf[i].reg, sc->rf[i].val); } } } @@ -1788,7 +1823,8 @@ run_read_eeprom(struct run_softc *sc) run_srom_read(sc, (sc->mac_ver != 0x3593) ? RT2860_EEPROM_FREQ_LEDS : RT3593_EEPROM_FREQ, &val); sc->freq = ((val & 0xff) != 0xff) ? val & 0xff : 0; - DPRINTF("EEPROM freq offset %d\n", sc->freq & 0xff); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, "EEPROM freq offset %d\n", + sc->freq & 0xff); run_srom_read(sc, (sc->mac_ver != 0x3593) ? RT2860_EEPROM_FREQ_LEDS : RT3593_EEPROM_FREQ_LEDS, &val); @@ -1808,7 +1844,8 @@ run_read_eeprom(struct run_softc *sc) sc->led[1] = 0x2221; sc->led[2] = 0x5627; /* differs from RT2860 */ } - DPRINTF("EEPROM LED mode=0x%02x, LEDs=0x%04x/0x%04x/0x%04x\n", + RUN_DPRINTF(sc, RUN_DEBUG_ROM, + "EEPROM LED mode=0x%02x, LEDs=0x%04x/0x%04x/0x%04x\n", sc->leds, sc->led[0], sc->led[1], sc->led[2]); /* read RF information */ @@ -1820,7 +1857,6 @@ run_read_eeprom(struct run_softc *sc) if (val == 0xffff) { device_printf(sc->sc_dev, "invalid EEPROM antenna info, using default\n"); - DPRINTF("invalid EEPROM antenna info, using default\n"); if (sc->mac_ver == 0x3572) { /* default to RF3052 2T2R */ sc->rf_rev = RT3070_RF_3052; @@ -1846,12 +1882,12 @@ run_read_eeprom(struct run_softc *sc) sc->ntxchains = (val >> 4) & 0xf; sc->nrxchains = val & 0xf; } - DPRINTF("EEPROM RF rev=0x%04x chains=%dT%dR\n", + RUN_DPRINTF(sc, RUN_DEBUG_ROM, "EEPROM RF rev=0x%04x chains=%dT%dR\n", sc->rf_rev, sc->ntxchains, sc->nrxchains); /* check if RF supports automatic Tx access gain control */ run_srom_read(sc, RT2860_EEPROM_CONFIG, &val); - DPRINTF("EEPROM CFG 0x%04x\n", val); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, "EEPROM CFG 0x%04x\n", val); /* check if driver should patch the DAC issue */ if ((val >> 8) != 0xff) sc->patch_dac = (val >> 15) & 1; @@ -1884,8 +1920,8 @@ run_read_eeprom(struct run_softc *sc) if (!(val & 0x40)) /* negative number */ delta_5ghz = -delta_5ghz; } - DPRINTF("power compensation=%d (2GHz), %d (5GHz)\n", - delta_2ghz, delta_5ghz); + RUN_DPRINTF(sc, RUN_DEBUG_ROM | RUN_DEBUG_TXPWR, + "power compensation=%d (2GHz), %d (5GHz)\n", delta_2ghz, delta_5ghz); for (ridx = 0; ridx < 5; ridx++) { uint32_t reg; @@ -1899,7 +1935,8 @@ run_read_eeprom(struct run_softc *sc) sc->txpow40mhz_2ghz[ridx] = b4inc(reg, delta_2ghz); sc->txpow40mhz_5ghz[ridx] = b4inc(reg, delta_5ghz); - DPRINTF("ridx %d: power 20MHz=0x%08x, 40MHz/2GHz=0x%08x, " + RUN_DPRINTF(sc, RUN_DEBUG_ROM | RUN_DEBUG_TXPWR, + "ridx %d: power 20MHz=0x%08x, 40MHz/2GHz=0x%08x, " "40MHz/5GHz=0x%08x\n", ridx, sc->txpow20mhz[ridx], sc->txpow40mhz_2ghz[ridx], sc->txpow40mhz_5ghz[ridx]); } @@ -1923,7 +1960,8 @@ run_read_eeprom(struct run_softc *sc) if ((val & 0xff) != 0xff) sc->txmixgain_2ghz = val & 0x7; } - DPRINTF("tx mixer gain=%u (2GHz)\n", sc->txmixgain_2ghz); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, "tx mixer gain=%u (2GHz)\n", + sc->txmixgain_2ghz); } else sc->rssi_2ghz[2] = val & 0xff; /* Ant C */ if (sc->mac_ver == 0x3593) @@ -1943,7 +1981,8 @@ run_read_eeprom(struct run_softc *sc) */ if ((val & 0xff) != 0xff) sc->txmixgain_5ghz = val & 0x7; - DPRINTF("tx mixer gain=%u (5GHz)\n", sc->txmixgain_5ghz); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, "tx mixer gain=%u (5GHz)\n", + sc->txmixgain_5ghz); } else sc->rssi_5ghz[2] = val & 0xff; /* Ant C */ if (sc->mac_ver == 0x3593) { @@ -1959,23 +1998,27 @@ run_read_eeprom(struct run_softc *sc) /* fix broken 5GHz LNA entries */ if (sc->lna[2] == 0 || sc->lna[2] == 0xff) { - DPRINTF("invalid LNA for channel group %d\n", 2); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, + "invalid LNA for channel group %d\n", 2); sc->lna[2] = sc->lna[1]; } if (sc->lna[3] == 0 || sc->lna[3] == 0xff) { - DPRINTF("invalid LNA for channel group %d\n", 3); + RUN_DPRINTF(sc, RUN_DEBUG_ROM, + "invalid LNA for channel group %d\n", 3); sc->lna[3] = sc->lna[1]; } /* fix broken RSSI offset entries */ for (ant = 0; ant < 3; ant++) { if (sc->rssi_2ghz[ant] < -10 || sc->rssi_2ghz[ant] > 10) { - DPRINTF("invalid RSSI%d offset: %d (2GHz)\n", + RUN_DPRINTF(sc, RUN_DEBUG_ROM | RUN_DEBUG_RSSI, + "invalid RSSI%d offset: %d (2GHz)\n", ant + 1, sc->rssi_2ghz[ant]); sc->rssi_2ghz[ant] = 0; } if (sc->rssi_5ghz[ant] < -10 || sc->rssi_5ghz[ant] > 10) { - DPRINTF("invalid RSSI%d offset: %d (5GHz)\n", + RUN_DPRINTF(sc, RUN_DEBUG_ROM | RUN_DEBUG_RSSI, + "invalid RSSI%d offset: %d (5GHz)\n", ant + 1, sc->rssi_5ghz[ant]); sc->rssi_5ghz[ant] = 0; } @@ -2020,7 +2063,8 @@ run_media_change(struct ifnet *ifp) ni = ieee80211_ref_node(vap->iv_bss); rn = RUN_NODE(ni); rn->fix_ridx = ridx; - DPRINTF("rate=%d, fix_ridx=%d\n", rate, rn->fix_ridx); + RUN_DPRINTF(sc, RUN_DEBUG_RATE, "rate=%d, fix_ridx=%d\n", + rate, rn->fix_ridx); ieee80211_free_node(ni); } @@ -2051,7 +2095,7 @@ run_newstate(struct ieee80211vap *vap, e uint8_t bid = 1 << rvp->rvp_id; ostate = vap->iv_state; - DPRINTF("%s -> %s\n", + RUN_DPRINTF(sc, RUN_DEBUG_STATE, "%s -> %s\n", ieee80211_state_name[ostate], ieee80211_state_name[nstate]); @@ -2156,7 +2200,7 @@ run_newstate(struct ieee80211vap *vap, e break; default: - DPRINTFN(6, "undefined case\n"); + RUN_DPRINTF(sc, RUN_DEBUG_STATE, "undefined state\n"); break; } @@ -2219,7 +2263,7 @@ run_wme_update(struct ieee80211com *ic) err: RUN_UNLOCK(sc); if (error) - DPRINTF("WME update failed\n"); + RUN_DPRINTF(sc, RUN_DEBUG_USB, "WME update failed\n"); return (error); } @@ -2261,11 +2305,12 @@ run_key_set_cb(void *arg) mode = RT2860_MODE_AES_CCMP; break; default: - DPRINTF("undefined case\n"); + RUN_DPRINTF(sc, RUN_DEBUG_KEY, "undefined case\n"); return; } - DPRINTFN(1, "associd=%x, keyix=%d, mode=%x, type=%s, tx=%s, rx=%s\n", + RUN_DPRINTF(sc, RUN_DEBUG_KEY, + "associd=%x, keyix=%d, mode=%x, type=%s, tx=%s, rx=%s\n", associd, k->wk_keyix, mode, (k->wk_flags & IEEE80211_KEY_GROUP) ? "group" : "pairwise", (k->wk_flags & IEEE80211_KEY_XMIT) ? "on" : "off", @@ -2357,7 +2402,7 @@ run_key_set(struct ieee80211vap *vap, st uint32_t i; i = RUN_CMDQ_GET(&sc->cmdq_store); - DPRINTF("cmdq_store=%d\n", i); + RUN_DPRINTF(sc, RUN_DEBUG_KEY, "cmdq_store=%d\n", i); sc->cmdq[i].func = run_key_set_cb; sc->cmdq[i].arg0 = NULL; sc->cmdq[i].arg1 = vap; @@ -2396,13 +2441,14 @@ run_key_delete_cb(void *arg) if (k->wk_flags & IEEE80211_KEY_GROUP) { /* remove group key */ - DPRINTF("removing group key\n"); + RUN_DPRINTF(sc, RUN_DEBUG_KEY, "removing group key\n"); run_read(sc, RT2860_SKEY_MODE_0_7, &attr); attr &= ~(0xf << (k->wk_keyix * 4)); run_write(sc, RT2860_SKEY_MODE_0_7, attr); } else { /* remove pairwise key */ - DPRINTF("removing key for wcid %x\n", k->wk_pad); + RUN_DPRINTF(sc, RUN_DEBUG_KEY, + "removing key for wcid %x\n", k->wk_pad); /* matching wcid was written to wk_pad in run_key_set() */ wcid = k->wk_pad; run_read(sc, RT2860_WCID_ATTR(wcid), &attr); @@ -2432,7 +2478,7 @@ run_key_delete(struct ieee80211vap *vap, * So, use atomic instead. */ i = RUN_CMDQ_GET(&sc->cmdq_store); - DPRINTF("cmdq_store=%d\n", i); + RUN_DPRINTF(sc, RUN_DEBUG_KEY, "cmdq_store=%d\n", i); sc->cmdq[i].func = run_key_delete_cb; sc->cmdq[i].arg0 = NULL; sc->cmdq[i].arg1 = sc; @@ -2504,7 +2550,7 @@ run_drain_fifo(void *arg) for (;;) { /* drain Tx status FIFO (maxsize = 16) */ run_read(sc, RT2860_TX_STAT_FIFO, &stat); - DPRINTFN(4, "tx stat 0x%08x\n", stat); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "tx stat 0x%08x\n", stat); if (!(stat & RT2860_TXQ_VLD)) break; @@ -2543,7 +2589,7 @@ run_drain_fifo(void *arg) (*wstat)[RUN_RETRY] += retry; } } - DPRINTFN(3, "count=%d\n", sc->fifo_cnt); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "count=%d\n", sc->fifo_cnt); sc->fifo_cnt = 0; } @@ -2587,9 +2633,9 @@ run_iter_func(void *arg, struct ieee8021 txs->nframes = txs->nretries + txs->nsuccess + le16toh(sta[0].error.fail); - DPRINTFN(3, "retrycnt=%d success=%d failcnt=%d\n", - txs->nretries, txs->nsuccess, - le16toh(sta[0].error.fail)); + RUN_DPRINTF(sc, RUN_DEBUG_RATE, + "retrycnt=%d success=%d failcnt=%d\n", + txs->nretries, txs->nsuccess, le16toh(sta[0].error.fail)); } else { wstat = &(sc->wcid_stats[RUN_AID2WCID(ni->ni_associd)]); @@ -2600,7 +2646,8 @@ run_iter_func(void *arg, struct ieee8021 txs->nretries = (*wstat)[RUN_RETRY]; txs->nsuccess = (*wstat)[RUN_SUCCESS]; txs->nframes = (*wstat)[RUN_TXCNT]; - DPRINTFN(3, "retrycnt=%d txcnt=%d success=%d\n", + RUN_DPRINTF(sc, RUN_DEBUG_RATE, + "retrycnt=%d txcnt=%d success=%d\n", txs->nretries, txs->nframes, txs->nsuccess); memset(wstat, 0, sizeof(*wstat)); @@ -2612,7 +2659,7 @@ run_iter_func(void *arg, struct ieee8021 fail: RUN_UNLOCK(sc); - DPRINTFN(3, "ridx=%d\n", rn->amrr_ridx); + RUN_DPRINTF(sc, RUN_DEBUG_RATE, "ridx=%d\n", rn->amrr_ridx); } static void @@ -2660,7 +2707,7 @@ run_newassoc(struct ieee80211_node *ni, * Need to defer. */ uint32_t cnt = RUN_CMDQ_GET(&sc->cmdq_store); - DPRINTF("cmdq_store=%d\n", cnt); + RUN_DPRINTF(sc, RUN_DEBUG_STATE, "cmdq_store=%d\n", cnt); sc->cmdq[cnt].func = run_newassoc_cb; sc->cmdq[cnt].arg0 = NULL; sc->cmdq[cnt].arg1 = ni; @@ -2668,7 +2715,8 @@ run_newassoc(struct ieee80211_node *ni, ieee80211_runtask(ic, &sc->cmdq_task); } - DPRINTF("new assoc isnew=%d associd=%x addr=%s\n", + RUN_DPRINTF(sc, RUN_DEBUG_STATE, + "new assoc isnew=%d associd=%x addr=%s\n", isnew, ni->ni_associd, ether_sprintf(ni->ni_macaddr)); for (i = 0; i < rs->rs_nrates; i++) { @@ -2691,7 +2739,8 @@ run_newassoc(struct ieee80211_node *ni, /* no basic rate found, use mandatory one */ rn->ctl_ridx[i] = rt2860_rates[ridx].ctl_ridx; } - DPRINTF("rate=0x%02x ridx=%d ctl_ridx=%d\n", + RUN_DPRINTF(sc, RUN_DEBUG_STATE | RUN_DEBUG_RATE, + "rate=0x%02x ridx=%d ctl_ridx=%d\n", rs->rs_rates[i], rn->ridx[i], rn->ctl_ridx[i]); } rate = vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)].mgmtrate; @@ -2699,7 +2748,8 @@ run_newassoc(struct ieee80211_node *ni, if (rt2860_rates[ridx].rate == rate) break; rn->mgt_ridx = ridx; - DPRINTF("rate=%d, mgmt_ridx=%d\n", rate, rn->mgt_ridx); + RUN_DPRINTF(sc, RUN_DEBUG_STATE | RUN_DEBUG_RATE, + "rate=%d, mgmt_ridx=%d\n", rate, rn->mgt_ridx); RUN_LOCK(sc); if(sc->ratectl_run != RUN_RATECTL_OFF) @@ -2746,7 +2796,8 @@ run_recv_mgmt(struct ieee80211_node *ni, rx_tstamp = le64toh(rx_tstamp); if (ni_tstamp >= rx_tstamp) { - DPRINTF("ibss merge, tsf %ju tstamp %ju\n", + RUN_DPRINTF(sc, RUN_DEBUG_RECV | RUN_DEBUG_BEACON, + "ibss merge, tsf %ju tstamp %ju\n", (uintmax_t)rx_tstamp, (uintmax_t)ni_tstamp); (void) ieee80211_ibss_merge(ni); } @@ -2776,7 +2827,8 @@ run_rx_frame(struct run_softc *sc, struc if (__predict_false(len > dmalen)) { m_freem(m); counter_u64_add(ic->ic_ierrors, 1); - DPRINTF("bad RXWI length %u > %u\n", len, dmalen); + RUN_DPRINTF(sc, RUN_DEBUG_RECV, + "bad RXWI length %u > %u\n", len, dmalen); return; } /* Rx descriptor is located at the end */ @@ -2786,7 +2838,8 @@ run_rx_frame(struct run_softc *sc, struc if (__predict_false(flags & (RT2860_RX_CRCERR | RT2860_RX_ICVERR))) { m_freem(m); counter_u64_add(ic->ic_ierrors, 1); - DPRINTF("%s error.\n", (flags & RT2860_RX_CRCERR)?"CRC":"ICV"); + RUN_DPRINTF(sc, RUN_DEBUG_RECV, "%s error.\n", + (flags & RT2860_RX_CRCERR)?"CRC":"ICV"); return; } @@ -2801,7 +2854,8 @@ run_rx_frame(struct run_softc *sc, struc } if (flags & RT2860_RX_L2PAD) { - DPRINTFN(8, "received RT2860_RX_L2PAD frame\n"); + RUN_DPRINTF(sc, RUN_DEBUG_RECV, + "received RT2860_RX_L2PAD frame\n"); len += 2; } @@ -2815,7 +2869,8 @@ run_rx_frame(struct run_softc *sc, struc rxwi->keyidx); m_freem(m); counter_u64_add(ic->ic_ierrors, 1); - DPRINTF("MIC error. Someone is lying.\n"); + RUN_DPRINTF(sc, RUN_DEBUG_RECV, + "MIC error. Someone is lying.\n"); return; } @@ -2896,11 +2951,13 @@ run_bulk_rx_callback(struct usb_xfer *xf switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - DPRINTFN(15, "rx done, actlen=%d\n", xferlen); + RUN_DPRINTF(sc, RUN_DEBUG_RECV, + "rx done, actlen=%d\n", xferlen); if (xferlen < (int)(sizeof(uint32_t) + rxwisize + sizeof(struct rt2870_rxd))) { - DPRINTF("xfer too short %d\n", xferlen); + RUN_DPRINTF(sc, RUN_DEBUG_RECV_DESC | RUN_DEBUG_USB, + "xfer too short %d\n", xferlen); goto tr_setup; } @@ -2915,7 +2972,8 @@ tr_setup: MJUMPAGESIZE /* xfer can be bigger than MCLBYTES */); } if (sc->rx_m == NULL) { - DPRINTF("could not allocate mbuf - idle with stall\n"); + RUN_DPRINTF(sc, RUN_DEBUG_RECV | RUN_DEBUG_RECV_DESC, + "could not allocate mbuf - idle with stall\n"); counter_u64_add(ic->ic_ierrors, 1); usbd_xfer_set_stall(xfer); usbd_xfer_set_frames(xfer, 0); @@ -2963,11 +3021,13 @@ tr_setup: if ((dmalen >= (uint32_t)-8) || (dmalen == 0) || ((dmalen & 3) != 0)) { - DPRINTF("bad DMA length %u\n", dmalen); + RUN_DPRINTF(sc, RUN_DEBUG_RECV_DESC | RUN_DEBUG_USB, + "bad DMA length %u\n", dmalen); break; } if ((dmalen + 8) > (uint32_t)xferlen) { - DPRINTF("bad DMA length %u > %d\n", + RUN_DPRINTF(sc, RUN_DEBUG_RECV_DESC | RUN_DEBUG_USB, + "bad DMA length %u > %d\n", dmalen + 8, xferlen); break; } @@ -2985,7 +3045,8 @@ tr_setup: /* copy aggregated frames to another mbuf */ m0 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m0 == NULL)) { - DPRINTF("could not allocate mbuf\n"); + RUN_DPRINTF(sc, RUN_DEBUG_RECV_DESC, + "could not allocate mbuf\n"); counter_u64_add(ic->ic_ierrors, 1); break; } @@ -3038,8 +3099,8 @@ run_bulk_tx_callbackN(struct usb_xfer *x switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - DPRINTFN(11, "transfer complete: %d " - "bytes @ index %d\n", actlen, index); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT | RUN_DEBUG_USB, + "transfer complete: %d bytes @ index %d\n", actlen, index); data = usbd_xfer_get_priv(xfer); run_tx_free(pq, data, 0); @@ -3059,8 +3120,8 @@ tr_setup: sizeof(data->desc) + sizeof(uint32_t) : sizeof(data->desc); if ((m->m_pkthdr.len + size + 3 + 8) > RUN_MAX_TXSZ) { - DPRINTF("data overflow, %u bytes\n", - m->m_pkthdr.len); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT_DESC | RUN_DEBUG_USB, + "data overflow, %u bytes\n", m->m_pkthdr.len); run_tx_free(pq, data, 1); goto tr_setup; } @@ -3093,7 +3154,8 @@ tr_setup: ieee80211_radiotap_tx(vap, m); } - DPRINTFN(11, "sending frame len=%u/%u @ index %d\n", + RUN_DPRINTF(sc, RUN_DEBUG_XMIT | RUN_DEBUG_USB, + "sending frame len=%u/%u @ index %d\n", m->m_pkthdr.len, size, index); usbd_xfer_set_frame_len(xfer, 0, size); @@ -3104,8 +3166,8 @@ tr_setup: break; default: - DPRINTF("USB transfer error, %s\n", - usbd_errstr(error)); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT | RUN_DEBUG_USB, + "USB transfer error, %s\n", usbd_errstr(error)); data = usbd_xfer_get_priv(xfer); @@ -3123,7 +3185,8 @@ tr_setup: if (error == USB_ERR_TIMEOUT) { device_printf(sc->sc_dev, "device timeout\n"); uint32_t i = RUN_CMDQ_GET(&sc->cmdq_store); - DPRINTF("cmdq_store=%d\n", i); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT | RUN_DEBUG_USB, + "cmdq_store=%d\n", i); sc->cmdq[i].func = run_usb_timeout_cb; sc->cmdq[i].arg0 = vap; ieee80211_runtask(ic, &sc->cmdq_task); @@ -3294,7 +3357,7 @@ run_tx(struct run_softc *sc, struct mbuf } qflags = (qid < 4) ? RT2860_TX_QSEL_EDCA : RT2860_TX_QSEL_HCCA; - DPRINTFN(8, "qos %d\tqid %d\ttid %d\tqflags %x\n", + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "qos %d\tqid %d\ttid %d\tqflags %x\n", qos, qid, tid, qflags); chan = (ni->ni_chan != IEEE80211_CHAN_ANYC)?ni->ni_chan:ic->ic_curchan; @@ -3327,7 +3390,7 @@ run_tx(struct run_softc *sc, struct mbuf /* reserve slots for mgmt packets, just in case */ if (sc->sc_epq[qid].tx_nfree < 3) { - DPRINTFN(10, "tx ring %d is full\n", qid); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "tx ring %d is full\n", qid); return (-1); } @@ -3391,7 +3454,7 @@ run_tx(struct run_softc *sc, struct mbuf * with a non-sleepable lock, tcpinp. So, need to defer. */ uint32_t i = RUN_CMDQ_GET(&sc->cmdq_store); - DPRINTFN(6, "cmdq_store=%d\n", i); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "cmdq_store=%d\n", i); sc->cmdq[i].func = run_drain_fifo; sc->cmdq[i].arg0 = sc; ieee80211_runtask(ic, &sc->cmdq_task); @@ -3402,7 +3465,8 @@ run_tx(struct run_softc *sc, struct mbuf usbd_transfer_start(sc->sc_xfer[qid]); - DPRINTFN(8, "sending data frame len=%d rate=%d qid=%d\n", + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, + "sending data frame len=%d rate=%d qid=%d\n", m->m_pkthdr.len + (int)(sizeof(struct rt2870_txd) + sizeof(struct rt2860_txwi)), rt2860_rates[ridx].rate, qid); @@ -3464,9 +3528,9 @@ run_tx_mgt(struct run_softc *sc, struct run_set_tx_desc(sc, data); - DPRINTFN(10, "sending mgt frame len=%d rate=%d\n", m->m_pkthdr.len + - (int)(sizeof(struct rt2870_txd) + sizeof(struct rt2860_txwi)), - rt2860_rates[ridx].rate); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "sending mgt frame len=%d rate=%d\n", + m->m_pkthdr.len + (int)(sizeof(struct rt2870_txd) + + sizeof(struct rt2860_txwi)), rt2860_rates[ridx].rate); STAILQ_INSERT_TAIL(&sc->sc_epq[0].tx_qh, data, next); @@ -3527,7 +3591,7 @@ run_sendprot(struct run_softc *sc, } if (mprot == NULL) { if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); - DPRINTF("could not allocate mbuf\n"); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "could not allocate mbuf\n"); return (ENOBUFS); } @@ -3553,7 +3617,7 @@ run_sendprot(struct run_softc *sc, run_set_tx_desc(sc, data); - DPRINTFN(1, "sending prot len=%u rate=%u\n", + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "sending prot len=%u rate=%u\n", m->m_pkthdr.len, rate); STAILQ_INSERT_TAIL(&sc->sc_epq[0].tx_qh, data, next); @@ -3608,7 +3672,8 @@ run_tx_param(struct run_softc *sc, struc if (sc->sc_epq[0].tx_nfree == 0) { /* let caller free mbuf */ - DPRINTF("sending raw frame, but tx ring is full\n"); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, + "sending raw frame, but tx ring is full\n"); return (EIO); } data = STAILQ_FIRST(&sc->sc_epq[0].tx_fh); @@ -3632,7 +3697,7 @@ run_tx_param(struct run_softc *sc, struc run_set_tx_desc(sc, data); - DPRINTFN(10, "sending raw frame len=%u rate=%u\n", + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "sending raw frame len=%u rate=%u\n", m->m_pkthdr.len, rate); STAILQ_INSERT_TAIL(&sc->sc_epq[0].tx_qh, data, next); @@ -3660,13 +3725,13 @@ run_raw_xmit(struct ieee80211_node *ni, if (params == NULL) { /* tx mgt packet */ if ((error = run_tx_mgt(sc, m, ni)) != 0) { - DPRINTF("mgt tx failed\n"); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "mgt tx failed\n"); goto done; } } else { /* tx raw packet with param */ if ((error = run_tx_param(sc, m, ni, params)) != 0) { - DPRINTF("tx with param failed\n"); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "tx with param failed\n"); goto done; } } @@ -4882,7 +4947,7 @@ run_update_beacon(struct ieee80211vap *v ieee80211_beacon_update(ni, rvp->beacon_mbuf, mcast); i = RUN_CMDQ_GET(&sc->cmdq_store); - DPRINTF("cmdq_store=%d\n", i); + RUN_DPRINTF(sc, RUN_DEBUG_BEACON, "cmdq_store=%d\n", i); sc->cmdq[i].func = run_update_beacon_cb; sc->cmdq[i].arg0 = vap; ieee80211_runtask(ic, &sc->cmdq_task); @@ -4948,7 +5013,7 @@ run_updateprot(struct ieee80211com *ic) uint32_t i; i = RUN_CMDQ_GET(&sc->cmdq_store); - DPRINTF("cmdq_store=%d\n", i); + RUN_DPRINTF(sc, RUN_DEBUG_BEACON, "cmdq_store=%d\n", i); sc->cmdq[i].func = run_updateprot_cb; sc->cmdq[i].arg0 = ic; ieee80211_runtask(ic, &sc->cmdq_task); @@ -4990,11 +5055,13 @@ run_usb_timeout_cb(void *arg) vap->iv_opmode != IEEE80211_M_STA) run_reset_livelock(sc); else if (vap->iv_state == IEEE80211_S_SCAN) { - DPRINTF("timeout caused by scan\n"); + RUN_DPRINTF(sc, RUN_DEBUG_USB | RUN_DEBUG_STATE, + "timeout caused by scan\n"); /* cancel bgscan */ ieee80211_cancel_scan(vap); } else - DPRINTF("timeout by unknown cause\n"); + RUN_DPRINTF(sc, RUN_DEBUG_USB | RUN_DEBUG_STATE, + "timeout by unknown cause\n"); } static void @@ -5010,9 +5077,10 @@ run_reset_livelock(struct run_softc *sc) * crazy if protection is enabled. Reset MAC/BBP for a while */ run_read(sc, RT2860_DEBUG, &tmp); - DPRINTFN(3, "debug reg %08x\n", tmp); + RUN_DPRINTF(sc, RUN_DEBUG_RESET, "debug reg %08x\n", tmp); if ((tmp & (1 << 29)) && (tmp & (1 << 7 | 1 << 5))) { - DPRINTF("CTS-to-self livelock detected\n"); + RUN_DPRINTF(sc, RUN_DEBUG_RESET, + "CTS-to-self livelock detected\n"); run_write(sc, RT2860_MAC_SYS_CTRL, RT2860_MAC_SRST); run_delay(sc, 1); run_write(sc, RT2860_MAC_SYS_CTRL, @@ -5033,8 +5101,8 @@ run_update_promisc_locked(struct run_sof run_write(sc, RT2860_RX_FILTR_CFG, tmp); - DPRINTF("%s promiscuous mode\n", (sc->sc_ic.ic_promisc > 0) ? - "entering" : "leaving"); + RUN_DPRINTF(sc, RUN_DEBUG_RECV, "%s promiscuous mode\n", + (sc->sc_ic.ic_promisc > 0) ? "entering" : "leaving"); } static void @@ -5057,8 +5125,8 @@ run_enable_tsf_sync(struct run_softc *sc struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); uint32_t tmp; - DPRINTF("rvp_id=%d ic_opmode=%d\n", RUN_VAP(vap)->rvp_id, - ic->ic_opmode); + RUN_DPRINTF(sc, RUN_DEBUG_BEACON, "rvp_id=%d ic_opmode=%d\n", + RUN_VAP(vap)->rvp_id, ic->ic_opmode); run_read(sc, RT2860_BCN_TIME_CFG, &tmp); tmp &= ~0x1fffff; @@ -5084,7 +5152,8 @@ run_enable_tsf_sync(struct run_softc *sc /* SYNC with nobody */ tmp |= 3 << RT2860_TSF_SYNC_MODE_SHIFT; } else { - DPRINTF("Enabling TSF failed. undefined opmode\n"); + RUN_DPRINTF(sc, RUN_DEBUG_BEACON, + "Enabling TSF failed. undefined opmode\n"); return; } @@ -5194,7 +5263,7 @@ run_updateslot(struct ieee80211com *ic) uint32_t i; i = RUN_CMDQ_GET(&sc->cmdq_store); - DPRINTF("cmdq_store=%d\n", i); + RUN_DPRINTF(sc, RUN_DEBUG_BEACON, "cmdq_store=%d\n", i); sc->cmdq[i].func = run_updateslot_cb; sc->cmdq[i].arg0 = ic; ieee80211_runtask(ic, &sc->cmdq_task); @@ -6213,17 +6282,20 @@ run_stop(void *arg) /* wait for pending Tx to complete */ for (ntries = 0; ntries < 100; ntries++) { if (run_read(sc, RT2860_TXRXQ_PCNT, &tmp) != 0) { - DPRINTF("Cannot read Tx queue count\n"); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT | RUN_DEBUG_RESET, + "Cannot read Tx queue count\n"); break; } if ((tmp & RT2860_TX2Q_PCNT_MASK) == 0) { - DPRINTF("All Tx cleared\n"); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT | RUN_DEBUG_RESET, + "All Tx cleared\n"); break; } run_delay(sc, 10); } if (ntries >= 100) - DPRINTF("There are still pending Tx\n"); + RUN_DPRINTF(sc, RUN_DEBUG_XMIT | RUN_DEBUG_RESET, + "There are still pending Tx\n"); run_delay(sc, 10); run_write(sc, RT2860_USB_DMA_CFG, 0); From owner-svn-src-head@freebsd.org Wed Dec 7 23:18:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4BF7C6C5A6; Wed, 7 Dec 2016 23:18:01 +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 767701826; Wed, 7 Dec 2016 23:18:01 +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 uB7NI0oL021359; Wed, 7 Dec 2016 23:18:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7NI0mf021358; Wed, 7 Dec 2016 23:18:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612072318.uB7NI0mf021358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 7 Dec 2016 23:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309688 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 23:18:01 -0000 Author: glebius Date: Wed Dec 7 23:18:00 2016 New Revision: 309688 URL: https://svnweb.freebsd.org/changeset/base/309688 Log: Address regressions in SA-16:37.libc. PR: 215105 Submitted by: Modified: head/lib/libc/net/linkaddr.c Modified: head/lib/libc/net/linkaddr.c ============================================================================== --- head/lib/libc/net/linkaddr.c Wed Dec 7 22:52:12 2016 (r309687) +++ head/lib/libc/net/linkaddr.c Wed Dec 7 23:18:00 2016 (r309688) @@ -125,7 +125,7 @@ link_ntoa(const struct sockaddr_dl *sdl) static char obuf[64]; _Static_assert(sizeof(obuf) >= IFNAMSIZ + 20, "obuf is too small"); char *out; - const char *in, *inlim; + const u_char *in, *inlim; int namelen, i, rem; namelen = (sdl->sdl_nlen <= IFNAMSIZ) ? sdl->sdl_nlen : IFNAMSIZ; @@ -142,11 +142,11 @@ link_ntoa(const struct sockaddr_dl *sdl) } } - in = (const char *)sdl->sdl_data + sdl->sdl_nlen; + in = (const u_char *)sdl->sdl_data + sdl->sdl_nlen; inlim = in + sdl->sdl_alen; while (in < inlim && rem > 1) { - if (in != (const char *)sdl->sdl_data + sdl->sdl_nlen) { + if (in != (const u_char *)sdl->sdl_data + sdl->sdl_nlen) { *out++ = '.'; rem--; } @@ -154,15 +154,14 @@ link_ntoa(const struct sockaddr_dl *sdl) if (i > 0xf) { if (rem < 3) break; + *out++ = hexlist[i >> 4]; *out++ = hexlist[i & 0xf]; - i >>= 4; - *out++ = hexlist[i]; rem -= 2; } else { if (rem < 2) break; *out++ = hexlist[i]; - rem++; + rem--; } } *out = 0; From owner-svn-src-head@freebsd.org Wed Dec 7 23:34:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82C88C6CB5F; Wed, 7 Dec 2016 23:34:00 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5261CB35; Wed, 7 Dec 2016 23:34:00 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB7NXxfO029698; Wed, 7 Dec 2016 23:33:59 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7NXxlb029697; Wed, 7 Dec 2016 23:33:59 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612072333.uB7NXxlb029697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 7 Dec 2016 23:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309695 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 23:34:00 -0000 Author: avos Date: Wed Dec 7 23:33:59 2016 New Revision: 309695 URL: https://svnweb.freebsd.org/changeset/base/309695 Log: net80211: remove obsolete comment. The described LOR should be fixed in r302283. Modified: head/sys/net80211/ieee80211_superg.c Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Wed Dec 7 23:32:42 2016 (r309694) +++ head/sys/net80211/ieee80211_superg.c Wed Dec 7 23:33:59 2016 (r309695) @@ -909,12 +909,6 @@ ieee80211_ff_node_init(struct ieee80211_ ieee80211_ff_node_cleanup(ni); } -/* - * Note: this comlock acquisition LORs with the node lock: - * - * 1: sta_join1 -> NODE_LOCK -> node_free -> node_cleanup -> ff_node_cleanup -> COM_LOCK - * 2: TBD - */ void ieee80211_ff_node_cleanup(struct ieee80211_node *ni) { From owner-svn-src-head@freebsd.org Wed Dec 7 23:36:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30B0DC6CCAB; Wed, 7 Dec 2016 23:36:17 +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 005B3F93; Wed, 7 Dec 2016 23:36:16 +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 uB7NaG1A029980; Wed, 7 Dec 2016 23:36:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7NaG5X029979; Wed, 7 Dec 2016 23:36:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612072336.uB7NaG5X029979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Dec 2016 23:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309698 - head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 23:36:17 -0000 Author: markj Date: Wed Dec 7 23:36:15 2016 New Revision: 309698 URL: https://svnweb.freebsd.org/changeset/base/309698 Log: Run DTrace test scripts with "tst" set to the test script file name. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/cddl/usr.sbin/dtrace/tests/tools/dtest.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/dtest.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/dtest.sh Wed Dec 7 23:35:15 2016 (r309697) +++ head/cddl/usr.sbin/dtrace/tests/tools/dtest.sh Wed Dec 7 23:36:15 2016 (r309698) @@ -70,7 +70,7 @@ runtest() err.*.ksh|tst.*.ksh) expr "$TFILE" : 'err.*' >/dev/null && exstatus=1 - ksh "$TFILE" /usr/sbin/dtrace >$STDOUT 2>$STDERR + tst=$TFILE ksh "$TFILE" /usr/sbin/dtrace >$STDOUT 2>$STDERR status=$? if [ $status -ne $exstatus ]; then From owner-svn-src-head@freebsd.org Wed Dec 7 23:37:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 685B5C6CD23; Wed, 7 Dec 2016 23:37:52 +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 37BCF1160; Wed, 7 Dec 2016 23:37:52 +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 uB7NbpVI030073; Wed, 7 Dec 2016 23:37:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7NbpBE030072; Wed, 7 Dec 2016 23:37:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612072337.uB7NbpBE030072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Dec 2016 23:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309699 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 23:37:52 -0000 Author: markj Date: Wed Dec 7 23:37:51 2016 New Revision: 309699 URL: https://svnweb.freebsd.org/changeset/base/309699 Log: Use the native data model instead of forcing ILP32 in tst.provregex3.ksh. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh Wed Dec 7 23:36:15 2016 (r309698) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh Wed Dec 7 23:37:51 2016 (r309699) @@ -56,7 +56,7 @@ prov.h: prov.d $dtrace -h -s prov.d prov.o: prov.d main.o - $dtrace -G -32 -s prov.d main.o + $dtrace -G -s prov.d main.o EOF cat > prov.d < Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07AB1C6CD99; Wed, 7 Dec 2016 23:38:20 +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 B2BEE12E8; Wed, 7 Dec 2016 23:38:19 +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 uB7NcIrw030141; Wed, 7 Dec 2016 23:38:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB7NcIUb030138; Wed, 7 Dec 2016 23:38:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612072338.uB7NcIUb030138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Dec 2016 23:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309700 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 23:38:20 -0000 Author: markj Date: Wed Dec 7 23:38:18 2016 New Revision: 309700 URL: https://svnweb.freebsd.org/changeset/base/309700 Log: Use the correct path to date(1). MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh Wed Dec 7 23:37:51 2016 (r309699) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh Wed Dec 7 23:38:18 2016 (r309700) @@ -45,7 +45,7 @@ EOF spinny() { while true; do - /usr/bin/date > /dev/null + /bin/date > /dev/null done } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh Wed Dec 7 23:37:51 2016 (r309699) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh Wed Dec 7 23:38:18 2016 (r309700) @@ -45,7 +45,7 @@ EOF spinny() { while true; do - /usr/bin/date > /dev/null + /bin/date > /dev/null done } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh Wed Dec 7 23:37:51 2016 (r309699) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh Wed Dec 7 23:38:18 2016 (r309700) @@ -45,7 +45,7 @@ EOF spinny() { while true; do - /usr/bin/date > /dev/null + /bin/date > /dev/null done } From owner-svn-src-head@freebsd.org Thu Dec 8 01:06:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DA04C6B4A0; Thu, 8 Dec 2016 01:06:41 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (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 818B31DB7; Thu, 8 Dec 2016 01:06:41 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from [192.168.2.21] (atc.xcllnt.net [50.0.150.213]) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPS id uB8167q5017072 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Dec 2016 17:06:40 -0800 (PST) (envelope-from marcel@xcllnt.net) From: Marcel Moolenaar Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309394 - head/sys/netpfil/pf Date: Wed, 7 Dec 2016 17:06:41 -0800 In-Reply-To: <20161207210824.GN27748@FreeBSD.org> Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Gleb Smirnoff References: <201612020615.uB26Fxs1049431@repo.freebsd.org> <20161207210824.GN27748@FreeBSD.org> X-Mailer: Apple Mail (2.3251) X-Greylist: Sender IP whitelisted, ACL 39 matched, not delayed by milter-greylist-4.6.1 (mail.xcllnt.net [50.0.150.214]); Wed, 07 Dec 2016 17:06:40 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 01:06:41 -0000 > On Dec 7, 2016, at 1:08 PM, Gleb Smirnoff > wrote: >=20 > Marcel, >=20 > thanks for the fixes. While the problem with the first chunk > in pfsync_sendout() is obvious, the problem you are fixing in th > second chunk in the pfsync_delete_state() is not clear to me. > Can you please explain what scenario are you fixing there? State updates may be pending for state being deleted. This means that the state is still sitting on either the PFSYNC_S_UPD or PFSYNC_S_UPD_C queues. What pfsync(4) does in that case is simply remove the state from those queues and add it to the PFSYNC_S_DEL queue. But, pf(4) has already dropped the reference count for state that=E2=80=99s deleted and the only reference is by pfsync(4) by virtue of being on the PFSYNC_S_UPD or PFSYNC_S_UPD_C queues. When the state gets dequeued from those queues, the reference count drops to 0 and the state is deleted (read: memory freed). But the same state is subsequently added to the PFSYNC_S_DEL queue =E2=80=94 i.e. after the memory was freed. HTH, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@freebsd.org Thu Dec 8 01:10:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAB67C6B7C0; Thu, 8 Dec 2016 01:10:53 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (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 8E726253; Thu, 8 Dec 2016 01:10:53 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from [192.168.2.21] (atc.xcllnt.net [50.0.150.213]) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPS id uB8167q4017072 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Dec 2016 17:06:08 -0800 (PST) (envelope-from marcel@xcllnt.net) From: Marcel Moolenaar Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309394 - head/sys/netpfil/pf Date: Wed, 7 Dec 2016 17:06:08 -0800 In-Reply-To: <20161207210824.GN27748@FreeBSD.org> Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Gleb Smirnoff References: <201612020615.uB26Fxs1049431@repo.freebsd.org> <20161207210824.GN27748@FreeBSD.org> X-Mailer: Apple Mail (2.3251) X-Greylist: Sender IP whitelisted, ACL 39 matched, not delayed by milter-greylist-4.6.1 (mail.xcllnt.net [50.0.150.214]); Wed, 07 Dec 2016 17:06:08 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 01:10:53 -0000 > On Dec 7, 2016, at 1:08 PM, Gleb Smirnoff > wrote: >=20 > Marcel, >=20 > thanks for the fixes. While the problem with the first chunk > in pfsync_sendout() is obvious, the problem you are fixing in th > second chunk in the pfsync_delete_state() is not clear to me. > Can you please explain what scenario are you fixing there? State updates may be pending for state being deleted. This means that the state is still sitting on either the PFSYNC_S_UPD or PFSYNC_S_UPD_C queues. What pfsync(4) does in that case is simply remove the state from those queues and add it to the PFSYNC_S_DEL queue. But, pf(4) has already dropped the reference count for state that=E2=80=99s deleted and the only reference is by pfsync(4) by virtue of being on the PFSYNC_S_UPD or PFSYNC_S_UPD_C queues. When the state gets dequeued from those queues, the reference count drops to 0 and the state is deleted (read: memory freed). But the same state is subsequently added to the PFSYNC_S_DEL queue =E2=80=94 i.e. after the memory was freed. HTH, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@freebsd.org Thu Dec 8 02:07:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C428FC6C862; Thu, 8 Dec 2016 02:07:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 8C00C1C4C; Thu, 8 Dec 2016 02:07:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id BA4517852FC; Thu, 8 Dec 2016 13:07:08 +1100 (AEDT) Date: Thu, 8 Dec 2016 13:07:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Gleb Smirnoff , Mark Johnston , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r309658 - head/sys/vm In-Reply-To: Message-ID: <20161208123844.B935@besplex.bde.org> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207212647.GO27748@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cZeiljLM c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=6Ab79dwixtNJJACnbNEA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 02:07:17 -0000 On Wed, 7 Dec 2016, Warner Losh wrote: > On Wed, Dec 7, 2016 at 2:26 PM, Gleb Smirnoff wrote: >> On Tue, Dec 06, 2016 at 10:52:45PM +0000, Mark Johnston wrote: >> M> Author: markj >> M> Date: Tue Dec 6 22:52:45 2016 >> M> New Revision: 309658 >> M> URL: https://svnweb.freebsd.org/changeset/base/309658 >> M> >> M> Log: >> M> Provide dummy sysctls for v_cache_count and v_tcached. >> M> >> M> Some utilities (notably top(1)) exit if any of their input sysctls don't >> M> exist, and the removal of the above-mentioned PG_CACHE-related sysctls >> M> makes it difficult to run such utilities on different versions of the >> M> kernel without recompiling. >> M> >> M> Requested by: bde >> M> >> M> Modified: >> M> head/sys/vm/vm_meter.c >> M> >> M> Modified: head/sys/vm/vm_meter.c >> M> ============================================================================== >> M> --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) >> M> +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) >> M> @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec >> M> VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); >> M> VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); >> M> VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); >> M> + >> M> +#ifndef BURN_BRIDGES >> M> +/* >> M> + * Provide compatibility sysctls for the benefit of old utilities which exit >> M> + * with an error if they cannot be found. >> M> + */ >> M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, >> M> + (u_int *)NULL, 0, "Dummy for compatibility"); >> M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, >> M> + (u_int *)NULL, 0, "Dummy for compatibility"); >> M> +#endif >> >> IMHO, there should be some garbage collecting timeout for them. I'd suggest to >> delete them from head after stable/12 branch is forked. > > Other places define #if BURN_BRUDGES < 1200000 to make this automatic. The correct ifdef is something like '#if COMPAT_FREEBSD12' to make this non-automatic. Support for this option should of course be removed some time after the support for COMPAT_43 option. That is only 25-30 years old. FreeBSD never imported the rather large COMPAT_42 support from 4.4BSD-Lite (except for TCP_COMPAT_42) since it never supported the arches that needed it, but it still had 1 COMPAT_42 ifdef in udp_usrreq.c until 2002. That ifdef was garbage since the option was not supported (not in conf/options). It was for a sysctl too, but less needed since it was only for the default value. Bruce From owner-svn-src-head@freebsd.org Thu Dec 8 03:36:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F4D5C6C0EB; Thu, 8 Dec 2016 03:36:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 56FAF1660; Thu, 8 Dec 2016 03:36:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id uB83aLOP024204 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Dec 2016 19:36:21 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id uB83aLnN024203; Wed, 7 Dec 2016 19:36:21 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Dec 2016 19:36:21 -0800 From: Gleb Smirnoff To: Bruce Evans Cc: Warner Losh , Mark Johnston , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r309658 - head/sys/vm Message-ID: <20161208033621.GS27748@FreeBSD.org> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207212647.GO27748@FreeBSD.org> <20161208123844.B935@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161208123844.B935@besplex.bde.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 03:36:24 -0000 On Thu, Dec 08, 2016 at 01:07:06PM +1100, Bruce Evans wrote: B> >> M> +#ifndef BURN_BRIDGES B> >> M> +/* B> >> M> + * Provide compatibility sysctls for the benefit of old utilities which exit B> >> M> + * with an error if they cannot be found. B> >> M> + */ B> >> M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, B> >> M> + (u_int *)NULL, 0, "Dummy for compatibility"); B> >> M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, B> >> M> + (u_int *)NULL, 0, "Dummy for compatibility"); B> >> M> +#endif B> >> B> >> IMHO, there should be some garbage collecting timeout for them. I'd suggest to B> >> delete them from head after stable/12 branch is forked. B> > B> > Other places define #if BURN_BRUDGES < 1200000 to make this automatic. B> B> The correct ifdef is something like '#if COMPAT_FREEBSD12' to make this B> non-automatic. Support for this option should of course be removed some B> time after the support for COMPAT_43 option. That is only 25-30 years old. By the way, can anyone explain me why do we still have COMPAT_43 option? I also bet $100 against $10 that it is broken in head in many aspects, since there is no regression suite for it and since nobody uses it. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu Dec 8 04:29:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 747E8C6CF6A; Thu, 8 Dec 2016 04:29:31 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 388C31924; Thu, 8 Dec 2016 04:29:31 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB84TUGq048834; Thu, 8 Dec 2016 04:29:30 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB84TToV048828; Thu, 8 Dec 2016 04:29:29 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201612080429.uB84TToV048828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 8 Dec 2016 04:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309703 - in head/sys: amd64/amd64 arm64/arm64 i386/i386 vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 04:29:31 -0000 Author: alc Date: Thu Dec 8 04:29:29 2016 New Revision: 309703 URL: https://svnweb.freebsd.org/changeset/base/309703 Log: Previously, vm_radix_remove() would panic if the radix trie didn't contain a vm_page_t at the specified index. However, with this change, vm_radix_remove() no longer panics. Instead, it returns NULL if there is no vm_page_t at the specified index. Otherwise, it returns the vm_page_t. The motivation for this change is that it simplifies the use of radix tries in the amd64, arm64, and i386 pmap implementations. Instead of performing a lookup before every remove, the pmap can simply perform the remove. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D8708 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm64/arm64/pmap.c head/sys/i386/i386/pmap.c head/sys/vm/vm_page.c head/sys/vm/vm_radix.c head/sys/vm/vm_radix.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Dec 8 01:07:00 2016 (r309702) +++ head/sys/amd64/amd64/pmap.c Thu Dec 8 04:29:29 2016 (r309703) @@ -614,7 +614,6 @@ static vm_page_t pmap_enter_quick_locked static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); -static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va); static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp); @@ -625,7 +624,7 @@ static int pmap_remove_pde(pmap_t pmap, struct spglist *free, struct rwlock **lockp); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, pd_entry_t ptepde, struct spglist *free, struct rwlock **lockp); -static void pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte); +static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); static void pmap_remove_page(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, struct spglist *free); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, @@ -2209,29 +2208,17 @@ pmap_insert_pt_page(pmap_t pmap, vm_page } /* - * Looks for a page table page mapping the specified virtual address in the - * specified pmap's collection of idle page table pages. Returns NULL if there - * is no page table page corresponding to the specified virtual address. + * Removes the page table page mapping the specified virtual address from the + * specified pmap's collection of idle page table pages, and returns it. + * Otherwise, returns NULL if there is no page table page corresponding to the + * specified virtual address. */ static __inline vm_page_t -pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va) +pmap_remove_pt_page(pmap_t pmap, vm_offset_t va) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); - return (vm_radix_lookup(&pmap->pm_root, pmap_pde_pindex(va))); -} - -/* - * Removes the specified page table page from the specified pmap's collection - * of idle page table pages. The specified page table page must be a member of - * the pmap's collection. - */ -static __inline void -pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte) -{ - - PMAP_LOCK_ASSERT(pmap, MA_OWNED); - vm_radix_remove(&pmap->pm_root, mpte->pindex); + return (vm_radix_remove(&pmap->pm_root, pmap_pde_pindex(va))); } /* @@ -3450,10 +3437,8 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e oldpde = *pde; KASSERT((oldpde & (PG_PS | PG_V)) == (PG_PS | PG_V), ("pmap_demote_pde: oldpde is missing PG_PS and/or PG_V")); - if ((oldpde & PG_A) != 0 && (mpte = pmap_lookup_pt_page(pmap, va)) != - NULL) - pmap_remove_pt_page(pmap, mpte); - else { + if ((oldpde & PG_A) == 0 || (mpte = pmap_remove_pt_page(pmap, va)) == + NULL) { KASSERT((oldpde & PG_W) == 0, ("pmap_demote_pde: page table page for a wired mapping" " is missing")); @@ -3567,11 +3552,10 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_e KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mpte = pmap_lookup_pt_page(pmap, va); + mpte = pmap_remove_pt_page(pmap, va); if (mpte == NULL) panic("pmap_remove_kernel_pde: Missing pt page."); - pmap_remove_pt_page(pmap, mpte); mptepa = VM_PAGE_TO_PHYS(mpte); newpde = mptepa | X86_PG_M | X86_PG_A | X86_PG_RW | X86_PG_V; @@ -3646,9 +3630,8 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t if (pmap == kernel_pmap) { pmap_remove_kernel_pde(pmap, pdq, sva); } else { - mpte = pmap_lookup_pt_page(pmap, sva); + mpte = pmap_remove_pt_page(pmap, sva); if (mpte != NULL) { - pmap_remove_pt_page(pmap, mpte); pmap_resident_count_dec(pmap, 1); KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pde: pte page wire count error")); @@ -5488,9 +5471,8 @@ pmap_remove_pages(pmap_t pmap) TAILQ_EMPTY(&mt->md.pv_list)) vm_page_aflag_clear(mt, PGA_WRITEABLE); } - mpte = pmap_lookup_pt_page(pmap, pv->pv_va); + mpte = pmap_remove_pt_page(pmap, pv->pv_va); if (mpte != NULL) { - pmap_remove_pt_page(pmap, mpte); pmap_resident_count_dec(pmap, 1); KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pages: pte page wire count error")); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Dec 8 01:07:00 2016 (r309702) +++ head/sys/arm64/arm64/pmap.c Thu Dec 8 04:29:29 2016 (r309703) @@ -2509,29 +2509,17 @@ pmap_insert_pt_page(pmap_t pmap, vm_page } /* - * Looks for a page table page mapping the specified virtual address in the - * specified pmap's collection of idle page table pages. Returns NULL if there - * is no page table page corresponding to the specified virtual address. + * Removes the page table page mapping the specified virtual address from the + * specified pmap's collection of idle page table pages, and returns it. + * Otherwise, returns NULL if there is no page table page corresponding to the + * specified virtual address. */ static __inline vm_page_t -pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va) +pmap_remove_pt_page(pmap_t pmap, vm_offset_t va) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); - return (vm_radix_lookup(&pmap->pm_root, pmap_l2_pindex(va))); -} - -/* - * Removes the specified page table page from the specified pmap's collection - * of idle page table pages. The specified page table page must be a member of - * the pmap's collection. - */ -static __inline void -pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte) -{ - - PMAP_LOCK_ASSERT(pmap, MA_OWNED); - vm_radix_remove(&pmap->pm_root, mpte->pindex); + return (vm_radix_remove(&pmap->pm_root, pmap_l2_pindex(va))); } /* @@ -3586,10 +3574,9 @@ pmap_remove_pages(pmap_t pmap) TAILQ_EMPTY(&mt->md.pv_list)) vm_page_aflag_clear(mt, PGA_WRITEABLE); } - ml3 = pmap_lookup_pt_page(pmap, + ml3 = pmap_remove_pt_page(pmap, pv->pv_va); if (ml3 != NULL) { - pmap_remove_pt_page(pmap, ml3); pmap_resident_count_dec(pmap,1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_pages: l3 page wire count error")); @@ -4374,9 +4361,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en return (NULL); } - if ((ml3 = pmap_lookup_pt_page(pmap, va)) != NULL) { - pmap_remove_pt_page(pmap, ml3); - } else { + if ((ml3 = pmap_remove_pt_page(pmap, va)) == NULL) { ml3 = vm_page_alloc(NULL, pmap_l2_pindex(va), (VIRT_IN_DMAP(va) ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Dec 8 01:07:00 2016 (r309702) +++ head/sys/i386/i386/pmap.c Thu Dec 8 04:29:29 2016 (r309703) @@ -318,7 +318,6 @@ static boolean_t pmap_is_modified_pvh(st static boolean_t pmap_is_referenced_pvh(struct md_page *pvh); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); static void pmap_kenter_pde(vm_offset_t va, pd_entry_t newpde); -static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va); static void pmap_pde_attr(pd_entry_t *pde, int cache_bits); static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); static boolean_t pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, @@ -328,7 +327,7 @@ static void pmap_remove_pde(pmap_t pmap, struct spglist *free); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, struct spglist *free); -static void pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte); +static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); static void pmap_remove_page(struct pmap *pmap, vm_offset_t va, struct spglist *free); static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, @@ -1713,29 +1712,17 @@ pmap_insert_pt_page(pmap_t pmap, vm_page } /* - * Looks for a page table page mapping the specified virtual address in the - * specified pmap's collection of idle page table pages. Returns NULL if there - * is no page table page corresponding to the specified virtual address. + * Removes the page table page mapping the specified virtual address from the + * specified pmap's collection of idle page table pages, and returns it. + * Otherwise, returns NULL if there is no page table page corresponding to the + * specified virtual address. */ static __inline vm_page_t -pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va) +pmap_remove_pt_page(pmap_t pmap, vm_offset_t va) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); - return (vm_radix_lookup(&pmap->pm_root, va >> PDRSHIFT)); -} - -/* - * Removes the specified page table page from the specified pmap's collection - * of idle page table pages. The specified page table page must be a member of - * the pmap's collection. - */ -static __inline void -pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte) -{ - - PMAP_LOCK_ASSERT(pmap, MA_OWNED); - vm_radix_remove(&pmap->pm_root, mpte->pindex); + return (vm_radix_remove(&pmap->pm_root, va >> PDRSHIFT)); } /* @@ -2630,10 +2617,8 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t oldpde = *pde; KASSERT((oldpde & (PG_PS | PG_V)) == (PG_PS | PG_V), ("pmap_demote_pde: oldpde is missing PG_PS and/or PG_V")); - if ((oldpde & PG_A) != 0 && (mpte = pmap_lookup_pt_page(pmap, va)) != - NULL) - pmap_remove_pt_page(pmap, mpte); - else { + if ((oldpde & PG_A) == 0 || (mpte = pmap_remove_pt_page(pmap, va)) == + NULL) { KASSERT((oldpde & PG_W) == 0, ("pmap_demote_pde: page table page for a wired mapping" " is missing")); @@ -2770,11 +2755,10 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_e vm_page_t mpte; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mpte = pmap_lookup_pt_page(pmap, va); + mpte = pmap_remove_pt_page(pmap, va); if (mpte == NULL) panic("pmap_remove_kernel_pde: Missing pt page."); - pmap_remove_pt_page(pmap, mpte); mptepa = VM_PAGE_TO_PHYS(mpte); newpde = mptepa | PG_M | PG_A | PG_RW | PG_V; @@ -2841,9 +2825,8 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t if (pmap == kernel_pmap) { pmap_remove_kernel_pde(pmap, pdq, sva); } else { - mpte = pmap_lookup_pt_page(pmap, sva); + mpte = pmap_remove_pt_page(pmap, sva); if (mpte != NULL) { - pmap_remove_pt_page(pmap, mpte); pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pde: pte page wire count error")); @@ -4542,9 +4525,8 @@ pmap_remove_pages(pmap_t pmap) if (TAILQ_EMPTY(&mt->md.pv_list)) vm_page_aflag_clear(mt, PGA_WRITEABLE); } - mpte = pmap_lookup_pt_page(pmap, pv->pv_va); + mpte = pmap_remove_pt_page(pmap, pv->pv_va); if (mpte != NULL) { - pmap_remove_pt_page(pmap, mpte); pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pages: pte page wire count error")); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Dec 8 01:07:00 2016 (r309702) +++ head/sys/vm/vm_page.c Thu Dec 8 04:29:29 2016 (r309703) @@ -1241,9 +1241,8 @@ vm_page_insert_radixdone(vm_page_t m, vm /* * vm_page_remove: * - * Removes the given mem entry from the object/offset-page - * table and the object page list, but do not invalidate/terminate - * the backing store. + * Removes the specified page from its containing object, but does not + * invalidate any backing storage. * * The object must be locked. The page must be locked if it is managed. */ @@ -1251,6 +1250,7 @@ void vm_page_remove(vm_page_t m) { vm_object_t object; + vm_page_t mrem; if ((m->oflags & VPO_UNMANAGED) == 0) vm_page_assert_locked(m); @@ -1259,11 +1259,12 @@ vm_page_remove(vm_page_t m) VM_OBJECT_ASSERT_WLOCKED(object); if (vm_page_xbusied(m)) vm_page_xunbusy_maybelocked(m); + mrem = vm_radix_remove(&object->rtree, m->pindex); + KASSERT(mrem == m, ("removed page %p, expected page %p", mrem, m)); /* * Now remove from the object's list of backed pages. */ - vm_radix_remove(&object->rtree, m->pindex); TAILQ_REMOVE(&object->memq, m, listq); /* Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Thu Dec 8 01:07:00 2016 (r309702) +++ head/sys/vm/vm_radix.c Thu Dec 8 04:29:29 2016 (r309703) @@ -660,10 +660,10 @@ descend: } /* - * Remove the specified index from the tree. - * Panics if the key is not present. + * Remove the specified index from the trie, and return the value stored at + * that index. If the index is not present, return NULL. */ -void +vm_page_t vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index) { struct vm_radix_node *rnode, *parent; @@ -674,23 +674,23 @@ vm_radix_remove(struct vm_radix *rtree, if (vm_radix_isleaf(rnode)) { m = vm_radix_topage(rnode); if (m->pindex != index) - panic("%s: invalid key found", __func__); + return (NULL); vm_radix_setroot(rtree, NULL); - return; + return (m); } parent = NULL; for (;;) { if (rnode == NULL) - panic("vm_radix_remove: impossible to locate the key"); + return (NULL); slot = vm_radix_slot(index, rnode->rn_clev); if (vm_radix_isleaf(rnode->rn_child[slot])) { m = vm_radix_topage(rnode->rn_child[slot]); if (m->pindex != index) - panic("%s: invalid key found", __func__); + return (NULL); rnode->rn_child[slot] = NULL; rnode->rn_count--; if (rnode->rn_count > 1) - break; + return (m); for (i = 0; i < VM_RADIX_COUNT; i++) if (rnode->rn_child[i] != NULL) break; @@ -707,7 +707,7 @@ vm_radix_remove(struct vm_radix *rtree, rnode->rn_count--; rnode->rn_child[i] = NULL; vm_radix_node_put(rnode); - break; + return (m); } parent = rnode; rnode = rnode->rn_child[slot]; Modified: head/sys/vm/vm_radix.h ============================================================================== --- head/sys/vm/vm_radix.h Thu Dec 8 01:07:00 2016 (r309702) +++ head/sys/vm/vm_radix.h Thu Dec 8 04:29:29 2016 (r309703) @@ -42,7 +42,7 @@ vm_page_t vm_radix_lookup(struct vm_radi vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index); vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index); void vm_radix_reclaim_allnodes(struct vm_radix *rtree); -void vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index); +vm_page_t vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index); vm_page_t vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage); #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Thu Dec 8 04:44:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 199E3C6C55A for ; Thu, 8 Dec 2016 04:44:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D318114C for ; Thu, 8 Dec 2016 04:44:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id j92so1101315ioi.0 for ; Wed, 07 Dec 2016 20:44:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=G1vs7L7g9JSy+AVB+33RPb5t4+qI13el6GwsxLq6COA=; b=qD4SH803xcFf1cf3jkDDHQUqtXvApOcVVvG8mXn3TBrArnfiJZiMfUWkQgtT2/HDOz g2XwIltkqpt2GPJJ+OUTJ4/T+Hx7UJCeav3BmP6fyFKoir+eJUkfIZHfabKOQx5YbJhF iXd0Zd30TQg6jZAH19YcQdc0PXGpPB0VENnotdC7qe5fqgfqVdpTJpRF23Mml09qjXSJ 9rCfyaMK8A0StiVFe2G3P94qOw0lgOtwJ5axpU9e31yYUuA9Wu5V2PxYB6ydulYkWjTC IFtrM15ark9GGmJ6UzZEfI5ojRW6tnHuPWJo7u/X0LlqOaA81n5zUSmzat7ET2gDvhF7 T6CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=G1vs7L7g9JSy+AVB+33RPb5t4+qI13el6GwsxLq6COA=; b=bz+kuDVP0uud+6XOlDSKHcHviO9nE/mMAqOl4r0w7PunTwK6u5eD/F3vBunz9wc2L3 pzxnNZaBmMFEZvSOlkFazocJ+zjFqqYNFsB9L5XcJd1Z/KYbtn06sLvo1Es2RRUXdKxz Lzo5GKzSOXwjis5WSUjZu3ylWjKeqxndlaX/DQX/yL6QkgUr49vViQiCR2KEP2qMo1AV sRoWH7TFRDWTuUQNSU4PYZLLrnpjn2i0Pzr7NYc2RWD5gnUppH+RfSZB3I5TgJ0xnqTq a38v0x+1k9wyvj6GZaNJjuG4ijHuIAccfiDlJdmzFxro5KNlakUO8OmxtWhJXfF9uIQw +Bpg== X-Gm-Message-State: AKaTC00atkV8w2dVYzJvu/3GtQWA/UBKyBqWLuE8XpW59GL+Ng3AvCJ5yig0PWei0/ia6clJFFXdwp+Wa4Gyrg== X-Received: by 10.107.132.74 with SMTP id g71mr63047634iod.19.1481172268212; Wed, 07 Dec 2016 20:44:28 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.31.199 with HTTP; Wed, 7 Dec 2016 20:44:27 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20161208033621.GS27748@FreeBSD.org> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207212647.GO27748@FreeBSD.org> <20161208123844.B935@besplex.bde.org> <20161208033621.GS27748@FreeBSD.org> From: Warner Losh Date: Wed, 7 Dec 2016 21:44:27 -0700 X-Google-Sender-Auth: vJN-m8MZ0sPn7E2BvQ9t09KA5zk Message-ID: Subject: Re: svn commit: r309658 - head/sys/vm To: Gleb Smirnoff Cc: Bruce Evans , Mark Johnston , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 04:44:29 -0000 On Wed, Dec 7, 2016 at 8:36 PM, Gleb Smirnoff wrote: > On Thu, Dec 08, 2016 at 01:07:06PM +1100, Bruce Evans wrote: > B> >> M> +#ifndef BURN_BRIDGES > B> >> M> +/* > B> >> M> + * Provide compatibility sysctls for the benefit of old utilities which exit > B> >> M> + * with an error if they cannot be found. > B> >> M> + */ > B> >> M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, > B> >> M> + (u_int *)NULL, 0, "Dummy for compatibility"); > B> >> M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, > B> >> M> + (u_int *)NULL, 0, "Dummy for compatibility"); > B> >> M> +#endif > B> >> > B> >> IMHO, there should be some garbage collecting timeout for them. I'd suggest to > B> >> delete them from head after stable/12 branch is forked. > B> > > B> > Other places define #if BURN_BRUDGES < 1200000 to make this automatic. > B> > B> The correct ifdef is something like '#if COMPAT_FREEBSD12' to make this > B> non-automatic. Support for this option should of course be removed some > B> time after the support for COMPAT_43 option. That is only 25-30 years old. > > By the way, can anyone explain me why do we still have COMPAT_43 option? > > I also bet $100 against $10 that it is broken in head in many aspects, > since there is no regression suite for it and since nobody uses it. I'd say that we don't know what is or isn't used if it's working. We only know it isn't working if it fails in a spectacular way for a popular program (cf sbrk and emacs). I'd also say those are about the odds I'd give for all the rest. Warner From owner-svn-src-head@freebsd.org Thu Dec 8 04:52:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80AE2C6C813; Thu, 8 Dec 2016 04:52:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 063298A8; Thu, 8 Dec 2016 04:52:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id DE45BD61A2D; Thu, 8 Dec 2016 15:34:38 +1100 (AEDT) Date: Thu, 8 Dec 2016 15:34:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eric van Gyzen cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309676 - in head: bin/ps lib/libkvm sys/compat/freebsd32 sys/kern sys/sys usr.bin/procstat usr.bin/top In-Reply-To: <201612071504.uB7F4MCi020382@repo.freebsd.org> Message-ID: <20161208130730.O1089@besplex.bde.org> References: <201612071504.uB7F4MCi020382@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=BKLDlBYG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=v201P0twmFuHjgEfyYgA:9 a=KvgGgRznTEP-dP89:21 a=RZVXN80Jd8c52keY:21 a=ncrJ1ZNykZ1J1srM:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 04:52:57 -0000 On Wed, 7 Dec 2016, Eric van Gyzen wrote: > Log: > Export the whole thread name in kinfo_proc > > kinfo_proc::ki_tdname is three characters shorter than > thread::td_name. Add a ki_moretdname field for these three > extra characters. Add the new field to kinfo_proc32, as well. > Update all in-tree consumers to read the new field and assemble > the full name, except for lldb's HostThreadFreeBSD.cpp, which > I will handle separately. Bump __FreeBSD_version. tdname stuff was very badly implemented. It abuses the ki_ocomm field for ki_tdname. ki_ocomm was reserved for the old command name to support old applications. It should have been populated with an intelligently abbreviated copy of ki_comm, so that old applications which don't know about the ki_comm renaming see a useful name. It was actually populated by blindly truncating p_comm. This was good enough in most cases. Then when thread support was added, ki_ocomm was broken copying td_name to it. For the non-threaded case, this makes no difference, but for the threaded case this breaks ki_ocomm for old applications and it doesn't even work right for the threaded case since ki_ocomm is too short. This is the problem that you are partly fixing now. ki_ocomm should have remained as the truncated ki_comm. ki_comm should have been modified to contain an intelligently abbreviated copy of the command and thread names, so that not so old applications see any extra info in the thread name. A new field was needed for the thread name, and perhaps for the previous (non-mixed) command name, so that applications can see the raw names p_comm and td_name if the understand threads. Renaming ki_comm was rather gratuitous. It was only expanded from 16+1 to 19+1 bytes. This was done mainly because 16+1 gives either misalgnment or wastes space. The latter occurred for p_comm[] in struct proc. So we expanded to 19+1 but no more to get a slightly longer name at no cost in struct proc. But there was a large cost for using this. ac_comm[] in struct acct still has size 16+0 (it is not NUL-terminated). And the expansion didn't just work in user.h since the ki_comm[16+1] was packed there. The expansion was done cleanly by keeping renaming the old field but renaming it to ki_ocomm[16+1], and adding a new field ki_comm[19+1]. Then abusing ki_ocomm made a mess. ki_ocomm and OCOMMLEN are under a bogus BURN_BRIDGES ifdef in user.h. This doesn't even break the ABI. It only breaks the API, but that is less important and can be done in the head branch without any ifdefs (just after you update all uses of the API in src). The ABI was broken by abusing ki_ocomm. There is also much ugliness and loss of info by combining ki_comm and ki_tdname unintelligently and and then truncating. The combined length of 19+16 (now +3 more) is too wide for most displays. The unintelligences also adds excessive markup like '[]{}:' characters, giving lengths of 40+. Then blind truncation tends to lost the most useful info at the end. Your 'more' field instead of renaming again not as clean or wasteful of space as renaming again, but it is less invasive. > Modified: head/bin/ps/print.c > ============================================================================== > --- head/bin/ps/print.c Wed Dec 7 14:35:05 2016 (r309675) > +++ head/bin/ps/print.c Wed Dec 7 15:04:22 2016 (r309676) > @@ -120,11 +120,12 @@ command(KINFO *k, VARENT *ve) > if (cflag) { > /* If it is the last field, then don't pad */ > if (STAILQ_NEXT(ve, next_ve) == NULL) { > - asprintf(&str, "%s%s%s%s", > + asprintf(&str, "%s%s%s%s%s", > k->ki_d.prefix ? k->ki_d.prefix : "", > k->ki_p->ki_comm, > (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", > - (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); > + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "", > + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : ""); This expands the style bugs by copying a too-long line and expanding it further. With intelligent combination, you couldn't do it in a big printf() arg list. FreeBSD cluster machines seem to have stopped showing system processes (even idle) in ps and top, so I can't easily see many bad messes from unintelligent combination or debug things related to system load. Locally, I get for top -SH: PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU COMMAND 10 root 155 ki31 0K 64K CPU3 3 1:59 100.27% idle{idle: cpu3} 10 root 155 ki31 0K 64K CPU5 5 1:59 100.27% idle{idle: cpu5} 10 root 155 ki31 0K 64K CPU6 6 1:59 100.27% idle{idle: cpu6} 10 root 155 ki31 0K 64K CPU7 7 1:59 100.27% idle{idle: cpu7} 10 root 155 ki31 0K 64K CPU2 2 1:59 100.27% idle{idle: cpu2} 10 root 155 ki31 0K 64K CPU1 1 1:58 100.27% idle{idle: cpu1} 10 root 155 ki31 0K 64K RUN 0 1:58 100.27% idle{idle: cpu0} 10 root 155 ki31 0K 64K CPU4 4 1:58 100.27% idle{idle: cpu4} 0 root -16 - 0K 160K swapin 5 0:29 0.00% kernel{swapper} 13 root -68 - 0K 120K - 0 0:00 0.00% usb{usbus2} 13 root -68 - 0K 120K - 5 0:00 0.00% usb{usbus1} 0 root 8 - 0K 160K - 0 0:00 0.00% kernel{thread ta 1 root 8 0 732K 372K wait 4 0:00 0.00% init 11 root -60 - 0K 168K WAIT 0 0:00 0.00% intr{swi4: clock 11 root -88 - 0K 168K WAIT 4 0:00 0.00% intr{irq265: ahc 13 root -68 - 0K 120K - 0 0:00 0.00% usb{usbus0} 12 root -8 - 0K 24K - 0 0:00 0.00% geom{g_event} 678 bde 8 0 6344K 6168K wait 6 0:00 0.00% bash This suffers some truncation, but freefall is much worse: some undisplayed username is wider, so 5 columns are wasted for USERNAME and only 11 are left. for COMMAND. The above shows the common lossage that the first part of ki_tdname is the same as the whole ki_comm. ki_tdname needs to be longer to hold this, but is shorter. Unintelligent combination duplicates ki_comm and then truncates info. The other names are less consistently bad. "usb" is duplicated, and "intr" is duplicated as "irq". Other names mostly are just too long. ki_tdname is sometimes a description, not a name. ki_comm doesn't claim to be a name, but more usually is. It takes -a to get args for top. top -a and ps l suffer from to much truncation of COMMAND to actually show many args. > } else > str = strdup(k->ki_p->ki_comm); > > @@ -172,14 +173,16 @@ ucomm(KINFO *k, VARENT *ve) > char *str; > > if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field, don't pad */ > - asprintf(&str, "%s%s%s%s", > + asprintf(&str, "%s%s%s%s%s", > k->ki_d.prefix ? k->ki_d.prefix : "", > k->ki_p->ki_comm, > (showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "", > - (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : ""); > + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_tdname : "", > + (showthreads && k->ki_p->ki_numthreads > 1) ? k->ki_p->ki_moretdname : ""); As above. > } else { > if (showthreads && k->ki_p->ki_numthreads > 1) > - asprintf(&str, "%s/%s", k->ki_p->ki_comm, k->ki_p->ki_tdname); > + asprintf(&str, "%s/%s%s", k->ki_p->ki_comm, > + k->ki_p->ki_tdname, k->ki_p->ki_moretdname); > else > str = strdup(k->ki_p->ki_comm); > } Here you fixed the formatting style bug, but it might be considered a style bug to use strdup() instead of asprintf() for the simple case. style(9) says to always use fprintf() and not fputs()...or whatever, and we can do the same things for asprintf() to get uniform logic for the allocation. The printf() part is just not so uniform when its arg list depends on (showthreads && k->ki_p->ki_numthreads > 1). > @@ -192,7 +195,8 @@ tdnam(KINFO *k, VARENT *ve __unused) > char *str; > > if (showthreads && k->ki_p->ki_numthreads > 1) > - str = strdup(k->ki_p->ki_tdname); > + asprintf(&str, "%s%s", k->ki_p->ki_tdname, > + k->ki_p->ki_moretdname); > else > str = strdup(" "); Here always using asprintf() is clearly better because it avoids having to count the spaces in the literal string. > Modified: head/lib/libkvm/kvm_proc.c > ============================================================================== > --- head/lib/libkvm/kvm_proc.c Wed Dec 7 14:35:05 2016 (r309675) > +++ head/lib/libkvm/kvm_proc.c Wed Dec 7 15:04:22 2016 (r309676) > @@ -426,8 +426,6 @@ nopgrp: > kp->ki_pri.pri_native = mtd.td_base_pri; > kp->ki_lastcpu = mtd.td_lastcpu; > kp->ki_wchan = mtd.td_wchan; > - if (mtd.td_name[0] != 0) > - strlcpy(kp->ki_tdname, mtd.td_name, MAXCOMLEN); This seems to have been dead code. > kp->ki_oncpu = mtd.td_oncpu; > if (mtd.td_name[0] != '\0') > strlcpy(kp->ki_tdname, mtd.td_name, sizeof(kp->ki_tdname)); > In my version, most string lengths are not #defined and/or not exported in user.h, so as to force use of sizeof() like here. > Modified: head/sys/compat/freebsd32/freebsd32.h > ============================================================================== > --- head/sys/compat/freebsd32/freebsd32.h Wed Dec 7 14:35:05 2016 (r309675) > +++ head/sys/compat/freebsd32/freebsd32.h Wed Dec 7 15:04:22 2016 (r309676) > @@ -315,7 +315,8 @@ struct kinfo_proc32 { > char ki_comm[COMMLEN+1]; > char ki_emul[KI_EMULNAMELEN+1]; > char ki_loginclass[LOGINCLASSLEN+1]; > - char ki_sparestrings[50]; > + char ki_moretdname[MAXCOMLEN-TDNAMLEN+1]; > + char ki_sparestrings[46]; It's inconsistent to use #define'd values to calculate 3+1 for the size of the new field, then hard code this 3+1 in the adjustment of 50 to 46. I prefer to hard-code all the array sizes and then use sizeof() to recover them. I only do this in usee.h, not here. > int ki_spareints[KI_NSPARE_INT]; The #define's for the spare counts are more actively harmful. You needed to not have one for the char spares to make the above magic adjustment of 4 as easy as possible. > int ki_oncpu; > int ki_lastcpu; > > Modified: head/sys/kern/kern_proc.c > ============================================================================== > --- head/sys/kern/kern_proc.c Wed Dec 7 14:35:05 2016 (r309675) > +++ head/sys/kern/kern_proc.c Wed Dec 7 15:04:22 2016 (r309676) > @@ -1020,7 +1020,14 @@ fill_kinfo_thread(struct thread *td, str > strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg)); > else > bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg)); > - strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname)); > + if (strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname)) >= > + sizeof(kp->ki_tdname)) { > + strlcpy(kp->ki_moretdname, > + td->td_name + sizeof(kp->ki_tdname) - 1, > + sizeof(kp->ki_moretdname)); > + } else { > + bzero(kp->ki_moretdname, sizeof(kp->ki_moretdname)); > + } I think this bzero() and the one above for wmesg and a couple of others are bogus. There should have been a bzero() of the whole struct to fill any padding, and that fills all zero fields too. > Modified: head/sys/sys/user.h > ============================================================================== > --- head/sys/sys/user.h Wed Dec 7 14:35:05 2016 (r309675) > +++ head/sys/sys/user.h Wed Dec 7 15:04:22 2016 (r309676) > @@ -180,12 +180,13 @@ struct kinfo_proc { > char ki_comm[COMMLEN+1]; /* command name */ > char ki_emul[KI_EMULNAMELEN+1]; /* emulation name */ > char ki_loginclass[LOGINCLASSLEN+1]; /* login class */ > + char ki_moretdname[MAXCOMLEN-TDNAMLEN+1]; /* more thread name */ > /* > * When adding new variables, take space for char-strings from the > * front of ki_sparestrings, and ints from the end of ki_spareints. > * That way the spare room from both arrays will remain contiguous. > */ > - char ki_sparestrings[50]; /* spare string space */ > + char ki_sparestrings[46]; /* spare string space */ > int ki_spareints[KI_NSPARE_INT]; /* spare room for growth */ > int ki_oncpu; /* Which cpu we are on */ > int ki_lastcpu; /* Last cpu we were on */ > The #define's for the sizes are actually sort of needed. We are (ab)using the MI values in the compat headers. The values should be, but aren't required to be the same, especially for the spares. They are just what they have to be to preserve the ABI, and the ABIs have the same number of spares for historical reasons. Only strings are sure to have the same ABI for individual fields. > Modified: head/usr.bin/procstat/procstat.c > ============================================================================== > --- head/usr.bin/procstat/procstat.c Wed Dec 7 14:35:05 2016 (r309675) > +++ head/usr.bin/procstat/procstat.c Wed Dec 7 15:04:22 2016 (r309676) > @@ -35,6 +35,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -126,6 +127,21 @@ kinfo_proc_sort(struct kinfo_proc *kipp, > qsort(kipp, count, sizeof(*kipp), kinfo_proc_compare); > } > > +const char * > +kinfo_proc_thread_name(const struct kinfo_proc *kipp) > +{ > + static char name[MAXCOMLEN+1]; Don't use the style bug of no spaces around binary operators when nearby code sdoesn't already have it. > + > + strlcpy(name, kipp->ki_tdname, sizeof(name)); > + strlcat(name, kipp->ki_moretdname, sizeof(name)); Should probably use 1 snprintf(). > ... > Modified: head/usr.bin/procstat/procstat_threads.c > ============================================================================== > --- head/usr.bin/procstat/procstat_threads.c Wed Dec 7 14:35:05 2016 (r309675) > +++ head/usr.bin/procstat/procstat_threads.c Wed Dec 7 15:04:22 2016 (r309676) > @@ -71,11 +71,10 @@ procstat_threads(struct procstat *procst > xo_open_container(threadid); > xo_emit("{dk:process_id/%5d/%d} ", kipp->ki_pid); > xo_emit("{:thread_id/%6d/%d} ", kipp->ki_tid); > - xo_emit("{d:command/%-16s/%s} ", strlen(kipp->ki_comm) ? > + xo_emit("{d:command/%-19s/%s} ", strlen(kipp->ki_comm) ? > kipp->ki_comm : "-"); > - xo_emit("{:thread_name/%-16s/%s} ", (strlen(kipp->ki_tdname) && > - (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? > - kipp->ki_tdname : "-"); > + xo_emit("{:thread_name/%-19s/%s} ", > + kinfo_proc_thread_name(kipp)); > if (kipp->ki_oncpu != 255) > xo_emit("{:cpu/%3d/%d} ", kipp->ki_oncpu); > else if (kipp->ki_lastcpu != 255) > It's actually more invasive to make applications concatentate the names, but if you added a new field with the correct length you would have to change lots of hard-coded 16's for the old wrong size. Hard-coding these in printf formats is easiest and almost OK since the ABI prevents the size changing often. > Modified: head/usr.bin/top/machine.c > ============================================================================== > --- head/usr.bin/top/machine.c Wed Dec 7 14:35:05 2016 (r309675) > +++ head/usr.bin/top/machine.c Wed Dec 7 15:04:22 2016 (r309676) > @@ -991,8 +991,8 @@ format_next_process(caddr_t handle, char > if (!(flags & FMT_SHOWARGS)) { > if (ps.thread && pp->ki_flag & P_HADTHREADS && > pp->ki_tdname[0]) { > - snprintf(cmdbuf, cmdlen, "%s{%s}", pp->ki_comm, > - pp->ki_tdname); > + snprintf(cmdbuf, cmdlen, "%s{%s%s}", pp->ki_comm, > + pp->ki_tdname, pp->ki_moretdname); > } else { > snprintf(cmdbuf, cmdlen, "%s", pp->ki_comm); > } procstat has a little more intelligence to produce '-' when the thread name just duplicates the command name, but according to my top output it rarely does. I think it mainly produces '-' by finding a null thread name for the unthreaded case. procstat uses strcmp(). Comparing prefixes could do more. The above uses the null thread name test and other things to produce a different format instead of a thread name of '-'. It is not so easy to use a general function to prepare the names for special formatting. top doesn't have the hard-coded 16's and 19's in format strings. It would have just worked (except for bad combination) with a clean rename. Bruce From owner-svn-src-head@freebsd.org Thu Dec 8 05:15:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D5E8C6C09A; Thu, 8 Dec 2016 05:15:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6CA1C13E6; Thu, 8 Dec 2016 05:15:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB85F04N068654; Thu, 8 Dec 2016 05:15:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB85F0i9068653; Thu, 8 Dec 2016 05:15:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612080515.uB85F0i9068653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 8 Dec 2016 05:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309704 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 05:15:01 -0000 Author: sephe Date: Thu Dec 8 05:15:00 2016 New Revision: 309704 URL: https://svnweb.freebsd.org/changeset/base/309704 Log: hyperv/vmbus: Utilize vmbus_chan_run_task() MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8686 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 8 04:29:29 2016 (r309703) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Dec 8 05:15:00 2016 (r309704) @@ -772,8 +772,7 @@ vmbus_chan_clear_chmap(struct vmbus_chan struct task chmap_task; TASK_INIT(&chmap_task, 0, vmbus_chan_clrchmap_task, chan); - taskqueue_enqueue(chan->ch_tq, &chmap_task); - taskqueue_drain(chan->ch_tq, &chmap_task); + vmbus_chan_run_task(chan, &chmap_task); } static void From owner-svn-src-head@freebsd.org Thu Dec 8 05:37:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9AC7C6CA2F; Thu, 8 Dec 2016 05:37:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 83C6C1E60; Thu, 8 Dec 2016 05:37:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB85beRP076735; Thu, 8 Dec 2016 05:37:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB85beQi076728; Thu, 8 Dec 2016 05:37:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612080537.uB85beQi076728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 8 Dec 2016 05:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309705 - in head/sys/dev/hyperv: include utilities vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 05:37:41 -0000 Author: sephe Date: Thu Dec 8 05:37:39 2016 New Revision: 309705 URL: https://svnweb.freebsd.org/changeset/base/309705 Log: hyperv/timesync: Support "sent TC" to improve accuracy. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8723 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/vmbus_icreg.h head/sys/dev/hyperv/vmbus/hyperv_reg.h head/sys/dev/hyperv/vmbus/hyperv_var.h head/sys/dev/hyperv/vmbus/vmbus_et.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Thu Dec 8 05:15:00 2016 (r309704) +++ head/sys/dev/hyperv/include/hyperv.h Thu Dec 8 05:37:39 2016 (r309705) @@ -36,6 +36,23 @@ #include #include +#define MSR_HV_TIME_REF_COUNT 0x40000020 + +#define CPUID_HV_MSR_TIME_REFCNT 0x0002 /* MSR_HV_TIME_REF_COUNT */ +#define CPUID_HV_MSR_SYNIC 0x0004 /* MSRs for SynIC */ +#define CPUID_HV_MSR_SYNTIMER 0x0008 /* MSRs for SynTimer */ +#define CPUID_HV_MSR_APIC 0x0010 /* MSR_HV_{EOI,ICR,TPR} */ +#define CPUID_HV_MSR_HYPERCALL 0x0020 /* MSR_HV_GUEST_OS_ID + * MSR_HV_HYPERCALL */ +#define CPUID_HV_MSR_VP_INDEX 0x0040 /* MSR_HV_VP_INDEX */ +#define CPUID_HV_MSR_GUEST_IDLE 0x0400 /* MSR_HV_GUEST_IDLE */ + +#ifndef NANOSEC +#define NANOSEC 1000000000ULL +#endif +#define HYPERV_TIMER_NS_FACTOR 100ULL +#define HYPERV_TIMER_FREQ (NANOSEC / HYPERV_TIMER_NS_FACTOR) + struct hyperv_guid { uint8_t hv_guid[16]; } __packed; @@ -44,4 +61,6 @@ struct hyperv_guid { int hyperv_guid2str(const struct hyperv_guid *, char *, size_t); +extern u_int hyperv_features; /* CPUID_HV_MSR_ */ + #endif /* _HYPERV_H_ */ Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Thu Dec 8 05:15:00 2016 (r309704) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Thu Dec 8 05:37:39 2016 (r309705) @@ -46,10 +46,14 @@ __FBSDID("$FreeBSD$"); #define VMBUS_TIMESYNC_FWVER \ VMBUS_IC_VERSION(VMBUS_TIMESYNC_FWVER_MAJOR, 0) -#define VMBUS_TIMESYNC_MSGVER_MAJOR 3 +#define VMBUS_TIMESYNC_MSGVER_MAJOR 4 #define VMBUS_TIMESYNC_MSGVER \ VMBUS_IC_VERSION(VMBUS_TIMESYNC_MSGVER_MAJOR, 0) +#define VMBUS_TIMESYNC_DORTT(sc) \ + ((sc)->ic_msgver >= VMBUS_IC_VERSION(4, 0) && \ + (hyperv_features & CPUID_HV_MSR_TIME_REFCNT)) + static const struct vmbus_ic_desc vmbus_timesync_descs[] = { { .ic_guid = { .hv_guid = { @@ -81,12 +85,16 @@ SYSCTL_INT(_hw_hvtimesync, OID_AUTO, sam &vmbus_ts_sample_verbose, 0, "Increase sample request verbosity."); static void -vmbus_timesync(struct hv_util_sc *sc, uint64_t hvtime, uint8_t tsflags) +vmbus_timesync(struct hv_util_sc *sc, uint64_t hvtime, uint64_t sent_tc, + uint8_t tsflags) { struct timespec vm_ts; - uint64_t hv_ns, vm_ns; + uint64_t hv_ns, vm_ns, rtt = 0; + + if (VMBUS_TIMESYNC_DORTT(sc)) + rtt = rdmsr(MSR_HV_TIME_REF_COUNT) - sent_tc; - hv_ns = (hvtime - VMBUS_ICMSG_TS_BASE) * VMBUS_ICMSG_TS_FACTOR; + hv_ns = (hvtime - VMBUS_ICMSG_TS_BASE + rtt) * HYPERV_TIMER_NS_FACTOR; nanotime(&vm_ts); vm_ns = (vm_ts.tv_sec * NANOSEC) + vm_ts.tv_nsec; @@ -174,6 +182,8 @@ vmbus_timesync_cb(struct vmbus_channel * VMBUS_TIMESYNC_FWVER, VMBUS_TIMESYNC_MSGVER); if (error) return; + if (VMBUS_TIMESYNC_DORTT(sc)) + device_printf(sc->ic_dev, "RTT\n"); break; case VMBUS_ICMSG_TYPE_TIMESYNC: @@ -183,7 +193,8 @@ vmbus_timesync_cb(struct vmbus_channel * return; } msg = data; - vmbus_timesync(sc, msg->ic_hvtime, msg->ic_tsflags); + vmbus_timesync(sc, msg->ic_hvtime, msg->ic_sent_tc, + msg->ic_tsflags); break; default: Modified: head/sys/dev/hyperv/utilities/vmbus_icreg.h ============================================================================== --- head/sys/dev/hyperv/utilities/vmbus_icreg.h Thu Dec 8 05:15:00 2016 (r309704) +++ head/sys/dev/hyperv/utilities/vmbus_icreg.h Thu Dec 8 05:37:39 2016 (r309705) @@ -114,18 +114,13 @@ struct vmbus_icmsg_timesync { struct vmbus_icmsg_hdr ic_hdr; uint64_t ic_hvtime; uint64_t ic_vmtime; - uint64_t ic_rtt; + uint64_t ic_sent_tc; uint8_t ic_tsflags; /* VMBUS_ICMSG_TS_FLAG_ */ } __packed; #define VMBUS_ICMSG_TS_FLAG_SYNC 0x01 #define VMBUS_ICMSG_TS_FLAG_SAMPLE 0x02 -/* XXX consolidate w/ hyperv */ #define VMBUS_ICMSG_TS_BASE 116444736000000000ULL -#define VMBUS_ICMSG_TS_FACTOR 100ULL -#ifndef NANOSEC -#define NANOSEC 1000000000ULL -#endif #endif /* !_VMBUS_ICREG_H_ */ Modified: head/sys/dev/hyperv/vmbus/hyperv_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_reg.h Thu Dec 8 05:15:00 2016 (r309704) +++ head/sys/dev/hyperv/vmbus/hyperv_reg.h Thu Dec 8 05:37:39 2016 (r309705) @@ -57,8 +57,6 @@ #define MSR_HV_VP_INDEX 0x40000002 -#define MSR_HV_TIME_REF_COUNT 0x40000020 - #define MSR_HV_SCONTROL 0x40000080 #define MSR_HV_SCTRL_ENABLE 0x0001ULL #define MSR_HV_SCTRL_RSVD_MASK 0xfffffffffffffffeULL @@ -106,15 +104,7 @@ #define CPUID_LEAF_HV_IDENTITY 0x40000002 #define CPUID_LEAF_HV_FEATURES 0x40000003 -/* EAX: features */ -#define CPUID_HV_MSR_TIME_REFCNT 0x0002 /* MSR_HV_TIME_REF_COUNT */ -#define CPUID_HV_MSR_SYNIC 0x0004 /* MSRs for SynIC */ -#define CPUID_HV_MSR_SYNTIMER 0x0008 /* MSRs for SynTimer */ -#define CPUID_HV_MSR_APIC 0x0010 /* MSR_HV_{EOI,ICR,TPR} */ -#define CPUID_HV_MSR_HYPERCALL 0x0020 /* MSR_HV_GUEST_OS_ID - * MSR_HV_HYPERCALL */ -#define CPUID_HV_MSR_VP_INDEX 0x0040 /* MSR_HV_VP_INDEX */ -#define CPUID_HV_MSR_GUEST_IDLE 0x0400 /* MSR_HV_GUEST_IDLE */ +/* EAX: features include/hyperv.h CPUID_HV_MSR */ /* ECX: power management features */ #define CPUPM_HV_CSTATE_MASK 0x000f /* deepest C-state */ #define CPUPM_HV_C3_HPET 0x0010 /* C3 requires HPET */ Modified: head/sys/dev/hyperv/vmbus/hyperv_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv_var.h Thu Dec 8 05:15:00 2016 (r309704) +++ head/sys/dev/hyperv/vmbus/hyperv_var.h Thu Dec 8 05:37:39 2016 (r309705) @@ -29,13 +29,6 @@ #ifndef _HYPERV_VAR_H_ #define _HYPERV_VAR_H_ -#ifndef NANOSEC -#define NANOSEC 1000000000ULL -#endif -#define HYPERV_TIMER_NS_FACTOR 100ULL -#define HYPERV_TIMER_FREQ (NANOSEC / HYPERV_TIMER_NS_FACTOR) - -extern u_int hyperv_features; extern u_int hyperv_recommends; uint64_t hypercall_post_message(bus_addr_t msg_paddr); Modified: head/sys/dev/hyperv/vmbus/vmbus_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_et.c Thu Dec 8 05:15:00 2016 (r309704) +++ head/sys/dev/hyperv/vmbus/vmbus_et.c Thu Dec 8 05:37:39 2016 (r309705) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Thu Dec 8 07:56:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DF20C6D1AE; Thu, 8 Dec 2016 07:56:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1ACE7A8; Thu, 8 Dec 2016 07:56:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB87uQSj032936; Thu, 8 Dec 2016 07:56:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB87uQ9q032935; Thu, 8 Dec 2016 07:56:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612080756.uB87uQ9q032935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 8 Dec 2016 07:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309706 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 07:56:27 -0000 Author: adrian Date: Thu Dec 8 07:56:25 2016 New Revision: 309706 URL: https://svnweb.freebsd.org/changeset/base/309706 Log: [net80211] begin fleshing out support for channel survey information to be pushed back up into net80211. Modified: head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Thu Dec 8 05:37:39 2016 (r309705) +++ head/sys/net80211/ieee80211_freebsd.h Thu Dec 8 07:56:25 2016 (r309706) @@ -727,6 +727,17 @@ int ieee80211_add_toa_params(struct mbuf const struct ieee80211_toa_params *p); int ieee80211_get_toa_params(struct mbuf *m, struct ieee80211_toa_params *p); + +#define IEEE80211_F_SURVEY_TIME 0x00000001 +#define IEEE80211_F_SURVEY_TIME_BUSY 0x00000002 +#define IEEE80211_F_SURVEY_NOISE_DBM 0x00000004 +struct ieee80211_channel_survey { + uint32_t s_flags; + uint32_t s_time; + uint32_t s_time_busy; + int s_noise; +}; + #endif /* _KERNEL */ /* From owner-svn-src-head@freebsd.org Thu Dec 8 07:57:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 603AFC6D21F; Thu, 8 Dec 2016 07:57:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FEF0926; Thu, 8 Dec 2016 07:57:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB87vGOT033012; Thu, 8 Dec 2016 07:57:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB87vGKv033011; Thu, 8 Dec 2016 07:57:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612080757.uB87vGKv033011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 8 Dec 2016 07:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309707 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 07:57:17 -0000 Author: adrian Date: Thu Dec 8 07:57:16 2016 New Revision: 309707 URL: https://svnweb.freebsd.org/changeset/base/309707 Log: [net80211] add a field for storing a 64 bit TSC. Modified: head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Thu Dec 8 07:56:25 2016 (r309706) +++ head/sys/net80211/ieee80211_freebsd.h Thu Dec 8 07:57:16 2016 (r309707) @@ -731,11 +731,13 @@ int ieee80211_get_toa_params(struct mbuf #define IEEE80211_F_SURVEY_TIME 0x00000001 #define IEEE80211_F_SURVEY_TIME_BUSY 0x00000002 #define IEEE80211_F_SURVEY_NOISE_DBM 0x00000004 +#define IEEE80211_F_SURVEY_TSC 0x00000008 struct ieee80211_channel_survey { uint32_t s_flags; uint32_t s_time; uint32_t s_time_busy; - int s_noise; + int32_t s_noise; + uint64_t s_tsc; }; #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Thu Dec 8 10:28:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57F20C6AB00; Thu, 8 Dec 2016 10:28:52 +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 1C3281366; Thu, 8 Dec 2016 10:28:52 +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 uB8ASpfA092834; Thu, 8 Dec 2016 10:28:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8ASprp092833; Thu, 8 Dec 2016 10:28:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612081028.uB8ASprp092833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Dec 2016 10:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309708 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 10:28:52 -0000 Author: kib Date: Thu Dec 8 10:28:51 2016 New Revision: 309708 URL: https://svnweb.freebsd.org/changeset/base/309708 Log: Style. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/phys_pager.c Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Thu Dec 8 07:57:16 2016 (r309707) +++ head/sys/vm/phys_pager.c Thu Dec 8 10:28:51 2016 (r309708) @@ -56,9 +56,6 @@ phys_pager_init(void) mtx_init(&phys_pager_mtx, "phys_pager list", NULL, MTX_DEF); } -/* - * MPSAFE - */ static vm_object_t phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred) @@ -101,8 +98,8 @@ phys_pager_alloc(void *handle, vm_ooffse object = object1; object1 = NULL; object->handle = handle; - TAILQ_INSERT_TAIL(&phys_pager_object_list, object, - pager_object_list); + TAILQ_INSERT_TAIL(&phys_pager_object_list, + object, pager_object_list); } } else { if (pindex > object->size) @@ -117,9 +114,6 @@ phys_pager_alloc(void *handle, vm_ooffse return (object); } -/* - * MPSAFE - */ static void phys_pager_dealloc(vm_object_t object) { @@ -165,7 +159,7 @@ phys_pager_getpages(vm_object_t object, static void phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync, - int *rtvals) + int *rtvals) { panic("phys_pager_putpage called"); @@ -183,7 +177,7 @@ phys_pager_putpages(vm_object_t object, #endif static boolean_t phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, - int *after) + int *after) { vm_pindex_t base, end; From owner-svn-src-head@freebsd.org Thu Dec 8 10:29:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E75F8C6AB69; Thu, 8 Dec 2016 10:29:42 +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 B5C901547; Thu, 8 Dec 2016 10:29:42 +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 uB8ATfQG092912; Thu, 8 Dec 2016 10:29:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8ATfwj092911; Thu, 8 Dec 2016 10:29:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612081029.uB8ATfwj092911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Dec 2016 10:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309709 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 10:29:43 -0000 Author: kib Date: Thu Dec 8 10:29:41 2016 New Revision: 309709 URL: https://svnweb.freebsd.org/changeset/base/309709 Log: Move map_generation snapshot value into struct faultstate. Reviewed by: alc Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Dec 8 10:28:51 2016 (r309708) +++ head/sys/vm/vm_fault.c Thu Dec 8 10:29:41 2016 (r309709) @@ -122,6 +122,7 @@ struct faultstate { vm_pindex_t first_pindex; vm_map_t map; vm_map_entry_t entry; + int map_generation; bool lookup_still_valid; struct vnode *vp; }; @@ -339,7 +340,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t vm_pindex_t retry_pindex; vm_prot_t prot, retry_prot; int ahead, alloc_req, behind, cluster_offset, error, era, faultcount; - int locked, map_generation, nera, result, rv; + int locked, nera, result, rv; u_char behavior; boolean_t wired; /* Passed by reference. */ bool dead, growstack, hardfault, is_first_object_locked; @@ -373,7 +374,7 @@ RetryFault:; return (result); } - map_generation = fs.map->timestamp; + fs.map_generation = fs.map->timestamp; if (fs.entry->eflags & MAP_ENTRY_NOFAULT) { panic("vm_fault: fault on nofault entry, addr: %lx", @@ -972,7 +973,7 @@ readrest: goto RetryFault; } fs.lookup_still_valid = true; - if (fs.map->timestamp != map_generation) { + if (fs.map->timestamp != fs.map_generation) { result = vm_map_lookup_locked(&fs.map, vaddr, fault_type, &fs.entry, &retry_object, &retry_pindex, &retry_prot, &wired); From owner-svn-src-head@freebsd.org Thu Dec 8 11:26:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18B6EC6BD6A; Thu, 8 Dec 2016 11:26:13 +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 E757812E3; Thu, 8 Dec 2016 11:26:12 +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 uB8BQCFn017104; Thu, 8 Dec 2016 11:26:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8BQBGA017100; Thu, 8 Dec 2016 11:26:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612081126.uB8BQBGA017100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Dec 2016 11:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309710 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 11:26:13 -0000 Author: kib Date: Thu Dec 8 11:26:11 2016 New Revision: 309710 URL: https://svnweb.freebsd.org/changeset/base/309710 Log: Add a new populate() pager method and extend device pager ops vector with cdev_pg_populate() to provide device drivers access to it. It gives drivers fine control of the pages ownership and allows drivers to implement arbitrary prefault policies. The populate method is called on a page fault and is supposed to populate the vm object with the page at the fault location and some amount of pages around it, at pager's discretion. VM provides the pager with the hints about current range of the object mapping, to avoid instantiation of immediately unused pages, if pager decides so. Also, VM passes the fault type and map entry protection to the pager, allowing it to force the optimal required ownership of the mapped pages. Installed pages must contiguously fill the returned region, be fully valid and exclusively busied. Of course, the pages must be compatible with the object' type. After populate() successfully returned, VM fault handler installs as many instantiated pages into the process page tables as it sees reasonable, while still obeying the correct semantic for COW and vm map locking. The method is opt-in, pager sets OBJ_POPULATE flag to indicate that the method can be called. If pager' vm objects can be shadowed, pager must implement the traditional getpages() method in addition to the populate(). Populate() might fall back to the getpages() on per-call basis as well, by returning VM_PAGER_BAD error code. For now for device pagers, the populate() method is only allowed to be used by the managed device pagers, but the limitation is only made because there is no unmanaged fault handlers which could use it right now. KPI designed together with, and reviewed by: alc Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/vm/device_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_object.h head/sys/vm/vm_pager.h Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Thu Dec 8 10:29:41 2016 (r309709) +++ head/sys/vm/device_pager.c Thu Dec 8 11:26:11 2016 (r309710) @@ -63,6 +63,8 @@ static int dev_pager_getpages(vm_object_ static void dev_pager_putpages(vm_object_t, vm_page_t *, int, int, int *); static boolean_t dev_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); static void dev_pager_free_page(vm_object_t object, vm_page_t m); +static int dev_pager_populate(vm_object_t object, vm_pindex_t pidx, + int fault_type, vm_prot_t, vm_pindex_t *first, vm_pindex_t *last); /* list of device pager objects */ static struct pagerlst dev_pager_object_list; @@ -84,6 +86,7 @@ struct pagerops mgtdevicepagerops = { .pgo_getpages = dev_pager_getpages, .pgo_putpages = dev_pager_putpages, .pgo_haspage = dev_pager_haspage, + .pgo_populate = dev_pager_populate, }; static int old_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, @@ -127,6 +130,8 @@ cdev_pager_allocate(void *handle, enum o if (tp != OBJT_DEVICE && tp != OBJT_MGTDEVICE) return (NULL); + KASSERT(tp == OBJT_MGTDEVICE || ops->cdev_pg_populate == NULL, + ("populate on unmanaged device pager")); /* * Offset should be page aligned. @@ -179,6 +184,8 @@ cdev_pager_allocate(void *handle, enum o object->handle = handle; TAILQ_INSERT_TAIL(&dev_pager_object_list, object, pager_object_list); + if (ops->cdev_pg_populate != NULL) + vm_object_set_flag(object, OBJ_POPULATE); } } else { if (pindex > object->size) @@ -268,6 +275,8 @@ dev_pager_getpages(vm_object_t object, v /* Since our haspage reports zero after/before, the count is 1. */ KASSERT(count == 1, ("%s: count %d", __func__, count)); VM_OBJECT_ASSERT_WLOCKED(object); + if (object->un_pager.devp.ops->cdev_pg_fault == NULL) + return (VM_PAGER_FAIL); error = object->un_pager.devp.ops->cdev_pg_fault(object, IDX_TO_OFF(ma[0]->pindex), PROT_READ, &ma[0]); @@ -293,6 +302,18 @@ dev_pager_getpages(vm_object_t object, v } static int +dev_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) +{ + + VM_OBJECT_ASSERT_WLOCKED(object); + if (object->un_pager.devp.ops->cdev_pg_populate == NULL) + return (VM_PAGER_FAIL); + return (object->un_pager.devp.ops->cdev_pg_populate(object, pidx, + fault_type, max_prot, first, last)); +} + +static int old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot, vm_page_t *mres) { Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Dec 8 10:29:41 2016 (r309709) +++ head/sys/vm/vm_fault.c Thu Dec 8 11:26:11 2016 (r309710) @@ -289,6 +289,119 @@ vm_fault_soft_fast(struct faultstate *fs return (KERN_SUCCESS); } +static void +vm_fault_restore_map_lock(struct faultstate *fs) +{ + + VM_OBJECT_ASSERT_WLOCKED(fs->first_object); + MPASS(fs->first_object->paging_in_progress > 0); + + if (!vm_map_trylock_read(fs->map)) { + VM_OBJECT_WUNLOCK(fs->first_object); + vm_map_lock_read(fs->map); + VM_OBJECT_WLOCK(fs->first_object); + } + fs->lookup_still_valid = true; +} + + +static int +vm_fault_populate(struct faultstate *fs, vm_offset_t vaddr, vm_prot_t prot, + int fault_type, int fault_flags, boolean_t wired, vm_page_t *m_hold) +{ + vm_page_t m; + vm_pindex_t f_first, f_last, pidx; + int rv; + + MPASS(fs->object == fs->first_object); + VM_OBJECT_ASSERT_WLOCKED(fs->first_object); + MPASS(fs->first_object->paging_in_progress > 0); + MPASS(fs->first_object->backing_object == NULL); + MPASS(fs->lookup_still_valid); + + f_first = OFF_TO_IDX(fs->entry->offset); + f_last = OFF_TO_IDX(fs->entry->offset + fs->entry->end - + fs->entry->start) - 1; + unlock_map(fs); + unlock_vp(fs); + + /* + * Call the pager (driver) populate() method. + * + * There is no guarantee that the method will be called again + * if the current fault is for read, and a future fault is + * for write. Report the entry's maximum allowed protection + * to the driver. + */ + rv = vm_pager_populate(fs->first_object, fs->first_pindex, + fault_type, fs->entry->max_protection, &f_first, &f_last); + + VM_OBJECT_ASSERT_WLOCKED(fs->first_object); + if (rv == VM_PAGER_BAD) { + /* + * VM_PAGER_BAD is the backdoor for a pager to request + * normal fault handling. + */ + vm_fault_restore_map_lock(fs); + if (fs->map->timestamp != fs->map_generation) + return (KERN_RESOURCE_SHORTAGE); /* RetryFault */ + return (KERN_NOT_RECEIVER); + } + if (rv != VM_PAGER_OK) + return (KERN_FAILURE); /* AKA SIGSEGV */ + + /* Ensure that the driver is obeying the interface. */ + MPASS(f_first <= f_last); + MPASS(fs->first_pindex <= f_last); + MPASS(fs->first_pindex >= f_first); + MPASS(f_last < fs->first_object->size); + + vm_fault_restore_map_lock(fs); + if (fs->map->timestamp != fs->map_generation) + return (KERN_RESOURCE_SHORTAGE); /* RetryFault */ + + /* Clip pager response to fit into the vm_map_entry. */ + f_first = MAX(OFF_TO_IDX(fs->entry->offset), f_first); + f_last = MIN(OFF_TO_IDX(fs->entry->end - fs->entry->start + + fs->entry->offset), f_last); + + pidx = f_first; + for (m = vm_page_lookup(fs->first_object, pidx); pidx <= f_last; + pidx++, m = vm_page_next(m)) { + /* + * Check each page to ensure that the driver is + * obeying the interface: the page must be installed + * in the object, fully valid, and exclusively busied. + */ + MPASS(m != NULL); + MPASS(vm_page_xbusied(m)); + MPASS(m->valid == VM_PAGE_BITS_ALL); + MPASS(m->object == fs->first_object); + MPASS(m->pindex == pidx); + + vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags, + true); + VM_OBJECT_WUNLOCK(fs->first_object); + pmap_enter(fs->map->pmap, fs->entry->start + IDX_TO_OFF(pidx) - + fs->entry->offset, m, prot, fault_type | (wired ? + PMAP_ENTER_WIRED : 0), 0); + VM_OBJECT_WLOCK(fs->first_object); + if (pidx == fs->first_pindex) + vm_fault_fill_hold(m_hold, m); + vm_page_lock(m); + if ((fault_flags & VM_FAULT_WIRE) != 0) { + KASSERT(wired, ("VM_FAULT_WIRE && !wired")); + vm_page_wire(m); + } else { + vm_page_activate(m); + } + vm_page_unlock(m); + vm_page_xunbusy(m); + } + curthread->td_ru.ru_majflt++; + return (KERN_SUCCESS); +} + /* * vm_fault: * @@ -555,6 +668,30 @@ RetryFault:; return (KERN_PROTECTION_FAILURE); } + if (fs.object == fs.first_object && + (fs.first_object->flags & OBJ_POPULATE) != 0 && + fs.first_object->shadow_count == 0) { + rv = vm_fault_populate(&fs, vaddr, prot, + fault_type, fault_flags, wired, m_hold); + switch (rv) { + case KERN_SUCCESS: + case KERN_FAILURE: + unlock_and_deallocate(&fs); + return (rv); + case KERN_RESOURCE_SHORTAGE: + unlock_and_deallocate(&fs); + goto RetryFault; + case KERN_NOT_RECEIVER: + /* + * Pager's populate() method + * returned VM_PAGER_BAD. + */ + break; + default: + panic("inconsistent return codes"); + } + } + /* * Allocate a new page for this object/offset pair. * Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Thu Dec 8 10:29:41 2016 (r309709) +++ head/sys/vm/vm_object.h Thu Dec 8 11:26:11 2016 (r309710) @@ -181,6 +181,7 @@ struct vm_object { */ #define OBJ_FICTITIOUS 0x0001 /* (c) contains fictitious pages */ #define OBJ_UNMANAGED 0x0002 /* (c) contains unmanaged pages */ +#define OBJ_POPULATE 0x0004 /* pager implements populate() */ #define OBJ_DEAD 0x0008 /* dead objects (during rundown) */ #define OBJ_NOSPLIT 0x0010 /* dont split this object */ #define OBJ_UMTXDEAD 0x0020 /* umtx pshared was terminated */ Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Thu Dec 8 10:29:41 2016 (r309709) +++ head/sys/vm/vm_pager.h Thu Dec 8 11:26:11 2016 (r309710) @@ -56,6 +56,8 @@ typedef int pgo_getpages_async_t(vm_obje pgo_getpages_iodone_t, void *); typedef void pgo_putpages_t(vm_object_t, vm_page_t *, int, int, int *); typedef boolean_t pgo_haspage_t(vm_object_t, vm_pindex_t, int *, int *); +typedef int pgo_populate_t(vm_object_t, vm_pindex_t, int, vm_prot_t, + vm_pindex_t *, vm_pindex_t *); typedef void pgo_pageunswapped_t(vm_page_t); struct pagerops { @@ -66,6 +68,7 @@ struct pagerops { pgo_getpages_async_t *pgo_getpages_async; /* Get page asyncly. */ pgo_putpages_t *pgo_putpages; /* Put (write) page. */ pgo_haspage_t *pgo_haspage; /* Query page. */ + pgo_populate_t *pgo_populate; /* Bulk spec pagein. */ pgo_pageunswapped_t *pgo_pageunswapped; }; @@ -152,6 +155,19 @@ vm_pager_has_page( return (ret); } +static __inline int +vm_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) +{ + + MPASS((object->flags & OBJ_POPULATE) != 0); + MPASS(pidx < object->size); + MPASS(object->paging_in_progress > 0); + return ((*pagertab[object->type]->pgo_populate)(object, pidx, + fault_type, max_prot, first, last)); +} + + /* * vm_pager_page_unswapped * @@ -177,6 +193,9 @@ vm_pager_page_unswapped(vm_page_t m) struct cdev_pager_ops { int (*cdev_pg_fault)(vm_object_t vm_obj, vm_ooffset_t offset, int prot, vm_page_t *mres); + int (*cdev_pg_populate)(vm_object_t vm_obj, vm_pindex_t pidx, + int fault_type, vm_prot_t max_prot, vm_pindex_t *first, + vm_pindex_t *last); int (*cdev_pg_ctor)(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred, u_short *color); void (*cdev_pg_dtor)(void *handle); From owner-svn-src-head@freebsd.org Thu Dec 8 11:35:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57B97C6BFCD; Thu, 8 Dec 2016 11:35:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CA8717E1; Thu, 8 Dec 2016 11:35:53 +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 uB8BZrh9020932; Thu, 8 Dec 2016 11:35:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8BZrdw020931; Thu, 8 Dec 2016 11:35:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612081135.uB8BZrdw020931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Dec 2016 11:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309711 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 11:35:54 -0000 Author: kib Date: Thu Dec 8 11:35:53 2016 New Revision: 309711 URL: https://svnweb.freebsd.org/changeset/base/309711 Log: Implement the populate() pager method for phys pager. It allows to provide configurable agressive prefaulting and useful hints to page daemon about memory allocations, on faults for pages managed by phys pager. In fact, this implementation is superior to the MAP_SHARED_PHYS hack from my Postgresql paper, while giving similar benefits of reducing the page faults numbers on SysV shared memory mappings. Reviewed by: alc Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/vm/phys_pager.c Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Thu Dec 8 11:26:11 2016 (r309710) +++ head/sys/vm/phys_pager.c Thu Dec 8 11:35:53 2016 (r309711) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* list of phys pager objects */ @@ -98,6 +99,7 @@ phys_pager_alloc(void *handle, vm_ooffse object = object1; object1 = NULL; object->handle = handle; + vm_object_set_flag(object, OBJ_POPULATE); TAILQ_INSERT_TAIL(&phys_pager_object_list, object, pager_object_list); } @@ -109,6 +111,7 @@ phys_pager_alloc(void *handle, vm_ooffse vm_object_deallocate(object1); } else { object = vm_object_allocate(OBJT_PHYS, pindex); + vm_object_set_flag(object, OBJ_POPULATE); } return (object); @@ -157,32 +160,101 @@ phys_pager_getpages(vm_object_t object, return (VM_PAGER_OK); } -static void -phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync, - int *rtvals) -{ - - panic("phys_pager_putpage called"); -} - /* * Implement a pretty aggressive clustered getpages strategy. Hint that * everything in an entire 4MB window should be prefaulted at once. * - * XXX 4MB (1024 slots per page table page) is convenient for x86, + * 4MB (1024 slots per page table page) is convenient for x86, * but may not be for other arches. */ #ifndef PHYSCLUSTER #define PHYSCLUSTER 1024 #endif +static int phys_pager_cluster = PHYSCLUSTER; +SYSCTL_INT(_vm, OID_AUTO, phys_pager_cluster, CTLFLAG_RWTUN, + &phys_pager_cluster, 0, + "prefault window size for phys pager"); + +/* + * Max hint to vm_page_alloc() about the further allocation needs + * inside the phys_pager_populate() loop. The number of bits used to + * implement VM_ALLOC_COUNT() determines the hard limit on this value. + * That limit is currently 65535. + */ +#define PHYSALLOC 16 + +static int +phys_pager_populate(vm_object_t object, vm_pindex_t pidx, + int fault_type __unused, vm_prot_t max_prot __unused, vm_pindex_t *first, + vm_pindex_t *last) +{ + vm_page_t m; + vm_pindex_t base, end, i; + int ahead; + + base = rounddown(pidx, phys_pager_cluster); + end = base + phys_pager_cluster - 1; + if (end >= object->size) + end = object->size - 1; + if (*first > base) + base = *first; + if (end > *last) + end = *last; + *first = base; + *last = end; + + for (i = base; i <= end; i++) { +retry: + m = vm_page_lookup(object, i); + if (m == NULL) { + ahead = MIN(end - i, PHYSALLOC); + m = vm_page_alloc(object, i, VM_ALLOC_NORMAL | + VM_ALLOC_ZERO | VM_ALLOC_COUNT(ahead)); + if (m == NULL) { + VM_OBJECT_WUNLOCK(object); + VM_WAIT; + VM_OBJECT_WLOCK(object); + goto retry; + } + if ((m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + m->valid = VM_PAGE_BITS_ALL; + } else if (vm_page_xbusied(m)) { + vm_page_lock(m); + VM_OBJECT_WUNLOCK(object); + vm_page_busy_sleep(m, "physb", true); + VM_OBJECT_WLOCK(object); + goto retry; + } else { + vm_page_xbusy(m); + if (m->valid != VM_PAGE_BITS_ALL) + vm_page_zero_invalid(m, TRUE); + } + + KASSERT(m->valid == VM_PAGE_BITS_ALL, + ("phys_pager_populate: partially valid page %p", m)); + KASSERT(m->dirty == 0, + ("phys_pager_populate: dirty page %p", m)); + } + return (VM_PAGER_OK); +} + +static void +phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync, + int *rtvals) +{ + + panic("phys_pager_putpage called"); +} + static boolean_t phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after) { vm_pindex_t base, end; - base = rounddown2(pindex, PHYSCLUSTER); - end = base + (PHYSCLUSTER - 1); + base = rounddown(pindex, phys_pager_cluster); + end = base + phys_pager_cluster - 1; if (before != NULL) *before = pindex - base; if (after != NULL) @@ -197,4 +269,5 @@ struct pagerops physpagerops = { .pgo_getpages = phys_pager_getpages, .pgo_putpages = phys_pager_putpages, .pgo_haspage = phys_pager_haspage, + .pgo_populate = phys_pager_populate, }; From owner-svn-src-head@freebsd.org Thu Dec 8 11:39:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9A42C6C146; Thu, 8 Dec 2016 11:39:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA8D819DE; Thu, 8 Dec 2016 11:39:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8Bd83L021082; Thu, 8 Dec 2016 11:39:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8Bd8BE021081; Thu, 8 Dec 2016 11:39:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612081139.uB8Bd8BE021081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Dec 2016 11:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309712 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 11:39:10 -0000 Author: kib Date: Thu Dec 8 11:39:08 2016 New Revision: 309712 URL: https://svnweb.freebsd.org/changeset/base/309712 Log: Use the populate() driver paging method for i915 driver. In particular, the fault access type is accounted for when the aperture page is moved to GTT domain. On the other hand, the current pager structure is left intact, most important, only one page is instantiated per populate call. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/dev/drm2/i915/i915_gem.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Thu Dec 8 11:35:53 2016 (r309711) +++ head/sys/dev/drm2/i915/i915_gem.c Thu Dec 8 11:39:08 2016 (r309712) @@ -1474,8 +1474,8 @@ i915_gem_pager_ctor(void *handle, vm_oof int i915_intr_pf; static int -i915_gem_pager_fault(vm_object_t vm_obj, vm_ooffset_t offset, int prot, - vm_page_t *mres) +i915_gem_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) { struct drm_gem_object *gem_obj = vm_obj->handle; struct drm_i915_gem_object *obj = to_intel_bo(gem_obj); @@ -1483,31 +1483,9 @@ i915_gem_pager_fault(vm_object_t vm_obj, drm_i915_private_t *dev_priv = dev->dev_private; vm_page_t page; int ret = 0; -#ifdef FREEBSD_WIP - bool write = (prot & VM_PROT_WRITE) != 0; -#else - bool write = true; -#endif /* FREEBSD_WIP */ + bool write = (max_prot & VM_PROT_WRITE) != 0; bool pinned; - vm_object_pip_add(vm_obj, 1); - - /* - * Remove the placeholder page inserted by vm_fault() from the - * object before dropping the object lock. If - * i915_gem_release_mmap() is active in parallel on this gem - * object, then it owns the drm device sx and might find the - * placeholder already. Then, since the page is busy, - * i915_gem_release_mmap() sleeps waiting for the busy state - * of the page cleared. We will be unable to acquire drm - * device lock until i915_gem_release_mmap() is able to make a - * progress. - */ - if (*mres != NULL) { - vm_page_lock(*mres); - vm_page_remove(*mres); - vm_page_unlock(*mres); - } VM_OBJECT_WUNLOCK(vm_obj); retry: ret = 0; @@ -1527,7 +1505,7 @@ retry: * mapping for the page. Recheck. */ VM_OBJECT_WLOCK(vm_obj); - page = vm_page_lookup(vm_obj, OFF_TO_IDX(offset)); + page = vm_page_lookup(vm_obj, pidx); if (page != NULL) { if (vm_page_busied(page)) { DRM_UNLOCK(dev); @@ -1543,7 +1521,7 @@ retry: /* Now bind it into the GTT if needed */ ret = i915_gem_object_pin(obj, 0, true, false); if (ret) - goto unlock; + goto unpin; pinned = 1; ret = i915_gem_object_set_to_gtt_domain(obj, write); @@ -1556,20 +1534,19 @@ retry: obj->fault_mappable = true; - VM_OBJECT_WLOCK(vm_obj); - page = PHYS_TO_VM_PAGE(dev_priv->mm.gtt_base_addr + obj->gtt_offset + offset); - KASSERT((page->flags & PG_FICTITIOUS) != 0, - ("physical address %#jx not fictitious", - (uintmax_t)(dev_priv->mm.gtt_base_addr + obj->gtt_offset + offset))); + page = PHYS_TO_VM_PAGE(dev_priv->mm.gtt_base_addr + obj->gtt_offset + + IDX_TO_OFF(pidx)); if (page == NULL) { - VM_OBJECT_WUNLOCK(vm_obj); ret = -EFAULT; goto unpin; } KASSERT((page->flags & PG_FICTITIOUS) != 0, - ("not fictitious %p", page)); + ("physical address %#jx not fictitious, page %p", + (uintmax_t)(dev_priv->mm.gtt_base_addr + obj->gtt_offset + + IDX_TO_OFF(pidx)), page)); KASSERT(page->wire_count == 1, ("wire_count not 1 %p", page)); + VM_OBJECT_WLOCK(vm_obj); if (vm_page_busied(page)) { i915_gem_object_unpin(obj); DRM_UNLOCK(dev); @@ -1578,7 +1555,7 @@ retry: vm_page_busy_sleep(page, "915pbs", false); goto retry; } - if (vm_page_insert(page, vm_obj, OFF_TO_IDX(offset))) { + if (vm_page_insert(page, vm_obj, pidx)) { i915_gem_object_unpin(obj); DRM_UNLOCK(dev); VM_OBJECT_WUNLOCK(vm_obj); @@ -1589,33 +1566,24 @@ retry: have_page: vm_page_xbusy(page); - CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, offset, prot, + CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, pidx, fault_type, page->phys_addr); if (pinned) { /* * We may have not pinned the object if the page was - * found by the call to vm_page_lookup() + * found by the call to vm_page_lookup(). */ i915_gem_object_unpin(obj); } DRM_UNLOCK(dev); - if (*mres != NULL) { - KASSERT(*mres != page, ("losing %p %p", *mres, page)); - vm_page_lock(*mres); - vm_page_free(*mres); - vm_page_unlock(*mres); - } - *mres = page; - vm_object_pip_wakeup(vm_obj); + *first = *last = pidx; return (VM_PAGER_OK); unpin: - i915_gem_object_unpin(obj); -unlock: DRM_UNLOCK(dev); out: KASSERT(ret != 0, ("i915_gem_pager_fault: wrong return")); - CTR4(KTR_DRM, "fault_fail %p %jx %x err %d", gem_obj, offset, prot, + CTR4(KTR_DRM, "fault_fail %p %jx %x err %d", gem_obj, pidx, fault_type, -ret); if (ret == -ERESTARTSYS) { /* @@ -1629,7 +1597,6 @@ out: goto retry; } VM_OBJECT_WLOCK(vm_obj); - vm_object_pip_wakeup(vm_obj); return (VM_PAGER_ERROR); } @@ -1645,9 +1612,9 @@ i915_gem_pager_dtor(void *handle) } struct cdev_pager_ops i915_gem_pager_ops = { - .cdev_pg_fault = i915_gem_pager_fault, - .cdev_pg_ctor = i915_gem_pager_ctor, - .cdev_pg_dtor = i915_gem_pager_dtor + .cdev_pg_populate = i915_gem_pager_populate, + .cdev_pg_ctor = i915_gem_pager_ctor, + .cdev_pg_dtor = i915_gem_pager_dtor, }; /** From owner-svn-src-head@freebsd.org Thu Dec 8 13:01:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17238C6DDDA; Thu, 8 Dec 2016 13:01:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7F201028; Thu, 8 Dec 2016 13:01:19 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cEyJz-000KLg-2n; Thu, 08 Dec 2016 16:01:11 +0300 Date: Thu, 8 Dec 2016 16:01:11 +0300 From: Slawa Olhovchenkov To: Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309703 - in head/sys: amd64/amd64 arm64/arm64 i386/i386 vm Message-ID: <20161208130110.GQ57876@zxy.spb.ru> References: <201612080429.uB84TToV048828@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612080429.uB84TToV048828@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 13:01:20 -0000 On Thu, Dec 08, 2016 at 04:29:29AM +0000, Alan Cox wrote: > Author: alc > Date: Thu Dec 8 04:29:29 2016 > New Revision: 309703 > URL: https://svnweb.freebsd.org/changeset/base/309703 > > Log: > Previously, vm_radix_remove() would panic if the radix trie didn't > contain a vm_page_t at the specified index. However, with this > change, vm_radix_remove() no longer panics. Instead, it returns NULL > if there is no vm_page_t at the specified index. Otherwise, it > returns the vm_page_t. The motivation for this change is that it > simplifies the use of radix tries in the amd64, arm64, and i386 pmap > implementations. Instead of performing a lookup before every remove, > the pmap can simply perform the remove. Is this performance improvement? From owner-svn-src-head@freebsd.org Thu Dec 8 15:54:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56A2DC6DBD7; Thu, 8 Dec 2016 15:54:47 +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 3596C1BB7; Thu, 8 Dec 2016 15:54:47 +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 EB91110A758; Thu, 8 Dec 2016 10:54:45 -0500 (EST) From: John Baldwin To: Mark Johnston Cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309658 - head/sys/vm Date: Thu, 08 Dec 2016 07:50:17 -0800 Message-ID: <1613947.95yg9mLP0R@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20161207221548.GA33409@wkstn-mjohnston> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207212647.GO27748@FreeBSD.org> <20161207221548.GA33409@wkstn-mjohnston> 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); Thu, 08 Dec 2016 10:54:46 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 15:54:47 -0000 On Wednesday, December 07, 2016 02:15:49 PM Mark Johnston wrote: > On Wed, Dec 07, 2016 at 01:26:47PM -0800, Gleb Smirnoff wrote: > > On Tue, Dec 06, 2016 at 10:52:45PM +0000, Mark Johnston wrote: > > M> Author: markj > > M> Date: Tue Dec 6 22:52:45 2016 > > M> New Revision: 309658 > > M> URL: https://svnweb.freebsd.org/changeset/base/309658 > > M> > > M> Log: > > M> Provide dummy sysctls for v_cache_count and v_tcached. > > M> > > M> Some utilities (notably top(1)) exit if any of their input sysctls don't > > M> exist, and the removal of the above-mentioned PG_CACHE-related sysctls > > M> makes it difficult to run such utilities on different versions of the > > M> kernel without recompiling. > > M> > > M> Requested by: bde > > M> > > M> Modified: > > M> head/sys/vm/vm_meter.c > > M> > > M> Modified: head/sys/vm/vm_meter.c > > M> ============================================================================== > > M> --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) > > M> +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) > > M> @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec > > M> VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); > > M> VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); > > M> VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); > > M> + > > M> +#ifndef BURN_BRIDGES > > M> +/* > > M> + * Provide compatibility sysctls for the benefit of old utilities which exit > > M> + * with an error if they cannot be found. > > M> + */ > > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, > > M> + (u_int *)NULL, 0, "Dummy for compatibility"); > > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, > > M> + (u_int *)NULL, 0, "Dummy for compatibility"); > > M> +#endif > > > > IMHO, there should be some garbage collecting timeout for them. I'd suggest to > > delete them from head after stable/12 branch is forked. > > The intent was to improve compatibility with old userlands, not just to > help bridge the transition from 11.0 to 12.0. In general I'm all for > removing cruft, but these sysctls are unobtrusive and I don't see any > reason to remove them in a specific time frame provided that nothing > else breaks compatibility for top(1) (and vmstat(8)). Please feel free > to add a timeout if you still disagree, though. I would suggest sticking them under COMPAT_FREEBSD11 then. That would give users control via the COMPAT_FREEBSD options the way we do with other compat shims. The only nit is you need to add the COMPAT_FREEBSD11 option first (probably in a separate commit). -- John Baldwin From owner-svn-src-head@freebsd.org Thu Dec 8 15:58:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB2DC6DCF0; Thu, 8 Dec 2016 15:58:05 +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 045AC1D6F; Thu, 8 Dec 2016 15:58:04 +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 uB8Fw4Mc027509; Thu, 8 Dec 2016 15:58:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8Fw4xA027508; Thu, 8 Dec 2016 15:58:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612081558.uB8Fw4xA027508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Dec 2016 15:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309714 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 15:58:05 -0000 Author: mav Date: Thu Dec 8 15:58:03 2016 New Revision: 309714 URL: https://svnweb.freebsd.org/changeset/base/309714 Log: Fix spa_alloc_tree sorting by offset in r305331. Original commit "7090 zfs should improve allocation order" declares alloc queue sorted by time and offset. But in practice io_offset is always zero, so sorting happened only by time, while order of writes with equal time was completely random. On Illumos this did not affected much thanks to using high resolution timestamps. On FreeBSD due to using much faster but low resolution timestamps it caused bad data placement on disks, affecting further read performance. This change switches zio_timestamp_compare() from comparing uninitialized io_offset to really populated io_bookmark values. I haven't decided yet what to do with timestampts, but on simple tests this change gives the same peformance results by just making code to work as declared. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Dec 8 12:42:36 2016 (r309713) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Dec 8 15:58:03 2016 (r309714) @@ -563,9 +563,24 @@ zio_timestamp_compare(const void *x1, co if (z1->io_queued_timestamp > z2->io_queued_timestamp) return (1); - if (z1->io_offset < z2->io_offset) + if (z1->io_bookmark.zb_objset < z2->io_bookmark.zb_objset) return (-1); - if (z1->io_offset > z2->io_offset) + if (z1->io_bookmark.zb_objset > z2->io_bookmark.zb_objset) + return (1); + + if (z1->io_bookmark.zb_object < z2->io_bookmark.zb_object) + return (-1); + if (z1->io_bookmark.zb_object > z2->io_bookmark.zb_object) + return (1); + + if (z1->io_bookmark.zb_level < z2->io_bookmark.zb_level) + return (-1); + if (z1->io_bookmark.zb_level > z2->io_bookmark.zb_level) + return (1); + + if (z1->io_bookmark.zb_blkid < z2->io_bookmark.zb_blkid) + return (-1); + if (z1->io_bookmark.zb_blkid > z2->io_bookmark.zb_blkid) return (1); if (z1 < z2) From owner-svn-src-head@freebsd.org Thu Dec 8 16:28:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8570EC6D829; Thu, 8 Dec 2016 16:28:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF9A1470; Thu, 8 Dec 2016 16:28:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8GSY6D040892; Thu, 8 Dec 2016 16:28:34 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8GSYj9040889; Thu, 8 Dec 2016 16:28:34 GMT (envelope-from br@FreeBSD.org) Message-Id: <201612081628.uB8GSYj9040889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 8 Dec 2016 16:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309715 - head/sys/mips/ingenic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 16:28:35 -0000 Author: br Date: Thu Dec 8 16:28:34 2016 New Revision: 309715 URL: https://svnweb.freebsd.org/changeset/base/309715 Log: Add jz4780 internal codec initialization driver. Sponsored by: DARPA, AFRL Added: head/sys/mips/ingenic/jz4780_codec.c (contents, props changed) head/sys/mips/ingenic/jz4780_codec.h (contents, props changed) head/sys/mips/ingenic/jz4780_common.h (contents, props changed) Added: head/sys/mips/ingenic/jz4780_codec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/ingenic/jz4780_codec.c Thu Dec 8 16:28:34 2016 (r309715) @@ -0,0 +1,242 @@ +/*- + * Copyright (c) 2016 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Ingenic JZ4780 CODEC. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +struct codec_softc { + device_t dev; + struct resource *res[1]; + bus_space_tag_t bst; + bus_space_handle_t bsh; +}; + +static struct resource_spec codec_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int codec_probe(device_t dev); +static int codec_attach(device_t dev); +static int codec_detach(device_t dev); +void codec_print_registers(struct codec_softc *sc); + +static int +codec_write(struct codec_softc *sc, uint32_t reg, uint32_t val) +{ + uint32_t tmp; + + tmp = (reg << RGADW_RGADDR_S); + tmp |= (val << RGADW_RGDIN_S); + tmp |= RGADW_RGWR; + + WRITE4(sc, CODEC_RGADW, tmp); + + while(READ4(sc, CODEC_RGADW) & RGADW_RGWR) + ; + + return (0); +} + +static int +codec_read(struct codec_softc *sc, uint32_t reg) +{ + uint32_t tmp; + + tmp = (reg << RGADW_RGADDR_S); + WRITE4(sc, CODEC_RGADW, tmp); + + tmp = READ4(sc, CODEC_RGDATA); + + return (tmp); +} + +void +codec_print_registers(struct codec_softc *sc) +{ + + printf("codec SR %x\n", codec_read(sc, SR)); + printf("codec SR2 %x\n", codec_read(sc, SR2)); + printf("codec MR %x\n", codec_read(sc, MR)); + printf("codec AICR_DAC %x\n", codec_read(sc, AICR_DAC)); + printf("codec AICR_ADC %x\n", codec_read(sc, AICR_ADC)); + printf("codec CR_LO %x\n", codec_read(sc, CR_LO)); + printf("codec CR_HP %x\n", codec_read(sc, CR_HP)); + printf("codec CR_DMIC %x\n", codec_read(sc, CR_DMIC)); + printf("codec CR_MIC1 %x\n", codec_read(sc, CR_MIC1)); + printf("codec CR_MIC2 %x\n", codec_read(sc, CR_MIC2)); + printf("codec CR_LI1 %x\n", codec_read(sc, CR_LI1)); + printf("codec CR_LI2 %x\n", codec_read(sc, CR_LI2)); + printf("codec CR_DAC %x\n", codec_read(sc, CR_DAC)); + printf("codec CR_ADC %x\n", codec_read(sc, CR_ADC)); + printf("codec CR_MIX %x\n", codec_read(sc, CR_MIX)); + printf("codec DR_MIX %x\n", codec_read(sc, DR_MIX)); + printf("codec CR_VIC %x\n", codec_read(sc, CR_VIC)); + printf("codec CR_CK %x\n", codec_read(sc, CR_CK)); + printf("codec FCR_DAC %x\n", codec_read(sc, FCR_DAC)); + printf("codec FCR_ADC %x\n", codec_read(sc, FCR_ADC)); + printf("codec CR_TIMER_MSB %x\n", codec_read(sc, CR_TIMER_MSB)); + printf("codec CR_TIMER_LSB %x\n", codec_read(sc, CR_TIMER_LSB)); + printf("codec ICR %x\n", codec_read(sc, ICR)); + printf("codec IMR %x\n", codec_read(sc, IMR)); + printf("codec IFR %x\n", codec_read(sc, IFR)); + printf("codec IMR2 %x\n", codec_read(sc, IMR2)); + printf("codec IFR2 %x\n", codec_read(sc, IFR2)); + printf("codec GCR_HPL %x\n", codec_read(sc, GCR_HPL)); + printf("codec GCR_HPR %x\n", codec_read(sc, GCR_HPR)); + printf("codec GCR_LIBYL %x\n", codec_read(sc, GCR_LIBYL)); + printf("codec GCR_LIBYR %x\n", codec_read(sc, GCR_LIBYR)); + printf("codec GCR_DACL %x\n", codec_read(sc, GCR_DACL)); + printf("codec GCR_DACR %x\n", codec_read(sc, GCR_DACR)); + printf("codec GCR_MIC1 %x\n", codec_read(sc, GCR_MIC1)); + printf("codec GCR_MIC2 %x\n", codec_read(sc, GCR_MIC2)); + printf("codec GCR_ADCL %x\n", codec_read(sc, GCR_ADCL)); + printf("codec GCR_ADCR %x\n", codec_read(sc, GCR_ADCR)); + printf("codec GCR_MIXDACL %x\n", codec_read(sc, GCR_MIXDACL)); + printf("codec GCR_MIXDACR %x\n", codec_read(sc, GCR_MIXDACR)); + printf("codec GCR_MIXADCL %x\n", codec_read(sc, GCR_MIXADCL)); + printf("codec GCR_MIXADCR %x\n", codec_read(sc, GCR_MIXADCR)); + printf("codec CR_ADC_AGC %x\n", codec_read(sc, CR_ADC_AGC)); + printf("codec DR_ADC_AGC %x\n", codec_read(sc, DR_ADC_AGC)); +} + +static int +codec_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "ingenic,jz4780-codec")) + return (ENXIO); + + device_set_desc(dev, "Ingenic JZ4780 CODEC"); + + return (BUS_PROBE_DEFAULT); +} + +static int +codec_attach(device_t dev) +{ + struct codec_softc *sc; + uint8_t reg; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, codec_spec, sc->res)) { + device_printf(dev, "could not allocate resources for device\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* Initialize codec. */ + reg = codec_read(sc, CR_VIC); + reg &= ~(VIC_SB_SLEEP | VIC_SB); + codec_write(sc, CR_VIC, reg); + + reg = codec_read(sc, CR_DAC); + reg &= ~(DAC_SB | DAC_MUTE); + codec_write(sc, CR_DAC, reg); + + /* I2S, 16-bit, 96 kHz. */ + reg = codec_read(sc, AICR_DAC); + reg &= ~(AICR_DAC_SB | DAC_ADWL_M); + reg |= DAC_ADWL_16; + reg &= ~(AUDIOIF_M); + reg |= AUDIOIF_I2S; + codec_write(sc, AICR_DAC, reg); + + reg = FCR_DAC_96; + codec_write(sc, FCR_DAC, reg); + + /* Unmute headphones. */ + reg = codec_read(sc, CR_HP); + reg &= ~(HP_SB | HP_MUTE); + codec_write(sc, CR_HP, 0); + + return (0); +} + +static int +codec_detach(device_t dev) +{ + struct codec_softc *sc; + + sc = device_get_softc(dev); + + bus_release_resources(dev, codec_spec, sc->res); + + return (0); +} + +static device_method_t codec_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, codec_probe), + DEVMETHOD(device_attach, codec_attach), + DEVMETHOD(device_detach, codec_detach), + + DEVMETHOD_END +}; + +static driver_t codec_driver = { + "codec", + codec_methods, + sizeof(struct codec_softc), +}; + +static devclass_t codec_devclass; + +DRIVER_MODULE(codec, simplebus, codec_driver, codec_devclass, 0, 0); Added: head/sys/mips/ingenic/jz4780_codec.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/ingenic/jz4780_codec.h Thu Dec 8 16:28:34 2016 (r309715) @@ -0,0 +1,101 @@ +/*- + * Copyright (c) 2016 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define CODEC_RGADW 0x00 /* Address, data in and write command */ +#define RGADW_ICRST (1 << 31) /* Reset internal CODEC */ +#define RGADW_RGWR (1 << 16) /* Issue a write command to CODEC */ +#define RGADW_RGADDR_S 8 /* CODEC register's address. */ +#define RGADW_RGADDR_M (0x7f << RGADW_RGADDR_S) +#define RGADW_RGDIN_S 0 /* CODEC register data to write */ +#define RGADW_RGDIN_M (0xff << RGADW_RGDIN_S) +#define CODEC_RGDATA 0x04 /* The data read out */ + +#define SR 0x00 /* Status Register */ +#define SR2 0x01 /* Status Register 2 */ +#define MR 0x07 /* Mode status register */ +#define AICR_DAC 0x08 /* DAC Audio Interface Control Register */ +#define DAC_ADWL_S 6 /* Audio Data Word Length for DAC path. */ +#define DAC_ADWL_M (0x3 << DAC_ADWL_S) +#define DAC_ADWL_16 (0 << DAC_ADWL_S) +#define AICR_DAC_SB (1 << 4) /* DAC audio interface in power-down mode */ +#define AUDIOIF_S 0 +#define AUDIOIF_M (0x3 << AUDIOIF_S) +#define AUDIOIF_I2S 0x3 /* I2S interface */ +#define AUDIOIF_DSP 0x2 /* DSP interface */ +#define AUDIOIF_LJ 0x1 /* Left-justified interface */ +#define AUDIOIF_P 0x0 /* Parallel interface */ +#define AICR_ADC 0x09 /* ADC Audio Interface Control Register */ +#define CR_LO 0x0B /* Differential line-out Control Register */ +#define CR_HP 0x0D /* HeadPhone Control Register */ +#define HP_MUTE (1 << 7) /* no signal on headphone outputs */ +#define HP_SB (1 << 4) /* power-down */ +#define CR_DMIC 0x10 /* Digital Microphone register */ +#define CR_MIC1 0x11 /* Microphone1 Control register */ +#define CR_MIC2 0x12 /* Microphone2 Control register */ +#define CR_LI1 0x13 /* Control Register for line1 inputs */ +#define CR_LI2 0x14 /* Control Register for line2 inputs */ +#define CR_DAC 0x17 /* DAC Control Register */ +#define DAC_MUTE (1 << 7) /* puts the DAC in soft mute mode */ +#define DAC_SB (1 << 4) /* power-down */ +#define CR_ADC 0x18 /* ADC Control Register */ +#define CR_MIX 0x19 /* Digital Mixer Control Register */ +#define DR_MIX 0x1A /* Digital Mixer Data Register */ +#define CR_VIC 0x1B /* Control Register for the ViC */ +#define VIC_SB_SLEEP (1 << 1) /* sleep mode */ +#define VIC_SB (1 << 0) /* complete power-down */ +#define CR_CK 0x1C /* Clock Control Register */ +#define FCR_DAC 0x1D /* DAC Frequency Control Register */ +#define FCR_DAC_96 10 /* 96 kHz. */ +#define FCR_ADC 0x20 /* ADC Frequency Control Register */ +#define CR_TIMER_MSB 0x21 /* MSB of programmable counter */ +#define CR_TIMER_LSB 0x22 /* LSB of programmable counter */ +#define ICR 0x23 /* Interrupt Control Register */ +#define IMR 0x24 /* Interrupt Mask Register */ +#define IFR 0x25 /* Interrupt Flag Register */ +#define IMR2 0x26 /* Interrupt Mask Register 2 */ +#define IFR2 0x27 /* Interrupt Flag Register 2 */ +#define GCR_HPL 0x28 /* Left channel headphone Control Gain Register */ +#define GCR_HPR 0x29 /* Right channel headphone Control Gain Register */ +#define GCR_LIBYL 0x2A /* Left channel bypass line Control Gain Register */ +#define GCR_LIBYR 0x2B /* Right channel bypass line Control Gain Register */ +#define GCR_DACL 0x2C /* Left channel DAC Gain Control Register */ +#define GCR_DACR 0x2D /* Right channel DAC Gain Control Register */ +#define GCR_MIC1 0x2E /* Microphone 1 Gain Control Register */ +#define GCR_MIC2 0x2F /* Microphone 2 Gain Control Register */ +#define GCR_ADCL 0x30 /* Left ADC Gain Control Register */ +#define GCR_ADCR 0x31 /* Right ADC Gain Control Register */ +#define GCR_MIXDACL 0x34 /* DAC Digital Mixer Control Register */ +#define GCR_MIXDACR 0x35 /* DAC Digital Mixer Control Register */ +#define GCR_MIXADCL 0x36 /* ADC Digital Mixer Control Register */ +#define GCR_MIXADCR 0x37 /* ADC Digital Mixer Control Register */ +#define CR_ADC_AGC 0x3A /* Automatic Gain Control Register */ +#define DR_ADC_AGC 0x3B /* Automatic Gain Control Data Register */ Added: head/sys/mips/ingenic/jz4780_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/ingenic/jz4780_common.h Thu Dec 8 16:28:34 2016 (r309715) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2016 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) From owner-svn-src-head@freebsd.org Thu Dec 8 16:31:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D09FC6DBC9; Thu, 8 Dec 2016 16:31:39 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3212D19D5; Thu, 8 Dec 2016 16:31:38 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.16.0.17/8.16.0.17) with SMTP id uB8EJSB3018170; Thu, 8 Dec 2016 09:38:59 -0600 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 276usxg91g-1; Thu, 08 Dec 2016 09:38:59 -0600 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 65D1F46014D; Thu, 8 Dec 2016 09:38:59 -0600 (CST) Subject: Re: svn commit: r309703 - in head/sys: amd64/amd64 arm64/arm64 i386/i386 vm To: Slawa Olhovchenkov , Alan Cox References: <201612080429.uB84TToV048828@repo.freebsd.org> <20161208130110.GQ57876@zxy.spb.ru> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Alan Cox Message-ID: <9d908236-8875-c03a-fca5-b7a140042fa9@rice.edu> Date: Thu, 8 Dec 2016 09:38:58 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161208130110.GQ57876@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611190142 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 16:31:39 -0000 On 12/08/2016 07:01, Slawa Olhovchenkov wrote: > On Thu, Dec 08, 2016 at 04:29:29AM +0000, Alan Cox wrote: > >> Author: alc >> Date: Thu Dec 8 04:29:29 2016 >> New Revision: 309703 >> URL: https://svnweb.freebsd.org/changeset/base/309703 >> >> Log: >> Previously, vm_radix_remove() would panic if the radix trie didn't >> contain a vm_page_t at the specified index. However, with this >> change, vm_radix_remove() no longer panics. Instead, it returns NUL= L >> if there is no vm_page_t at the specified index. Otherwise, it >> returns the vm_page_t. The motivation for this change is that it >> simplifies the use of radix tries in the amd64, arm64, and i386 pmap= >> implementations. Instead of performing a lookup before every remove= , >> the pmap can simply perform the remove. > Is this performance improvement? > > In that it reduces the number of radix trie operations performed by the pmap, yes. However, radix tries are only used in the pmap to store page table pages that were formerly used by now promoted superpages, so the net effect is going to be small. From owner-svn-src-head@freebsd.org Thu Dec 8 16:41:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D611DC6DF22; Thu, 8 Dec 2016 16:41:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BEB71E6A; Thu, 8 Dec 2016 16:41:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8GfIBx046801; Thu, 8 Dec 2016 16:41:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8GfI3t046800; Thu, 8 Dec 2016 16:41:18 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201612081641.uB8GfI3t046800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 8 Dec 2016 16:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309716 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 16:41:19 -0000 Author: dteske Date: Thu Dec 8 16:41:18 2016 New Revision: 309716 URL: https://svnweb.freebsd.org/changeset/base/309716 Log: Add support for "hidden" Wi-Fi networks PR: bin/214933 Submitted by: Maxim Filimonov Reviewed by: dteske, allanjude, adrian MFC after: 6 days X-MFC-with: Follow-up commit for style Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 16:28:34 2016 (r309715) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 16:41:18 2016 (r309716) @@ -207,6 +207,7 @@ fi while : do + SCANSSID=0 output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" dialog --backtitle "FreeBSD Installer" --title "Scanning" \ @@ -236,7 +237,19 @@ do break ;; 1) # Cancel - exit 1 + # here we ask if the user wants to select the network manually + f_dialog_title "Network Selection" + f_dialog_yesno "Do you want to select the network manually?" || exit 1 + # and take the manual input + # first, take the ssid + f_dialog_input NETWORK "Enter SSID" || exit 1 + # then, the encryption + ENCRYPTION=$( dialog --backtitle "$DIALOG_BACKTITLE" --title \ + "$DIALOG_TITLE" --menu "Select encryption type" 0 0 0 \ + "1 WPA/WPA2 PSK" "" "2 WPA/WPA2 EAP" "" "3 WEP" "" "0 None" "" 2>&1 1>&3 ) || exit 1 + SCANSSID=1 + f_dialog_title_restore + break ;; 3) # Rescan ;; @@ -244,7 +257,7 @@ do exec 3>&- done -ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ +[ -z "$ENCRYPTION" ] && ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"` if echo $ENCRYPTION | grep -q 'PSK'; then @@ -258,6 +271,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the exec 3>&- echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID psk=\"$PASS\" priority=5 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf @@ -273,6 +287,7 @@ elif echo $ENCRYPTION | grep -q EAP; the exec 3>&- echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf echo "$USERPASS" | awk ' { @@ -294,6 +309,7 @@ elif echo $ENCRYPTION | grep -q WEP; the || exec $0 $@ echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=NONE wep_key0=\"$WEPKEY\" wep_tx_keyidx=0 @@ -302,6 +318,7 @@ echo "network={ else # Open echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=NONE priority=5 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf From owner-svn-src-head@freebsd.org Thu Dec 8 18:18:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0ABAC6D4E2; Thu, 8 Dec 2016 18:18:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 703D52DA; Thu, 8 Dec 2016 18:18:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8IImaJ091473; Thu, 8 Dec 2016 18:18:48 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8IImiv091472; Thu, 8 Dec 2016 18:18:48 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612081818.uB8IImiv091472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 8 Dec 2016 18:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309717 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 18:18:49 -0000 Author: loos Date: Thu Dec 8 18:18:48 2016 New Revision: 309717 URL: https://svnweb.freebsd.org/changeset/base/309717 Log: Fix the typos and style(9) in comment. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Dec 8 16:41:18 2016 (r309716) +++ head/sys/net/route.c Thu Dec 8 18:18:48 2016 (r309717) @@ -467,9 +467,8 @@ rtalloc1_fib(struct sockaddr *dst, int r RIB_RUNLOCK(rh); /* - * Either we hit the root or couldn't find any match, - * Which basically means - * "caint get there frm here" + * Either we hit the root or could not find any match, + * which basically means: "cannot get there from here". */ miss: V_rtstat.rts_unreach++; From owner-svn-src-head@freebsd.org Thu Dec 8 18:56:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91FD8C6DE24; Thu, 8 Dec 2016 18:56:36 +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 565041683; Thu, 8 Dec 2016 18:56:36 +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 uB8IuZaG007539; Thu, 8 Dec 2016 18:56:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8IuZub007538; Thu, 8 Dec 2016 18:56:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612081856.uB8IuZub007538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 8 Dec 2016 18:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309718 - head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 18:56:36 -0000 Author: markj Date: Thu Dec 8 18:56:35 2016 New Revision: 309718 URL: https://svnweb.freebsd.org/changeset/base/309718 Log: err.D_PROC_CREATEFAIL.many.d passes, so remove the EFAIL annotation. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Thu Dec 8 18:18:48 2016 (r309717) +++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Thu Dec 8 18:56:35 2016 (r309718) @@ -128,9 +128,6 @@ exclude EXFAIL common/ip/tst.ipv4remotei exclude EXFAIL common/ip/tst.localtcpstate.ksh exclude EXFAIL common/ip/tst.remotetcpstate.ksh -# Depends on the number of probes in /bin/sh and the current DOF limit. -exclude EXFAIL common/pid/err.D_PROC_CREATEFAIL.many.d - # Tries to enable pid$target:libc::entry, though there's no "libc" module. # Currently unsure as to whether this might be a libproc bug. exclude EXFAIL common/pid/tst.probemod.ksh From owner-svn-src-head@freebsd.org Thu Dec 8 19:26:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 583C7C6C955; Thu, 8 Dec 2016 19:26:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC90AED; Thu, 8 Dec 2016 19:26:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8JQM9V022874; Thu, 8 Dec 2016 19:26:22 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8JQMTW022873; Thu, 8 Dec 2016 19:26:22 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201612081926.uB8JQMTW022873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 8 Dec 2016 19:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309719 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 19:26:23 -0000 Author: dteske Date: Thu Dec 8 19:26:22 2016 New Revision: 309719 URL: https://svnweb.freebsd.org/changeset/base/309719 Log: Remove unnecessary trailing backslashes Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 18:56:35 2016 (r309718) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 19:26:22 2016 (r309719) @@ -46,8 +46,8 @@ echo >> $BSDINSTALL_TMPETC/wpa_supplican # Try to reach wpa_supplicant. If it isn't running and we can modify the # existing system, start it. Otherwise, fail. -(wpa_cli ping >/dev/null 2>/dev/null || ([ ! -z $BSDINSTALL_CONFIGCURRENT ] && \ - wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) || \ +(wpa_cli ping >/dev/null 2>/dev/null || ([ ! -z $BSDINSTALL_CONFIGCURRENT ] && + wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) || (dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 @@ -86,7 +86,7 @@ country_set() if [ ! -z "$iface_up" ]; then ifconfig $WLAN_IFACE down fi - error_str=`ifconfig $WLAN_IFACE $ifconfig_args 2>&1 | \ + error_str=`ifconfig $WLAN_IFACE $ifconfig_args 2>&1 | sed 's/ifconfig: //'` if [ ! -z "$iface_up" ]; then # Restart wpa_supplicant(8) (should not fail). @@ -123,9 +123,9 @@ dialog_country_select() # Parse available countries/regdomains input=`ifconfig $WLAN_IFACE list countries | sed 's/DEBUG//gi'` - regdomains=`echo $input | sed 's/.*domains://' | tr ' ' '\n' | \ + regdomains=`echo $input | sed 's/.*domains://' | tr ' ' '\n' | sort | tr '\n' ' '` - countries=`echo $input | sed 's/Country codes://' | \ + countries=`echo $input | sed 's/Country codes://' | sed 's/Regulatory.*//' | awk '{ for (i = 1; i <= NF; i++) { printf "%s", $i @@ -222,7 +222,7 @@ do if [ -z "$NETWORKS" ]; then dialog --backtitle "FreeBSD Installer" --title "Error" \ - --yesno "No wireless networks were found. Rescan?" 0 0 && \ + --yesno "No wireless networks were found. Rescan?" 0 0 && continue exit 1 fi From owner-svn-src-head@freebsd.org Thu Dec 8 19:28:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89788C6CA3F; Thu, 8 Dec 2016 19:28:13 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D073C9F; Thu, 8 Dec 2016 19:28:13 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8JSC5e023015; Thu, 8 Dec 2016 19:28:12 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8JSCwp023014; Thu, 8 Dec 2016 19:28:12 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201612081928.uB8JSCwp023014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 8 Dec 2016 19:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309720 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 19:28:13 -0000 Author: dteske Date: Thu Dec 8 19:28:12 2016 New Revision: 309720 URL: https://svnweb.freebsd.org/changeset/base/309720 Log: Functions in their own section Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 19:26:22 2016 (r309719) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Thu Dec 8 19:28:12 2016 (r309720) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2015 Devin Teske +# Copyright (c) 2013-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -33,31 +33,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_include $BSDCFG_SHARE/dialog.subr -############################################################ MAIN - -echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf -chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf - -echo "ctrl_interface=/var/run/wpa_supplicant" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "eapol_version=2" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "ap_scan=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf -echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf - -# Try to reach wpa_supplicant. If it isn't running and we can modify the -# existing system, start it. Otherwise, fail. -(wpa_cli ping >/dev/null 2>/dev/null || ([ ! -z $BSDINSTALL_CONFIGCURRENT ] && - wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) || - (dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ - "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 - -# See if we succeeded -wpa_cli ping >/dev/null 2>/dev/null -if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCURRENT ]; then - dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ - "Wireless cannot be configured without making changes to the local system!" \ 0 0 - exit 1 -fi +############################################################ FUNCTIONS country_set() { @@ -177,6 +153,32 @@ dialog_country_select() return $? } +############################################################ MAIN + +echo -n > $BSDINSTALL_TMPETC/wpa_supplicant.conf +chmod 0600 $BSDINSTALL_TMPETC/wpa_supplicant.conf + +echo "ctrl_interface=/var/run/wpa_supplicant" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo "eapol_version=2" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo "ap_scan=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo "fast_reauth=1" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf +echo >> $BSDINSTALL_TMPETC/wpa_supplicant.conf + +# Try to reach wpa_supplicant. If it isn't running and we can modify the +# existing system, start it. Otherwise, fail. +(wpa_cli ping >/dev/null 2>/dev/null || ([ ! -z $BSDINSTALL_CONFIGCURRENT ] && + wpa_supplicant -B -i $1 -c $BSDINSTALL_TMPETC/wpa_supplicant.conf)) || + (dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ + "Could not start wpa_supplicant!" 0 0; exit 1) || exit 1 + +# See if we succeeded +wpa_cli ping >/dev/null 2>/dev/null +if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCURRENT ]; then + dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ + "Wireless cannot be configured without making changes to the local system!" \ 0 0 + exit 1 +fi + # There is no way to check country/regdomain without (possible) # interface state modification if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then From owner-svn-src-head@freebsd.org Thu Dec 8 20:54:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4129C6E88E; Thu, 8 Dec 2016 20:54:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A39A123A; Thu, 8 Dec 2016 20:54:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8KssLm071521; Thu, 8 Dec 2016 20:54:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8Ksst9071520; Thu, 8 Dec 2016 20:54:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612082054.uB8Ksst9071520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 8 Dec 2016 20:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309721 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 20:54:55 -0000 Author: avos Date: Thu Dec 8 20:54:54 2016 New Revision: 309721 URL: https://svnweb.freebsd.org/changeset/base/309721 Log: rsu: fix incorrect register addresses. Modified: head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Thu Dec 8 19:28:12 2016 (r309720) +++ head/sys/dev/usb/wlan/if_rsureg.h Thu Dec 8 20:54:54 2016 (r309721) @@ -51,16 +51,16 @@ #define R92S_MACID (R92S_MACIDSETTING + 0x000) #define R92S_MAR (R92S_MACIDSETTING + 0x010) -#define R92S_GP 0x01e0 -#define R92S_GPIO_CTRL (R92S_GP + 0x00c) -#define R92S_GPIO_IO_SEL (R92S_GP + 0x00e) -#define R92S_MAC_PINMUX_CTRL (R92S_GP + 0x011) - #define R92S_SECURITY 0x0240 #define R92S_CAMCMD (R92S_SECURITY + 0x000) #define R92S_CAMWRITE (R92S_SECURITY + 0x004) #define R92S_CAMREAD (R92S_SECURITY + 0x008) +#define R92S_GP 0x02e0 +#define R92S_GPIO_CTRL (R92S_GP + 0x00c) +#define R92S_GPIO_IO_SEL (R92S_GP + 0x00e) +#define R92S_MAC_PINMUX_CTRL (R92S_GP + 0x011) + #define R92S_IOCMD_CTRL 0x0370 #define R92S_IOCMD_DATA 0x0374 From owner-svn-src-head@freebsd.org Thu Dec 8 21:02:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E90AC6EAB9; Thu, 8 Dec 2016 21:02:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62F589B8; Thu, 8 Dec 2016 21:02:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8L2Y5k075552; Thu, 8 Dec 2016 21:02:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8L2YZB075551; Thu, 8 Dec 2016 21:02:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612082102.uB8L2YZB075551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 8 Dec 2016 21:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309722 - head/contrib/llvm/lib/Analysis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 21:02:35 -0000 Author: dim Date: Thu Dec 8 21:02:34 2016 New Revision: 309722 URL: https://svnweb.freebsd.org/changeset/base/309722 Log: Pull in r281586 from upstream llvm trunk (by Wei Mi): Add some shortcuts in LazyValueInfo to reduce compile time of Correlated Value Propagation. The patch is to partially fix PR10584. Correlated Value Propagation queries LVI to check non-null for pointer params of each callsite. If we know the def of param is an alloca instruction, we know it is non-null and can return early from LVI. Similarly, CVP queries LVI to check whether pointer for each mem access is constant. If the def of the pointer is an alloca instruction, we know it is not a constant pointer. These shortcuts can reduce the cost of CVP significantly. Differential Revision: https://reviews.llvm.org/D18066 This significantly reduces memory usage and compilation time when compiling a particular C++ source file of the graphics/colmap port. PR: 215136 MFC after: 3 days Modified: head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp Modified: head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp Thu Dec 8 20:54:54 2016 (r309721) +++ head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp Thu Dec 8 21:02:34 2016 (r309722) @@ -1479,8 +1479,27 @@ LazyValueInfo LazyValueAnalysis::run(Fun return LazyValueInfo(&AC, &TLI, DT); } + +/// Returns true if we can statically tell that this value will never be a +/// "useful" constant. In practice, this means we've got something like an +/// alloca or a malloc call for which a comparison against a constant can +/// only be guarding dead code. Note that we are potentially giving up some +/// precision in dead code (a constant result) in favour of avoiding a +/// expensive search for a easily answered common query. +static bool isKnownNonConstant(Value *V) { + V = V->stripPointerCasts(); + // The return val of alloc cannot be a Constant. + if (isa(V)) + return true; + return false; +} + Constant *LazyValueInfo::getConstant(Value *V, BasicBlock *BB, Instruction *CxtI) { + // Bail out early if V is known not to be a Constant. + if (isKnownNonConstant(V)) + return nullptr; + const DataLayout &DL = BB->getModule()->getDataLayout(); LVILatticeVal Result = getCache(PImpl, AC, &DL, DT).getValueInBlock(V, BB, CxtI); @@ -1613,6 +1632,17 @@ LazyValueInfo::getPredicateOnEdge(unsign LazyValueInfo::Tristate LazyValueInfo::getPredicateAt(unsigned Pred, Value *V, Constant *C, Instruction *CxtI) { + // Is or is not NonNull are common predicates being queried. If + // isKnownNonNull can tell us the result of the predicate, we can + // return it quickly. But this is only a fastpath, and falling + // through would still be correct. + if (V->getType()->isPointerTy() && C->isNullValue() && + isKnownNonNull(V->stripPointerCasts())) { + if (Pred == ICmpInst::ICMP_EQ) + return LazyValueInfo::False; + else if (Pred == ICmpInst::ICMP_NE) + return LazyValueInfo::True; + } const DataLayout &DL = CxtI->getModule()->getDataLayout(); LVILatticeVal Result = getCache(PImpl, AC, &DL, DT).getValueAt(V, CxtI); Tristate Ret = getPredicateResult(Pred, C, Result, DL, TLI); From owner-svn-src-head@freebsd.org Thu Dec 8 22:48:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7742EC6DA1F; Thu, 8 Dec 2016 22:48:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 58F691DBD; Thu, 8 Dec 2016 22:48:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id uB8Mmi9C030248 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 8 Dec 2016 14:48:44 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id uB8MmiUI030247; Thu, 8 Dec 2016 14:48:44 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 8 Dec 2016 14:48:43 -0800 From: Gleb Smirnoff To: Marcel Moolenaar Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309394 - head/sys/netpfil/pf Message-ID: <20161208224843.GY27748@FreeBSD.org> References: <201612020615.uB26Fxs1049431@repo.freebsd.org> <20161207210824.GN27748@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ISA6zNVXmTIvvkD5" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 22:48:45 -0000 --ISA6zNVXmTIvvkD5 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Marcel, On Wed, Dec 07, 2016 at 05:06:08PM -0800, Marcel Moolenaar wrote: M> > thanks for the fixes. While the problem with the first chunk M> > in pfsync_sendout() is obvious, the problem you are fixing in th M> > second chunk in the pfsync_delete_state() is not clear to me. M> > Can you please explain what scenario are you fixing there? M> M> State updates may be pending for state being deleted. This M> means that the state is still sitting on either the PFSYNC_S_UPD M> or PFSYNC_S_UPD_C queues. What pfsync(4) does in that case is M> simply remove the state from those queues and add it to the M> PFSYNC_S_DEL queue. M> M> But, pf(4) has already dropped the reference count for state M> that’s deleted and the only reference is by pfsync(4) by virtue M> of being on the PFSYNC_S_UPD or PFSYNC_S_UPD_C queues. When the M> state gets dequeued from those queues, the reference count drops M> to 0 and the state is deleted (read: memory freed). But the same M> state is subsequently added to the PFSYNC_S_DEL queue — i.e. M> after the memory was freed. Thanks for explanation, Marcel! Potentially this problem also exists in pfsync_update_state() and in pfsync_update_state_req(). Your patch introduces extra unnecessary atomic operations, so let me suggest another patch. It should be applied on top of yours, and it also addresses pfsync_update_state() and in pfsync_update_state_req(). It isn't tested, but is pretty straightforward. -- Totus tuus, Glebius. --ISA6zNVXmTIvvkD5 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pfsync.diff" Index: sys/netpfil/pf/if_pfsync.c =================================================================== --- sys/netpfil/pf/if_pfsync.c (revision 309722) +++ sys/netpfil/pf/if_pfsync.c (working copy) @@ -161,8 +161,8 @@ static struct pfsync_q pfsync_qs[] = { { pfsync_out_del, sizeof(struct pfsync_del_c), PFSYNC_ACT_DEL_C } }; -static void pfsync_q_ins(struct pf_state *, int); -static void pfsync_q_del(struct pf_state *); +static void pfsync_q_ins(struct pf_state *, int, bool); +static void pfsync_q_del(struct pf_state *, bool); static void pfsync_update_state(struct pf_state *); @@ -542,7 +542,7 @@ pfsync_state_import(struct pfsync_state *sp, u_int if (!(flags & PFSYNC_SI_IOCTL)) { st->state_flags &= ~PFSTATE_NOSYNC; if (st->state_flags & PFSTATE_ACK) { - pfsync_q_ins(st, PFSYNC_S_IACK); + pfsync_q_ins(st, PFSYNC_S_IACK, true); pfsync_push(sc); } } @@ -1668,7 +1668,7 @@ pfsync_insert_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); - pfsync_q_ins(st, PFSYNC_S_INS); + pfsync_q_ins(st, PFSYNC_S_INS, true); PFSYNC_UNLOCK(sc); st->sync_updates = 0; @@ -1789,7 +1789,7 @@ static void pfsync_update_state(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; - int sync = 0; + bool sync = false, ref = true; PF_STATE_LOCK_ASSERT(st); PFSYNC_LOCK(sc); @@ -1798,7 +1798,7 @@ pfsync_update_state(struct pf_state *st) pfsync_undefer_state(st, 0); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st); + pfsync_q_del(st, true); PFSYNC_UNLOCK(sc); return; } @@ -1815,14 +1815,17 @@ pfsync_update_state(struct pf_state *st) if (st->key[PF_SK_WIRE]->proto == IPPROTO_TCP) { st->sync_updates++; if (st->sync_updates >= sc->sc_maxupdates) - sync = 1; + sync = true; } break; case PFSYNC_S_IACK: - pfsync_q_del(st); + pfsync_q_del(st, false); + ref = false; + /* FALLTHROUGH */ + case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_UPD_C); + pfsync_q_ins(st, PFSYNC_S_UPD_C, ref); st->sync_updates = 0; break; @@ -1880,6 +1883,7 @@ static void pfsync_update_state_req(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; + bool ref = true; PF_STATE_LOCK_ASSERT(st); PFSYNC_LOCK(sc); @@ -1886,7 +1890,7 @@ pfsync_update_state_req(struct pf_state *st) if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st); + pfsync_q_del(st, true); PFSYNC_UNLOCK(sc); return; } @@ -1894,9 +1898,12 @@ pfsync_update_state_req(struct pf_state *st) switch (st->sync_state) { case PFSYNC_S_UPD_C: case PFSYNC_S_IACK: - pfsync_q_del(st); + pfsync_q_del(st, false); + ref = false; + /* FALLTHROUGH */ + case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_UPD); + pfsync_q_ins(st, PFSYNC_S_UPD, true); pfsync_push(sc); break; @@ -1917,6 +1924,7 @@ static void pfsync_delete_state(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; + bool ref = true; PFSYNC_LOCK(sc); if (st->state_flags & PFSTATE_ACK) @@ -1923,7 +1931,7 @@ pfsync_delete_state(struct pf_state *st) pfsync_undefer_state(st, 1); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st); + pfsync_q_del(st, true); PFSYNC_UNLOCK(sc); return; } @@ -1931,22 +1939,21 @@ pfsync_delete_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); - pf_ref_state(st); - switch (st->sync_state) { case PFSYNC_S_INS: /* We never got to tell the world so just forget about it. */ - pfsync_q_del(st); + pfsync_q_del(st, true); break; case PFSYNC_S_UPD_C: case PFSYNC_S_UPD: case PFSYNC_S_IACK: - pfsync_q_del(st); - /* FALLTHROUGH to putting it on the del list */ + pfsync_q_del(st, false); + ref = false; + /* FALLTHROUGH */ case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_DEL); + pfsync_q_ins(st, PFSYNC_S_DEL, ref); break; default: @@ -1953,8 +1960,6 @@ pfsync_delete_state(struct pf_state *st) panic("%s: unexpected sync state %d", __func__, st->sync_state); } - pf_release_state(st); - PFSYNC_UNLOCK(sc); } @@ -1982,7 +1987,7 @@ pfsync_clear_states(u_int32_t creatorid, const cha } static void -pfsync_q_ins(struct pf_state *st, int q) +pfsync_q_ins(struct pf_state *st, int q, bool ref) { struct pfsync_softc *sc = V_pfsyncif; size_t nlen = pfsync_qs[q].len; @@ -2006,11 +2011,12 @@ static void sc->sc_len += nlen; TAILQ_INSERT_TAIL(&sc->sc_qs[q], st, sync_list); st->sync_state = q; - pf_ref_state(st); + if (ref) + pf_ref_state(st); } static void -pfsync_q_del(struct pf_state *st) +pfsync_q_del(struct pf_state *st, bool unref) { struct pfsync_softc *sc = V_pfsyncif; int q = st->sync_state; @@ -2022,7 +2028,8 @@ static void sc->sc_len -= pfsync_qs[q].len; TAILQ_REMOVE(&sc->sc_qs[q], st, sync_list); st->sync_state = PFSYNC_S_NONE; - pf_release_state(st); + if (unref) + pf_release_state(st); if (TAILQ_EMPTY(&sc->sc_qs[q])) sc->sc_len -= sizeof(struct pfsync_subheader); --ISA6zNVXmTIvvkD5-- From owner-svn-src-head@freebsd.org Thu Dec 8 23:03:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1563EC6E1CB; Thu, 8 Dec 2016 23:03:33 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com [IPv6:2607:f8b0:400d:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C66E8A7C; Thu, 8 Dec 2016 23:03:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x243.google.com with SMTP id x190so132489qkb.0; Thu, 08 Dec 2016 15:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EhmMZ3qpbSig0WPAUM4gfQu3hW1l0aq1fmupRPgVMJk=; b=uEeIo3DyUrYvhmc+cyhaEJcVu+fIMaAiV/PstB3zv6bPjYYtWuSvl/vQ01Yy/qFVQm r9atDDbpS38rsZ3zZDSw0EQY7B+wxWGsglE5/dAPNqtiCNUbNveU4t8dT0vfnK7aYY4J puvu+s0FPHl23QUJLdGGC5HY9GFSfAlZuUgQo1scl6/bH5qssqfCY8vSEWxyJZrfNPZq nhQ+7kHzuli32nU+3+nA3yvQIyq84Z9TRdCJrNEjxyQ2O+yZPkkzzPzgIiin6jm69MfS j0OZ/mpeU6kwRz3eAoWx+7pd/s0BpHylkFpppftvVmUEeWC0jxN53JwXjKNqWYTuAw+b 60FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=EhmMZ3qpbSig0WPAUM4gfQu3hW1l0aq1fmupRPgVMJk=; b=hpCqxwo7aAFZP1qaJfLKgiTp0KamulnRz1O2PwdArJHoJ45mFkUahNyFcdX54q2qeM 7X+nGXtTyfdbuPzkveM+VpVBXq2hJ8Bg2lEhC5oAjR8dLdRpqqJeZILyB0BY/eFHWgxc ny1tCcdfx2Kv86NytBv1XbA+hxhK1ht4N3enLJ2AKz9Yv6dzfaO/WqjQoMRhkfLT1ejI pDFhr6h45rVO2WZ3Zv3ZnDRy9/IRLyRV3gK2FSoLIwQdnEOepTXYDdGUYbKL2jYX4Ysu CNoDrLfge8qwWzlycqHhLxvkVxA+ceZgADt2lU+9tv1xAYayXtLCxvp9/YwYaNZs4Utv a07w== X-Gm-Message-State: AKaTC03a0wdOdFYZoa0/o4s/+Nz6CRJzglLLBaiW53GuTapX0222vPqBDH9LcvU+ygMPgg== X-Received: by 10.55.92.199 with SMTP id q190mr65666453qkb.303.1481238211858; Thu, 08 Dec 2016 15:03:31 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id f66sm18509992qkj.23.2016.12.08.15.03.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 15:03:31 -0800 (PST) Sender: Mark Johnston Date: Thu, 8 Dec 2016 15:09:43 -0800 From: Mark Johnston To: John Baldwin Cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309658 - head/sys/vm Message-ID: <20161208230943.GA25503@wkstn-mjohnston.west.isilon.com> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207212647.GO27748@FreeBSD.org> <20161207221548.GA33409@wkstn-mjohnston> <1613947.95yg9mLP0R@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1613947.95yg9mLP0R@ralph.baldwin.cx> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 23:03:33 -0000 On Thu, Dec 08, 2016 at 07:50:17AM -0800, John Baldwin wrote: > On Wednesday, December 07, 2016 02:15:49 PM Mark Johnston wrote: > > On Wed, Dec 07, 2016 at 01:26:47PM -0800, Gleb Smirnoff wrote: > > > On Tue, Dec 06, 2016 at 10:52:45PM +0000, Mark Johnston wrote: > > > M> Author: markj > > > M> Date: Tue Dec 6 22:52:45 2016 > > > M> New Revision: 309658 > > > M> URL: https://svnweb.freebsd.org/changeset/base/309658 > > > M> > > > M> Log: > > > M> Provide dummy sysctls for v_cache_count and v_tcached. > > > M> > > > M> Some utilities (notably top(1)) exit if any of their input sysctls don't > > > M> exist, and the removal of the above-mentioned PG_CACHE-related sysctls > > > M> makes it difficult to run such utilities on different versions of the > > > M> kernel without recompiling. > > > M> > > > M> Requested by: bde > > > M> > > > M> Modified: > > > M> head/sys/vm/vm_meter.c > > > M> > > > M> Modified: head/sys/vm/vm_meter.c > > > M> ============================================================================== > > > M> --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) > > > M> +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) > > > M> @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec > > > M> VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); > > > M> VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); > > > M> VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); > > > M> + > > > M> +#ifndef BURN_BRIDGES > > > M> +/* > > > M> + * Provide compatibility sysctls for the benefit of old utilities which exit > > > M> + * with an error if they cannot be found. > > > M> + */ > > > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, > > > M> + (u_int *)NULL, 0, "Dummy for compatibility"); > > > M> +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, > > > M> + (u_int *)NULL, 0, "Dummy for compatibility"); > > > M> +#endif > > > > > > IMHO, there should be some garbage collecting timeout for them. I'd suggest to > > > delete them from head after stable/12 branch is forked. > > > > The intent was to improve compatibility with old userlands, not just to > > help bridge the transition from 11.0 to 12.0. In general I'm all for > > removing cruft, but these sysctls are unobtrusive and I don't see any > > reason to remove them in a specific time frame provided that nothing > > else breaks compatibility for top(1) (and vmstat(8)). Please feel free > > to add a timeout if you still disagree, though. > > I would suggest sticking them under COMPAT_FREEBSD11 then. That would give > users control via the COMPAT_FREEBSD options the way we do with other > compat shims. The only nit is you need to add the COMPAT_FREEBSD11 option > first (probably in a separate commit). Ok. I've put up a CR here if anyone would like to take a look first: https://reviews.freebsd.org/D8736 From owner-svn-src-head@freebsd.org Thu Dec 8 23:29:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17906C6E803; Thu, 8 Dec 2016 23:29:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E63281444; Thu, 8 Dec 2016 23:29:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB8NTvrj033407; Thu, 8 Dec 2016 23:29:57 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB8NTvMd033406; Thu, 8 Dec 2016 23:29:57 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201612082329.uB8NTvMd033406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 8 Dec 2016 23:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309723 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 23:29:58 -0000 Author: rmacklem Date: Thu Dec 8 23:29:56 2016 New Revision: 309723 URL: https://svnweb.freebsd.org/changeset/base/309723 Log: Patch the nfsd so that it doesn't register with rpcbind for an NFSv4 only server. This patch uses the sysctl vfs.nfsd.server_min_nfsvers to determine if/what versions of NFS service should be registered with rpcbind. For NFSv4 only, it does not register at all, since NFSv4 always uses 2049 and does not require rpcbind. For NFSv3 minimum, it registers NFSv3 but not NFSv2. Tested by: jmader2@gmu.edu Submitted by: jmader2@gmu.edu (earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D8696 Modified: head/usr.sbin/nfsd/nfsd.c Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Thu Dec 8 21:02:34 2016 (r309722) +++ head/usr.sbin/nfsd/nfsd.c Thu Dec 8 23:29:56 2016 (r309723) @@ -82,6 +82,9 @@ static int debug = 0; #define NFSD_STABLEBACKUP "/var/db/nfs-stablerestart.bak" #define MAXNFSDCNT 256 #define DEFNFSDCNT 4 +#define NFS_VER2 2 +#define NFS_VER3 3 +#define NFS_VER4 4 static pid_t children[MAXNFSDCNT]; /* PIDs of children */ static int nfsdcnt; /* number of children */ static int nfsdcnt_set; @@ -158,6 +161,8 @@ main(int argc, char **argv) int bindhostc, bindanyflag, rpcbreg, rpcbregcnt; int nfssvc_addsock; int longindex = 0; + int nfs_minvers = NFS_VER2; + size_t nfs_minvers_size; const char *lopt; char **bindhost = NULL; pid_t pid; @@ -266,6 +271,15 @@ main(int argc, char **argv) errx(1, "Out of memory"); } + nfs_minvers_size = sizeof(nfs_minvers); + error = sysctlbyname("vfs.nfsd.server_min_nfsvers", &nfs_minvers, + &nfs_minvers_size, NULL, 0); + if (error != 0 || nfs_minvers < NFS_VER2 || nfs_minvers > NFS_VER4) { + warnx("sysctlbyname(vfs.nfsd.server_min_nfsvers) failed," + " defaulting to NFSv2"); + nfs_minvers = NFS_VER2; + } + if (unregister) { unregistration(); exit (0); @@ -285,9 +299,14 @@ main(int argc, char **argv) err(1, "getnetconfigent udp failed"); nb_udp.buf = ai_udp->ai_addr; nb_udp.len = nb_udp.maxlen = ai_udp->ai_addrlen; - if ((!rpcb_set(NFS_PROGRAM, 2, nconf_udp, &nb_udp)) || - (!rpcb_set(NFS_PROGRAM, 3, nconf_udp, &nb_udp))) - err(1, "rpcb_set udp failed"); + if (nfs_minvers == NFS_VER2) + if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp, + &nb_udp)) + err(1, "rpcb_set udp failed"); + if (nfs_minvers <= NFS_VER3) + if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp, + &nb_udp)) + err(1, "rpcb_set udp failed"); freeaddrinfo(ai_udp); } if (udpflag && ip6flag) { @@ -304,9 +323,14 @@ main(int argc, char **argv) err(1, "getnetconfigent udp6 failed"); nb_udp6.buf = ai_udp6->ai_addr; nb_udp6.len = nb_udp6.maxlen = ai_udp6->ai_addrlen; - if ((!rpcb_set(NFS_PROGRAM, 2, nconf_udp6, &nb_udp6)) || - (!rpcb_set(NFS_PROGRAM, 3, nconf_udp6, &nb_udp6))) - err(1, "rpcb_set udp6 failed"); + if (nfs_minvers == NFS_VER2) + if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp6, + &nb_udp6)) + err(1, "rpcb_set udp6 failed"); + if (nfs_minvers <= NFS_VER3) + if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp6, + &nb_udp6)) + err(1, "rpcb_set udp6 failed"); freeaddrinfo(ai_udp6); } if (tcpflag) { @@ -323,9 +347,14 @@ main(int argc, char **argv) err(1, "getnetconfigent tcp failed"); nb_tcp.buf = ai_tcp->ai_addr; nb_tcp.len = nb_tcp.maxlen = ai_tcp->ai_addrlen; - if ((!rpcb_set(NFS_PROGRAM, 2, nconf_tcp, &nb_tcp)) || - (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp, &nb_tcp))) - err(1, "rpcb_set tcp failed"); + if (nfs_minvers == NFS_VER2) + if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp, + &nb_tcp)) + err(1, "rpcb_set tcp failed"); + if (nfs_minvers <= NFS_VER3) + if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp, + &nb_tcp)) + err(1, "rpcb_set tcp failed"); freeaddrinfo(ai_tcp); } if (tcpflag && ip6flag) { @@ -342,9 +371,14 @@ main(int argc, char **argv) err(1, "getnetconfigent tcp6 failed"); nb_tcp6.buf = ai_tcp6->ai_addr; nb_tcp6.len = nb_tcp6.maxlen = ai_tcp6->ai_addrlen; - if ((!rpcb_set(NFS_PROGRAM, 2, nconf_tcp6, &nb_tcp6)) || - (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp6, &nb_tcp6))) - err(1, "rpcb_set tcp6 failed"); + if (nfs_minvers == NFS_VER2) + if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp6, + &nb_tcp6)) + err(1, "rpcb_set tcp6 failed"); + if (nfs_minvers <= NFS_VER3) + if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp6, + &nb_tcp6)) + err(1, "rpcb_set tcp6 failed"); freeaddrinfo(ai_tcp6); } exit (0); @@ -475,9 +509,14 @@ main(int argc, char **argv) err(1, "getnetconfigent udp failed"); nb_udp.buf = ai_udp->ai_addr; nb_udp.len = nb_udp.maxlen = ai_udp->ai_addrlen; - if ((!rpcb_set(NFS_PROGRAM, 2, nconf_udp, &nb_udp)) || - (!rpcb_set(NFS_PROGRAM, 3, nconf_udp, &nb_udp))) - err(1, "rpcb_set udp failed"); + if (nfs_minvers == NFS_VER2) + if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp, + &nb_udp)) + err(1, "rpcb_set udp failed"); + if (nfs_minvers <= NFS_VER3) + if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp, + &nb_udp)) + err(1, "rpcb_set udp failed"); freeaddrinfo(ai_udp); } } @@ -544,9 +583,16 @@ main(int argc, char **argv) err(1, "getnetconfigent udp6 failed"); nb_udp6.buf = ai_udp6->ai_addr; nb_udp6.len = nb_udp6.maxlen = ai_udp6->ai_addrlen; - if ((!rpcb_set(NFS_PROGRAM, 2, nconf_udp6, &nb_udp6)) || - (!rpcb_set(NFS_PROGRAM, 3, nconf_udp6, &nb_udp6))) - err(1, "rpcb_set udp6 failed"); + if (nfs_minvers == NFS_VER2) + if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp6, + &nb_udp6)) + err(1, + "rpcb_set udp6 failed"); + if (nfs_minvers <= NFS_VER3) + if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp6, + &nb_udp6)) + err(1, + "rpcb_set udp6 failed"); freeaddrinfo(ai_udp6); } } @@ -610,10 +656,14 @@ main(int argc, char **argv) err(1, "getnetconfigent tcp failed"); nb_tcp.buf = ai_tcp->ai_addr; nb_tcp.len = nb_tcp.maxlen = ai_tcp->ai_addrlen; - if ((!rpcb_set(NFS_PROGRAM, 2, nconf_tcp, - &nb_tcp)) || (!rpcb_set(NFS_PROGRAM, 3, - nconf_tcp, &nb_tcp))) - err(1, "rpcb_set tcp failed"); + if (nfs_minvers == NFS_VER2) + if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp, + &nb_tcp)) + err(1, "rpcb_set tcp failed"); + if (nfs_minvers <= NFS_VER3) + if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp, + &nb_tcp)) + err(1, "rpcb_set tcp failed"); freeaddrinfo(ai_tcp); } } @@ -685,9 +735,14 @@ main(int argc, char **argv) err(1, "getnetconfigent tcp6 failed"); nb_tcp6.buf = ai_tcp6->ai_addr; nb_tcp6.len = nb_tcp6.maxlen = ai_tcp6->ai_addrlen; - if ((!rpcb_set(NFS_PROGRAM, 2, nconf_tcp6, &nb_tcp6)) || - (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp6, &nb_tcp6))) - err(1, "rpcb_set tcp6 failed"); + if (nfs_minvers == NFS_VER2) + if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp6, + &nb_tcp6)) + err(1, "rpcb_set tcp6 failed"); + if (nfs_minvers <= NFS_VER3) + if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp6, + &nb_tcp6)) + err(1, "rpcb_set tcp6 failed"); freeaddrinfo(ai_tcp6); } } From owner-svn-src-head@freebsd.org Fri Dec 9 02:21:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9E3FC6D3D9; Fri, 9 Dec 2016 02:21:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79AEF1D0B; Fri, 9 Dec 2016 02:21:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB92LRwx005052; Fri, 9 Dec 2016 02:21:27 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB92LR5f005050; Fri, 9 Dec 2016 02:21:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201612090221.uB92LR5f005050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 9 Dec 2016 02:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309725 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 02:21:28 -0000 Author: np Date: Fri Dec 9 02:21:27 2016 New Revision: 309725 URL: https://svnweb.freebsd.org/changeset/base/309725 Log: cxgbe(4): netmap does not set IFCAP_NETMAP in an ifnet's if_capabilities any more (since r307394). Do it in the driver instead. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Dec 9 01:44:26 2016 (r309724) +++ head/sys/dev/cxgbe/t4_main.c Fri Dec 9 02:21:27 2016 (r309725) @@ -1417,6 +1417,10 @@ cxgbe_vi_attach(device_t dev, struct vi_ if (vi->nofldrxq != 0) ifp->if_capabilities |= IFCAP_TOE; #endif +#ifdef DEV_NETMAP + if (vi->nnmrxq != 0) + ifp->if_capabilities |= IFCAP_NETMAP; +#endif ifp->if_capenable = T4_CAP_ENABLE; ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | CSUM_UDP_IPV6 | CSUM_TCP_IPV6; @@ -1435,7 +1439,7 @@ cxgbe_vi_attach(device_t dev, struct vi_ ether_ifattach(ifp, vi->hw_addr); #ifdef DEV_NETMAP - if (vi->nnmrxq != 0) + if (ifp->if_capabilities & IFCAP_NETMAP) cxgbe_nm_attach(vi); #endif sb = sbuf_new_auto(); Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Fri Dec 9 01:44:26 2016 (r309724) +++ head/sys/dev/cxgbe/t4_netmap.c Fri Dec 9 02:21:27 2016 (r309725) @@ -870,7 +870,7 @@ cxgbe_nm_attach(struct vi_info *vi) na.nm_register = cxgbe_netmap_reg; na.num_tx_rings = vi->nnmtxq; na.num_rx_rings = vi->nnmrxq; - netmap_attach(&na); /* This adds IFCAP_NETMAP to if_capabilities */ + netmap_attach(&na); } void From owner-svn-src-head@freebsd.org Fri Dec 9 03:16:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86DE2C6C88C; Fri, 9 Dec 2016 03:16:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 618B21ADD; Fri, 9 Dec 2016 03:16:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB93Gam3026133; Fri, 9 Dec 2016 03:16:36 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB93GaIw026132; Fri, 9 Dec 2016 03:16:36 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612090316.uB93GaIw026132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 9 Dec 2016 03:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309726 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 03:16:37 -0000 Author: sephe Date: Fri Dec 9 03:16:36 2016 New Revision: 309726 URL: https://svnweb.freebsd.org/changeset/base/309726 Log: hyperv/storvsc: Fix the SCSI disk attachment issue. On pre-WS2016 Hyper-V, if the only LUNs > 7 are used, then all disks fails to attach. Mainly because those versions of Hyper-V do not set SRB_STATUS properly and deliver junky INQUERY responses. Submitted by: Hongjiang Zhang Reported by: Hongxiong Xian MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8724 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Dec 9 02:21:27 2016 (r309725) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Dec 9 03:16:36 2016 (r309726) @@ -2053,6 +2053,17 @@ create_storvsc_request(union ccb *ccb, s return(0); } +static uint32_t +is_scsi_valid(const struct scsi_inquiry_data *inq_data) +{ + u_int8_t type; + type = SID_TYPE(inq_data); + if (type == T_NODEVICE) + return (0); + if (SID_QUAL(inq_data) == SID_QUAL_BAD_LU) + return (0); + return (1); +} /** * @brief completion function before returning to CAM * @@ -2164,32 +2175,46 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status |= CAM_REQ_CMP; } - if (cmd->opcode == INQUIRY) { + if (cmd->opcode == INQUIRY && + vm_srb->srb_status == SRB_STATUS_SUCCESS) { + int resp_xfer_len, resp_buf_len, data_len; struct scsi_inquiry_data *inq_data = (struct scsi_inquiry_data *)csio->data_ptr; - uint8_t *resp_buf = (uint8_t *)csio->data_ptr; - int resp_xfer_len, resp_buf_len, data_len; - /* Get the buffer length reported by host */ resp_xfer_len = vm_srb->transfer_len; + uint8_t *resp_buf = (uint8_t *)csio->data_ptr; + /* Get the available buffer length */ resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; data_len = (resp_buf_len < resp_xfer_len) ? resp_buf_len : resp_xfer_len; - if (bootverbose && data_len >= 5) { xpt_print(ccb->ccb_h.path, "storvsc inquiry " "(%d) [%x %x %x %x %x ... ]\n", data_len, resp_buf[0], resp_buf[1], resp_buf[2], resp_buf[3], resp_buf[4]); } - if (vm_srb->srb_status == SRB_STATUS_SUCCESS && - data_len >= SHORT_INQUIRY_LENGTH) { + /* + * XXX: Manually fix the wrong response returned from WS2012 + */ + if (!is_scsi_valid(inq_data) && + (vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8_1 || + vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8 || + vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN7)) { + if (data_len >= 4 && + (resp_buf[2] == 0 || resp_buf[3] == 0)) { + resp_buf[2] = 5; // verion=5 means SPC-3 + resp_buf[3] = 2; // resp fmt must be 2 + if (bootverbose) + xpt_print(ccb->ccb_h.path, + "fix version and resp fmt for 0x%x\n", + vmstor_proto_version); + } + } else if (data_len >= SHORT_INQUIRY_LENGTH) { char vendor[16]; cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), sizeof(vendor)); - /* * XXX: Upgrade SPC2 to SPC3 if host is WIN8 or * WIN2012 R2 in order to support UNMAP feature. From owner-svn-src-head@freebsd.org Fri Dec 9 06:18:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E483C6E943; Fri, 9 Dec 2016 06:18:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B995DD3F; Fri, 9 Dec 2016 06:18:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB96ICiX097774; Fri, 9 Dec 2016 06:18:12 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB96ICgE097773; Fri, 9 Dec 2016 06:18:12 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612090618.uB96ICgE097773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 9 Dec 2016 06:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309728 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 06:18:14 -0000 Author: sephe Date: Fri Dec 9 06:18:12 2016 New Revision: 309728 URL: https://svnweb.freebsd.org/changeset/base/309728 Log: hyperv/storvsc: Minor style changes; no functional changes. Reported by: rpokala MFC after: 1 week Sponsored by: Microsoft Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Dec 9 04:35:07 2016 (r309727) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Dec 9 06:18:12 2016 (r309728) @@ -2057,6 +2057,7 @@ static uint32_t is_scsi_valid(const struct scsi_inquiry_data *inq_data) { u_int8_t type; + type = SID_TYPE(inq_data); if (type == T_NODEVICE) return (0); @@ -2064,6 +2065,7 @@ is_scsi_valid(const struct scsi_inquiry_ return (0); return (1); } + /** * @brief completion function before returning to CAM * @@ -2082,6 +2084,7 @@ storvsc_io_done(struct hv_storvsc_reques struct vmscsi_req *vm_srb = &reqp->vstor_packet.u.vm_srb; bus_dma_segment_t *ori_sglist = NULL; int ori_sg_count = 0; + /* destroy bounce buffer if it is used */ if (reqp->bounce_sgl_count) { ori_sglist = (bus_dma_segment_t *)ccb->csio.data_ptr; @@ -2136,6 +2139,7 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status &= ~CAM_STATUS_MASK; if (vm_srb->scsi_status == SCSI_STATUS_OK) { const struct scsi_generic *cmd; + cmd = (const struct scsi_generic *) ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); @@ -2178,11 +2182,12 @@ storvsc_io_done(struct hv_storvsc_reques if (cmd->opcode == INQUIRY && vm_srb->srb_status == SRB_STATUS_SUCCESS) { int resp_xfer_len, resp_buf_len, data_len; + uint8_t *resp_buf = (uint8_t *)csio->data_ptr; struct scsi_inquiry_data *inq_data = (struct scsi_inquiry_data *)csio->data_ptr; + /* Get the buffer length reported by host */ resp_xfer_len = vm_srb->transfer_len; - uint8_t *resp_buf = (uint8_t *)csio->data_ptr; /* Get the available buffer length */ resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; From owner-svn-src-head@freebsd.org Fri Dec 9 09:16:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 509BDC6C3BC; Fri, 9 Dec 2016 09:16:19 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5]) (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 04F2F964; Fri, 9 Dec 2016 09:16:18 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from mail-wm0-f44.google.com (unknown [74.125.82.44]) (Authenticated sender: gugus69) by smtp5-g21.free.fr (Postfix) with ESMTPSA id 7896C5FFCF; Fri, 9 Dec 2016 10:16:03 +0100 (CET) Received: by mail-wm0-f44.google.com with SMTP id g23so17205274wme.1; Fri, 09 Dec 2016 01:16:03 -0800 (PST) X-Gm-Message-State: AKaTC03lAzwBCdjYrpbOhxfdvN/nCmM0SS9P0dCO6ipWx+v+2f4u/qQ5yI9y4QcsHaEzdzI81sc10SVCpRrnzw== X-Received: by 10.28.60.194 with SMTP id j185mr5636738wma.33.1481274963211; Fri, 09 Dec 2016 01:16:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.14.197 with HTTP; Fri, 9 Dec 2016 01:15:42 -0800 (PST) In-Reply-To: <201612090221.uB92LR5f005050@repo.freebsd.org> References: <201612090221.uB92LR5f005050@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Fri, 9 Dec 2016 10:15:42 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309725 - head/sys/dev/cxgbe To: Navdeep Parhar Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 09:16:19 -0000 On Fri, Dec 9, 2016 at 3:21 AM, Navdeep Parhar wrote: > Author: np > Date: Fri Dec 9 02:21:27 2016 > New Revision: 309725 > URL: https://svnweb.freebsd.org/changeset/base/309725 > > Log: > cxgbe(4): netmap does not set IFCAP_NETMAP in an ifnet's if_capabilitie= s > any more (since r307394). Do it in the driver instead. > > MFC after: 1 week > > =E2=80=8BThanks:It's better! Now I can start one pkt-gen process without panicing my server. But as soon as I start a second pkt-gen at the same time it panic again. I don't have this problem with Intel NIC, only with Chelsio. Fatal trap 12: page fault while in kernel mode cpuid =3D 5; apic id =3D 0a fault virtual address =3D 0x0 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff8047c63a stack pointer =3D 0x28:0xfffffe0466004240 frame pointer =3D 0x28:0xfffffe0466004310 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 1902 (pkt-gen) trap number =3D 12 panic: page fault cpuid =3D 5 KDB: stack backtrace: #0 0xffffffff8095cc07 at kdb_backtrace+0x67 #1 0xffffffff80916af6 at vpanic+0x186 #2 0xffffffff80916963 at panic+0x43 #3 0xffffffff80d36b82 at trap_fatal+0x322 #4 0xffffffff80d36d4c at trap_pfault+0x1bc #5 0xffffffff80d36400 at trap+0x280 #6 0xffffffff80d198b1 at calltrap+0x8 #7 0xffffffff80634bec at netmap_hw_reg+0x2c #8 0xffffffff806321cb at netmap_do_regif+0x2ab #9 0xffffffff80632da8 at netmap_ioctl+0xb58 #10 0xffffffff8063688e at freebsd_netmap_ioctl+0x3e #11 0xffffffff8084ea37 at devfs_ioctl+0xb7 #12 0xffffffff80ec6d28 at VOP_IOCTL_APV+0x88 #13 0xffffffff809f24d1 at vn_ioctl+0x161 #14 0xffffffff8084f27f at devfs_ioctl_f+0x1f #15 0xffffffff8097a66b at kern_ioctl+0x31b #16 0xffffffff8097a2ac at sys_ioctl+0x13c #17 0xffffffff80d374f5 at amd64_syscall+0x4f5 Uptime: 59m40s (kgdb) backtrace #0 doadump (textdump=3D) at pcpu.h:222 #1 0xffffffff80916579 in kern_reboot (howto=3D260) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/kern/kern_shutdown.c:366 #2 0xffffffff80916b30 in vpanic (fmt=3D, ap=3D) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/kern/kern_shutdown.c:759 #3 0xffffffff80916963 in panic (fmt=3D) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/kern/kern_shutdown.c:690 #4 0xffffffff80d36b82 in trap_fatal (frame=3D0xfffffe0465fb7180, eva=3D0) = at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/trap.c:801 #5 0xffffffff80d36d4c in trap_pfault (frame=3D0xfffffe0465fb7180, usermode=3D0) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/trap.c:658 #6 0xffffffff80d36400 in trap (frame=3D0xfffffe0465fb7180) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/trap.c:421 #7 0xffffffff80d198b1 in calltrap () at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/exception.S:236 #8 0xffffffff8047c63a in cxgbe_netmap_reg (na=3D, on=3D) at netmap_kern.h:1747 #9 0xffffffff80634bec in netmap_hw_reg (na=3D0xfffff800055bc400, onoff=3D1= ) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/dev/netmap/netmap.c:2788 #10 0xffffffff806321cb in netmap_do_regif (priv=3D, na=3D, ringid=3D, flags=3D) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/dev/netmap/netmap.c:2050 #11 0xffffffff80632da8 in netmap_ioctl (priv=3D, cmd=3D, data=3D0xfffffe0465fb79b0 "vcxl0", td=3D0xfffff800371bb500) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/dev/netmap/netmap.c:2257 #12 0xffffffff8063688e in freebsd_netmap_ioctl (dev=3D= , cmd=3D3225184658, data=3D0xfffffe0465fb79b0 "vcxl0", ffla=3D, td=3D0xfffff800371bb500) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/dev/netmap/netmap_freebsd.c:1389 #13 0xffffffff8084ea37 in devfs_ioctl (ap=3D) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/fs/devfs/devfs_vnops.c:831 #14 0xffffffff80ec6d28 in VOP_IOCTL_APV (vop=3D, a=3D) at vnode_if.c:1067 #15 0xffffffff809f24d1 in vn_ioctl (fp=3D0xfffff800372d0be0, com=3D, data=3D0xfffffe0465fb79b0, active_cred=3D0xfffff8003714b500= , td=3D) at vnode_if.h:448 #16 0xffffffff8084f27f in devfs_ioctl_f (fp=3D, com=3D, data=3D, cred=3D, td=3D0xfffff800371bb500) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/fs/devfs/devfs_vnops.c:789 #17 0xffffffff8097a66b in kern_ioctl (td=3D, fd=3D, com=3D3225184658, data=3D0xfffffe0465fb79b0 "vcxl0") at file.h:327 #18 0xffffffff8097a2ac in sys_ioctl (td=3D0xfffff800371bb500, uap=3D0xfffffe0465fb7b60) at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/kern/sys_generic.c:746 #19 0xffffffff80d374f5 in amd64_syscall (td=3D0xfffff800371bb500, traced=3D= 0) at subr_syscall.c:135 #20 0xffffffff80d19b9b in Xfast_syscall () at /usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/amd64/amd64/exception.S:396 #21 0x000000080100c3aa in ?? () Previous frame inner to this frame (corrupt stack?) Current language: auto; currently minimal From owner-svn-src-head@freebsd.org Fri Dec 9 13:41:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D74D6C6E6EF; Fri, 9 Dec 2016 13:41:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 955518C7; Fri, 9 Dec 2016 13:41:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9DfQ2l081761; Fri, 9 Dec 2016 13:41:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9DfQfh081760; Fri, 9 Dec 2016 13:41:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612091341.uB9DfQfh081760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Dec 2016 13:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309731 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 13:41:27 -0000 Author: hselasky Date: Fri Dec 9 13:41:26 2016 New Revision: 309731 URL: https://svnweb.freebsd.org/changeset/base/309731 Log: Prefix the Linux KPI's kmem_xxx() functions with linux_ to avoid conflict with the opensolaris kernel module. This patch solves a problem where the kernel linker will incorrectly resolve opensolaris kmem_xxx() functions as linuxkpi ones, which leads to a panic when these functions are used. Submitted by: gallatin @ Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Fri Dec 9 08:41:57 2016 (r309730) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Fri Dec 9 13:41:26 2016 (r309731) @@ -55,7 +55,18 @@ MALLOC_DECLARE(M_KMALLOC); #define vmalloc(size) kmalloc(size, GFP_KERNEL) #define vmalloc_node(size, node) kmalloc(size, GFP_KERNEL) -struct kmem_cache { + +/* + * Prefix some functions with linux_ to avoid namespace conflict + * with the OpenSolaris code in the kernel. + */ +#define kmem_cache linux_kmem_cache +#define kmem_cache_create(...) linux_kmem_cache_create(__VA_ARGS__) +#define kmem_cache_alloc(...) linux_kmem_cache_alloc(__VA_ARGS__) +#define kmem_cache_free(...) linux_kmem_cache_free(__VA_ARGS__) +#define kmem_cache_destroy(...) linux_kmem_cache_destroy(__VA_ARGS__) + +struct linux_kmem_cache { uma_zone_t cache_zone; void (*cache_ctor)(void *); }; @@ -63,7 +74,7 @@ struct kmem_cache { #define SLAB_HWCACHE_ALIGN 0x0001 static inline int -kmem_ctor(void *mem, int size, void *arg, int flags) +linux_kmem_ctor(void *mem, int size, void *arg, int flags) { void (*ctor)(void *); @@ -74,7 +85,7 @@ kmem_ctor(void *mem, int size, void *arg } static inline struct kmem_cache * -kmem_cache_create(char *name, size_t size, size_t align, u_long flags, +linux_kmem_cache_create(char *name, size_t size, size_t align, u_long flags, void (*ctor)(void *)) { struct kmem_cache *c; @@ -84,7 +95,7 @@ kmem_cache_create(char *name, size_t siz align--; if (flags & SLAB_HWCACHE_ALIGN) align = UMA_ALIGN_CACHE; - c->cache_zone = uma_zcreate(name, size, ctor ? kmem_ctor : NULL, + c->cache_zone = uma_zcreate(name, size, ctor ? linux_kmem_ctor : NULL, NULL, NULL, NULL, align, 0); c->cache_ctor = ctor; @@ -92,19 +103,19 @@ kmem_cache_create(char *name, size_t siz } static inline void * -kmem_cache_alloc(struct kmem_cache *c, int flags) +linux_kmem_cache_alloc(struct kmem_cache *c, int flags) { return uma_zalloc_arg(c->cache_zone, c->cache_ctor, flags); } static inline void -kmem_cache_free(struct kmem_cache *c, void *m) +linux_kmem_cache_free(struct kmem_cache *c, void *m) { uma_zfree(c->cache_zone, m); } static inline void -kmem_cache_destroy(struct kmem_cache *c) +linux_kmem_cache_destroy(struct kmem_cache *c) { uma_zdestroy(c->cache_zone); free(c, M_KMALLOC); From owner-svn-src-head@freebsd.org Fri Dec 9 13:47:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1103C6E8E7; Fri, 9 Dec 2016 13:47:51 +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 916FCC66; Fri, 9 Dec 2016 13:47:51 +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 uB9DloaJ083432; Fri, 9 Dec 2016 13:47:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9DloCF083429; Fri, 9 Dec 2016 13:47:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612091347.uB9DloCF083429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Dec 2016 13:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309732 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 13:47:51 -0000 Author: hselasky Date: Fri Dec 9 13:47:50 2016 New Revision: 309732 URL: https://svnweb.freebsd.org/changeset/base/309732 Log: Prefix some _pci_xxx() functions in the Linux KPI with linux_ and make sure the IRQ number used by these functions is unsigned. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Dec 9 13:41:26 2016 (r309731) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Fri Dec 9 13:47:50 2016 (r309732) @@ -50,11 +50,11 @@ struct irq_ent { void *arg; irqreturn_t (*handler)(int, void *); void *tag; - int irq; + unsigned int irq; }; static inline int -linux_irq_rid(struct device *dev, int irq) +linux_irq_rid(struct device *dev, unsigned int irq) { if (irq == dev->irq) return (0); @@ -64,7 +64,7 @@ linux_irq_rid(struct device *dev, int ir extern void linux_irq_handler(void *); static inline struct irq_ent * -linux_irq_ent(struct device *dev, int irq) +linux_irq_ent(struct device *dev, unsigned int irq) { struct irq_ent *irqe; @@ -85,7 +85,7 @@ request_irq(unsigned int irq, irq_handle int error; int rid; - dev = _pci_find_irq_dev(irq); + dev = linux_pci_find_irq_dev(irq); if (dev == NULL) return -ENXIO; rid = linux_irq_rid(dev, irq); @@ -117,7 +117,7 @@ bind_irq_to_cpu(unsigned int irq, int cp struct irq_ent *irqe; struct device *dev; - dev = _pci_find_irq_dev(irq); + dev = linux_pci_find_irq_dev(irq); if (dev == NULL) return (-ENOENT); @@ -135,7 +135,7 @@ free_irq(unsigned int irq, void *device) struct device *dev; int rid; - dev = _pci_find_irq_dev(irq); + dev = linux_pci_find_irq_dev(irq); if (dev == NULL) return; rid = linux_irq_rid(dev, irq); Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Dec 9 13:41:26 2016 (r309731) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Dec 9 13:47:50 2016 (r309732) @@ -171,7 +171,7 @@ struct pci_dev { }; static inline struct resource_list_entry * -_pci_get_rle(struct pci_dev *pdev, int type, int rid) +linux_pci_get_rle(struct pci_dev *pdev, int type, int rid) { struct pci_devinfo *dinfo; struct resource_list *rl; @@ -182,18 +182,18 @@ _pci_get_rle(struct pci_dev *pdev, int t } static inline struct resource_list_entry * -_pci_get_bar(struct pci_dev *pdev, int bar) +linux_pci_get_bar(struct pci_dev *pdev, int bar) { struct resource_list_entry *rle; bar = PCIR_BAR(bar); - if ((rle = _pci_get_rle(pdev, SYS_RES_MEMORY, bar)) == NULL) - rle = _pci_get_rle(pdev, SYS_RES_IOPORT, bar); + if ((rle = linux_pci_get_rle(pdev, SYS_RES_MEMORY, bar)) == NULL) + rle = linux_pci_get_rle(pdev, SYS_RES_IOPORT, bar); return (rle); } static inline struct device * -_pci_find_irq_dev(unsigned int irq) +linux_pci_find_irq_dev(unsigned int irq) { struct pci_dev *pdev; @@ -215,7 +215,7 @@ pci_resource_start(struct pci_dev *pdev, { struct resource_list_entry *rle; - if ((rle = _pci_get_bar(pdev, bar)) == NULL) + if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) return (0); return rle->start; } @@ -225,7 +225,7 @@ pci_resource_len(struct pci_dev *pdev, i { struct resource_list_entry *rle; - if ((rle = _pci_get_bar(pdev, bar)) == NULL) + if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) return (0); return rle->count; } @@ -331,7 +331,7 @@ pci_release_region(struct pci_dev *pdev, { struct resource_list_entry *rle; - if ((rle = _pci_get_bar(pdev, bar)) == NULL) + if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) return; bus_release_resource(pdev->dev.bsddev, rle->type, rle->rid, rle->res); } @@ -477,7 +477,7 @@ pci_enable_msix(struct pci_dev *pdev, st pci_release_msi(pdev->dev.bsddev); return avail; } - rle = _pci_get_rle(pdev, SYS_RES_IRQ, 1); + rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 1); pdev->dev.msix = rle->start; pdev->dev.msix_max = rle->start + avail; for (i = 0; i < nreq; i++) Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Dec 9 13:41:26 2016 (r309731) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Dec 9 13:47:50 2016 (r309732) @@ -140,8 +140,8 @@ linux_pci_attach(device_t dev) kobject_set_name(&pdev->dev.kobj, device_get_nameunit(dev)); kobject_add(&pdev->dev.kobj, &linux_root_device.kobj, kobject_name(&pdev->dev.kobj)); - rle = _pci_get_rle(pdev, SYS_RES_IRQ, 0); - if (rle) + rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 0); + if (rle != NULL) pdev->dev.irq = rle->start; else pdev->dev.irq = 255; From owner-svn-src-head@freebsd.org Fri Dec 9 13:53:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 702F1C6EC27; Fri, 9 Dec 2016 13:53:32 +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 3F28510F2; Fri, 9 Dec 2016 13:53:32 +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 uB9DrVxm087649; Fri, 9 Dec 2016 13:53:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9DrVGu087647; Fri, 9 Dec 2016 13:53:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612091353.uB9DrVGu087647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Dec 2016 13:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309733 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 13:53:32 -0000 Author: hselasky Date: Fri Dec 9 13:53:31 2016 New Revision: 309733 URL: https://svnweb.freebsd.org/changeset/base/309733 Log: MSIX can support more than 256 IRQs. Make sure the invalid IRQ number set in the LinuxKPI is big enough. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Fri Dec 9 13:47:50 2016 (r309732) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Fri Dec 9 13:53:31 2016 (r309733) @@ -70,6 +70,7 @@ struct device { uint64_t *dma_mask; void *driver_data; unsigned int irq; +#define LINUX_IRQ_INVALID 65535 unsigned int msix; unsigned int msix_max; const struct attribute_group **groups; Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Dec 9 13:47:50 2016 (r309732) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Dec 9 13:53:31 2016 (r309733) @@ -144,7 +144,7 @@ linux_pci_attach(device_t dev) if (rle != NULL) pdev->dev.irq = rle->start; else - pdev->dev.irq = 255; + pdev->dev.irq = LINUX_IRQ_INVALID; pdev->irq = pdev->dev.irq; DROP_GIANT(); spin_lock(&pci_lock); From owner-svn-src-head@freebsd.org Fri Dec 9 14:06:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E5CAC6EEB7; Fri, 9 Dec 2016 14:06:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6E2172C; Fri, 9 Dec 2016 14:06:24 +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 uB9E6Nvg091974; Fri, 9 Dec 2016 14:06:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9E6Nh9091973; Fri, 9 Dec 2016 14:06:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612091406.uB9E6Nh9091973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Dec 2016 14:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309734 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 14:06:24 -0000 Author: hselasky Date: Fri Dec 9 14:06:22 2016 New Revision: 309734 URL: https://svnweb.freebsd.org/changeset/base/309734 Log: Avoid malloc() warnings when using the LinuxKPI by zero-checking the allocation flags. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h head/sys/compat/linuxkpi/common/include/linux/slab.h Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Dec 9 13:53:31 2016 (r309733) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Dec 9 14:06:22 2016 (r309734) @@ -64,7 +64,7 @@ #define GFP_IOFS M_NOWAIT #define GFP_NOIO M_NOWAIT #define GFP_DMA32 0 -#define GFP_TEMPORARY 0 +#define GFP_TEMPORARY M_NOWAIT static inline void * page_address(struct page *page) Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Fri Dec 9 13:53:31 2016 (r309733) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Fri Dec 9 14:06:22 2016 (r309734) @@ -43,7 +43,7 @@ MALLOC_DECLARE(M_KMALLOC); #define kmalloc(size, flags) malloc((size), M_KMALLOC, (flags)) #define kvmalloc(size) kmalloc((size), 0) -#define kzalloc(size, flags) kmalloc((size), (flags) | M_ZERO) +#define kzalloc(size, flags) kmalloc((size), M_ZERO | ((flags) ? (flags) : M_NOWAIT)) #define kzalloc_node(size, flags, node) kzalloc(size, flags) #define kfree(ptr) free(__DECONST(void *, (ptr)), M_KMALLOC) #define kfree_const(ptr) kfree(ptr) From owner-svn-src-head@freebsd.org Fri Dec 9 14:51:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A87CC6D34C; Fri, 9 Dec 2016 14:51:07 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E12BD183F; Fri, 9 Dec 2016 14:51:06 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9Ep673011273; Fri, 9 Dec 2016 14:51:06 GMT (envelope-from robak@FreeBSD.org) Received: (from robak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9Ep6xv011272; Fri, 9 Dec 2016 14:51:06 GMT (envelope-from robak@FreeBSD.org) Message-Id: <201612091451.uB9Ep6xv011272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: robak set sender to robak@FreeBSD.org using -f From: Bartek Rutkowski Date: Fri, 9 Dec 2016 14:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309735 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 14:51:07 -0000 Author: robak (ports committer) Date: Fri Dec 9 14:51:05 2016 New Revision: 309735 URL: https://svnweb.freebsd.org/changeset/base/309735 Log: Capsicum support for dd(1) Adds Capsicum sandboxing to dd utility. Submitted by: Pawel Biernacki Reviewed by: allanjude, emaste, oshogbo Approved by: oshogbo Sponsored by: Mysterious Code Ltd. Differential Revision: https://reviews.freebsd.org/D8543 Modified: head/bin/dd/dd.c Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Fri Dec 9 14:06:22 2016 (r309734) +++ head/bin/dd/dd.c Fri Dec 9 14:51:05 2016 (r309735) @@ -47,11 +47,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include +#include #include #include #include @@ -92,6 +95,10 @@ main(int argc __unused, char *argv[]) jcl(argv); setup(); + caph_cache_catpages(); + if (cap_enter() == -1 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + (void)signal(SIGINFO, siginfo_handler); (void)signal(SIGINT, terminate); @@ -125,6 +132,8 @@ static void setup(void) { u_int cnt; + cap_rights_t rights; + unsigned long cmds[] = { FIODTYPE, MTIOCTOP }; if (in.name == NULL) { in.name = "stdin"; @@ -133,13 +142,20 @@ setup(void) in.fd = open(in.name, O_RDONLY, 0); if (in.fd == -1) err(1, "%s", in.name); + if (caph_limit_stdin() == -1) + err(1, "unable to limit capability rights"); } getfdtype(&in); + cap_rights_init(&rights, CAP_READ, CAP_SEEK); + if (cap_rights_limit(in.fd, &rights) == -1 && errno != ENOSYS) + err(1, "unable to limit capability rights"); + if (files_cnt > 1 && !(in.flags & ISTAPE)) errx(1, "files is not supported for non-tape devices"); + cap_rights_set(&rights, CAP_FTRUNCATE, CAP_IOCTL, CAP_WRITE); if (out.name == NULL) { /* No way to check for read access here. */ out.fd = STDOUT_FILENO; @@ -156,13 +172,27 @@ setup(void) if (out.fd == -1) { out.fd = open(out.name, O_WRONLY | OFLAGS, DEFFILEMODE); out.flags |= NOREAD; + cap_rights_clear(&rights, CAP_READ); } if (out.fd == -1) err(1, "%s", out.name); + if (caph_limit_stdout() == -1) + err(1, "unable to limit capability rights"); } getfdtype(&out); + if (cap_rights_limit(out.fd, &rights) == -1 && errno != ENOSYS) + err(1, "unable to limit capability rights"); + if (cap_ioctls_limit(out.fd, cmds, nitems(cmds)) == -1 && + errno != ENOSYS) + err(1, "unable to limit capability rights"); + + if (in.fd != STDERR_FILENO && out.fd != STDERR_FILENO) { + if (caph_limit_stderr() == -1) + err(1, "unable to limit capability rights"); + } + /* * Allocate space for the input and output buffers. If not doing * record oriented I/O, only need a single buffer. From owner-svn-src-head@freebsd.org Fri Dec 9 15:01:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6240EC6D713; Fri, 9 Dec 2016 15:01:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 315501F12; Fri, 9 Dec 2016 15:01:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9F1bG4015171; Fri, 9 Dec 2016 15:01:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9F1bUs015170; Fri, 9 Dec 2016 15:01:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612091501.uB9F1bUs015170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Dec 2016 15:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309736 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 15:01:38 -0000 Author: hselasky Date: Fri Dec 9 15:01:37 2016 New Revision: 309736 URL: https://svnweb.freebsd.org/changeset/base/309736 Log: Prefer function macros over regular macros in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Dec 9 14:51:05 2016 (r309735) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Dec 9 15:01:37 2016 (r309736) @@ -537,9 +537,9 @@ static inline void pci_disable_sriov(str #define PCI_DMA_NONE 3 #define pci_pool dma_pool -#define pci_pool_destroy dma_pool_destroy -#define pci_pool_alloc dma_pool_alloc -#define pci_pool_free dma_pool_free +#define pci_pool_destroy(...) dma_pool_destroy(__VA_ARGS__) +#define pci_pool_alloc(...) dma_pool_alloc(__VA_ARGS__) +#define pci_pool_free(...) dma_pool_free(__VA_ARGS__) #define pci_pool_create(_name, _pdev, _size, _align, _alloc) \ dma_pool_create(_name, &(_pdev)->dev, _size, _align, _alloc) #define pci_free_consistent(_hwdev, _size, _vaddr, _dma_handle) \ From owner-svn-src-head@freebsd.org Fri Dec 9 15:05:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64D4C6D852; Fri, 9 Dec 2016 15:05:10 +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 A0D8A31E; Fri, 9 Dec 2016 15:05:10 +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 uB9F59qD016901; Fri, 9 Dec 2016 15:05:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9F59A0016900; Fri, 9 Dec 2016 15:05:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612091505.uB9F59A0016900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Dec 2016 15:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309737 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 15:05:10 -0000 Author: hselasky Date: Fri Dec 9 15:05:09 2016 New Revision: 309737 URL: https://svnweb.freebsd.org/changeset/base/309737 Log: Add more LinuxKPI PCI definitions. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Dec 9 15:01:37 2016 (r309736) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Dec 9 15:05:09 2016 (r309737) @@ -64,8 +64,18 @@ struct pci_device_id { #define MODULE_DEVICE_TABLE(bus, table) #define PCI_ANY_ID (-1) +#define PCI_VENDOR_ID_APPLE 0x106b +#define PCI_VENDOR_ID_ASUSTEK 0x1043 +#define PCI_VENDOR_ID_ATI 0x1002 +#define PCI_VENDOR_ID_DELL 0x1028 +#define PCI_VENDOR_ID_HP 0x103c +#define PCI_VENDOR_ID_IBM 0x1014 +#define PCI_VENDOR_ID_INTEL 0x8086 #define PCI_VENDOR_ID_MELLANOX 0x15b3 +#define PCI_VENDOR_ID_SERVERWORKS 0x1166 +#define PCI_VENDOR_ID_SONY 0x104d #define PCI_VENDOR_ID_TOPSPIN 0x1867 +#define PCI_VENDOR_ID_VIA 0x1106 #define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 #define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46 #define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 @@ -121,6 +131,10 @@ struct pci_device_id { #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ +#define PCI_EXP_LNKCTL_HAWD PCIEM_LINK_CTL_HAWD +#define PCI_EXP_LNKCAP_CLKPM 0x00040000 +#define PCI_EXP_DEVSTA_TRPND 0x0020 + #define IORESOURCE_MEM (1 << SYS_RES_MEMORY) #define IORESOURCE_IO (1 << SYS_RES_IOPORT) #define IORESOURCE_IRQ (1 << SYS_RES_IRQ) @@ -133,9 +147,19 @@ enum pci_bus_speed { }; enum pcie_link_width { - PCIE_LNK_WIDTH_UNKNOWN = -1, + PCIE_LNK_WIDTH_UNKNOWN = 0xFF, }; +typedef int pci_power_t; + +#define PCI_D0 PCI_POWERSTATE_D0 +#define PCI_D1 PCI_POWERSTATE_D1 +#define PCI_D2 PCI_POWERSTATE_D2 +#define PCI_D3hot PCI_POWERSTATE_D3 +#define PCI_D3cold 4 + +#define PCI_POWER_ERROR PCI_POWERSTATE_UNKNOWN + struct pci_dev; struct pci_driver { @@ -303,6 +327,14 @@ pci_set_master(struct pci_dev *pdev) } static inline int +pci_set_power_state(struct pci_dev *pdev, int state) +{ + + pci_set_powerstate(pdev->dev.bsddev, state); + return (0); +} + +static inline int pci_clear_master(struct pci_dev *pdev) { @@ -368,9 +400,23 @@ pci_disable_msix(struct pci_dev *pdev) pci_release_msi(pdev->dev.bsddev); } +static inline bus_addr_t +pci_bus_address(struct pci_dev *pdev, int bar) +{ + + return (pci_resource_start(pdev, bar)); +} + #define PCI_CAP_ID_EXP PCIY_EXPRESS #define PCI_CAP_ID_PCIX PCIY_PCIX +#define PCI_CAP_ID_AGP PCIY_AGP +#define PCI_CAP_ID_PM PCIY_PMG +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_DEVCTL_PAYLOAD PCIEM_CTL_MAX_PAYLOAD +#define PCI_EXP_DEVCTL_READRQ PCIEM_CTL_MAX_READ_REQUEST +#define PCI_EXP_LNKCTL PCIER_LINK_CTL +#define PCI_EXP_LNKSTA PCIER_LINK_STA static inline int pci_find_capability(struct pci_dev *pdev, int capid) @@ -410,7 +456,7 @@ pci_read_config_dword(struct pci_dev *pd *val = (u32)pci_read_config(pdev->dev.bsddev, where, 4); return (0); -} +} static inline int pci_write_config_byte(struct pci_dev *pdev, int where, u8 val) @@ -430,7 +476,7 @@ pci_write_config_word(struct pci_dev *pd static inline int pci_write_config_dword(struct pci_dev *pdev, int where, u32 val) -{ +{ pci_write_config(pdev->dev.bsddev, where, val, 4); return (0); @@ -708,7 +754,8 @@ static bool pcie_capability_reg_implemen } } -static inline int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *dst) +static inline int +pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *dst) { if (pos & 3) return -EINVAL; @@ -719,7 +766,20 @@ static inline int pcie_capability_read_d return pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, dst); } -static inline int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val) +static inline int +pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *dst) +{ + if (pos & 3) + return -EINVAL; + + if (!pcie_capability_reg_implemented(dev, pos)) + return -EINVAL; + + return pci_read_config_word(dev, pci_pcie_cap(dev) + pos, dst); +} + +static inline int +pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val) { if (pos & 1) return -EINVAL; From owner-svn-src-head@freebsd.org Fri Dec 9 16:14:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9529C6E042; Fri, 9 Dec 2016 16:14:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 98F731235; Fri, 9 Dec 2016 16:14:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9GEtpP046580; Fri, 9 Dec 2016 16:14:55 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9GEtAu046579; Fri, 9 Dec 2016 16:14:55 GMT (envelope-from des@FreeBSD.org) Message-Id: <201612091614.uB9GEtAu046579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 9 Dec 2016 16:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309738 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 16:14:56 -0000 Author: des Date: Fri Dec 9 16:14:55 2016 New Revision: 309738 URL: https://svnweb.freebsd.org/changeset/base/309738 Log: More debugging code I missed in r309051. Reported by: jbeich, jkim Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Fri Dec 9 15:05:09 2016 (r309737) +++ head/lib/libfetch/common.c Fri Dec 9 16:14:55 2016 (r309738) @@ -335,7 +335,6 @@ fetch_connect(const char *host, int port fetch_info("resolving server address: %s:%d", host, port); if ((sais = fetch_resolve(host, port, af)) == NULL) goto fail; - fetch_info("resolved"); /* resolve client address */ bindaddr = getenv("FETCH_BIND_ADDRESS"); From owner-svn-src-head@freebsd.org Fri Dec 9 17:16:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7484C6E53E; Fri, 9 Dec 2016 17:16:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1DD6191D; Fri, 9 Dec 2016 17:16:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9HG9NV071000; Fri, 9 Dec 2016 17:16:09 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9HG9fj070998; Fri, 9 Dec 2016 17:16:09 GMT (envelope-from br@FreeBSD.org) Message-Id: <201612091716.uB9HG9fj070998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 9 Dec 2016 17:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309739 - head/sys/mips/ingenic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 17:16:10 -0000 Author: br Date: Fri Dec 9 17:16:09 2016 New Revision: 309739 URL: https://svnweb.freebsd.org/changeset/base/309739 Log: Add registers for jz4780 audio and PDMA controllers. Sponsored by: DARPA, AFRL Added: head/sys/mips/ingenic/jz4780_aic.h (contents, props changed) Modified: head/sys/mips/ingenic/jz4780_pdma.h Added: head/sys/mips/ingenic/jz4780_aic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/ingenic/jz4780_aic.h Fri Dec 9 17:16:09 2016 (r309739) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2016 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define AICFR 0x00 /* AIC Configuration Register */ +#define AICFR_TFTH_S 16 /* Transmit FIFO threshold for interrupt or DMA request. */ +#define AICFR_TFTH_M (0x1f << AICFR_TFTH_S) +#define AICFR_TFTH(x) ((x) << AICFR_TFTH_S) +#define AICFR_RFTH_S 24 /* Receive FIFO threshold for interrupt or DMA request. */ +#define AICFR_RFTH_M (0x0f << AICFR_RFTH_S) +#define AICFR_RFTH(x) ((x) << AICFR_RFTH_S) +#define AICFR_ICDC (1 << 5) /* Internal CODEC used. */ +#define AICFR_AUSEL (1 << 4) /* Audio Unit Select */ +#define AICFR_RST (1 << 3) /* Reset AIC. */ +#define AICFR_BCKD (1 << 2) /* BIT_CLK Direction. */ +#define AICFR_SYNCD (1 << 1) /* SYNC is generated internally and driven out to the CODEC. */ +#define AICFR_ENB (1 << 0) /* Enable AIC Controller. */ +#define AICCR 0x04 /* AIC Common Control Register */ +#define AICCR_TFLUSH (1 << 8) /* Transmit FIFO Flush. */ +#define AICCR_RFLUSH (1 << 7) /* Receive FIFO Flush. */ +#define AICCR_CHANNEL_S 24 +#define AICCR_CHANNEL_M (0x7 << AICCR_CHANNEL_S) +#define AICCR_CHANNEL_2 (0x1 << AICCR_CHANNEL_S) /* 2 channels, stereo */ +#define AICCR_ISS_S 16 /* Input Sample Size. */ +#define AICCR_ISS_M (0x7 << AICCR_ISS_S) +#define AICCR_ISS_16 (0x1 << AICCR_ISS_S) +#define AICCR_OSS_S 19 /* Output Sample Size. */ +#define AICCR_OSS_M (0x7 << AICCR_OSS_S) +#define AICCR_OSS_16 (0x1 << AICCR_OSS_S) +#define AICCR_RDMS (1 << 15) /* Receive DMA enable. */ +#define AICCR_TDMS (1 << 14) /* Transmit DMA enable. */ +#define AICCR_ENLBF (1 << 2) /* Enable AIC Loop Back Function. */ +#define AICCR_ERPL (1 << 1) /* Enable Playing Back function. */ +#define I2SCR 0x10 /* AIC I2S/MSB-justified Control */ +#define I2SCR_ESCLK (1 << 4) /* Enable SYSCLK output. */ +#define I2SCR_AMSL (1 << 0) /* Select MSB-Justified Operation Mode. */ +#define AICSR 0x14 /* AIC FIFO Status Register Register */ +#define I2SSR 0x1C /* AIC I2S/MSB-justified Status Register */ +#define I2SDIV 0x30 /* AIC I2S/MSB-justified Clock Divider Register */ +#define AICDR 0x34 /* AIC FIFO Data Port Register */ +#define SPENA 0x80 /* SPDIF Enable Register */ +#define SPCTRL 0x84 /* SPDIF Control Register */ +#define SPSTATE 0x88 /* SPDIF Status Register */ +#define SPCFG1 0x8C /* SPDIF Configure 1 Register */ +#define SPCFG2 0x90 /* SPDIF Configure 2 Register */ +#define SPFIFO 0x94 /* SPDIF FIFO Register */ Modified: head/sys/mips/ingenic/jz4780_pdma.h ============================================================================== --- head/sys/mips/ingenic/jz4780_pdma.h Fri Dec 9 16:14:55 2016 (r309738) +++ head/sys/mips/ingenic/jz4780_pdma.h Fri Dec 9 17:16:09 2016 (r309739) @@ -35,13 +35,52 @@ #define PDMA_DTA(n) (0x04 + 0x20 * n) /* Channel n Target Address */ #define PDMA_DTC(n) (0x08 + 0x20 * n) /* Channel n Transfer Count */ #define PDMA_DRT(n) (0x0C + 0x20 * n) /* Channel n Request Source */ +#define DRT_AUTO (1 << 3) /* Auto-request. */ #define PDMA_DCS(n) (0x10 + 0x20 * n) /* Channel n Control/Status */ +#define DCS_DES8 (1 << 30) /* Descriptor 8 Word. */ +#define DCS_AR (1 << 4) /* Address Error. */ +#define DCS_TT (1 << 3) /* Transfer Terminate. */ +#define DCS_HLT (1 << 2) /* DMA halt. */ +#define DCS_CTE (1 << 0) /* Channel transfer enable. */ #define PDMA_DCM(n) (0x14 + 0x20 * n) /* Channel n Command */ +#define DCM_SAI (1 << 23) /* Source Address Increment. */ +#define DCM_DAI (1 << 22) /* Destination Address Increment. */ + +#define DCM_SP_S 14 /* Source port width. */ +#define DCM_SP_M (0x3 << DCM_SP_S) +#define DCM_SP_1 (0x1 << DCM_SP_S) /* 1 byte */ +#define DCM_SP_2 (0x2 << DCM_SP_S) /* 2 bytes */ +#define DCM_SP_4 (0x0 << DCM_SP_S) /* 4 bytes */ + +#define DCM_DP_S 12 /* Destination port width. */ +#define DCM_DP_M (0x3 << DCM_DP_S) +#define DCM_DP_1 (0x1 << DCM_DP_S) /* 1 byte */ +#define DCM_DP_2 (0x2 << DCM_DP_S) /* 2 bytes */ +#define DCM_DP_4 (0x0 << DCM_DP_S) /* 4 bytes */ + +#define DCM_TSZ_S 8 /* Transfer Data Size of a data unit. */ +#define DCM_TSZ_M (0x7 << DCM_TSZ_S) +#define DCM_TSZ_1 (0x1 << DCM_TSZ_S) +#define DCM_TSZ_2 (0x2 << DCM_TSZ_S) +#define DCM_TSZ_4 (0x0 << DCM_TSZ_S) +#define DCM_TSZ_16 (0x3 << DCM_TSZ_S) +#define DCM_TSZ_32 (0x4 << DCM_TSZ_S) +#define DCM_TSZ_64 (0x5 << DCM_TSZ_S) +#define DCM_TSZ_128 (0x6 << DCM_TSZ_S) +#define DCM_TIE (1 << 1) /* Transfer Interrupt Enable (TIE). */ +#define DCM_LINK (1 << 0) /* Descriptor Link Enable. */ #define PDMA_DDA(n) (0x18 + 0x20 * n) /* Channel n Descriptor Address */ #define PDMA_DSD(n) (0x1C + 0x20 * n) /* Channel n Stride Difference */ /* Global Control Registers */ #define PDMA_DMAC 0x1000 /* DMA Control */ +#define DMAC_FMSC (1 << 31) +#define DMAC_INTCC_S 17 +#define DMAC_INTCC_M (0x1f << DMAC_INTCC_S) +#define DMAC_INTCE (1 << 16) /* Permit INTC_IRQ to be bound to one of programmable channel. */ +#define DMAC_HLT (1 << 3) /* Global halt status */ +#define DMAC_AR (1 << 2) /* Global address error status */ +#define DMAC_DMAE (1 << 0) /* Enable DMA. */ #define PDMA_DIRQP 0x1004 /* DMA Interrupt Pending */ #define PDMA_DDB 0x1008 /* DMA Doorbell */ #define PDMA_DDS 0x100C /* DMA Doorbell Set */ From owner-svn-src-head@freebsd.org Fri Dec 9 17:57:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BAE3C6EFD9; Fri, 9 Dec 2016 17:57:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 766431014; Fri, 9 Dec 2016 17:57:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9HvH04087251; Fri, 9 Dec 2016 17:57:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9HvH8M087250; Fri, 9 Dec 2016 17:57:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612091757.uB9HvH8M087250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 9 Dec 2016 17:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309743 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 17:57:18 -0000 Author: tuexen Date: Fri Dec 9 17:57:17 2016 New Revision: 309743 URL: https://svnweb.freebsd.org/changeset/base/309743 Log: Don't send multiple SHUTDOWN chunks in a single packet. Thanks to Felix Weinrank for making me aware of this issue. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Dec 9 17:21:59 2016 (r309742) +++ head/sys/netinet/sctp_output.c Fri Dec 9 17:57:17 2016 (r309743) @@ -9164,40 +9164,61 @@ sctp_send_shutdown(struct sctp_tcb *stcb struct sctp_shutdown_chunk *shutdown_cp; struct sctp_tmit_chunk *chk; - m_shutdown = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_chunk), 0, M_NOWAIT, 1, MT_HEADER); - if (m_shutdown == NULL) { - /* no mbuf's */ - return; + TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { + if (chk->rec.chunk_id.id == SCTP_SHUTDOWN) { + /* We already have a SHUTDOWN queued. Reuse it. */ + if (chk->whoTo) { + sctp_free_remote_addr(chk->whoTo); + chk->whoTo = NULL; + } + break; + } } - SCTP_BUF_RESV_UF(m_shutdown, SCTP_MIN_OVERHEAD); - sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { - /* no memory */ - sctp_m_freem(m_shutdown); - return; - } - chk->copy_by_ref = 0; - chk->rec.chunk_id.id = SCTP_SHUTDOWN; - chk->rec.chunk_id.can_take_data = 1; - chk->flags = 0; - chk->send_size = sizeof(struct sctp_shutdown_chunk); - chk->sent = SCTP_DATAGRAM_UNSENT; - chk->snd_count = 0; - chk->flags = 0; - chk->asoc = &stcb->asoc; - chk->data = m_shutdown; - chk->whoTo = net; - if (chk->whoTo) { - atomic_add_int(&chk->whoTo->ref_count, 1); + m_shutdown = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_chunk), 0, M_NOWAIT, 1, MT_HEADER); + if (m_shutdown == NULL) { + /* no mbuf's */ + return; + } + SCTP_BUF_RESV_UF(m_shutdown, SCTP_MIN_OVERHEAD); + sctp_alloc_a_chunk(stcb, chk); + if (chk == NULL) { + /* no memory */ + sctp_m_freem(m_shutdown); + return; + } + chk->copy_by_ref = 0; + chk->rec.chunk_id.id = SCTP_SHUTDOWN; + chk->rec.chunk_id.can_take_data = 1; + chk->flags = 0; + chk->send_size = sizeof(struct sctp_shutdown_chunk); + chk->sent = SCTP_DATAGRAM_UNSENT; + chk->snd_count = 0; + chk->flags = 0; + chk->asoc = &stcb->asoc; + chk->data = m_shutdown; + chk->whoTo = net; + if (chk->whoTo) { + atomic_add_int(&chk->whoTo->ref_count, 1); + } + shutdown_cp = mtod(m_shutdown, struct sctp_shutdown_chunk *); + shutdown_cp->ch.chunk_type = SCTP_SHUTDOWN; + shutdown_cp->ch.chunk_flags = 0; + shutdown_cp->ch.chunk_length = htons(chk->send_size); + shutdown_cp->cumulative_tsn_ack = htonl(stcb->asoc.cumulative_tsn); + SCTP_BUF_LEN(m_shutdown) = chk->send_size; + TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next); + chk->asoc->ctrl_queue_cnt++; + } else { + TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, sctp_next); + chk->whoTo = net; + if (chk->whoTo) { + atomic_add_int(&chk->whoTo->ref_count, 1); + } + shutdown_cp = mtod(chk->data, struct sctp_shutdown_chunk *); + shutdown_cp->cumulative_tsn_ack = htonl(stcb->asoc.cumulative_tsn); + TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); } - shutdown_cp = mtod(m_shutdown, struct sctp_shutdown_chunk *); - shutdown_cp->ch.chunk_type = SCTP_SHUTDOWN; - shutdown_cp->ch.chunk_flags = 0; - shutdown_cp->ch.chunk_length = htons(chk->send_size); - shutdown_cp->cumulative_tsn_ack = htonl(stcb->asoc.cumulative_tsn); - SCTP_BUF_LEN(m_shutdown) = chk->send_size; - TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next); - chk->asoc->ctrl_queue_cnt++; return; } From owner-svn-src-head@freebsd.org Fri Dec 9 17:58:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E6D8C6F044; Fri, 9 Dec 2016 17:58:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2E311CE; Fri, 9 Dec 2016 17:58:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9Hw7gw087326; Fri, 9 Dec 2016 17:58:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9Hw7lK087325; Fri, 9 Dec 2016 17:58:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612091758.uB9Hw7lK087325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 9 Dec 2016 17:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309744 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 17:58:08 -0000 Author: tuexen Date: Fri Dec 9 17:58:07 2016 New Revision: 309744 URL: https://svnweb.freebsd.org/changeset/base/309744 Log: Don't bundle a SACK chunk with a SHUTDOWN chunk if it is not required. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Fri Dec 9 17:57:17 2016 (r309743) +++ head/sys/netinet/sctp_indata.c Fri Dec 9 17:58:07 2016 (r309744) @@ -2437,13 +2437,17 @@ sctp_sack_check(struct sctp_tcb *stcb, i { struct sctp_association *asoc; uint32_t highest_tsn; + int is_a_gap; + sctp_slide_mapping_arrays(stcb); asoc = &stcb->asoc; if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; } + /* Is there a gap now? */ + is_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); /* * Now we need to see if we need to queue a sack or just start the @@ -2462,13 +2466,10 @@ sctp_sack_check(struct sctp_tcb *stcb, i } sctp_send_shutdown(stcb, ((stcb->asoc.alternate) ? stcb->asoc.alternate : stcb->asoc.primary_destination)); - sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); + if (is_a_gap) { + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); + } } else { - int is_a_gap; - - /* is there a gap now ? */ - is_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); - /* * CMT DAC algorithm: increase number of packets received * since last ack From owner-svn-src-head@freebsd.org Fri Dec 9 17:58:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C1AC6F0AD; Fri, 9 Dec 2016 17:58:35 +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 7D6281351; Fri, 9 Dec 2016 17:58:35 +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 uB9HwYWG087387; Fri, 9 Dec 2016 17:58:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9HwYC0087384; Fri, 9 Dec 2016 17:58:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612091758.uB9HwYC0087384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Dec 2016 17:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309745 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 17:58:35 -0000 Author: glebius Date: Fri Dec 9 17:58:34 2016 New Revision: 309745 URL: https://svnweb.freebsd.org/changeset/base/309745 Log: Provide counter_ratecheck(), a MP-friendly substitution to ppsratecheck(). When rated event happens at a very quick rate, the ppsratecheck() is not only racy, but also becomes a performance bottleneck. Together with: rrs, jtl Modified: head/share/man/man9/counter.9 head/sys/kern/subr_counter.c head/sys/sys/counter.h Modified: head/share/man/man9/counter.9 ============================================================================== --- head/share/man/man9/counter.9 Fri Dec 9 17:58:07 2016 (r309744) +++ head/share/man/man9/counter.9 Fri Dec 9 17:58:34 2016 (r309745) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2016 +.Dd December 8, 2016 .Dt COUNTER 9 .Os .Sh NAME @@ -51,6 +51,8 @@ .Fn counter_u64_fetch "counter_u64_t c" .Ft void .Fn counter_u64_zero "counter_u64_t c" +.Ft int64_t +.Fn counter_ratecheck "struct counter_rate *cr" "int64_t limit" .In sys/sysctl.h .Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr .Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr @@ -128,6 +130,18 @@ value for any moment. Clear the counter .Fa c and set it to zero. +.It Fn counter_ratecheck cr limit +The function is a multiprocessor-friendly version of +.Fn ppsratecheck , +which uses +.Nm +internally. +Returns non-negative value if the rate isn't yet reached during the current +second, and a negative value otherwise. +If the limit was reached on previous second, but was just reset back to zero, +then +.Fn counter_ratecheck +returns number of events since previous reset. .It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr Declare a static .Xr sysctl Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Fri Dec 9 17:58:07 2016 (r309744) +++ head/sys/kern/subr_counter.c Fri Dec 9 17:58:34 2016 (r309745) @@ -119,3 +119,57 @@ sysctl_handle_counter_u64_array(SYSCTL_H return (0); } + +/* + * MP-friendly version of ppsratecheck(). + * + * Returns non-negative if we are in the rate, negative otherwise. + * 0 - rate limit not reached. + * -1 - rate limit reached. + * >0 - rate limit was reached before, and was just reset. The return value + * is number of events since last reset. + */ +int64_t +counter_ratecheck(struct counter_rate *cr, int64_t limit) +{ + int64_t val; + int now; + + val = cr->cr_over; + now = ticks; + + if (now - cr->cr_ticks >= hz) { + /* + * Time to clear the structure, we are in the next second. + * First try unlocked read, and then proceed with atomic. + */ + if ((cr->cr_lock == 0) && + atomic_cmpset_int(&cr->cr_lock, 0, 1)) { + /* + * Check if other thread has just went through the + * reset sequence before us. + */ + if (now - cr->cr_ticks >= hz) { + val = counter_u64_fetch(cr->cr_rate); + counter_u64_zero(cr->cr_rate); + cr->cr_over = 0; + cr->cr_ticks = now; + } + atomic_store_rel_int(&cr->cr_lock, 0); + } else + /* + * We failed to lock, in this case other thread may + * be running counter_u64_zero(), so it is not safe + * to do an update, we skip it. + */ + return (val); + } + + counter_u64_add(cr->cr_rate, 1); + if (cr->cr_over != 0) + return (-1); + if (counter_u64_fetch(cr->cr_rate) > limit) + val = cr->cr_over = -1; + + return (val); +} Modified: head/sys/sys/counter.h ============================================================================== --- head/sys/sys/counter.h Fri Dec 9 17:58:07 2016 (r309744) +++ head/sys/sys/counter.h Fri Dec 9 17:58:34 2016 (r309745) @@ -59,5 +59,18 @@ uint64_t counter_u64_fetch(counter_u64_t for (int i = 0; i < (n); i++) \ counter_u64_zero((a)[i]); \ } while (0) + +/* + * counter(9) based rate checking. + */ +struct counter_rate { + counter_u64_t cr_rate; /* Events since last second */ + volatile int cr_lock; /* Lock to clean the struct */ + int cr_ticks; /* Ticks on last clean */ + int cr_over; /* Over limit since cr_ticks? */ +}; + +int64_t counter_ratecheck(struct counter_rate *, int64_t); + #endif /* _KERNEL */ #endif /* ! __SYS_COUNTER_H__ */ From owner-svn-src-head@freebsd.org Fri Dec 9 17:59:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93C8DC6F11E; Fri, 9 Dec 2016 17:59:16 +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 55FC01531; Fri, 9 Dec 2016 17:59:16 +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 uB9HxFgP087463; Fri, 9 Dec 2016 17:59:15 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9HxFgX087460; Fri, 9 Dec 2016 17:59:15 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612091759.uB9HxFgX087460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Dec 2016 17:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309746 - in head/sys: netinet netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 17:59:16 -0000 Author: glebius Date: Fri Dec 9 17:59:15 2016 New Revision: 309746 URL: https://svnweb.freebsd.org/changeset/base/309746 Log: Use counter_ratecheck() in the ICMP rate limiting. Together with: rrs, jtl Modified: head/sys/netinet/icmp_var.h head/sys/netinet/ip_icmp.c head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netinet/icmp_var.h ============================================================================== --- head/sys/netinet/icmp_var.h Fri Dec 9 17:58:34 2016 (r309745) +++ head/sys/netinet/icmp_var.h Fri Dec 9 17:59:15 2016 (r309746) @@ -96,7 +96,7 @@ extern int badport_bandlim(int); #define BANDLIM_RST_OPENPORT 4 /* No connection, listener */ #define BANDLIM_ICMP6_UNREACH 5 #define BANDLIM_SCTP_OOTB 6 -#define BANDLIM_MAX 6 +#define BANDLIM_MAX 7 #endif #endif Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Fri Dec 9 17:58:34 2016 (r309745) +++ head/sys/netinet/ip_icmp.c Fri Dec 9 17:59:15 2016 (r309746) @@ -973,44 +973,59 @@ ip_next_mtu(int mtu, int dir) * the 'final' error, but it doesn't make sense to solve the printing * delay with more complex code. */ +struct icmp_rate { + const char *descr; + struct counter_rate cr; +}; +static VNET_DEFINE(struct icmp_rate, icmp_rates[BANDLIM_MAX]) = { + { "icmp unreach response" }, + { "icmp ping response" }, + { "icmp tstamp response" }, + { "closed port RST response" }, + { "open port RST response" }, + { "icmp6 unreach response" }, + { "sctp ootb response" } +}; +#define V_icmp_rates VNET(icmp_rates) + +static void +icmp_bandlimit_init(void) +{ + + for (int i = 0; i < BANDLIM_MAX; i++) { + V_icmp_rates[i].cr.cr_rate = counter_u64_alloc(M_WAITOK); + V_icmp_rates[i].cr.cr_ticks = ticks; + } +} +VNET_SYSINIT(icmp_bandlimit, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, + icmp_bandlimit_init, NULL); + +static void +icmp_bandlimit_uninit(void) +{ + + for (int i = 0; i < BANDLIM_MAX; i++) + counter_u64_free(V_icmp_rates[i].cr.cr_rate); +} +VNET_SYSUNINIT(icmp_bandlimit, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, + icmp_bandlimit_uninit, NULL); int badport_bandlim(int which) { + int64_t pps; -#define N(a) (sizeof (a) / sizeof (a[0])) - static struct rate { - const char *type; - struct timeval lasttime; - int curpps; - } rates[BANDLIM_MAX+1] = { - { "icmp unreach response" }, - { "icmp ping response" }, - { "icmp tstamp response" }, - { "closed port RST response" }, - { "open port RST response" }, - { "icmp6 unreach response" }, - { "sctp ootb response" } - }; - - /* - * Return ok status if feature disabled or argument out of range. - */ - if (V_icmplim > 0 && (u_int) which < N(rates)) { - struct rate *r = &rates[which]; - int opps = r->curpps; - - if (!ppsratecheck(&r->lasttime, &r->curpps, V_icmplim)) - return -1; /* discard packet */ - /* - * If we've dropped below the threshold after having - * rate-limited traffic print the message. This preserves - * the previous behaviour at the expense of added complexity. - */ - if (V_icmplim_output && opps > V_icmplim) - log(LOG_NOTICE, "Limiting %s from %d to %d packets/sec\n", - r->type, opps, V_icmplim); - } - return 0; /* okay to send packet */ -#undef N + if (V_icmplim == 0 || which == BANDLIM_UNLIMITED) + return (0); + + KASSERT(which >= 0 && which < BANDLIM_MAX, + ("%s: which %d", __func__, which)); + + pps = counter_ratecheck(&V_icmp_rates[which].cr, V_icmplim); + if (pps == -1) + return (-1); + if (pps > 0 && V_icmplim_output) + log(LOG_NOTICE, "Limiting %s from %ld to %d packets/sec\n", + V_icmp_rates[which].descr, pps, V_icmplim); + return (0); } Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Dec 9 17:58:34 2016 (r309745) +++ head/sys/netpfil/pf/if_pfsync.c Fri Dec 9 17:59:15 2016 (r309746) @@ -161,8 +161,8 @@ static struct pfsync_q pfsync_qs[] = { { pfsync_out_del, sizeof(struct pfsync_del_c), PFSYNC_ACT_DEL_C } }; -static void pfsync_q_ins(struct pf_state *, int); -static void pfsync_q_del(struct pf_state *); +static void pfsync_q_ins(struct pf_state *, int, bool); +static void pfsync_q_del(struct pf_state *, bool); static void pfsync_update_state(struct pf_state *); @@ -542,7 +542,7 @@ pfsync_state_import(struct pfsync_state if (!(flags & PFSYNC_SI_IOCTL)) { st->state_flags &= ~PFSTATE_NOSYNC; if (st->state_flags & PFSTATE_ACK) { - pfsync_q_ins(st, PFSYNC_S_IACK); + pfsync_q_ins(st, PFSYNC_S_IACK, true); pfsync_push(sc); } } @@ -1668,7 +1668,7 @@ pfsync_insert_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); - pfsync_q_ins(st, PFSYNC_S_INS); + pfsync_q_ins(st, PFSYNC_S_INS, true); PFSYNC_UNLOCK(sc); st->sync_updates = 0; @@ -1789,7 +1789,7 @@ static void pfsync_update_state(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; - int sync = 0; + bool sync = false, ref = true; PF_STATE_LOCK_ASSERT(st); PFSYNC_LOCK(sc); @@ -1798,7 +1798,7 @@ pfsync_update_state(struct pf_state *st) pfsync_undefer_state(st, 0); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st); + pfsync_q_del(st, true); PFSYNC_UNLOCK(sc); return; } @@ -1815,14 +1815,17 @@ pfsync_update_state(struct pf_state *st) if (st->key[PF_SK_WIRE]->proto == IPPROTO_TCP) { st->sync_updates++; if (st->sync_updates >= sc->sc_maxupdates) - sync = 1; + sync = true; } break; case PFSYNC_S_IACK: - pfsync_q_del(st); + pfsync_q_del(st, false); + ref = false; + /* FALLTHROUGH */ + case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_UPD_C); + pfsync_q_ins(st, PFSYNC_S_UPD_C, ref); st->sync_updates = 0; break; @@ -1880,13 +1883,14 @@ static void pfsync_update_state_req(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; + bool ref = true; PF_STATE_LOCK_ASSERT(st); PFSYNC_LOCK(sc); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st); + pfsync_q_del(st, true); PFSYNC_UNLOCK(sc); return; } @@ -1894,9 +1898,12 @@ pfsync_update_state_req(struct pf_state switch (st->sync_state) { case PFSYNC_S_UPD_C: case PFSYNC_S_IACK: - pfsync_q_del(st); + pfsync_q_del(st, false); + ref = false; + /* FALLTHROUGH */ + case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_UPD); + pfsync_q_ins(st, PFSYNC_S_UPD, true); pfsync_push(sc); break; @@ -1917,13 +1924,14 @@ static void pfsync_delete_state(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; + bool ref = true; PFSYNC_LOCK(sc); if (st->state_flags & PFSTATE_ACK) pfsync_undefer_state(st, 1); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st); + pfsync_q_del(st, true); PFSYNC_UNLOCK(sc); return; } @@ -1931,30 +1939,27 @@ pfsync_delete_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); - pf_ref_state(st); - switch (st->sync_state) { case PFSYNC_S_INS: /* We never got to tell the world so just forget about it. */ - pfsync_q_del(st); + pfsync_q_del(st, true); break; case PFSYNC_S_UPD_C: case PFSYNC_S_UPD: case PFSYNC_S_IACK: - pfsync_q_del(st); - /* FALLTHROUGH to putting it on the del list */ + pfsync_q_del(st, false); + ref = false; + /* FALLTHROUGH */ case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_DEL); + pfsync_q_ins(st, PFSYNC_S_DEL, ref); break; default: panic("%s: unexpected sync state %d", __func__, st->sync_state); } - pf_release_state(st); - PFSYNC_UNLOCK(sc); } @@ -1982,7 +1987,7 @@ pfsync_clear_states(u_int32_t creatorid, } static void -pfsync_q_ins(struct pf_state *st, int q) +pfsync_q_ins(struct pf_state *st, int q, bool ref) { struct pfsync_softc *sc = V_pfsyncif; size_t nlen = pfsync_qs[q].len; @@ -2006,11 +2011,12 @@ pfsync_q_ins(struct pf_state *st, int q) sc->sc_len += nlen; TAILQ_INSERT_TAIL(&sc->sc_qs[q], st, sync_list); st->sync_state = q; - pf_ref_state(st); + if (ref) + pf_ref_state(st); } static void -pfsync_q_del(struct pf_state *st) +pfsync_q_del(struct pf_state *st, bool unref) { struct pfsync_softc *sc = V_pfsyncif; int q = st->sync_state; @@ -2022,7 +2028,8 @@ pfsync_q_del(struct pf_state *st) sc->sc_len -= pfsync_qs[q].len; TAILQ_REMOVE(&sc->sc_qs[q], st, sync_list); st->sync_state = PFSYNC_S_NONE; - pf_release_state(st); + if (unref) + pf_release_state(st); if (TAILQ_EMPTY(&sc->sc_qs[q])) sc->sc_len -= sizeof(struct pfsync_subheader); From owner-svn-src-head@freebsd.org Fri Dec 9 18:00:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5082C6F1AE; Fri, 9 Dec 2016 18:00:46 +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 67105182B; Fri, 9 Dec 2016 18:00:46 +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 uB9I0jXP088345; Fri, 9 Dec 2016 18:00:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9I0jBN088344; Fri, 9 Dec 2016 18:00:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612091800.uB9I0jBN088344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Dec 2016 18:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309747 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 18:00:46 -0000 Author: glebius Date: Fri Dec 9 18:00:45 2016 New Revision: 309747 URL: https://svnweb.freebsd.org/changeset/base/309747 Log: Backout accidentially leaked in r309746 not yet reviewed patch :( Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Dec 9 17:59:15 2016 (r309746) +++ head/sys/netpfil/pf/if_pfsync.c Fri Dec 9 18:00:45 2016 (r309747) @@ -161,8 +161,8 @@ static struct pfsync_q pfsync_qs[] = { { pfsync_out_del, sizeof(struct pfsync_del_c), PFSYNC_ACT_DEL_C } }; -static void pfsync_q_ins(struct pf_state *, int, bool); -static void pfsync_q_del(struct pf_state *, bool); +static void pfsync_q_ins(struct pf_state *, int); +static void pfsync_q_del(struct pf_state *); static void pfsync_update_state(struct pf_state *); @@ -542,7 +542,7 @@ pfsync_state_import(struct pfsync_state if (!(flags & PFSYNC_SI_IOCTL)) { st->state_flags &= ~PFSTATE_NOSYNC; if (st->state_flags & PFSTATE_ACK) { - pfsync_q_ins(st, PFSYNC_S_IACK, true); + pfsync_q_ins(st, PFSYNC_S_IACK); pfsync_push(sc); } } @@ -1668,7 +1668,7 @@ pfsync_insert_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); - pfsync_q_ins(st, PFSYNC_S_INS, true); + pfsync_q_ins(st, PFSYNC_S_INS); PFSYNC_UNLOCK(sc); st->sync_updates = 0; @@ -1789,7 +1789,7 @@ static void pfsync_update_state(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; - bool sync = false, ref = true; + int sync = 0; PF_STATE_LOCK_ASSERT(st); PFSYNC_LOCK(sc); @@ -1798,7 +1798,7 @@ pfsync_update_state(struct pf_state *st) pfsync_undefer_state(st, 0); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st, true); + pfsync_q_del(st); PFSYNC_UNLOCK(sc); return; } @@ -1815,17 +1815,14 @@ pfsync_update_state(struct pf_state *st) if (st->key[PF_SK_WIRE]->proto == IPPROTO_TCP) { st->sync_updates++; if (st->sync_updates >= sc->sc_maxupdates) - sync = true; + sync = 1; } break; case PFSYNC_S_IACK: - pfsync_q_del(st, false); - ref = false; - /* FALLTHROUGH */ - + pfsync_q_del(st); case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_UPD_C, ref); + pfsync_q_ins(st, PFSYNC_S_UPD_C); st->sync_updates = 0; break; @@ -1883,14 +1880,13 @@ static void pfsync_update_state_req(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; - bool ref = true; PF_STATE_LOCK_ASSERT(st); PFSYNC_LOCK(sc); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st, true); + pfsync_q_del(st); PFSYNC_UNLOCK(sc); return; } @@ -1898,12 +1894,9 @@ pfsync_update_state_req(struct pf_state switch (st->sync_state) { case PFSYNC_S_UPD_C: case PFSYNC_S_IACK: - pfsync_q_del(st, false); - ref = false; - /* FALLTHROUGH */ - + pfsync_q_del(st); case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_UPD, true); + pfsync_q_ins(st, PFSYNC_S_UPD); pfsync_push(sc); break; @@ -1924,14 +1917,13 @@ static void pfsync_delete_state(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; - bool ref = true; PFSYNC_LOCK(sc); if (st->state_flags & PFSTATE_ACK) pfsync_undefer_state(st, 1); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st, true); + pfsync_q_del(st); PFSYNC_UNLOCK(sc); return; } @@ -1939,27 +1931,30 @@ pfsync_delete_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); + pf_ref_state(st); + switch (st->sync_state) { case PFSYNC_S_INS: /* We never got to tell the world so just forget about it. */ - pfsync_q_del(st, true); + pfsync_q_del(st); break; case PFSYNC_S_UPD_C: case PFSYNC_S_UPD: case PFSYNC_S_IACK: - pfsync_q_del(st, false); - ref = false; - /* FALLTHROUGH */ + pfsync_q_del(st); + /* FALLTHROUGH to putting it on the del list */ case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_DEL, ref); + pfsync_q_ins(st, PFSYNC_S_DEL); break; default: panic("%s: unexpected sync state %d", __func__, st->sync_state); } + pf_release_state(st); + PFSYNC_UNLOCK(sc); } @@ -1987,7 +1982,7 @@ pfsync_clear_states(u_int32_t creatorid, } static void -pfsync_q_ins(struct pf_state *st, int q, bool ref) +pfsync_q_ins(struct pf_state *st, int q) { struct pfsync_softc *sc = V_pfsyncif; size_t nlen = pfsync_qs[q].len; @@ -2011,12 +2006,11 @@ pfsync_q_ins(struct pf_state *st, int q, sc->sc_len += nlen; TAILQ_INSERT_TAIL(&sc->sc_qs[q], st, sync_list); st->sync_state = q; - if (ref) - pf_ref_state(st); + pf_ref_state(st); } static void -pfsync_q_del(struct pf_state *st, bool unref) +pfsync_q_del(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; int q = st->sync_state; @@ -2028,8 +2022,7 @@ pfsync_q_del(struct pf_state *st, bool u sc->sc_len -= pfsync_qs[q].len; TAILQ_REMOVE(&sc->sc_qs[q], st, sync_list); st->sync_state = PFSYNC_S_NONE; - if (unref) - pf_release_state(st); + pf_release_state(st); if (TAILQ_EMPTY(&sc->sc_qs[q])) sc->sc_len -= sizeof(struct pfsync_subheader); From owner-svn-src-head@freebsd.org Fri Dec 9 18:07:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 539A5C6F30E; Fri, 9 Dec 2016 18:07:29 +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 185841BB9; Fri, 9 Dec 2016 18:07:29 +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 uB9I7S4i091610; Fri, 9 Dec 2016 18:07:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9I7SYU091609; Fri, 9 Dec 2016 18:07:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612091807.uB9I7SYU091609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Dec 2016 18:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309748 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 18:07:29 -0000 Author: glebius Date: Fri Dec 9 18:07:28 2016 New Revision: 309748 URL: https://svnweb.freebsd.org/changeset/base/309748 Log: Treat R_X86_64_PLT32 relocs as R_X86_64_PC32. If we load a binary that is designed to be a library, it produces relocatable code via assembler directives in the assembly itself (rather than compiler options). This emits R_X86_64_PLT32 relocations, which are not handled by the kernel linker. Submitted by: gallatin Reviewed by: kib Modified: head/sys/amd64/amd64/elf_machdep.c Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Fri Dec 9 18:00:45 2016 (r309747) +++ head/sys/amd64/amd64/elf_machdep.c Fri Dec 9 18:07:28 2016 (r309748) @@ -178,6 +178,7 @@ elf_reloc_internal(linker_file_t lf, Elf switch (rtype) { case R_X86_64_PC32: case R_X86_64_32S: + case R_X86_64_PLT32: addend = *(Elf32_Addr *)where; break; default: @@ -211,6 +212,8 @@ elf_reloc_internal(linker_file_t lf, Elf break; case R_X86_64_PC32: /* S + A - P */ + case R_X86_64_PLT32: /* L + A - P, L is PLT location for + the symbol, which we treat as S */ error = lookup(lf, symidx, 1, &addr); where32 = (Elf32_Addr *)where; val32 = (Elf32_Addr)(addr + addend - (Elf_Addr)where); From owner-svn-src-head@freebsd.org Fri Dec 9 18:41:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F6CCC6FA7D; Fri, 9 Dec 2016 18:41:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 30A35102D; Fri, 9 Dec 2016 18:41:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uB9IfHMc011099 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 9 Dec 2016 20:41:17 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uB9IfHMc011099 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uB9IfHRs011098; Fri, 9 Dec 2016 20:41:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 9 Dec 2016 20:41:17 +0200 From: Konstantin Belousov To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309745 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20161209184117.GJ54029@kib.kiev.ua> References: <201612091758.uB9HwYC0087384@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612091758.uB9HwYC0087384@repo.freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 18:41:24 -0000 On Fri, Dec 09, 2016 at 05:58:34PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Dec 9 17:58:34 2016 > New Revision: 309745 > URL: https://svnweb.freebsd.org/changeset/base/309745 > > Log: > Provide counter_ratecheck(), a MP-friendly substitution to ppsratecheck(). > When rated event happens at a very quick rate, the ppsratecheck() is not > only racy, but also becomes a performance bottleneck. > > Together with: rrs, jtl > > Modified: > head/share/man/man9/counter.9 > head/sys/kern/subr_counter.c > head/sys/sys/counter.h > > Modified: head/share/man/man9/counter.9 > ============================================================================== > --- head/share/man/man9/counter.9 Fri Dec 9 17:58:07 2016 (r309744) > +++ head/share/man/man9/counter.9 Fri Dec 9 17:58:34 2016 (r309745) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 14, 2016 > +.Dd December 8, 2016 > .Dt COUNTER 9 > .Os > .Sh NAME > @@ -51,6 +51,8 @@ > .Fn counter_u64_fetch "counter_u64_t c" > .Ft void > .Fn counter_u64_zero "counter_u64_t c" > +.Ft int64_t > +.Fn counter_ratecheck "struct counter_rate *cr" "int64_t limit" > .In sys/sysctl.h > .Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr > .Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr > @@ -128,6 +130,18 @@ value for any moment. > Clear the counter > .Fa c > and set it to zero. > +.It Fn counter_ratecheck cr limit > +The function is a multiprocessor-friendly version of > +.Fn ppsratecheck , > +which uses > +.Nm > +internally. > +Returns non-negative value if the rate isn't yet reached during the current > +second, and a negative value otherwise. > +If the limit was reached on previous second, but was just reset back to zero, > +then > +.Fn counter_ratecheck > +returns number of events since previous reset. > .It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr > Declare a static > .Xr sysctl > > Modified: head/sys/kern/subr_counter.c > ============================================================================== > --- head/sys/kern/subr_counter.c Fri Dec 9 17:58:07 2016 (r309744) > +++ head/sys/kern/subr_counter.c Fri Dec 9 17:58:34 2016 (r309745) > @@ -119,3 +119,57 @@ sysctl_handle_counter_u64_array(SYSCTL_H > > return (0); > } > + > +/* > + * MP-friendly version of ppsratecheck(). > + * > + * Returns non-negative if we are in the rate, negative otherwise. > + * 0 - rate limit not reached. > + * -1 - rate limit reached. > + * >0 - rate limit was reached before, and was just reset. The return value > + * is number of events since last reset. > + */ > +int64_t > +counter_ratecheck(struct counter_rate *cr, int64_t limit) > +{ > + int64_t val; > + int now; > + > + val = cr->cr_over; > + now = ticks; > + > + if (now - cr->cr_ticks >= hz) { > + /* > + * Time to clear the structure, we are in the next second. > + * First try unlocked read, and then proceed with atomic. > + */ > + if ((cr->cr_lock == 0) && > + atomic_cmpset_int(&cr->cr_lock, 0, 1)) { This should be cmpset_acq to avoid reordering of the operations from locked region outside of it, and to make _rel below to sync-with. Or call atomic_thread_fence_acq() after cmpset(), then unneeded barrier is not executed if atomic failed. > + /* > + * Check if other thread has just went through the > + * reset sequence before us. > + */ > + if (now - cr->cr_ticks >= hz) { > + val = counter_u64_fetch(cr->cr_rate); > + counter_u64_zero(cr->cr_rate); > + cr->cr_over = 0; > + cr->cr_ticks = now; > + } > + atomic_store_rel_int(&cr->cr_lock, 0); > + } else > + /* > + * We failed to lock, in this case other thread may > + * be running counter_u64_zero(), so it is not safe > + * to do an update, we skip it. > + */ > + return (val); > + } > + > + counter_u64_add(cr->cr_rate, 1); What prevents this thread to fail the check for now - cr->cr_ticks >= hz above, then get off the cpu long enough for the next second to tick, so that another thread starts the cleanup, while this thread performs the increment ? The current thread update is lost then. > + if (cr->cr_over != 0) > + return (-1); > + if (counter_u64_fetch(cr->cr_rate) > limit) > + val = cr->cr_over = -1; > + > + return (val); > +} > > Modified: head/sys/sys/counter.h > ============================================================================== > --- head/sys/sys/counter.h Fri Dec 9 17:58:07 2016 (r309744) > +++ head/sys/sys/counter.h Fri Dec 9 17:58:34 2016 (r309745) > @@ -59,5 +59,18 @@ uint64_t counter_u64_fetch(counter_u64_t > for (int i = 0; i < (n); i++) \ > counter_u64_zero((a)[i]); \ > } while (0) > + > +/* > + * counter(9) based rate checking. > + */ > +struct counter_rate { > + counter_u64_t cr_rate; /* Events since last second */ > + volatile int cr_lock; /* Lock to clean the struct */ > + int cr_ticks; /* Ticks on last clean */ > + int cr_over; /* Over limit since cr_ticks? */ > +}; > + > +int64_t counter_ratecheck(struct counter_rate *, int64_t); > + > #endif /* _KERNEL */ > #endif /* ! __SYS_COUNTER_H__ */ From owner-svn-src-head@freebsd.org Fri Dec 9 18:54:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0977BC6FDBA; Fri, 9 Dec 2016 18:54:15 +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 CD469178B; Fri, 9 Dec 2016 18:54:14 +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 uB9IsErU011673; Fri, 9 Dec 2016 18:54:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9IsCpN011656; Fri, 9 Dec 2016 18:54:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612091854.uB9IsCpN011656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 9 Dec 2016 18:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309749 - in head/sys: amd64/conf arm/conf conf i386/conf mips/conf pc98/conf powerpc/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 18:54:15 -0000 Author: markj Date: Fri Dec 9 18:54:12 2016 New Revision: 309749 URL: https://svnweb.freebsd.org/changeset/base/309749 Log: Add a COMPAT_FREEBSD11 kernel option. Use it wherever COMPAT_FREEBSD10 is currently specified. Reviewed by: glebius, imp, jhb Differential Revision: https://reviews.freebsd.org/D8736 Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/arm/conf/std.arm head/sys/arm/conf/std.armv6 head/sys/conf/NOTES head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/mips/conf/ERL head/sys/mips/conf/JZ4780 head/sys/mips/conf/X1000 head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/amd64/conf/GENERIC Fri Dec 9 18:54:12 2016 (r309749) @@ -57,6 +57,7 @@ options COMPAT_FREEBSD6 # Compatible w options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/amd64/conf/MINIMAL Fri Dec 9 18:54:12 2016 (r309749) @@ -58,6 +58,7 @@ options COMPAT_FREEBSD6 # Compatible w options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/arm/conf/std.arm ============================================================================== --- head/sys/arm/conf/std.arm Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/arm/conf/std.arm Fri Dec 9 18:54:12 2016 (r309749) @@ -3,6 +3,7 @@ # $FreeBSD$ options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 # Debugging support. Always need this: makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/arm/conf/std.armv6 Fri Dec 9 18:54:12 2016 (r309749) @@ -42,6 +42,7 @@ options FREEBSD_BOOT_LOADER # Process m options VFP # Enable floating point hardware support options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 # DTrace support options KDTRACE_HOOKS # Kernel DTrace hooks Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/conf/NOTES Fri Dec 9 18:54:12 2016 (r309749) @@ -370,6 +370,9 @@ options COMPAT_FREEBSD9 # Enable FreeBSD10 compatibility syscalls options COMPAT_FREEBSD10 +# Enable FreeBSD11 compatibility syscalls +options COMPAT_FREEBSD11 + # Enable Linux Kernel Programming Interface options COMPAT_LINUXKPI Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/conf/options Fri Dec 9 18:54:12 2016 (r309749) @@ -88,6 +88,7 @@ COMPAT_FREEBSD6 opt_compat.h COMPAT_FREEBSD7 opt_compat.h COMPAT_FREEBSD9 opt_compat.h COMPAT_FREEBSD10 opt_compat.h +COMPAT_FREEBSD11 opt_compat.h COMPAT_CLOUDABI32 opt_dontuse.h COMPAT_CLOUDABI64 opt_dontuse.h COMPAT_LINUXKPI opt_compat.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/i386/conf/GENERIC Fri Dec 9 18:54:12 2016 (r309749) @@ -58,6 +58,7 @@ options COMPAT_FREEBSD6 # Compatible w options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/mips/conf/ERL Fri Dec 9 18:54:12 2016 (r309749) @@ -75,6 +75,7 @@ options GEOM_PART_GPT # GUID Partition options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD32 # Compatible with o32 binaries options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/mips/conf/JZ4780 ============================================================================== --- head/sys/mips/conf/JZ4780 Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/mips/conf/JZ4780 Fri Dec 9 18:54:12 2016 (r309749) @@ -28,6 +28,7 @@ options KDB options BREAK_TO_DEBUGGER options COMPAT_FREEBSD10 +options COMPAT_FREEBSD11 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking Modified: head/sys/mips/conf/X1000 ============================================================================== --- head/sys/mips/conf/X1000 Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/mips/conf/X1000 Fri Dec 9 18:54:12 2016 (r309749) @@ -28,6 +28,7 @@ options KDB options BREAK_TO_DEBUGGER options COMPAT_FREEBSD10 +options COMPAT_FREEBSD11 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/pc98/conf/GENERIC Fri Dec 9 18:54:12 2016 (r309749) @@ -55,6 +55,7 @@ options COMPAT_FREEBSD6 # Compatible w options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options EPSON_BOUNCEDMA # use bounce buffer for 15-16M #options EPSON_MEMWIN # EPSON memory window support Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/powerpc/conf/GENERIC Fri Dec 9 18:54:12 2016 (r309749) @@ -64,6 +64,7 @@ options COMPAT_FREEBSD6 #Compatible wi options COMPAT_FREEBSD7 #Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/powerpc/conf/GENERIC64 Fri Dec 9 18:54:12 2016 (r309749) @@ -63,6 +63,7 @@ options COMPAT_FREEBSD6 #Compatible wi options COMPAT_FREEBSD7 #Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/powerpc/conf/MPC85XX Fri Dec 9 18:54:12 2016 (r309749) @@ -59,6 +59,7 @@ options SYSVSHM options WITNESS options WITNESS_SKIPSPIN options COMPAT_FREEBSD10 +options COMPAT_FREEBSD11 options HWPMC_HOOKS options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/powerpc/conf/MPC85XXSPE Fri Dec 9 18:54:12 2016 (r309749) @@ -59,6 +59,7 @@ options SYSVSHM options WITNESS options WITNESS_SKIPSPIN options COMPAT_FREEBSD10 +options COMPAT_FREEBSD11 options HWPMC_HOOKS options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Dec 9 18:07:28 2016 (r309748) +++ head/sys/sparc64/conf/GENERIC Fri Dec 9 18:54:12 2016 (r309749) @@ -55,6 +55,7 @@ options COMPAT_FREEBSD6 # Compatible w options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support From owner-svn-src-head@freebsd.org Fri Dec 9 18:55:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE99DC6FE35; Fri, 9 Dec 2016 18:55:28 +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 AE4AF1960; Fri, 9 Dec 2016 18:55:28 +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 uB9ItRjv011787; Fri, 9 Dec 2016 18:55:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9ItRhB011786; Fri, 9 Dec 2016 18:55:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612091855.uB9ItRhB011786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 9 Dec 2016 18:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309750 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 18:55:29 -0000 Author: markj Date: Fri Dec 9 18:55:27 2016 New Revision: 309750 URL: https://svnweb.freebsd.org/changeset/base/309750 Log: Conditionalize PG_CACHE sysctls on COMPAT_FREEBSD11. Reviewed by: glebius, imp, jhb Differential Revision: https://reviews.freebsd.org/D8736 Modified: head/sys/vm/vm_meter.c Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Fri Dec 9 18:54:12 2016 (r309749) +++ head/sys/vm/vm_meter.c Fri Dec 9 18:55:27 2016 (r309750) @@ -32,6 +32,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include @@ -315,7 +317,7 @@ VM_STATS_VM(v_vforkpages, "VM pages affe VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); -#ifndef BURN_BRIDGES +#ifdef COMPAT_FREEBSD11 /* * Provide compatibility sysctls for the benefit of old utilities which exit * with an error if they cannot be found. From owner-svn-src-head@freebsd.org Fri Dec 9 18:56:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6229CC6FEB5; Fri, 9 Dec 2016 18:56:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 322881AE7; Fri, 9 Dec 2016 18:56:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id uB9IuaSt036663 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 9 Dec 2016 10:56:36 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id uB9IuaGY036662; Fri, 9 Dec 2016 10:56:36 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 9 Dec 2016 10:56:36 -0800 From: Gleb Smirnoff To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309745 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20161209185636.GJ27748@FreeBSD.org> References: <201612091758.uB9HwYC0087384@repo.freebsd.org> <20161209184117.GJ54029@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161209184117.GJ54029@kib.kiev.ua> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 18:56:38 -0000 Konstantin, On Fri, Dec 09, 2016 at 08:41:17PM +0200, Konstantin Belousov wrote: K> > +int64_t K> > +counter_ratecheck(struct counter_rate *cr, int64_t limit) K> > +{ K> > + int64_t val; K> > + int now; K> > + K> > + val = cr->cr_over; K> > + now = ticks; K> > + K> > + if (now - cr->cr_ticks >= hz) { K> > + /* K> > + * Time to clear the structure, we are in the next second. K> > + * First try unlocked read, and then proceed with atomic. K> > + */ K> > + if ((cr->cr_lock == 0) && K> > + atomic_cmpset_int(&cr->cr_lock, 0, 1)) { K> This should be cmpset_acq to avoid reordering of the operations from K> locked region outside of it, and to make _rel below to sync-with. K> Or call atomic_thread_fence_acq() after cmpset(), then unneeded barrier K> is not executed if atomic failed. Thanks! K> > + /* K> > + * Check if other thread has just went through the K> > + * reset sequence before us. K> > + */ K> > + if (now - cr->cr_ticks >= hz) { K> > + val = counter_u64_fetch(cr->cr_rate); K> > + counter_u64_zero(cr->cr_rate); K> > + cr->cr_over = 0; K> > + cr->cr_ticks = now; K> > + } K> > + atomic_store_rel_int(&cr->cr_lock, 0); K> > + } else K> > + /* K> > + * We failed to lock, in this case other thread may K> > + * be running counter_u64_zero(), so it is not safe K> > + * to do an update, we skip it. K> > + */ K> > + return (val); K> > + } K> > + K> > + counter_u64_add(cr->cr_rate, 1); K> What prevents this thread to fail the check for K> now - cr->cr_ticks >= hz K> above, then get off the cpu long enough for the next second to tick, K> so that another thread starts the cleanup, while this thread performs the K> increment ? The current thread update is lost then. Yes, this is expected. The interface isn't designed to be precise. So if we hit limit, the next second result will be 20345 events exceeded the rate instead of 20346 events. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Dec 9 19:07:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91E69C6E125; Fri, 9 Dec 2016 19:07:32 +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 61711FB; Fri, 9 Dec 2016 19:07:32 +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 uB9J7VeX015908; Fri, 9 Dec 2016 19:07:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9J7VHu015907; Fri, 9 Dec 2016 19:07:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612091907.uB9J7VHu015907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Dec 2016 19:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309751 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 19:07:32 -0000 Author: glebius Date: Fri Dec 9 19:07:31 2016 New Revision: 309751 URL: https://svnweb.freebsd.org/changeset/base/309751 Log: Use acquire write to cr_lock to complement with release write at end of locked region. Submitted by: kib Modified: head/sys/kern/subr_counter.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Fri Dec 9 18:55:27 2016 (r309750) +++ head/sys/kern/subr_counter.c Fri Dec 9 19:07:31 2016 (r309751) @@ -144,7 +144,7 @@ counter_ratecheck(struct counter_rate *c * First try unlocked read, and then proceed with atomic. */ if ((cr->cr_lock == 0) && - atomic_cmpset_int(&cr->cr_lock, 0, 1)) { + atomic_cmpset_acq_int(&cr->cr_lock, 0, 1)) { /* * Check if other thread has just went through the * reset sequence before us. From owner-svn-src-head@freebsd.org Fri Dec 9 19:09:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF3BFC6E1C8; Fri, 9 Dec 2016 19:09:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9EE72E5; Fri, 9 Dec 2016 19:09:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9J9xae016033; Fri, 9 Dec 2016 19:09:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9J9wMj016032; Fri, 9 Dec 2016 19:09:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612091909.uB9J9wMj016032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 9 Dec 2016 19:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309752 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 19:10:00 -0000 Author: emaste Date: Fri Dec 9 19:09:58 2016 New Revision: 309752 URL: https://svnweb.freebsd.org/changeset/base/309752 Log: src.conf.5: regen after r309142 (WITH_LLD_AS_LD knob) Reported by: Nikolai Lifanov Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Dec 9 19:07:31 2016 (r309751) +++ head/share/man/man5/src.conf.5 Fri Dec 9 19:09:58 2016 (r309752) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 306729 2016-10-05 20:12:00Z emaste .\" $FreeBSD$ -.Dd October 15, 2016 +.Dd December 9, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -165,13 +165,19 @@ The resulting system cannot build progra .Pp It is a default setting on arm64/aarch64. +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_GDB +.El .It Va WITH_BINUTILS .\" from FreeBSD: head/tools/build/options/WITH_BINUTILS 295491 2016-02-11 00:14:00Z emaste Set to build and install binutils (as, ld, objcopy, and objdump) as part of the normal system build. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP .\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 295490 2016-02-10 23:57:09Z emaste Set to not build binutils (as, ld, objcopy and objdump) @@ -189,7 +195,7 @@ Set build binutils (as, ld, objcopy and as part of the bootstrap process. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_BLACKLIST .\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST 301554 2016-06-07 16:35:55Z lidl Set this if you do not want to build blacklistd / blacklistctl. @@ -326,7 +332,7 @@ When set, it also enforces the following Set to not build the Clang C/C++ compiler during the regular phase of the build. .Pp It is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. When set, it also enforces the following options: .Pp .Bl -item -compact @@ -340,7 +346,7 @@ When set, it also enforces the following Set to build the Clang C/C++ compiler during the normal phase of the build. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_CLANG_BOOTSTRAP .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. @@ -349,7 +355,7 @@ unless an alternative compiler is provid XCC. .Pp It is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_CLANG_BOOTSTRAP .\" from FreeBSD: head/tools/build/options/WITH_CLANG_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp Set to build the Clang C/C++ compiler during the bootstrap phase of the build. @@ -365,14 +371,14 @@ Set to avoid building the ARCMigrate, Re the Clang C/C++ compiler. .Pp It is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_CLANG_FULL .\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_CLANG_IS_CC .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks Set to install the GCC compiler as @@ -382,7 +388,7 @@ and .Pa /usr/bin/cpp . .Pp It is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_CLANG_IS_CC .\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb Set to install the Clang C/C++ compiler as @@ -702,7 +708,7 @@ amd64/amd64, arm/arm, arm/armeb, arm/arm Set to build and install gcc and g++. .Pp It is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GCC_BOOTSTRAP .\" from FreeBSD: head/tools/build/options/WITHOUT_GCC_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer Set to not build gcc and g++ as part of the bootstrap process. @@ -717,7 +723,7 @@ amd64/amd64, arm/arm, arm/armeb, arm/arm Set to build gcc and g++ as part of the bootstrap process. .Pp It is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GCOV .\" from FreeBSD: head/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru Set to not build the @@ -736,7 +742,7 @@ Set to build .Xr gdb 1 . .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GNU .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru Set to not build contributed GNU software as a part of the base system. @@ -764,7 +770,17 @@ Build the GNU C++ stack (g++, libstdc++) This is the default on platforms where gcc is the system compiler. .Pp It is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +.It Va WITHOUT_GNU_DIFF +.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_DIFF 307674 2016-10-20 14:48:57Z emaste +Set to not build GNU +.Xr diff 1 +and +.Xr diff3 1 . +.It Va WITHOUT_GNU_GREP +.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP 307674 2016-10-20 14:48:57Z emaste +Set to not build GNU +.Xr grep 1 . .It Va WITHOUT_GNU_GREP_COMPAT .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT 273421 2014-10-21 20:44:33Z emaste Set this option to omit the gnu extensions to grep from being included in @@ -990,24 +1006,48 @@ Set to not build the .Nm libthr (1:1 threading) library. +.It Va WITHOUT_LLD +.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD 309124 2016-11-24 22:54:55Z dim +Set to not build LLVM's lld linker. +.Pp +It is a default setting on +arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +.It Va WITH_LLD +.\" from FreeBSD: head/tools/build/options/WITH_LLD 309124 2016-11-24 22:54:55Z dim +Set to build LLVM's lld linker. +.Pp +It is a default setting on +amd64/amd64 and arm64/aarch64. .It Va WITHOUT_LLDB .\" from FreeBSD: head/tools/build/options/WITHOUT_LLDB 289275 2015-10-14 00:23:31Z emaste Set to not build the LLDB debugger. .Pp It is a default setting on -arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLDB .\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste Set to build the LLDB debugger. .Pp It is a default setting on amd64/amd64 and arm64/aarch64. +.It Va WITHOUT_LLD_AS_LD +.\" from FreeBSD: head/tools/build/options/WITHOUT_LLD_AS_LD 309142 2016-11-25 13:15:28Z emaste +Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +.It Va WITH_LLD_AS_LD +.\" from FreeBSD: head/tools/build/options/WITH_LLD_AS_LD 309142 2016-11-25 13:15:28Z emaste +Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. +.Pp +It is a default setting on +arm64/aarch64. .It Va WITHOUT_LLVM_LIBUNWIND .\" from FreeBSD: head/tools/build/options/WITHOUT_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp It is a default setting on -arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLVM_LIBUNWIND .\" from FreeBSD: head/tools/build/options/WITH_LLVM_LIBUNWIND 293450 2016-01-09 00:42:07Z emaste Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). @@ -1379,7 +1419,7 @@ Set to not build kernel modules that inc Set to not build world with propolice stack smashing protection. .Pp It is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64 and mips/mipsn32. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITH_STAGING .\" from FreeBSD: head/tools/build/options/WITH_STAGING 290816 2015-11-14 03:24:48Z sjg Enable staging of files to a stage tree. From owner-svn-src-head@freebsd.org Fri Dec 9 20:13:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A26C6F71A; Fri, 9 Dec 2016 20:13:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-qt0-f176.google.com (mail-qt0-f176.google.com [209.85.216.176]) (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 29C1511DA; Fri, 9 Dec 2016 20:13:16 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-qt0-f176.google.com with SMTP id p16so26407713qta.0; Fri, 09 Dec 2016 12:13:16 -0800 (PST) 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=PFfoELrcVZ4KtWXCh4XnFkz6S07LaErLNBNT6R4+X00=; b=L068IX189H4se7ewM6nZ7xPyePM4bqX6Ymf3mJpW9yRpRgXihdeSVw5+79BBiFo9IE +Fj0+QVu0jrLtEh40pU5tX+gCH4S9XP3ymZ+8XMwo6EI2DXN1aCI0xhDuywH5GYS+CD/ VAgEneEc80IHPnFdlzFNCFQK9nX4ndGS5RfXS1donmeU3ZBTywmsOrWv3qGA5cUS5fbr lZc44bVc97jEeIzAVX9h/kYc9HzcO58lYyqkU4bueZAkf88k00i+XaF+wKhtXNKc6JfI UDOoeHAZapd/lXDfdRAqdJXYNiglCjAYoWRwW75X02ngHwb2tohktXSdSRSqbUlLjmJ3 gmiw== X-Gm-Message-State: AKaTC02PKJJa1mMH1PerHclO10s9ZXo2l4zajJmumWaFfNGZ/AN2aMLeq4j/jovxfwNs8g== X-Received: by 10.237.62.89 with SMTP id m25mr69830113qtf.119.1481314390329; Fri, 09 Dec 2016 12:13:10 -0800 (PST) Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com. [209.85.220.173]) by smtp.gmail.com with ESMTPSA id t7sm20622363qtd.13.2016.12.09.12.13.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Dec 2016 12:13:10 -0800 (PST) Received: by mail-qk0-f173.google.com with SMTP id n21so28720452qka.3; Fri, 09 Dec 2016 12:13:10 -0800 (PST) X-Received: by 10.55.12.10 with SMTP id 10mr70015963qkm.49.1481314389914; Fri, 09 Dec 2016 12:13:09 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.200.58.165 with HTTP; Fri, 9 Dec 2016 12:13:09 -0800 (PST) In-Reply-To: <201611021243.uA2ChGIg003295@repo.freebsd.org> References: <201611021243.uA2ChGIg003295@repo.freebsd.org> From: Conrad Meyer Date: Fri, 9 Dec 2016 12:13:09 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r308212 - in head/sys: fs/nfsserver kern sys To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 20:13:17 -0000 On Wed, Nov 2, 2016 at 5:43 AM, Konstantin Belousov wrote: > Author: kib > Date: Wed Nov 2 12:43:15 2016 > New Revision: 308212 > URL: https://svnweb.freebsd.org/changeset/base/308212 > > Log: > Allow some dotdot lookups in capability mode. > > If dotdot lookup does not escape from the file descriptor passed as > the lookup root, we can allow the component traversal. Track the > directories traversed, and check the result of dotdot lookup against > the recorded list of the directory vnodes. > > Dotdot lookups are enabled by sysctl vfs.lookup_cap_dotdot, currently > disabled by default until more verification of the approach is done. Hi Konstantin, Are we waiting on a specific reviewer or something else? It would be very nice to have this enabled by default. Thanks, Conrad From owner-svn-src-head@freebsd.org Fri Dec 9 20:50:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF2E3C6E820; Fri, 9 Dec 2016 20:50:36 +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 7EDAB1678; Fri, 9 Dec 2016 20:50:36 +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 uB9KoZZU057687; Fri, 9 Dec 2016 20:50:35 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9KoZP7057686; Fri, 9 Dec 2016 20:50:35 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612092050.uB9KoZP7057686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Dec 2016 20:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309766 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 20:50:36 -0000 Author: glebius Date: Fri Dec 9 20:50:35 2016 New Revision: 309766 URL: https://svnweb.freebsd.org/changeset/base/309766 Log: Fix build for 32-bit machines. Submitted by: tuexen Modified: head/sys/netinet/ip_icmp.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Fri Dec 9 20:48:47 2016 (r309765) +++ head/sys/netinet/ip_icmp.c Fri Dec 9 20:50:35 2016 (r309766) @@ -1025,7 +1025,7 @@ badport_bandlim(int which) if (pps == -1) return (-1); if (pps > 0 && V_icmplim_output) - log(LOG_NOTICE, "Limiting %s from %ld to %d packets/sec\n", - V_icmp_rates[which].descr, pps, V_icmplim); + log(LOG_NOTICE, "Limiting %s from %jd to %d packets/sec\n", + V_icmp_rates[which].descr, (intmax_t )pps, V_icmplim); return (0); } From owner-svn-src-head@freebsd.org Fri Dec 9 21:21:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3003C6F427; Fri, 9 Dec 2016 21:21:25 +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 C2BF410B9; Fri, 9 Dec 2016 21:21:25 +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 uB9LLO37072943; Fri, 9 Dec 2016 21:21:24 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9LLO3E072942; Fri, 9 Dec 2016 21:21:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612092121.uB9LLO3E072942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Dec 2016 21:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309772 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 21:21:26 -0000 Author: glebius Date: Fri Dec 9 21:21:24 2016 New Revision: 309772 URL: https://svnweb.freebsd.org/changeset/base/309772 Log: Allow bogus_page to be passed to pager(s). Modified: head/sys/vm/vm_pager.c Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Fri Dec 9 21:17:40 2016 (r309771) +++ head/sys/vm/vm_pager.c Fri Dec 9 21:21:24 2016 (r309772) @@ -84,6 +84,8 @@ __FBSDID("$FreeBSD$"); #include #include +extern vm_page_t bogus_page; + int cluster_pbuf_freecnt = -1; /* unlimited to begin with */ struct buf *swbuf; @@ -260,6 +262,8 @@ vm_pager_assert_in(vm_object_t object, v * not dirty and belong to the proper object. */ for (int i = 0 ; i < count; i++) { + if (m[i] == bogus_page) + continue; vm_page_assert_xbusied(m[i]); KASSERT(!pmap_page_is_mapped(m[i]), ("%s: page %p is mapped", __func__, m[i])); From owner-svn-src-head@freebsd.org Fri Dec 9 21:28:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 196B2C6F5CD; Fri, 9 Dec 2016 21:28:29 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-ua0-x241.google.com (mail-ua0-x241.google.com [IPv6:2607:f8b0:400c:c08::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8C35152E; Fri, 9 Dec 2016 21:28:28 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-ua0-x241.google.com with SMTP id 20so3059934uak.0; Fri, 09 Dec 2016 13:28:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0AULgnJCgeG6u1Zk19rpYr4ELK0QSPzG13UihJDL544=; b=ZuNDZqFNj5HwsVkHBYCeBr2vK0+OC16Aeve5Fnl/5W7o+0izaMM4lDfOZhTuywqCXw s0f9ldIvdt4KvbnNTL/YXaRLKKPCZmXKJYDjrE8ZdCUjlF0sNG9DkihUquYoKHSHevs5 DNuVe+EBpTLVHIiVBrak5Tc+TxSBPvhfXmGFrlDWmAnDa1M0PZzf/h42I4MTMOKqhyfY tKh0SrwNg+uMvXzgqrJDVaU5qsKFTHDpNDnXuFr7x7DoD/mf+2KyqTZb06A5Xend4D38 L6Bi0qy5PeQeaCn9WYAFyG+6u5zoITx8+otcwJEa1jnYwtx7Jg5KHVtfnWNbg5hdv5rB enlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0AULgnJCgeG6u1Zk19rpYr4ELK0QSPzG13UihJDL544=; b=iT6z+p6D10ZOhewurZpKVhCpGE1bcjCt86hb1Ca5A8yheh4WrHf1MtSVPv3q2emfzs bhx3Fcb0MO24jkTgtIYghPApQF1JiQvuw+5dDX48Sbq6XeML15Jw9kVvfLWGo3c635op hyyi+6p0v+n6D7aBUONRRHZqXvxQvIRAg96gjjfnsUnIQ+preF7uh/sMX1eu9tD30rAf +S7Ps6bZCoxvkrrEixGZ63W0PIWQkFyYZkS7oo2ql8hJbDPc2dcuQgQZaRsN7Zc8jqUT iD+/DZGUvDJA6B9cP5k+FfASK0eeop8M6+urUjQgsZ0gvudfsB6t5At/wPpnm8x+TEIn YJNw== X-Gm-Message-State: AKaTC03yOCLymd4RQ5td/D1GyFUJ2SDf0q8ss720zXjHemQ2KmXcv1tqjbczYGmVYpTiClpJYgb4FUZXfINiUA== X-Received: by 10.176.67.132 with SMTP id l4mr53749245ual.164.1481318907788; Fri, 09 Dec 2016 13:28:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.50.215 with HTTP; Fri, 9 Dec 2016 13:28:27 -0800 (PST) In-Reply-To: <201612092121.uB9LLO3E072942@repo.freebsd.org> References: <201612092121.uB9LLO3E072942@repo.freebsd.org> From: Xin LI Date: Fri, 9 Dec 2016 13:28:27 -0800 Message-ID: Subject: Re: svn commit: r309772 - head/sys/vm To: Gleb Smirnoff Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 21:28:29 -0000 Thanks! On Fri, Dec 9, 2016 at 1:21 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Dec 9 21:21:24 2016 > New Revision: 309772 > URL: https://svnweb.freebsd.org/changeset/base/309772 > > Log: > Allow bogus_page to be passed to pager(s). > > Modified: > head/sys/vm/vm_pager.c > > Modified: head/sys/vm/vm_pager.c > ============================================================================== > --- head/sys/vm/vm_pager.c Fri Dec 9 21:17:40 2016 (r309771) > +++ head/sys/vm/vm_pager.c Fri Dec 9 21:21:24 2016 (r309772) > @@ -84,6 +84,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +extern vm_page_t bogus_page; > + > int cluster_pbuf_freecnt = -1; /* unlimited to begin with */ > > struct buf *swbuf; > @@ -260,6 +262,8 @@ vm_pager_assert_in(vm_object_t object, v > * not dirty and belong to the proper object. > */ > for (int i = 0 ; i < count; i++) { > + if (m[i] == bogus_page) > + continue; > vm_page_assert_xbusied(m[i]); > KASSERT(!pmap_page_is_mapped(m[i]), > ("%s: page %p is mapped", __func__, m[i])); > From owner-svn-src-head@freebsd.org Fri Dec 9 22:13:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D099C6F16E; Fri, 9 Dec 2016 22:13:02 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC235C04; Fri, 9 Dec 2016 22:13:01 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9MD1UG093926; Fri, 9 Dec 2016 22:13:01 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9MD0ZT093923; Fri, 9 Dec 2016 22:13:00 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201612092213.uB9MD0ZT093923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 9 Dec 2016 22:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309773 - head/tools/regression/sockets/unix_cmsg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 22:13:02 -0000 Author: sobomax Date: Fri Dec 9 22:13:00 2016 New Revision: 309773 URL: https://svnweb.freebsd.org/changeset/base/309773 Log: Check that SCM_XXX timestamp returned by the kernel is less 1 second away in the past from the current time. This should be plenty for the scheduler to do its job. It provides assurance that the timestamp returned is actually a valid one, not just some random garbage. Added: head/tools/regression/sockets/unix_cmsg/uc_check_time.c (contents, props changed) head/tools/regression/sockets/unix_cmsg/uc_check_time.h (contents, props changed) Modified: head/tools/regression/sockets/unix_cmsg/Makefile head/tools/regression/sockets/unix_cmsg/t_xxxtime.c.in Modified: head/tools/regression/sockets/unix_cmsg/Makefile ============================================================================== --- head/tools/regression/sockets/unix_cmsg/Makefile Fri Dec 9 21:21:24 2016 (r309772) +++ head/tools/regression/sockets/unix_cmsg/Makefile Fri Dec 9 22:13:00 2016 (r309773) @@ -4,7 +4,8 @@ PROG= unix_cmsg SRCS= ${AUTOSRCS} unix_cmsg.c uc_common.h uc_common.c \ t_generic.h t_generic.c t_peercred.h t_peercred.c \ t_cmsgcred.h t_cmsgcred.c t_sockcred.h t_sockcred.c \ - t_cmsgcred_sockcred.h t_cmsgcred_sockcred.c t_cmsg_len.h t_cmsg_len.c + t_cmsgcred_sockcred.h t_cmsgcred_sockcred.c t_cmsg_len.h t_cmsg_len.c \ + uc_check_time.h uc_check_time.c CLEANFILES+= ${AUTOSRCS} MAN= WARNS?= 3 Modified: head/tools/regression/sockets/unix_cmsg/t_xxxtime.c.in ============================================================================== --- head/tools/regression/sockets/unix_cmsg/t_xxxtime.c.in Fri Dec 9 21:21:24 2016 (r309772) +++ head/tools/regression/sockets/unix_cmsg/t_xxxtime.c.in Fri Dec 9 22:13:00 2016 (r309773) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "t_%%TTYPE%%.h" #include "t_generic.h" #include "uc_common.h" +#include "uc_check_time.h" #if defined(%%SCM_TTYPE%%) static int @@ -51,6 +52,9 @@ check_scm_%%TTYPE%%(struct cmsghdr *cmsg bt = (struct %%DTYPE%% *)CMSG_DATA(cmsghdr); + if (uc_check_%%TTYPE%%(bt) < 0) + return (-1); + uc_dbgmsg("%%DTYPE%%.%%MAJ_MEMB%% %"PRIdMAX", %%DTYPE%%.%%MIN_MEMB%% %"PRIuMAX, (intmax_t)bt->%%MAJ_MEMB%%, (uintmax_t)bt->%%MIN_MEMB%%); Added: head/tools/regression/sockets/unix_cmsg/uc_check_time.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/uc_check_time.c Fri Dec 9 22:13:00 2016 (r309773) @@ -0,0 +1,101 @@ +/*- + * Copyright (c) 2016 Maksym Sobolyev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "uc_check_time.h" + +static const struct timeval max_diff_tv = {.tv_sec = 1, .tv_usec = 0}; +static const struct timespec max_diff_ts = {.tv_sec = 1, .tv_nsec = 0}; + +#define timespeccmp(tvp, uvp, cmp) \ + (((tvp)->tv_sec == (uvp)->tv_sec) ? \ + ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \ + ((tvp)->tv_sec cmp (uvp)->tv_sec)) +#define timespecsub(vvp, uvp) \ + do { \ + (vvp)->tv_sec -= (uvp)->tv_sec; \ + (vvp)->tv_nsec -= (uvp)->tv_nsec; \ + if ((vvp)->tv_nsec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_nsec += 1000000000; \ + } \ + } while (0) + +int +uc_check_bintime(const struct bintime *mt) +{ + struct timespec bt; + + bintime2timespec(mt, &bt); + return (uc_check_timespec_real(&bt)); +} + +int +uc_check_timeval(const struct timeval *bt) +{ + struct timeval ct, dt; + + if (gettimeofday(&ct, NULL) < 0) + return (-1); + timersub(&ct, bt, &dt); + if (!timercmp(&dt, &max_diff_tv, <)) + return (-1); + + return (0); +} + +int +uc_check_timespec_real(const struct timespec *bt) +{ + struct timespec ct; + + if (clock_gettime(CLOCK_REALTIME, &ct) < 0) + return (-1); + timespecsub(&ct, bt); + if (!timespeccmp(&ct, &max_diff_ts, <)) + return (-1); + + return (0); +} + +int +uc_check_timespec_mono(const struct timespec *bt) +{ + struct timespec ct; + + if (clock_gettime(CLOCK_MONOTONIC, &ct) < 0) + return (-1); + timespecsub(&ct, bt); + if (!timespeccmp(&ct, &max_diff_ts, <)) + return (-1); + + return (0); +} Added: head/tools/regression/sockets/unix_cmsg/uc_check_time.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_cmsg/uc_check_time.h Fri Dec 9 22:13:00 2016 (r309773) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2016 Maksym Sobolyev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +struct bintime; +struct timeval; +struct timespec; + +int uc_check_bintime(const struct bintime *bt); +int uc_check_timeval(const struct timeval *bt); +int uc_check_timespec_real(const struct timespec *bt); +int uc_check_timespec_mono(const struct timespec *bt); From owner-svn-src-head@freebsd.org Fri Dec 9 22:50:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81B2FC6F098; Fri, 9 Dec 2016 22:50:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51032F38; Fri, 9 Dec 2016 22:50:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9MohS6008577; Fri, 9 Dec 2016 22:50:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9MohnP008576; Fri, 9 Dec 2016 22:50:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612092250.uB9MohnP008576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 9 Dec 2016 22:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309774 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 22:50:44 -0000 Author: ngie Date: Fri Dec 9 22:50:43 2016 New Revision: 309774 URL: https://svnweb.freebsd.org/changeset/base/309774 Log: Only run mdconfig -d -u 3 if /dev/md3 exists on the system This will prevent "cleanup failures" (exit code != 0 returned) when tmpfs is not loaded MFC after: 1 week Modified: head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Modified: head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Fri Dec 9 22:13:00 2016 (r309773) +++ head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Fri Dec 9 22:50:43 2016 (r309774) @@ -85,7 +85,7 @@ basic_cleanup() { umount mnt 2>/dev/null 1>&2 # Begin FreeBSD if true; then - atf_check -s eq:0 -o empty -e empty mdconfig -d -u 3 + [ ! -c /dev/md3 ] || mdconfig -d -u 3 else # End FreeBSD vndconfig -u /dev/vnd3 2>/dev/null 1>&2 From owner-svn-src-head@freebsd.org Fri Dec 9 22:51:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABE83C6F10B; Fri, 9 Dec 2016 22:51:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B89511E5; Fri, 9 Dec 2016 22:51:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9MpwqP009523; Fri, 9 Dec 2016 22:51:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9Mpw42009522; Fri, 9 Dec 2016 22:51:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612092251.uB9Mpw42009522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 9 Dec 2016 22:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309775 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 22:51:59 -0000 Author: emaste Date: Fri Dec 9 22:51:58 2016 New Revision: 309775 URL: https://svnweb.freebsd.org/changeset/base/309775 Log: Keep /usr/bin/ld for WITHOUT_BINUTILS but WITH_LLD_AS_LD Reported by: Nikolai Lifanov Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Dec 9 22:50:43 2016 (r309774) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Dec 9 22:51:58 2016 (r309775) @@ -218,7 +218,9 @@ OLD_DIRS+=usr/share/examples/bhyve .if ${MK_BINUTILS} == no OLD_FILES+=usr/bin/as +.if ${MK_LLD_AS_LD} == no OLD_FILES+=usr/bin/ld +.endif OLD_FILES+=usr/bin/ld.bfd OLD_FILES+=usr/bin/objdump OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.x From owner-svn-src-head@freebsd.org Fri Dec 9 23:37:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DEBEC6FC04; Fri, 9 Dec 2016 23:37:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DA14B85; Fri, 9 Dec 2016 23:37:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9NbBTM028172; Fri, 9 Dec 2016 23:37:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9NbBpT028171; Fri, 9 Dec 2016 23:37:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612092337.uB9NbBpT028171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Dec 2016 23:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309776 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 23:37:12 -0000 Author: imp Date: Fri Dec 9 23:37:11 2016 New Revision: 309776 URL: https://svnweb.freebsd.org/changeset/base/309776 Log: Permit loading of efirt module even when there's no EFI to call. The module loading is successful, but attempts to use it will not be successful. This is similar to what we do (did?) with ACPI on non-ACPI systems. We succeed if we can't find the necessary information to hook into EFI, but still fail if we're unable to allocate resources if we do find EFI. Not Objected to by: kib@ MFC Afer: 3 days Modified: head/sys/amd64/amd64/efirt.c Modified: head/sys/amd64/amd64/efirt.c ============================================================================== --- head/sys/amd64/amd64/efirt.c Fri Dec 9 22:51:58 2016 (r309775) +++ head/sys/amd64/amd64/efirt.c Fri Dec 9 23:37:11 2016 (r309776) @@ -355,14 +355,14 @@ efi_init(void) if (efi_systbl_phys == 0) { if (bootverbose) printf("EFI systbl not available\n"); - return (ENXIO); + return (0); } efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { efi_systbl = NULL; if (bootverbose) printf("EFI systbl signature invalid\n"); - return (ENXIO); + return (0); } efi_cfgtbl = (efi_systbl->st_cfgtbl == 0) ? NULL : (struct efi_cfgtbl *)efi_systbl->st_cfgtbl; @@ -379,7 +379,7 @@ efi_init(void) if (efihdr == NULL) { if (bootverbose) printf("EFI map is not present\n"); - return (ENXIO); + return (0); } efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; map = (struct efi_md *)((uint8_t *)efihdr + efisz); From owner-svn-src-head@freebsd.org Fri Dec 9 23:37:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51579C6FC25; Fri, 9 Dec 2016 23:37:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08903B86; Fri, 9 Dec 2016 23:37:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9NbETF028215; Fri, 9 Dec 2016 23:37:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9NbE7r028214; Fri, 9 Dec 2016 23:37:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612092337.uB9NbE7r028214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Dec 2016 23:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309777 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 23:37:15 -0000 Author: imp Date: Fri Dec 9 23:37:14 2016 New Revision: 309777 URL: https://svnweb.freebsd.org/changeset/base/309777 Log: Implement Intel's log page 0xc1 (Read Command Latency Log) and page 0xc1 (Write Command Latency Log). Sponsored By: Netflix, Inc Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Fri Dec 9 23:37:11 2016 (r309776) +++ head/sbin/nvmecontrol/logpage.c Fri Dec 9 23:37:14 2016 (r309777) @@ -324,6 +324,47 @@ print_intel_temp_stats(void *buf, uint32 printf("Estimated Temperature Offset: %ju C/K\n", (uintmax_t)temp->est_offset); } +/* + * Format from Table 22, section 5.7 IO Command Latency Statistics. + * Read and write stats pages have identical encoding. + */ +static void +print_intel_read_write_lat_log(void *buf, uint32_t size __unused) +{ + const char *walker = buf; + int i; + + printf("Major: %d\n", le16dec(walker + 0)); + printf("Minor: %d\n", le16dec(walker + 2)); + for (i = 0; i < 32; i++) + printf("%4dus-%4dus: %ju\n", i * 32, (i + 1) * 32, (uintmax_t)le32dec(walker + 4 + i * 4)); + for (i = 1; i < 32; i++) + printf("%4dms-%4dms: %ju\n", i, i + 1, (uintmax_t)le32dec(walker + 132 + i * 4)); + for (i = 1; i < 32; i++) + printf("%4dms-%4dms: %ju\n", i * 32, (i + 1) * 32, (uintmax_t)le32dec(walker + 256 + i * 4)); +} + +static void +print_intel_read_lat_log(void *buf, uint32_t size) +{ + + printf("Intel Read Latency Log\n"); + printf("======================\n"); + print_intel_read_write_lat_log(buf, size); +} + +static void +print_intel_write_lat_log(void *buf, uint32_t size) +{ + + printf("Intel Write Latency Log\n"); + printf("=======================\n"); + print_intel_read_write_lat_log(buf, size); +} + +/* + * Table 19. 5.4 SMART Attributes + */ static void print_intel_add_smart(void *buf, uint32_t size __unused) { @@ -803,11 +844,15 @@ static struct logpage_function { sizeof(struct nvme_health_information_page)}, {NVME_LOG_FIRMWARE_SLOT, NULL, print_log_firmware, sizeof(struct nvme_firmware_page)}, + {HGST_INFO_LOG, "hgst", print_hgst_info_log, + DEFAULT_SIZE}, {INTEL_LOG_TEMP_STATS, "intel", print_intel_temp_stats, sizeof(struct intel_log_temp_stats)}, - {INTEL_LOG_ADD_SMART, "intel", print_intel_add_smart, + {INTEL_LOG_READ_LAT_LOG, "intel", print_intel_read_lat_log, DEFAULT_SIZE}, - {HGST_INFO_LOG, "hgst", print_hgst_info_log, + {INTEL_LOG_WRITE_LAT_LOG, "intel", print_intel_write_lat_log, + DEFAULT_SIZE}, + {INTEL_LOG_ADD_SMART, "intel", print_intel_add_smart, DEFAULT_SIZE}, {0, NULL, NULL, 0}, }; From owner-svn-src-head@freebsd.org Fri Dec 9 23:42:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72146C6FDF4; Fri, 9 Dec 2016 23:42:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EAE5FA6; Fri, 9 Dec 2016 23:42:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9Ng44p031886; Fri, 9 Dec 2016 23:42:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9Ng4a9031885; Fri, 9 Dec 2016 23:42:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612092342.uB9Ng4a9031885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 9 Dec 2016 23:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309778 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 23:42:05 -0000 Author: ngie Date: Fri Dec 9 23:42:04 2016 New Revision: 309778 URL: https://svnweb.freebsd.org/changeset/base/309778 Log: Make test_unmount usable in cleanup subroutines - Duplicate test_unmount to _test_unmount - Remove atf_check calls - Call _test_unmount from test_unmount, checking the exit code at the end, and returning it to maintain the test_unmount "contract" MFC after: 1 week Modified: head/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Modified: head/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Fri Dec 9 23:37:14 2016 (r309777) +++ head/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Fri Dec 9 23:42:04 2016 (r309778) @@ -59,12 +59,31 @@ test_mount() { # Unmounts the file system mounted by test_mount. # test_unmount() { + # Begin FreeBSD + _test_unmount + exit_code=$? + atf_check_equal "$exit_code" "0" + return $exit_code + # End FreeBSD cd - >/dev/null atf_check -s eq:0 -o empty -e empty umount ${Mount_Point} atf_check -s eq:0 -o empty -e empty rmdir ${Mount_Point} Mount_Point= } +# Begin FreeBSD +_test_unmount() { + if [ -z "${Mount_Point}" -o ! -d "${Mount_Point}" ]; then + return 0 + fi + + cd - >/dev/null + umount ${Mount_Point} + rmdir ${Mount_Point} + Mount_Point= +} +# End FreeBSD + # # kqueue_monitor expected_nevents file1 [.. fileN] # From owner-svn-src-head@freebsd.org Fri Dec 9 23:43:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21013C6FE71; Fri, 9 Dec 2016 23:43:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4D2512C2; Fri, 9 Dec 2016 23:43:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9NhYLW031983; Fri, 9 Dec 2016 23:43:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9NhYXX031982; Fri, 9 Dec 2016 23:43:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612092343.uB9NhYXX031982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 9 Dec 2016 23:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309779 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 23:43:35 -0000 Author: ngie Date: Fri Dec 9 23:43:33 2016 New Revision: 309779 URL: https://svnweb.freebsd.org/changeset/base/309779 Log: - Ignore errors from umount - Use _test_unmount instead of test_unmount in cleanup MFC after: 1 week Modified: head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Modified: head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Fri Dec 9 23:42:04 2016 (r309778) +++ head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Fri Dec 9 23:43:33 2016 (r309779) @@ -97,7 +97,8 @@ negative_body() { if true; then atf_test_case large cleanup large_cleanup() { - umount -f tmp 2>/dev/null + umount -f tmp 2>/dev/null || : + Mount_Point=$(pwd)/mnt _test_unmount || : } else # End FreeBSD From owner-svn-src-head@freebsd.org Fri Dec 9 23:44:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C75EC6FED3; Fri, 9 Dec 2016 23:44:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9743148A; Fri, 9 Dec 2016 23:44:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9NiQPu032077; Fri, 9 Dec 2016 23:44:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9NiQxN032075; Fri, 9 Dec 2016 23:44:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612092344.uB9NiQxN032075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 9 Dec 2016 23:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309780 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 23:44:27 -0000 Author: ngie Date: Fri Dec 9 23:44:25 2016 New Revision: 309780 URL: https://svnweb.freebsd.org/changeset/base/309780 Log: Use _test_unmount instead of test_unmount in cleanup to avoid false positives with atf_check when tmpfs is not loaded, etc MFC after: 1 week Modified: head/contrib/netbsd-tests/fs/tmpfs/t_link.sh head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Modified: head/contrib/netbsd-tests/fs/tmpfs/t_link.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_link.sh Fri Dec 9 23:43:33 2016 (r309779) +++ head/contrib/netbsd-tests/fs/tmpfs/t_link.sh Fri Dec 9 23:44:25 2016 (r309780) @@ -97,7 +97,7 @@ subdirs_body() { if true; then atf_test_case kqueue cleanup kqueue_cleanup() { - Mount_Point=$(pwd)/mntpt test_unmount || : + Mount_Point=$(pwd)/mntpt _test_unmount || : } else # End FreeBSD Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Fri Dec 9 23:43:33 2016 (r309779) +++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Fri Dec 9 23:44:25 2016 (r309780) @@ -50,7 +50,7 @@ single_body() { if true; then atf_test_case uchg cleanup uchg_cleanup() { - Mount_Point=$(pwd)/mntpt test_unmount || : + Mount_Point=$(pwd)/mntpt _test_unmount } else # End FreeBSD From owner-svn-src-head@freebsd.org Sat Dec 10 01:02:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E4E9C6D6F6; Sat, 10 Dec 2016 01:02:35 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (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 E63B01D8A; Sat, 10 Dec 2016 01:02:34 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from [192.168.2.21] (atc.xcllnt.net [50.0.150.213]) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPS id uBA12Rwj027912 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 9 Dec 2016 17:02:28 -0800 (PST) (envelope-from marcel@xcllnt.net) From: Marcel Moolenaar Message-Id: <853E1226-7B6F-426E-ACD6-9A1E5A126DDF@xcllnt.net> Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309394 - head/sys/netpfil/pf Date: Fri, 9 Dec 2016 17:02:27 -0800 In-Reply-To: <20161208224843.GY27748@FreeBSD.org> Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Gleb Smirnoff References: <201612020615.uB26Fxs1049431@repo.freebsd.org> <20161207210824.GN27748@FreeBSD.org> <20161208224843.GY27748@FreeBSD.org> X-Mailer: Apple Mail (2.3251) X-Greylist: Sender IP whitelisted, ACL 39 matched, not delayed by milter-greylist-4.6.1 (mail.xcllnt.net [50.0.150.214]); Fri, 09 Dec 2016 17:02:28 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 01:02:35 -0000 > On Dec 8, 2016, at 2:48 PM, Gleb Smirnoff > wrote: >=20 > Marcel, >=20 > On Wed, Dec 07, 2016 at 05:06:08PM -0800, Marcel Moolenaar wrote: > M> > thanks for the fixes. While the problem with the first chunk > M> > in pfsync_sendout() is obvious, the problem you are fixing in th > M> > second chunk in the pfsync_delete_state() is not clear to me. > M> > Can you please explain what scenario are you fixing there? > M>=20 > M> State updates may be pending for state being deleted. This > M> means that the state is still sitting on either the PFSYNC_S_UPD > M> or PFSYNC_S_UPD_C queues. What pfsync(4) does in that case is > M> simply remove the state from those queues and add it to the > M> PFSYNC_S_DEL queue. > M>=20 > M> But, pf(4) has already dropped the reference count for state > M> that=E2=80=99s deleted and the only reference is by pfsync(4) by = virtue > M> of being on the PFSYNC_S_UPD or PFSYNC_S_UPD_C queues. When the > M> state gets dequeued from those queues, the reference count drops > M> to 0 and the state is deleted (read: memory freed). But the same > M> state is subsequently added to the PFSYNC_S_DEL queue =E2=80=94 = i.e. > M> after the memory was freed. >=20 > Thanks for explanation, Marcel! Potentially this problem also exists > in pfsync_update_state() and in pfsync_update_state_req(). >=20 > Your patch introduces extra unnecessary atomic operations, so let > me suggest another patch. It should be applied on top of yours, and > it also addresses pfsync_update_state() and in = pfsync_update_state_req(). >=20 > It isn't tested, but is pretty straightforward.=20 I=E2=80=99ll give it a spin and commit. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@freebsd.org Sat Dec 10 01:40:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA3B5C6E104; Sat, 10 Dec 2016 01:40:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FC1FF47; Sat, 10 Dec 2016 01:40:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBA1eANi076299; Sat, 10 Dec 2016 01:40:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBA1eAhQ076297; Sat, 10 Dec 2016 01:40:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612100140.uBA1eAhQ076297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 10 Dec 2016 01:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309782 - head/contrib/elftoolchain/libelftc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 01:40:12 -0000 Author: emaste Date: Sat Dec 10 01:40:10 2016 New Revision: 309782 URL: https://svnweb.freebsd.org/changeset/base/309782 Log: libelftc: add elf{32,64}-tradlittlemips target emulation names Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Sat Dec 10 00:32:10 2016 (r309781) +++ head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Sat Dec 10 01:40:10 2016 (r309782) @@ -83,6 +83,7 @@ Known descriptor names and their propert .It Li elf32-shl-linux Ta ELF Ta LSB Ta 32 .It Li elf32-sparc Ta ELF Ta MSB Ta 32 .It Li elf32-tradbigmips Ta ELF Ta MSB Ta 32 +.It Li elf32-tradlittlemips Ta ELF Ta LSB Ta 32 .It Li elf64-alpha Ta ELF Ta LSB Ta 64 .It Li elf64-alpha-freebsd Ta ELF Ta LSB Ta 64 .It Li elf64-big Ta ELF Ta MSB Ta 64 @@ -103,6 +104,7 @@ Known descriptor names and their propert .It Li elf64-sparc Ta ELF Ta MSB Ta 64 .It Li elf64-sparc-freebsd Ta ELF Ta MSB Ta 64 .It Li elf64-tradbigmips Ta ELF Ta MSB Ta 64 +.It Li elf64-tradlittlemips Ta ELF Ta LSB Ta 64 .It Li elf64-x86-64 Ta ELF Ta LSB Ta 64 .It Li elf64-x86-64-freebsd Ta ELF Ta LSB Ta 64 .It Li ihex Ta IHEX Ta - Ta - Modified: head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Sat Dec 10 00:32:10 2016 (r309781) +++ head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Sat Dec 10 01:40:10 2016 (r309782) @@ -203,6 +203,14 @@ struct _Elftc_Bfd_Target _libelftc_targe }, { + .bt_name = "elf32-tradlittlemips", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS32, + .bt_machine = EM_MIPS, + }, + + { .bt_name = "elf64-alpha", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2LSB, @@ -367,6 +375,14 @@ struct _Elftc_Bfd_Target _libelftc_targe }, { + .bt_name = "elf64-tradlittlemips", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_MIPS, + }, + + { .bt_name = "elf64-x86-64", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2LSB, From owner-svn-src-head@freebsd.org Sat Dec 10 02:56:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CE53C6FB9F; Sat, 10 Dec 2016 02:56:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 159501349; Sat, 10 Dec 2016 02:56:45 +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 uBA2uiot008366; Sat, 10 Dec 2016 02:56:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBA2uiXJ008365; Sat, 10 Dec 2016 02:56:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612100256.uBA2uiXJ008365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 10 Dec 2016 02:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309783 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 02:56:45 -0000 Author: markj Date: Sat Dec 10 02:56:44 2016 New Revision: 309783 URL: https://svnweb.freebsd.org/changeset/base/309783 Log: Return a non-NULL owner only if the lock is exclusively held in owner_sx(). Fix some whitespace bugs while here. MFC after: 2 weeks Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Dec 10 01:40:10 2016 (r309782) +++ head/sys/kern/kern_sx.c Sat Dec 10 02:56:44 2016 (r309783) @@ -215,12 +215,14 @@ unlock_sx(struct lock_object *lock) int owner_sx(const struct lock_object *lock, struct thread **owner) { - const struct sx *sx = (const struct sx *)lock; - uintptr_t x = sx->sx_lock; + const struct sx *sx; + uintptr_t x; - *owner = (struct thread *)SX_OWNER(x); - return ((x & SX_LOCK_SHARED) != 0 ? (SX_SHARERS(x) != 0) : - (*owner != NULL)); + sx = (const struct sx *)lock; + x = sx->sx_lock; + *owner = NULL; + return ((x & SX_LOCK_SHARED) != 0 ? (SX_SHARERS(x) != 0) : + ((*owner = (struct thread *)SX_OWNER(x)) != NULL)); } #endif From owner-svn-src-head@freebsd.org Sat Dec 10 02:59:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFBC4C6FCBD; Sat, 10 Dec 2016 02:59:35 +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 AF8FB158D; Sat, 10 Dec 2016 02:59:35 +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 uBA2xYWZ008493; Sat, 10 Dec 2016 02:59:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBA2xYp2008492; Sat, 10 Dec 2016 02:59:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612100259.uBA2xYp2008492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 10 Dec 2016 02:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309784 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 02:59:36 -0000 Author: markj Date: Sat Dec 10 02:59:34 2016 New Revision: 309784 URL: https://svnweb.freebsd.org/changeset/base/309784 Log: Use a consistent snapshot of the lock state in owner_mtx(). MFC after: 2 weeks Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sat Dec 10 02:56:44 2016 (r309783) +++ head/sys/kern/kern_mutex.c Sat Dec 10 02:59:34 2016 (r309784) @@ -249,10 +249,13 @@ unlock_spin(struct lock_object *lock) int owner_mtx(const struct lock_object *lock, struct thread **owner) { - const struct mtx *m = (const struct mtx *)lock; + const struct mtx *m; + uintptr_t x; - *owner = mtx_owner(m); - return (mtx_unowned(m) == 0); + m = (const struct mtx *)lock; + x = m->mtx_lock; + *owner = (struct thread *)(x & ~MTX_FLAGMASK); + return (x != MTX_UNOWNED); } #endif From owner-svn-src-head@freebsd.org Sat Dec 10 03:11:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5184AC6F968; Sat, 10 Dec 2016 03:11:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 110E9A52; Sat, 10 Dec 2016 03:11:06 +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 uBA3B6Li014068; Sat, 10 Dec 2016 03:11:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBA3B6m6014065; Sat, 10 Dec 2016 03:11:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612100311.uBA3B6m6014065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 10 Dec 2016 03:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309785 - in head/sys/cddl/dev/fbt: arm powerpc x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 03:11:07 -0000 Author: markj Date: Sat Dec 10 03:11:05 2016 New Revision: 309785 URL: https://svnweb.freebsd.org/changeset/base/309785 Log: Consistently use fbt_excluded() on all architectures. MFC after: 2 weeks Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c head/sys/cddl/dev/fbt/powerpc/fbt_isa.c head/sys/cddl/dev/fbt/x86/fbt_isa.c Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/arm/fbt_isa.c Sat Dec 10 02:59:34 2016 (r309784) +++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Sat Dec 10 03:11:05 2016 (r309785) @@ -95,16 +95,8 @@ fbt_provide_module_function(linker_file_ uint32_t *instr, *limit; int popm; - if (strncmp(name, "dtrace_", 7) == 0 && - strncmp(name, "dtrace_safe_", 12) != 0) { - /* - * Anything beginning with "dtrace_" may be called - * from probe context unless it explicitly indicates - * that it won't be called from probe context by - * using the prefix "dtrace_safe_". - */ + if (fbt_excluded(name)) return (0); - } instr = (uint32_t *)symval->value; limit = (uint32_t *)(symval->value + symval->size); Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Sat Dec 10 02:59:34 2016 (r309784) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Sat Dec 10 03:11:05 2016 (r309785) @@ -127,16 +127,8 @@ fbt_provide_module_function(linker_file_ return (0); #endif - if (strncmp(name, "dtrace_", 7) == 0 && - strncmp(name, "dtrace_safe_", 12) != 0) { - /* - * Anything beginning with "dtrace_" may be called - * from probe context unless it explicitly indicates - * that it won't be called from probe context by - * using the prefix "dtrace_safe_". - */ + if (fbt_excluded(name) == 0) return (0); - } instr = (uint32_t *) symval->value; limit = (uint32_t *) (symval->value + symval->size); Modified: head/sys/cddl/dev/fbt/x86/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/x86/fbt_isa.c Sat Dec 10 02:59:34 2016 (r309784) +++ head/sys/cddl/dev/fbt/x86/fbt_isa.c Sat Dec 10 03:11:05 2016 (r309785) @@ -158,21 +158,15 @@ fbt_provide_module_function(linker_file_ int size; uint8_t *instr, *limit; - if ((strncmp(name, "dtrace_", 7) == 0 && - strncmp(name, "dtrace_safe_", 12) != 0) || - strcmp(name, "trap_check") == 0) { - /* - * Anything beginning with "dtrace_" may be called - * from probe context unless it explicitly indicates - * that it won't be called from probe context by - * using the prefix "dtrace_safe_". - * - * Additionally, we avoid instrumenting trap_check() to avoid - * the possibility of generating a fault in probe context before - * DTrace's fault handler is called. - */ + if (fbt_excluded(name)) + return (0); + + /* + * trap_check() is a wrapper for DTrace's fault handler, so we don't + * want to be able to instrument it. + */ + if (strcmp(name, "trap_check") == 0) return (0); - } size = symval->size; From owner-svn-src-head@freebsd.org Sat Dec 10 03:13:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEA04C6FA35; Sat, 10 Dec 2016 03:13:12 +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 8E544E08; Sat, 10 Dec 2016 03:13:12 +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 uBA3DBcu016911; Sat, 10 Dec 2016 03:13:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBA3DBEK016910; Sat, 10 Dec 2016 03:13:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201612100313.uBA3DBEK016910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 10 Dec 2016 03:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309786 - head/sys/cddl/dev/fbt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 03:13:12 -0000 Author: markj Date: Sat Dec 10 03:13:11 2016 New Revision: 309786 URL: https://svnweb.freebsd.org/changeset/base/309786 Log: Don't create FBT probes for lock owner methods. These functions may be called in DTrace probe context, so they cannot be safely traced. Moreover, they are currently only used by DTrace, so their corresponding FBT probes are not particularly useful. MFC after: 2 weeks Modified: head/sys/cddl/dev/fbt/fbt.c Modified: head/sys/cddl/dev/fbt/fbt.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt.c Sat Dec 10 03:11:05 2016 (r309785) +++ head/sys/cddl/dev/fbt/fbt.c Sat Dec 10 03:13:11 2016 (r309786) @@ -127,6 +127,15 @@ fbt_excluded(const char *name) } /* + * Lock owner methods may be called from probe context. + */ + if (strcmp(name, "owner_mtx") == 0 || + strcmp(name, "owner_rm") == 0 || + strcmp(name, "owner_rw") == 0 || + strcmp(name, "owner_sx") == 0) + return (1); + + /* * When DTrace is built into the kernel we need to exclude * the FBT functions from instrumentation. */ From owner-svn-src-head@freebsd.org Sat Dec 10 03:31:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A5C9C6FC8A; Sat, 10 Dec 2016 03:31:40 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DF32C79D; Sat, 10 Dec 2016 03:31:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBA3VdNj025432; Sat, 10 Dec 2016 03:31:39 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBA3VdFW025431; Sat, 10 Dec 2016 03:31:39 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201612100331.uBA3VdFW025431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 10 Dec 2016 03:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309787 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 03:31:40 -0000 Author: marcel Date: Sat Dec 10 03:31:38 2016 New Revision: 309787 URL: https://svnweb.freebsd.org/changeset/base/309787 Log: Improve upon r309394 Instead of taking an extra reference to deal with pfsync_q_ins() and pfsync_q_del() taken and dropping a reference (resp,) make it optional of those functions to take or drop a reference by passing an extra argument. Submitted by: glebius@ Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Sat Dec 10 03:13:11 2016 (r309786) +++ head/sys/netpfil/pf/if_pfsync.c Sat Dec 10 03:31:38 2016 (r309787) @@ -161,8 +161,8 @@ static struct pfsync_q pfsync_qs[] = { { pfsync_out_del, sizeof(struct pfsync_del_c), PFSYNC_ACT_DEL_C } }; -static void pfsync_q_ins(struct pf_state *, int); -static void pfsync_q_del(struct pf_state *); +static void pfsync_q_ins(struct pf_state *, int, bool); +static void pfsync_q_del(struct pf_state *, bool); static void pfsync_update_state(struct pf_state *); @@ -542,7 +542,7 @@ pfsync_state_import(struct pfsync_state if (!(flags & PFSYNC_SI_IOCTL)) { st->state_flags &= ~PFSTATE_NOSYNC; if (st->state_flags & PFSTATE_ACK) { - pfsync_q_ins(st, PFSYNC_S_IACK); + pfsync_q_ins(st, PFSYNC_S_IACK, true); pfsync_push(sc); } } @@ -1668,7 +1668,7 @@ pfsync_insert_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); - pfsync_q_ins(st, PFSYNC_S_INS); + pfsync_q_ins(st, PFSYNC_S_INS, true); PFSYNC_UNLOCK(sc); st->sync_updates = 0; @@ -1789,7 +1789,7 @@ static void pfsync_update_state(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; - int sync = 0; + bool sync = false, ref = true; PF_STATE_LOCK_ASSERT(st); PFSYNC_LOCK(sc); @@ -1798,7 +1798,7 @@ pfsync_update_state(struct pf_state *st) pfsync_undefer_state(st, 0); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st); + pfsync_q_del(st, true); PFSYNC_UNLOCK(sc); return; } @@ -1815,14 +1815,17 @@ pfsync_update_state(struct pf_state *st) if (st->key[PF_SK_WIRE]->proto == IPPROTO_TCP) { st->sync_updates++; if (st->sync_updates >= sc->sc_maxupdates) - sync = 1; + sync = true; } break; case PFSYNC_S_IACK: - pfsync_q_del(st); + pfsync_q_del(st, false); + ref = false; + /* FALLTHROUGH */ + case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_UPD_C); + pfsync_q_ins(st, PFSYNC_S_UPD_C, ref); st->sync_updates = 0; break; @@ -1880,13 +1883,14 @@ static void pfsync_update_state_req(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; + bool ref = true; PF_STATE_LOCK_ASSERT(st); PFSYNC_LOCK(sc); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st); + pfsync_q_del(st, true); PFSYNC_UNLOCK(sc); return; } @@ -1894,9 +1898,12 @@ pfsync_update_state_req(struct pf_state switch (st->sync_state) { case PFSYNC_S_UPD_C: case PFSYNC_S_IACK: - pfsync_q_del(st); + pfsync_q_del(st, false); + ref = false; + /* FALLTHROUGH */ + case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_UPD); + pfsync_q_ins(st, PFSYNC_S_UPD, ref); pfsync_push(sc); break; @@ -1917,13 +1924,14 @@ static void pfsync_delete_state(struct pf_state *st) { struct pfsync_softc *sc = V_pfsyncif; + bool ref = true; PFSYNC_LOCK(sc); if (st->state_flags & PFSTATE_ACK) pfsync_undefer_state(st, 1); if (st->state_flags & PFSTATE_NOSYNC) { if (st->sync_state != PFSYNC_S_NONE) - pfsync_q_del(st); + pfsync_q_del(st, true); PFSYNC_UNLOCK(sc); return; } @@ -1931,30 +1939,27 @@ pfsync_delete_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); - pf_ref_state(st); - switch (st->sync_state) { case PFSYNC_S_INS: /* We never got to tell the world so just forget about it. */ - pfsync_q_del(st); + pfsync_q_del(st, true); break; case PFSYNC_S_UPD_C: case PFSYNC_S_UPD: case PFSYNC_S_IACK: - pfsync_q_del(st); - /* FALLTHROUGH to putting it on the del list */ + pfsync_q_del(st, false); + ref = false; + /* FALLTHROUGH */ case PFSYNC_S_NONE: - pfsync_q_ins(st, PFSYNC_S_DEL); + pfsync_q_ins(st, PFSYNC_S_DEL, ref); break; default: panic("%s: unexpected sync state %d", __func__, st->sync_state); } - pf_release_state(st); - PFSYNC_UNLOCK(sc); } @@ -1982,7 +1987,7 @@ pfsync_clear_states(u_int32_t creatorid, } static void -pfsync_q_ins(struct pf_state *st, int q) +pfsync_q_ins(struct pf_state *st, int q, bool ref) { struct pfsync_softc *sc = V_pfsyncif; size_t nlen = pfsync_qs[q].len; @@ -2006,11 +2011,12 @@ pfsync_q_ins(struct pf_state *st, int q) sc->sc_len += nlen; TAILQ_INSERT_TAIL(&sc->sc_qs[q], st, sync_list); st->sync_state = q; - pf_ref_state(st); + if (ref) + pf_ref_state(st); } static void -pfsync_q_del(struct pf_state *st) +pfsync_q_del(struct pf_state *st, bool unref) { struct pfsync_softc *sc = V_pfsyncif; int q = st->sync_state; @@ -2022,7 +2028,8 @@ pfsync_q_del(struct pf_state *st) sc->sc_len -= pfsync_qs[q].len; TAILQ_REMOVE(&sc->sc_qs[q], st, sync_list); st->sync_state = PFSYNC_S_NONE; - pf_release_state(st); + if (unref) + pf_release_state(st); if (TAILQ_EMPTY(&sc->sc_qs[q])) sc->sc_len -= sizeof(struct pfsync_subheader); From owner-svn-src-head@freebsd.org Sat Dec 10 08:30:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F31D9C6F6F7; Sat, 10 Dec 2016 08:30:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0B4F161E; Sat, 10 Dec 2016 08:30:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id 3so4772760pgd.0; Sat, 10 Dec 2016 00:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=k7tA9KK0tT2UIbgQ5gjJ2fDg7v0jkzhKbjctfnoG/gw=; b=gBi1BAXbZjZCy51mKpe5Y9i2nS8Uzyj5sh+Sh+bq+FaCN02jbzXhbGz6nP6WF0Kc8j 0zsAWQi1TZU4IUvYc5KtbLdXvwWMQY9QCv48ddVLq9I7NQ1vBcz2oiQJ8LOuxbgNlmkG ASa17IjKLUn/AX8x00rHivHj3iuL6kmhjyPCw02/+l5m9g84G1mTQV/Da1rHTHfRfTjO KWr6U8bz54IclF10fZQVL8kfVJoEpDLg8qtlfzpwRTkdfXflZolGQKlt+EqPrZY7lB/L S+5KKLcFSVpvLEA1OyRv5cOci2Dz2WHxjJZHuwKxYJv/w2kiHgjUtydlnv64j9JHNtT6 tXoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=k7tA9KK0tT2UIbgQ5gjJ2fDg7v0jkzhKbjctfnoG/gw=; b=SW+VgxQyDGi/wCPkz50HLLETsVFlcM71FBhQ5bKqoBkxDv/SX2MUZXkgUOFDyrhKNI wSqUCcniC7lIf4RaqtELEorkQ+N+pwxELGkzxlZVWMWHrwABP19W1Wq4X4fQPhBCpQhm 5txUHobL9ZABZNWcMF+mmOB0dF7FAPpGC6qGulfO6fKhkMDwynQUT539jO58hwO1IgtS nLHJHsbJvj2434vVU5UlF484t4T+hCxsgu3AyiZXxI+x2aJPbPpBGt2xZq+kWVAXTV4n QlClztjiPytDvPcaR7opS7ZEeJF2E6fCGsIufU0mvUA2dJmCxhQcpiyKuGn6F5T+w89q WTMQ== X-Gm-Message-State: AKaTC02wFcTCJ9qA3nZ6nyVr2B4O3PtAcvKMdAMcjMiMs4eHJB6PE4hxzdXZeDvkEMFVNg== X-Received: by 10.84.196.164 with SMTP id l33mr166454312pld.150.1481358602915; Sat, 10 Dec 2016 00:30:02 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id d1sm62550201pfb.76.2016.12.10.00.30.01 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Dec 2016 00:30:02 -0800 (PST) Subject: Re: svn commit: r309735 - head/bin/dd Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F752FAE6-7909-41D8-B436-A01F9E36F97B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201612091451.uB9Ep6xv011272@repo.freebsd.org> Date: Sat, 10 Dec 2016 00:30:00 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201612091451.uB9Ep6xv011272@repo.freebsd.org> To: Bartek Rutkowski X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 08:30:04 -0000 --Apple-Mail=_F752FAE6-7909-41D8-B436-A01F9E36F97B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Dec 9, 2016, at 06:51, Bartek Rutkowski wrote: >=20 > Author: robak (ports committer) > Date: Fri Dec 9 14:51:05 2016 > New Revision: 309735 > URL: https://svnweb.freebsd.org/changeset/base/309735 >=20 > Log: > Capsicum support for dd(1) >=20 > Adds Capsicum sandboxing to dd utility. >=20 > Submitted by: Pawel Biernacki > Reviewed by: allanjude, emaste, oshogbo > Approved by: oshogbo > Sponsored by: Mysterious Code Ltd. > Differential Revision: https://reviews.freebsd.org/D8543 >=20 > Modified: > head/bin/dd/dd.c This change broke some of the tests: $ sudo kyua test ... bin/dd/dd_test:length -> failed: Expected 512 bytes of output, got 0: = dd if=3D/dev/zero of=3D/dev/fd/5 count=3D1 5>&1 >&- 2>/dev/null = [0.031s] $ svn merge -c -309735 . --- Reverse-merging r309735 into '.': U bin/dd/dd.c --- Recording mergeinfo for reverse merge of r309735 into '.': U . $ (cd bin/dd/; make -s obj all; sudo make -s install; cd tests/; make -s = check) =3D=3D=3D> tests (obj) =3D=3D=3D> tests (all) =3D=3D=3D> tests (install) dd_test:io -> passed [0.083s] dd_test:length -> passed [0.032s] dd_test:seek -> passed [0.060s] Results file id is usr_tests_bin_dd.20161210-082907-733272 Results saved to = /home/ngie/.kyua/store/results.usr_tests_bin_dd.20161210-082907-733272.db 3/3 passed (0 failed) $ --Apple-Mail=_F752FAE6-7909-41D8-B436-A01F9E36F97B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYS70IAAoJEPWDqSZpMIYVGjsP+wdbmaCZ0VkljiGtDcV3Ocy+ ZDtZE5poWi8z+1mM7YHHvFo3T8jK/WmLn23NSvtuUjLVKp3bZ8dAAsyGohdcGhle +rhJPhK2slc1x3DMlLoVFf0gD44RbP2MWOxiIe6ld8FXVq7xseDcbzrDlRcdpkvR 9zc1vuGDR5dApbmZTk4Y5PduobQi64myCV8+EffRHFgcbSQxa57sc0MBVq7sHW71 5q2ZIMWHBN8/QcuiQtucxAxturcUYK1rAx38SOSpla7iJ+W+cGJ7se6StqtE2QXK TBTG5W4ZwNLbMSeTBxKyLMReju64U2k4is0vDtovAesnUA4SYQ+esKbVZKvKRsjH Cg9EDM3pbtA8fxuC6RIn+KvyADbgTxBnc819GE6Nzy7uFcBNXKyToSpk+MH8dHcS pSLAeLg4GvbUv32Z13u79QPnSTYzcOPCQAHoA6ZCTUTyqZdkqRL09RizeWV78zAs nK6f3yFU/CL1RHA7HA3Xc8QQ0ZMOZSyj5ojdjazwOu+2hrMOaUtcliwysHjTbLSM M3o+nZNxaxWv3UFAU5GLb+OgPXAaQQp7cQ+dh5/wlkrHROf3omqOM6xy9AMWP01l +TuNXS/12NUidm3J3z8TFZlKJdI/jWgTcVkYJX5PTVDz7GUpxVmyrPvIgxAvYtGc givHLWxSU+mGXSciIBvZ =NJmd -----END PGP SIGNATURE----- --Apple-Mail=_F752FAE6-7909-41D8-B436-A01F9E36F97B-- From owner-svn-src-head@freebsd.org Sat Dec 10 09:10:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D804C702BF; Sat, 10 Dec 2016 09:10:49 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4D6A192D; Sat, 10 Dec 2016 09:10:49 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBA9AmQL058333; Sat, 10 Dec 2016 09:10:48 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBA9AmSJ058332; Sat, 10 Dec 2016 09:10:48 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201612100910.uBA9AmSJ058332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sat, 10 Dec 2016 09:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309790 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 09:10:49 -0000 Author: phk Date: Sat Dec 10 09:10:48 2016 New Revision: 309790 URL: https://svnweb.freebsd.org/changeset/base/309790 Log: Add Genesys Logic USB hub. Make two other USB hub descriptions more precise. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Dec 10 06:27:45 2016 (r309789) +++ head/sys/dev/usb/usbdevs Sat Dec 10 09:10:48 2016 (r309790) @@ -1240,7 +1240,7 @@ product ATHEROS2 AR9170 0x9170 AR9170 /* Atmel Comp. products */ product ATMEL STK541 0x2109 Zigbee Controller -product ATMEL UHB124 0x3301 UHB124 hub +product ATMEL UHB124 0x3301 AT43301 USB 1.1 Hub product ATMEL DWL120 0x7603 DWL-120 Wireless Adapter product ATMEL BW002 0x7605 BW002 Wireless Adapter product ATMEL WL1130USB 0x7613 WL-1130 USB @@ -2174,7 +2174,8 @@ product GENERALINSTMNTS SB5100 0x5100 SU /* Genesys Logic products */ product GENESYS GL620USB 0x0501 GL620USB Host-Host interface product GENESYS GL650 0x0604 GL650 HUB -product GENESYS GL606 0x0606 USB 2.0 HUB +product GENESYS GL606 0x0606 GL606 USB 2.0 HUB +product GENESYS GL850G 0x0608 GL850G USB 2.0 HUB product GENESYS GL641USB 0x0700 GL641USB CompactFlash Card Reader product GENESYS GL641USB2IDE_2 0x0701 GL641USB USB-IDE Bridge No 2 product GENESYS GL641USB2IDE 0x0702 GL641USB USB-IDE Bridge From owner-svn-src-head@freebsd.org Sat Dec 10 10:00:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFFF3C7015F; Sat, 10 Dec 2016 10:00:28 +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 BD4A51E11; Sat, 10 Dec 2016 10:00:28 +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 uBAA0RJ3077850; Sat, 10 Dec 2016 10:00:27 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAA0RmE077849; Sat, 10 Dec 2016 10:00:27 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201612101000.uBAA0RmE077849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 10 Dec 2016 10:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309791 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 10:00:29 -0000 Author: gnn Date: Sat Dec 10 10:00:27 2016 New Revision: 309791 URL: https://svnweb.freebsd.org/changeset/base/309791 Log: This adds a configuration for arm64 users that track CURRENT but don't need the extra debug facilities. Copied from the amd64 configuration of the same name. Submitted by: Nikolai Lifanov Reviewed by: emaste MFC after: 2 weeks Added: head/sys/arm64/conf/GENERIC-NODEBUG - copied, changed from r309790, head/sys/amd64/conf/GENERIC-NODEBUG Copied and modified: head/sys/arm64/conf/GENERIC-NODEBUG (from r309790, head/sys/amd64/conf/GENERIC-NODEBUG) ============================================================================== --- head/sys/amd64/conf/GENERIC-NODEBUG Sat Dec 10 09:10:48 2016 (r309790, copy source) +++ head/sys/arm64/conf/GENERIC-NODEBUG Sat Dec 10 10:00:27 2016 (r309791) @@ -1,6 +1,6 @@ # # GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file -# for FreeBSD/amd64 +# for FreeBSD/arm64 # # This configuration file removes several debugging options, including # WITNESS and INVARIANTS checking, which are known to have significant From owner-svn-src-head@freebsd.org Sat Dec 10 10:12:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77251C70533; Sat, 10 Dec 2016 10:12:06 +0000 (UTC) (envelope-from kostik@kib.kiev.ua) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 E5EEA8D1; Sat, 10 Dec 2016 10:12:05 +0000 (UTC) (envelope-from kostik@kib.kiev.ua) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBAABseQ004130 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 10 Dec 2016 12:11:54 +0200 (EET) (envelope-from kostik@tom.home) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBAABseQ004130 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBAABsJ3004129; Sat, 10 Dec 2016 12:11:54 +0200 (EET) (envelope-from kostik) From: Konstantin Belousov Date: Sat, 10 Dec 2016 12:11:54 +0200 To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, emaste@freebsd.org Subject: Re: svn commit: r308212 - in head/sys: fs/nfsserver kern sys Message-ID: <20161210101154.GM54029@kib.kiev.ua> References: <201611021243.uA2ChGIg003295@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: jrom: Konstantin Belousov User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 10:12:06 -0000 On Fri, Dec 09, 2016 at 12:13:09PM -0800, Conrad Meyer wrote: > On Wed, Nov 2, 2016 at 5:43 AM, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Nov 2 12:43:15 2016 > > New Revision: 308212 > > URL: https://svnweb.freebsd.org/changeset/base/308212 > > > > Log: > > Allow some dotdot lookups in capability mode. > > > > If dotdot lookup does not escape from the file descriptor passed as > > the lookup root, we can allow the component traversal. Track the > > directories traversed, and check the result of dotdot lookup against > > the recorded list of the directory vnodes. > > > > Dotdot lookups are enabled by sysctl vfs.lookup_cap_dotdot, currently > > disabled by default until more verification of the approach is done. > > Hi Konstantin, > > Are we waiting on a specific reviewer or something else? It would be > very nice to have this enabled by default. I did waited for some review, but it obviously not going to happen. Please push the button for D8746, and I will commit the change. From owner-svn-src-head@freebsd.org Sat Dec 10 10:35:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3D24C70BBD; Sat, 10 Dec 2016 10:35:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 1B41412E2; Sat, 10 Dec 2016 10:35:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBAAZBPo084230 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 10 Dec 2016 12:35:11 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBAAZBPo084230 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBAAZBwG084228; Sat, 10 Dec 2016 12:35:11 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 10 Dec 2016 12:35:11 +0200 From: Konstantin Belousov To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309774 - head/contrib/netbsd-tests/fs/tmpfs Message-ID: <20161210103511.GO54029@kib.kiev.ua> References: <201612092250.uB9MohnP008576@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612092250.uB9MohnP008576@repo.freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 10:35:21 -0000 On Fri, Dec 09, 2016 at 10:50:43PM +0000, Ngie Cooper wrote: > Author: ngie > Date: Fri Dec 9 22:50:43 2016 > New Revision: 309774 > URL: https://svnweb.freebsd.org/changeset/base/309774 > > Log: > Only run mdconfig -d -u 3 if /dev/md3 exists on the system > > This will prevent "cleanup failures" (exit code != 0 returned) when > tmpfs is not loaded > > MFC after: 1 week > > Modified: > head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh > > Modified: head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh > ============================================================================== > --- head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Fri Dec 9 22:13:00 2016 (r309773) > +++ head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Fri Dec 9 22:50:43 2016 (r309774) > @@ -85,7 +85,7 @@ basic_cleanup() { > umount mnt 2>/dev/null 1>&2 > # Begin FreeBSD > if true; then > - atf_check -s eq:0 -o empty -e empty mdconfig -d -u 3 > + [ ! -c /dev/md3 ] || mdconfig -d -u 3 > else > # End FreeBSD > vndconfig -u /dev/vnd3 2>/dev/null 1>&2 Why this test is under fs/tmpfs ? I was not able to see how tmpfs is used for this test. From owner-svn-src-head@freebsd.org Sat Dec 10 11:41:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9B1DC70C26; Sat, 10 Dec 2016 11:41:27 +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 A269C1FFB; Sat, 10 Dec 2016 11:41:27 +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 uBABfQWP018992; Sat, 10 Dec 2016 11:41:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBABfQbV018991; Sat, 10 Dec 2016 11:41:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101141.uBABfQbV018991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 11:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309795 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 11:41:28 -0000 Author: bapt Date: Sat Dec 10 11:41:26 2016 New Revision: 309795 URL: https://svnweb.freebsd.org/changeset/base/309795 Log: Update pci ids database to 2016.11.21 MFC after: 2 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Sat Dec 10 11:38:29 2016 (r309794) +++ head/share/misc/pci_vendors Sat Dec 10 11:41:26 2016 (r309795) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2016.10.20 -# Date: 2016-10-20 03:15:02 +# Version: 2016.11.21 +# Date: 2016-11-21 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -50,9 +50,11 @@ 021b Compaq Computer Corporation 8139 HNE-300 (RealTek RTL8139c) [iPaq Networking] 0270 Hauppauge computer works Inc. (Wrong ID) +0291 Davicom Semiconductor, Inc. (Wrong ID) # SpeedStream is Efficient Networks, Inc, a Siemens Company 02ac SpeedStream 1012 1012 PCMCIA 10/100 Ethernet Card [RTL81xx] +02e0 XFX Pine Group Inc. (Wrong ID) 0303 Hewlett-Packard Company (Wrong ID) 0308 ZyXEL Communications Corporation (Wrong ID) 0315 SK-Electronics Co., Ltd. @@ -548,12 +550,12 @@ 1028 1fd3 HBA330 MMZ 00ab SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00ac SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) - 1d49 0201 ThinkSystem 9400-16i PCIe 12Gb HBA - 1d49 0203 ThinkSystem 9400-16e PCIe 12Gb HBA + 1d49 0201 ThinkSystem 430-16i SAS/SATA 12Gb HBA + 1d49 0203 ThinkSystem 430-16e SAS/SATA 12Gb HBA 00ae SAS3508 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00af SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) - 1d49 0200 ThinkSystem 9400-8i PCIe 12Gb HBA - 1d49 0202 ThinkSystem 9400-8e PCIe 12Gb HBA + 1d49 0200 ThinkSystem 430-8i SAS/SATA 12Gb HBA + 1d49 0202 ThinkSystem 430-8e SAS/SATA 12Gb HBA 00be SAS3504 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00bf SAS3404 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 00c0 SAS3324 PCI-Express Fusion-MPT SAS-3 @@ -7531,7 +7533,7 @@ 1885 0700 Tsunami FPGA PMC with Altera Stratix S40 1885 0701 Tsunami FPGA PMC with Altera Stratix S30 9733 PEX 9733 33-lane, 9-port PCI Express Gen 3 (8.0 GT/s) Switch - 1d49 0001 ThinkSystem P310W-4P NVMe Switch Card + 1d49 0001 ThinkSystem 1610-4P NVMe Switch Adapter 9749 PEX 9749 49-lane, 13-port PCI Express Gen 3 (8.0 GT/s) Switch a100 Blackmagic Design DeckLink bb04 B&B 3PCIOSD1A Isolated PCI Serial @@ -8377,6 +8379,7 @@ 1048 0c45 GLoria II 1048 0c4a GLoria II-64 Pro 1048 0c4b GLoria II-64 Pro DVII + 10a9 9002 VPro VR3 0110 NV11 [GeForce2 MX/MX 400] 1043 4015 AGP-V7100 Pro 1043 4021 V7100 Deluxe Combo @@ -10649,6 +10652,7 @@ 1b00 GP102 [TITAN X] 1b01 GP102 1b30 GP102GL [Quadro P6000] + 1b38 GP102GL [Tesla P40] 1b70 GP102GL 1b78 GP102GL 1b80 GP104 [GeForce GTX 1080] @@ -10668,10 +10672,11 @@ 1c03 GP106 [GeForce GTX 1060 6GB] 1c20 GP106M [GeForce GTX 1060] 1c30 GP106GL + 1c35 GP106 1c60 GP106M [GeForce GTX 1060] 1c70 GP106GL 1c80 GP107 - 1c81 GP107 + 1c81 GP107 [GeForce GTX 1050] 1c82 GP107 [GeForce GTX 1050 Ti] 1ca7 GP107GL 1ca8 GP107GL @@ -13729,6 +13734,7 @@ 7375 PM7375 [LASAR-155 ATM SAR] 7384 PM7384 [FREEDM - 84P672 Frm Engine & Datalink Mgr] 8000 PM8000 [SPC - SAS Protocol Controller] + 8009 PM8009 SPCve 8x6G 8032 ATTO Celerity FC8xEN 117c 003b Celerity FC-82EN Fibre Channel Adapter 117c 003c Celerity FC-84EN Fibre Channel Adapter @@ -13742,6 +13748,8 @@ 8071 PM8071 Tachyon SPCve 12G eight-port SAS/SATA controller 8072 PM8072 Tachyon SPCv 12G 16-port SAS/SATA controller 8073 PM8073 Tachyon SPCve 12G 16-port SAS/SATA controller + 8531 PM8531 PFX 24xG3 Fanout PCIe Switches + 8546 PM8546 B-FEIP PSX 96xG3 PCIe Storage Switch 11f9 I-Cube Inc 11fa Kasan Electronics Company, Ltd. 11fb Datel Inc @@ -16213,6 +16221,71 @@ 589a T520-509A Unified Wire Ethernet Controller [VF] 589b T540-509B Unified Wire Ethernet Controller [VF] 589c T520-509C Unified Wire Ethernet Controller [VF] + 6001 T6225-CR Unified Wire Ethernet Controller + 6002 T6225-SO-CR Unified Wire Ethernet Controller + 6003 T6425-CR Unified Wire Ethernet Controller + 6004 T6425-SO-CR Unified Wire Ethernet Controller + 6005 T6225-OCP-SO Unified Wire Ethernet Controller + 6006 T62100-OCP-SO Unified Wire Ethernet Controller + 6007 T62100-LP-CR Unified Wire Ethernet Controller + 6008 T62100-SO-CR Unified Wire Ethernet Controller + 6009 T6210-BT Unified Wire Ethernet Controller + 600d T62100-CR Unified Wire Ethernet Controller + 6011 T6225-LL-CR Unified Wire Ethernet Controller + 6014 T61100-OCP-SO Unified Wire Ethernet Controller + 6015 T6201-BT Unified Wire Ethernet Controller + 6401 T6225-CR Unified Wire Ethernet Controller + 6402 T6225-SO-CR Unified Wire Ethernet Controller + 6403 T6425-CR Unified Wire Ethernet Controller + 6404 T6425-SO-CR Unified Wire Ethernet Controller + 6405 T6225-OCP-SO Unified Wire Ethernet Controller + 6406 T62100-OCP-SO Unified Wire Ethernet Controller + 6407 T62100-LP-CR Unified Wire Ethernet Controller + 6408 T62100-SO-CR Unified Wire Ethernet Controller + 6409 T6210-BT Unified Wire Ethernet Controller + 640d T62100-CR Unified Wire Ethernet Controller + 6411 T6225-LL-CR Unified Wire Ethernet Controller + 6414 T61100-OCP-SO Unified Wire Ethernet Controller + 6415 T6201-BT Unified Wire Ethernet Controller + 6501 T6225-CR Unified Wire Storage Controller + 6502 T6225-SO-CR Unified Wire Storage Controller + 6503 T6425-CR Unified Wire Storage Controller + 6504 T6425-SO-CR Unified Wire Storage Controller + 6505 T6225-OCP-SO Unified Wire Storage Controller + 6506 T62100-OCP-SO Unified Wire Storage Controller + 6507 T62100-LP-CR Unified Wire Storage Controller + 6508 T62100-SO-CR Unified Wire Storage Controller + 6509 T6210-BT Unified Wire Storage Controller + 650d T62100-CR Unified Wire Storage Controller + 6511 T6225-LL-CR Unified Wire Storage Controller + 6514 T61100-OCP-SO Unified Wire Storage Controller + 6515 T6201-BT Unified Wire Storage Controller + 6601 T6225-CR Unified Wire Storage Controller + 6602 T6225-SO-CR Unified Wire Storage Controller + 6603 T6425-CR Unified Wire Storage Controller + 6604 T6425-SO-CR Unified Wire Storage Controller + 6605 T6225-OCP-SO Unified Wire Storage Controller + 6606 T62100-OCP-SO Unified Wire Storage Controller + 6607 T62100-LP-CR Unified Wire Storage Controller + 6608 T62100-SO-CR Unified Wire Storage Controller + 6609 T6210-BT Unified Wire Storage Controller + 660d T62100-CR Unified Wire Storage Controller + 6611 T6225-LL-CR Unified Wire Storage Controller + 6614 T61100-OCP-SO Unified Wire Storage Controller + 6615 T6201-BT Unified Wire Storage Controller + 6801 T6225-CR Unified Wire Ethernet Controller [VF] + 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] + 6803 T6425-CR Unified Wire Ethernet Controller [VF] + 6804 T6425-SO-CR Unified Wire Ethernet Controller [VF] + 6805 T6225-OCP-SO Unified Wire Ethernet Controller [VF] + 6806 T62100-OCP-SO Unified Wire Ethernet Controller [VF] + 6807 T62100-LP-CR Unified Wire Ethernet Controller [VF] + 6808 T62100-SO-CR Unified Wire Ethernet Controller [VF] + 6809 T6210-BT Unified Wire Ethernet Controller [VF] + 680d T62100-CR Unified Wire Ethernet Controller [VF] + 6811 T6225-LL-CR Unified Wire Ethernet Controller [VF] + 6814 T61100-OCP-SO Unified Wire Ethernet Controller [VF] + 6815 T6201-BT Unified Wire Ethernet Controller [VF] a000 PE10K Unified Wire Ethernet Controller 1426 Storage Technology Corp. 1427 Better On-Line Solutions @@ -16923,6 +16996,7 @@ 16bc BCM57765/57785 SDXC/MMC Card Reader 16be BCM57765/57785 MS Card Reader 16bf BCM57765/57785 xD-Picture Card Reader + 16c1 NetXtreme-E RDMA Virtual Function 16c6 NetXtreme BCM5702A3 Gigabit Ethernet 10b7 1100 3C1000B-T 10/100/1000 PCI 14e4 000c BCM5702 1000Base-T @@ -16969,7 +17043,9 @@ 16e8 BCM57406 NetXtreme-E Ethernet Partition 16e9 BCM57407 NetXtreme-E 25Gb Ethernet Controller 16ec BCM57414 NetXtreme-E Ethernet Partition + 16ed BCM57414 NetXtreme-E RDMA Partition 16ee BCM57416 NetXtreme-E Ethernet Partition + 16ef BCM57416 NetXtreme-E RDMA Partition 16f3 NetXtreme BCM5727 Gigabit Ethernet PCIe 16f7 NetXtreme BCM5753 Gigabit Ethernet PCI Express 16fd NetXtreme BCM5753M Gigabit Ethernet PCI Express @@ -17896,6 +17972,7 @@ 0209 MT27700 Family [ConnectX-4 Flash Recovery] 020b MT27710 Family [ConnectX-4 Lx Flash Recovery] 020d MT28800 Family [ConnectX-5 Flash Recovery] + 020f MT28908A0 Family [ConnectX-6 Flash Recovery] # reserved for RM#105916 024e MT53100 [Spectrum-2, Flash recovery mode] # Actual value to be used @@ -17913,6 +17990,7 @@ 1005 MT27510 Family 1006 MT27511 Family 1007 MT27520 Family [ConnectX-3 Pro] + 1014 04eb 2-Port 10GbE NIC and RoCE SR PCIe3 103c 22f3 InfiniBand FDR/Ethernet 10Gb/40Gb 2-port 544+QSFP Adapter 103c 22f4 InfiniBand FDR/Ethernet 10Gb/40Gb 2-port 544+FLR-QSFP Adapter 103c 801f Ethernet 10G 2-port 546SFP+ Adapter @@ -17938,8 +18016,8 @@ 1018 MT27800 Family [ConnectX-5 Virtual Function] 1019 MT28800 Family [ConnectX-5 Ex] 101a MT28800 Family [ConnectX-5 Ex Virtual Function] - 101b MT28831 - 101c MT28840 + 101b MT28908 Family [ConnectX-6] + 101c MT28908 Family [ConnectX-6 Virtual Function] 101d MT28841 101e MT28850 101f MT28851 @@ -17969,6 +18047,7 @@ 103c 1781 NC543i 1-port 4x QDR IB/Flex-10 10Gb Adapter 103c 3349 NC543i 2-port 4xQDR IB/10Gb Adapter 6750 MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s] + 1014 0461 2-Port 10 GbE RoCE SR LP PCIe2 (rev b0) 15b3 0018 HP 10 GbE PCI-e G2 Dual-Port NIC (rev C1) 675a MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe Gen2 5GT/s] 6764 MT26468 [ConnectX EN 10GigE, PCIe 2.0 5GT/s Virtualization+] @@ -17981,8 +18060,8 @@ 7121 NPS-600 configuration and management interface 7122 NPS-600 network interface PF 7123 NPS-600 network interface VF - a2d0 MT416842 - a2d1 MT416842 + a2d0 MT416842 BlueField SoC Crypto enabled + a2d1 MT416842 BlueField SoC Crypto disabled a2d3 MT416842 BlueField multicore SoC family VF # SwitchX-2, 40GbE switch c738 MT51136 @@ -19231,7 +19310,7 @@ 18bc GeCube Technologies, Inc. 18c3 Micronas Semiconductor Holding AG 0720 nGene PCI-Express Multimedia Controller - 07ca 032e Hybrid M779 PCI-E + 1461 032e Hybrid M779 PCI-E # Nee Octigabay System 18c8 Cray Inc 18c9 ARVOO Engineering BV @@ -19330,6 +19409,8 @@ 0155 NT100E3-1-PTP Network Adapter 1x100Gb 0165 NT80E3-2-PTP Network Adapter 2x40Gb 0175 NT20E3-2-PTP Network Adapter 2x10Gb + 0185 NT40A01-4x1 Network Adapter 4x1Gb + 01a5 NT200A01 Network Adapter 2x100Gb 18f6 NextIO 1000 [Nexsis] Switch Virtual P2P PCIe Bridge 1001 [Texsis] Switch Virtual P2P PCIe Bridge @@ -19763,6 +19844,7 @@ 0714 OneConnect 10Gb FCoE Initiator (be3) 103c 3315 NC553i 10Gb 2-port FlexFabric Converged Network Adapter 103c 337b NC554FLB 10Gb 2-port FlexFabric Converged Network Adapter + 0800 ServerView iRMC HTI 19a8 DAQDATA GmbH 19ac Kasten Chase Applied Research 0001 ACA2400 Crypto Accelerator @@ -20121,7 +20203,9 @@ 1bb1 6523 Nytro XP6500-8A4096 0100 Nytro Flash Storage 1bb1 0101 Nytro XF1440 + 1bb1 0103 Nytro 5000 1bb1 0121 Nytro XM1440 + 1bb1 0123 Nytro 5000 1bb1 01a1 Nytro XP7102 1bb3 Bluecherry 4304 BC-04120A MPEG4 4 port video encoder / decoder @@ -20179,7 +20263,9 @@ 00a5 FBC2XLG Capture 2x40Gb 00a6 FBC1CG Capture 1x100Gb 00a9 FBC2XGHH Capture 2x10Gb + 00ad FBC2CGG3HL Capture 2x200Gb 00af Capture slave device + a001 FBC2CGG3 Capture 2x200Gb # Used on V120 VME Crate Controller 1c32 Highland Technology, Inc. 1c33 Daktronics, Inc @@ -20259,10 +20345,15 @@ 100b K35-2SFP 100c K35-4SFP 100d AR-ARKA-FX0 [Arkville 32B DPDK Data Mover] + 1d6c 2001 DPDK-Aware Virtual Function [Arkville VF] 100e AR-ARKA-FX1 [Arkville 64B DPDK Data Mover] + 1d6c 2001 DPDK-Aware Virtual Function [Arkville VF] 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d78 DERA +1d7c Aerotech, Inc. 1d8f Enyx +1d95 Graphcore Ltd +1da1 Teko Telecom S.r.l. 1de1 Tekram Technology Co.,Ltd. 0391 TRM-S1040 [DC-315 / DC-395 series] 2020 DC-390 @@ -20346,6 +20437,7 @@ 2bd8 ROPEX Industrie-Elektronik GmbH 3000 Hansol Electronics Inc. 3112 Satelco Ingenieria S.A. +3130 AUDIOTRAK 3142 Post Impression Systems. 31ab Zonet 1faa ZEW1602 802.11b/g Wireless Adapter @@ -22681,6 +22773,8 @@ 8086 5004 Ethernet 10G 2P X540-t Adapter 1529 82599 10 Gigabit Dual Port Network Connection with FCoE 152a 82599 10 Gigabit Dual Port Backplane Connection with FCoE + 152e 82599 Virtual Function + 1530 X540 Virtual Function 1533 I210 Gigabit Network Connection 103c 0003 Ethernet I210-T1 GbE NIC 1093 7706 Compact Vision System Ethernet Adapter @@ -22736,6 +22830,7 @@ 8086 0001 Ethernet Converged Network Adapter X550-T2 8086 001a Ethernet Converged Network Adapter X550-T2 8086 0022 Ethernet Converged Network Adapter X550-T2 + 1564 X550 Virtual Function 1565 X550 Virtual Function 1566 DSL4410 Thunderbolt NHI [Redwood Ridge 2C 2013] 1567 DSL4410 Thunderbolt Bridge [Redwood Ridge 2C 2013] @@ -22755,10 +22850,12 @@ 103c 0000 Ethernet 10Gb 562SFP+ Adapter 103c 22fc HP Ethernet 10Gb 2-port 562FLR-SFP+ Adapter 103c 22fd HP Ethernet 10Gb 2-port 562SFP+ Adapter - 1137 0000 Ethernet Converged NIC X710-4 - 1137 013b Ethernet Converged NIC X710-4 - 1590 0000 Ethernet 10GbE 4P 563SFP+ Adapter + 1137 0000 Ethernet Converged NIC X710-DA + 1137 013b Ethernet Converged NIC X710-DA4 + 1137 020a Ethernet Converged NIC X710-DA2 + 1590 0000 Ethernet Controller X710 for 10GbE SFP+ 1590 0225 Ethernet 10GbE 4P 563SFP+ Adapter + 1590 022f Ethernet 10Gb 2-port 564i Communication Board 17aa 0000 ThinkServer X710 AnyFabric for 10GbE SFP+ 17aa 4001 ThinkServer X710-4 AnyFabric for 10GbE SFP+ 17aa 4002 ThinkServer X710-2 AnyFabric for 10GbE SFP+ @@ -22775,7 +22872,7 @@ 8086 000b Ethernet Server Adapter X710-DA2 for OCP 8086 000d Ethernet Controller X710 for 10GbE SFP+ 8086 0010 Ethernet Converged Network Adapter X710 - 8086 4005 Ethernet Controller XL710 for 10 Gigabit SFP+ + 8086 4005 Ethernet Controller X710 for 10GbE SFP+ 8086 4006 Ethernet Controller X710 for 10GbE SFP+ 1575 DSL6340 Thunderbolt 3 NHI [Alpine Ridge 2C 2015] 1576 DSL6340 Thunderbolt 3 Bridge [Alpine Ridge 2C 2015] @@ -22847,12 +22944,14 @@ 15a4 Ethernet Switch FM10000 Host Interface 15a5 Ethernet Switch FM10000 Host Virtual Interface 15a8 Ethernet Connection X552 Virtual Function + 15a9 X552 Virtual Function 15aa Ethernet Connection X552 10 GbE Backplane 1059 0120 T4008 10GbE interface 15ab Ethernet Connection X552 10 GbE Backplane 15ac Ethernet Connection X552 10 GbE SFP+ 15ad Ethernet Connection X552/X557-AT 10GBASE-T 15ae Ethernet Connection X552 1000BASE-T + 15b4 X553 Virtual Function 15b5 DSL6340 USB 3.1 Controller [Alpine Ridge] 15b6 DSL6540 USB 3.1 Controller [Alpine Ridge] 15b7 Ethernet Connection (2) I219-LM @@ -22860,6 +22959,7 @@ 15b9 Ethernet Connection (3) I219-LM 15bf JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] 15c0 JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] + 15c5 X553 Virtual Function 15d0 Ethernet SDI Adapter FM10420-100GbE-QDA2 15d1 Ethernet Controller 10G X550T 8086 0002 Ethernet Converged Network Adapter X550-T1 @@ -22974,7 +23074,30 @@ e4bf 3100 CX1-BAND 1962 80960RM (i960RM) Microprocessor 105a 0000 SuperTrak SX6000 I2O CPU + 19ac DNV SMBus Contoller - Host + 19b0 DNV SATA Controller 0 + 19b1 DNV SATA Controller 0 + 19b2 DNV SATA Controller 0 + 19b3 DNV SATA Controller 0 + 19b4 DNV SATA Controller 0 + 19b5 DNV SATA Controller 0 + 19b6 DNV SATA Controller 0 + 19b7 DNV SATA Controller 0 + 19be DNV SATA Controller 0 + 19bf DNV SATA Controller 0 + 19c0 DNV SATA Controller 1 + 19c1 DNV SATA Controller 1 + 19c2 DNV SATA Controller 1 + 19c3 DNV SATA Controller 1 + 19c4 DNV SATA Controller 1 + 19c5 DNV SATA Controller 1 + 19c6 DNV SATA Controller 1 + 19c7 DNV SATA Controller 1 + 19ce DNV SATA Controller 1 + 19cf DNV SATA Controller 1 + 19dc DNV LPC or eSPI 19df DNV SMBus controller + 19e0 DNV SPI Controller 1a21 82840 840 [Carmel] Chipset Host Bridge (Hub A) 1a23 82840 840 [Carmel] Chipset AGP Bridge 1a24 82840 840 [Carmel] Chipset PCI Bridge (Hub B) @@ -25845,6 +25968,9 @@ 2f09 Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 2f0a Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 2f0b Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 + 2f0d Haswell Xeon Non-Transparent Bridge (Back-to-back) + 2f0e Haswell Xeon Non-Transparent Bridge (Primary Side) + 2f0f Haswell Xeon Non-Transparent Bridge (Secondary Side) 2f10 Xeon E7 v3/Xeon E5 v3/Core i7 IIO Debug 2f11 Xeon E7 v3/Xeon E5 v3/Core i7 IIO Debug 2f12 Xeon E7 v3/Xeon E5 v3/Core i7 IIO Debug @@ -26272,19 +26398,22 @@ 17aa 4023 Intel Ethernet Connection X722 for 10GbE backplane 37cf Ethernet Connection X722 for 10GbE QSFP+ 37d0 Ethernet Connection X722 for 10GbE SFP+ + 17aa 4020 Intel Ethernet Connection X722 for 10G SFP+ + 17aa 4021 Intel Ethernet Connection X722 for 10G SFP+ + 17aa 4022 Ethernet Connection X722 for 10GbE SFP+ 37d1 Ethernet Connection X722 for 1GbE + 1590 0216 Ethernet 1Gb 2-port 368i Adapter + 1590 0217 Ethernet 1Gb 2-port 368FLR-MMT Adapter 17aa 4020 Intel Ethernet Connection X722 for 1GbE 17aa 4021 Intel Ethernet Connection X722 for 1GbE 17aa 4022 Intel Ethernet Connection X722 for 1GbE - 8086 4020 Ethernet Connection X722 for 1GbE - 8086 4021 Ethernet Connection X722 for 1GbE - 8086 4022 Ethernet Connection X722 for 1GbE 37d2 Ethernet Connection X722 for 10GBASE-T + 1590 0218 Ethernet 10Gb 2-port 568FLR-MMT Adapter 17aa 4020 Intel Ethernet Connection X722 for 10GBASE 17aa 4021 Intel Ethernet Connection X722 for 10GBASE - 8086 4020 Ethernet Connection X722 for 10GBASE - 8086 4021 Ethernet Connection X722 for 10GBASE + 17aa 4022 Ethernet Connection X722 for 10GBASE-T 37d3 Ethernet Connection X722 for 10GbE SFP+ + 1590 0219 Ethernet 10Gb 2-port 568FLR-MMSFP+ Adapter 37d4 Ethernet Connection X722 for 10GbE QSFP+ 37d9 X722 Hyper-V Virtual Function 3a00 82801JD/DO (ICH10 Family) 4-port SATA IDE Controller @@ -27641,6 +27770,7 @@ a16a Sunrise Point-H PCI Root Port #20 a170 Sunrise Point-H HD Audio a182 Lewisburg SATA Controller [AHCI mode] + a186 Lewisburg SATA Controller [RAID mode] a190 Lewisburg PCI Express Root Port #1 a191 Lewisburg PCI Express Root Port #2 a192 Lewisburg PCI Express Root Port #3 @@ -27676,6 +27806,7 @@ a1c6 Lewisburg LPC Controller a1c7 Lewisburg LPC Controller a1d2 Lewisburg SSATA Controller [AHCI mode] + a1d6 Lewisburg SSATA Controller [RAID mode] a1e7 Lewisburg PCI Express Root Port #17 a1e8 Lewisburg PCI Express Root Port #18 a1e9 Lewisburg PCI Express Root Port #19 @@ -27687,6 +27818,14 @@ a1fa Lewisburg IE: IDE-r a1fb Lewisburg IE: KT Controller a1fc Lewisburg IE: HECI #3 + a202 Lewisburg SATA Controller [AHCI mode] + a206 Lewisburg SATA Controller [RAID mode] + a223 Lewisburg SMBus + a224 Lewisburg SPI Controller + a242 Lewisburg LPC or eSPI Controller + a243 Lewisburg LPC or eSPI Controller + a252 Lewisburg SSATA Controller [AHCI mode] + a256 Lewisburg SSATA Controller [RAID mode] a620 6400/6402 Advanced Memory Buffer (AMB) abc0 Omni-Path Fabric Switch Silicon 100 Series b152 21152 PCI-to-PCI Bridge From owner-svn-src-head@freebsd.org Sat Dec 10 12:02:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32B2C70DAF; Sat, 10 Dec 2016 12:02:33 +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 9B7701011; Sat, 10 Dec 2016 12:02:33 +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 uBAC2Wis029791; Sat, 10 Dec 2016 12:02:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAC2WIn029789; Sat, 10 Dec 2016 12:02:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101202.uBAC2WIn029789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 12:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309796 - in head/contrib/groff: contrib/mm src/utils/afmtodit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 12:02:33 -0000 Author: bapt Date: Sat Dec 10 12:02:32 2016 New Revision: 309796 URL: https://svnweb.freebsd.org/changeset/base/309796 Log: Perl is not available in base fix scripts depending on it to use the version from ports PR: 215159 Reported by: Anatoly Kamchatnov MFC after: 2 days Modified: head/contrib/groff/contrib/mm/mmroff.pl head/contrib/groff/src/utils/afmtodit/afmtodit.pl Modified: head/contrib/groff/contrib/mm/mmroff.pl ============================================================================== --- head/contrib/groff/contrib/mm/mmroff.pl Sat Dec 10 11:41:26 2016 (r309795) +++ head/contrib/groff/contrib/mm/mmroff.pl Sat Dec 10 12:02:32 2016 (r309796) @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl use strict; # runs groff in safe mode, that seems to be the default Modified: head/contrib/groff/src/utils/afmtodit/afmtodit.pl ============================================================================== --- head/contrib/groff/src/utils/afmtodit/afmtodit.pl Sat Dec 10 11:41:26 2016 (r309795) +++ head/contrib/groff/src/utils/afmtodit/afmtodit.pl Sat Dec 10 12:02:32 2016 (r309796) @@ -1,4 +1,4 @@ -#! /usr/bin/perl -w +#! /usr/bin/env perl -w # -*- Perl -*- # Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. From owner-svn-src-head@freebsd.org Sat Dec 10 12:14:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00CE4C6E11A; Sat, 10 Dec 2016 12:14: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 C4BDB15BD; Sat, 10 Dec 2016 12:14:42 +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 uBACEfG1034218; Sat, 10 Dec 2016 12:14:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBACEfSJ034217; Sat, 10 Dec 2016 12:14:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101214.uBACEfSJ034217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 12:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309797 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 12:14:43 -0000 Author: bapt Date: Sat Dec 10 12:14:41 2016 New Revision: 309797 URL: https://svnweb.freebsd.org/changeset/base/309797 Log: Add entries to remove timed files with make delete-old if WITHOUT_TIMED is set PR: 213724 Submitted by: philippe.michel7@sfr.fr MFC after: 2 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:02:32 2016 (r309796) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:14:41 2016 (r309797) @@ -8059,6 +8059,13 @@ OLD_FILES+=usr/share/man/man1/colcrt.1.g OLD_FILES+=usr/share/man/man1/ul.1.gz .endif +.if ${MK_TIMED} == no +OLD_FILES+=usr/sbin/timed +OLD_FILES+=usr/sbin/timedc +OLD_FILES+=usr/share/man/man8/timed.8.gz +OLD_FILES+=usr/share/man/man8/timedc.8.gz +.endif + .if ${MK_TOOLCHAIN} == no OLD_FILES+=usr/bin/addr2line OLD_FILES+=usr/bin/as From owner-svn-src-head@freebsd.org Sat Dec 10 12:18:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5466BC6E2CB; Sat, 10 Dec 2016 12:18:05 +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 1D52017A8; Sat, 10 Dec 2016 12:18:05 +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 uBACI44g034494; Sat, 10 Dec 2016 12:18:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBACI4jv034493; Sat, 10 Dec 2016 12:18:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101218.uBACI4jv034493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 12:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309798 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 12:18:05 -0000 Author: bapt Date: Sat Dec 10 12:18:03 2016 New Revision: 309798 URL: https://svnweb.freebsd.org/changeset/base/309798 Log: Also remove auditdistd files if src.conf has WITHOUT_AUDIT PR: 213723 Submitted by: philippe.michel7@sfr.fr MFC after: 2 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:14:41 2016 (r309797) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:18:03 2016 (r309798) @@ -166,12 +166,15 @@ OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-A .if ${MK_AUDIT} == no OLD_FILES+=usr/sbin/audit OLD_FILES+=usr/sbin/auditd +OLD_FILES+=usr/sbin/auditdistd OLD_FILES+=usr/sbin/auditreduce OLD_FILES+=usr/sbin/praudit OLD_FILES+=usr/share/man/man1/auditreduce.1.gz OLD_FILES+=usr/share/man/man1/praudit.1.gz +OLD_FILES+=usr/share/man/man5/auditdistd.conf.5.gz OLD_FILES+=usr/share/man/man8/audit.8.gz OLD_FILES+=usr/share/man/man8/auditd.8.gz +OLD_FILES+=usr/share/man/man8/auditdistd.8.gz .endif .if ${MK_AUTHPF} == no From owner-svn-src-head@freebsd.org Sat Dec 10 12:21:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DED8C6E672; Sat, 10 Dec 2016 12:21:25 +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 1DAD11E2D; Sat, 10 Dec 2016 12:21:25 +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 uBACLOAM035640; Sat, 10 Dec 2016 12:21:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBACLOmo035639; Sat, 10 Dec 2016 12:21:24 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101221.uBACLOmo035639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 12:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309799 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 12:21:25 -0000 Author: bapt Date: Sat Dec 10 12:21:24 2016 New Revision: 309799 URL: https://svnweb.freebsd.org/changeset/base/309799 Log: Respect WITHOUT_RBOOTD in src.conf when running make delete-old PR: 213722 Submitted by: philippe.michel7@sfr.fr MFC after: 2 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:18:03 2016 (r309798) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:21:24 2016 (r309799) @@ -6861,6 +6861,11 @@ OLD_FILES+=usr/share/man/man8/quotaon.8. OLD_FILES+=usr/share/man/man8/repquota.8.gz .endif +.if ${MK_RBOOTD} == no +OLD_FILES+=usr/libexec/rbootd +OLD_FILES+=usr/share/man/man8/rbootd.8.gz +.endif + .if ${MK_RCMDS} == no OLD_FILES+=bin/rcp OLD_FILES+=etc/rc.d/rwho From owner-svn-src-head@freebsd.org Sat Dec 10 12:24:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6372C6E760; Sat, 10 Dec 2016 12:24:32 +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 95CE6120F; Sat, 10 Dec 2016 12:24:32 +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 uBACOVaV038616; Sat, 10 Dec 2016 12:24:31 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBACOVCa038615; Sat, 10 Dec 2016 12:24:31 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101224.uBACOVCa038615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 12:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309800 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 12:24:32 -0000 Author: bapt Date: Sat Dec 10 12:24:31 2016 New Revision: 309800 URL: https://svnweb.freebsd.org/changeset/base/309800 Log: Respect WITHOUT_BOOTPARAMD in src.conf when running make delete-old PR: 213721 Submitted by: philippe.michel7@sfr.fr MFC after: 2 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:21:24 2016 (r309799) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:24:31 2016 (r309800) @@ -649,6 +649,13 @@ OLD_FILES+=usr/share/man/man8/zfsboot.8. OLD_FILES+=usr/share/man/man8/zfsloader.8.gz .endif +.if ${MK_BOOTPARAMD} == no +OLD_FILES+=usr/sbin/bootparamd +OLD_FILES+=usr/share/man/man5/bootparams.5.gz +OLD_FILES+=usr/share/man/man8/bootparamd.8.gz +OLD_FILES+=usr/sbin/callbootd +.endif + .if ${MK_BSD_CPIO} == no OLD_FILES+=usr/bin/bsdcpio OLD_FILES+=usr/bin/cpio From owner-svn-src-head@freebsd.org Sat Dec 10 12:26:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A69FBC6E8D4; Sat, 10 Dec 2016 12:26: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 7668A14DA; Sat, 10 Dec 2016 12:26: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 uBACQn9Z038752; Sat, 10 Dec 2016 12:26:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBACQnIc038751; Sat, 10 Dec 2016 12:26:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101226.uBACQnIc038751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 12:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309801 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 12:26:50 -0000 Author: bapt Date: Sat Dec 10 12:26:49 2016 New Revision: 309801 URL: https://svnweb.freebsd.org/changeset/base/309801 Log: Respect WITHOUT_BOOTPD in src.conf when running make delete-old PR: 213720 Submitted by: philippe.michel7@sfr.fr MFC after: 2 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:24:31 2016 (r309800) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:26:49 2016 (r309801) @@ -656,6 +656,17 @@ OLD_FILES+=usr/share/man/man8/bootparamd OLD_FILES+=usr/sbin/callbootd .endif +.if ${MK_BOOTPD} == no +OLD_FILES+=usr/libexec/bootpd +OLD_FILES+=usr/share/man/man5/bootptab.5.gz +OLD_FILES+=usr/share/man/man8/bootpd.8.gz +OLD_FILES+=usr/libexec/bootpgw +OLD_FILES+=usr/sbin/bootpef +OLD_FILES+=usr/share/man/man8/bootpef.8.gz +OLD_FILES+=usr/sbin/bootptest +OLD_FILES+=usr/share/man/man8/bootptest.8.gz +.endif + .if ${MK_BSD_CPIO} == no OLD_FILES+=usr/bin/bsdcpio OLD_FILES+=usr/bin/cpio From owner-svn-src-head@freebsd.org Sat Dec 10 12:28:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A773FC6EA40; Sat, 10 Dec 2016 12:28:44 +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 77337172F; Sat, 10 Dec 2016 12:28:44 +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 uBACShAG038868; Sat, 10 Dec 2016 12:28:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBACShx9038867; Sat, 10 Dec 2016 12:28:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101228.uBACShx9038867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 12:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309802 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 12:28:44 -0000 Author: bapt Date: Sat Dec 10 12:28:43 2016 New Revision: 309802 URL: https://svnweb.freebsd.org/changeset/base/309802 Log: Respect WITHOUT_FINGER in src.conf when running make delete-old PR: 213719 Submitted by: philippe.michel7@sfr.fr MFC after: 2 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:26:49 2016 (r309801) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 10 12:28:43 2016 (r309802) @@ -2039,6 +2039,14 @@ OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee # to be filled in #.endif +.if ${MK_FINGER} == no +OLD_FILES+=usr/bin/finger +OLD_FILES+=usr/share/man/man1/finger.1.gz +OLD_FILES+=usr/share/man/man5/finger.conf.5.gz +OLD_FILES+=usr/libexec/fingerd +OLD_FILES+=usr/share/man/man8/fingerd.8.gz +.endif + .if ${MK_FLOPPY} == no OLD_FILES+=usr/sbin/fdcontrol OLD_FILES+=usr/sbin/fdformat From owner-svn-src-head@freebsd.org Sat Dec 10 12:48:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 327D8C6F252; Sat, 10 Dec 2016 12:48: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 0236E12E2; Sat, 10 Dec 2016 12:48:49 +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 uBACmn8H046645; Sat, 10 Dec 2016 12:48:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBACmnwC046644; Sat, 10 Dec 2016 12:48:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101248.uBACmnwC046644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 12:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309803 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 12:48:50 -0000 Author: bapt Date: Sat Dec 10 12:48:48 2016 New Revision: 309803 URL: https://svnweb.freebsd.org/changeset/base/309803 Log: Fix pkg groupshow PR: 204676 Submitted by: longwitz@incore.de MFC after: 2 days Modified: head/usr.sbin/pw/pw_group.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sat Dec 10 12:28:43 2016 (r309802) +++ head/usr.sbin/pw/pw_group.c Sat Dec 10 12:48:48 2016 (r309803) @@ -282,7 +282,7 @@ int pw_group_show(int argc, char **argv, char *arg1) { struct group *grp = NULL; - char *name; + char *name = NULL; intmax_t id = -1; int ch; bool all, force, quiet, pretty; From owner-svn-src-head@freebsd.org Sat Dec 10 13:29:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3433C70466; Sat, 10 Dec 2016 13:29:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 930091F4D; Sat, 10 Dec 2016 13:29:52 +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 uBADTpln063899; Sat, 10 Dec 2016 13:29:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBADTpwH063898; Sat, 10 Dec 2016 13:29:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101329.uBADTpwH063898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 13:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309805 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 13:29:52 -0000 Author: bapt Date: Sat Dec 10 13:29:51 2016 New Revision: 309805 URL: https://svnweb.freebsd.org/changeset/base/309805 Log: Make WITHOUT_CAPSICUM implying WITHOUT_CASPER PR: 214562 Reported by: dewayne@heuristicsystems.com.au MFC after: 2 days Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Dec 10 13:25:42 2016 (r309804) +++ head/share/mk/src.opts.mk Sat Dec 10 13:29:51 2016 (r309805) @@ -311,6 +311,10 @@ MK_LLVM_LIBUNWIND:= no MK_GDB:= no .endif +.if ${MK_CAPSICUM} == "no" +MK_CASPER:= no +.endif + .if ${MK_LIBPTHREAD} == "no" MK_LIBTHR:= no .endif From owner-svn-src-head@freebsd.org Sat Dec 10 13:30:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64506C70514; Sat, 10 Dec 2016 13:30:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 253B41118; Sat, 10 Dec 2016 13:30:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBADUGKR064000; Sat, 10 Dec 2016 13:30:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBADUGkn063998; Sat, 10 Dec 2016 13:30:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612101330.uBADUGkn063998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 10 Dec 2016 13:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309806 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 13:30:17 -0000 Author: avos Date: Sat Dec 10 13:30:16 2016 New Revision: 309806 URL: https://svnweb.freebsd.org/changeset/base/309806 Log: rsu: add TSF field into Rx radiotap. Tested with Asus USB-N10. Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 13:29:51 2016 (r309805) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 13:30:16 2016 (r309806) @@ -234,6 +234,8 @@ static void rsu_rx_multi_event(struct rs static int8_t rsu_get_rssi(struct rsu_softc *, int, void *); static struct mbuf * rsu_rx_copy_to_mbuf(struct rsu_softc *, struct r92s_rx_stat *, int); +static uint32_t rsu_get_tsf_low(struct rsu_softc *); +static uint32_t rsu_get_tsf_high(struct rsu_softc *); static struct ieee80211_node * rsu_rx_frame(struct rsu_softc *, struct mbuf *, int8_t *); static struct mbuf * rsu_rx_multi_frame(struct rsu_softc *, uint8_t *, int); @@ -2223,6 +2225,18 @@ fail: return (NULL); } +static uint32_t +rsu_get_tsf_low(struct rsu_softc *sc) +{ + return (rsu_read_4(sc, R92S_TSFTR)); +} + +static uint32_t +rsu_get_tsf_high(struct rsu_softc *sc) +{ + return (rsu_read_4(sc, R92S_TSFTR + 4)); +} + static struct ieee80211_node * rsu_rx_frame(struct rsu_softc *sc, struct mbuf *m, int8_t *rssi_p) { @@ -2254,6 +2268,12 @@ rsu_rx_frame(struct rsu_softc *sc, struc /* Map HW rate index to 802.11 rate. */ tap->wr_flags = 0; /* TODO */ + tap->wr_tsft = rsu_get_tsf_high(sc); + if (le32toh(stat->tsf_low) > rsu_get_tsf_low(sc)) + tap->wr_tsft--; + tap->wr_tsft = (uint64_t)htole32(tap->wr_tsft) << 32; + tap->wr_tsft += stat->tsf_low; + if (rate < 12) { switch (rate) { /* CCK. */ Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 13:29:51 2016 (r309805) +++ head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 13:30:16 2016 (r309806) @@ -51,6 +51,9 @@ #define R92S_MACID (R92S_MACIDSETTING + 0x000) #define R92S_MAR (R92S_MACIDSETTING + 0x010) +#define R92S_TIMECTRL 0x0080 +#define R92S_TSFTR (R92S_TIMECTRL + 0x000) + #define R92S_SECURITY 0x0240 #define R92S_CAMCMD (R92S_SECURITY + 0x000) #define R92S_CAMWRITE (R92S_SECURITY + 0x004) @@ -592,7 +595,7 @@ struct r92s_rx_stat { #define R92S_RXDW3_HTC 0x00004000 uint32_t rxdw4; - uint32_t rxdw5; + uint32_t tsf_low; } __packed __aligned(4); /* Rx PHY descriptor. */ @@ -735,6 +738,7 @@ static const uint8_t rsu_qid2idx_11ep[] struct rsu_rx_radiotap_header { struct ieee80211_radiotap_header wr_ihdr; + uint64_t wr_tsft; uint8_t wr_flags; uint8_t wr_rate; uint16_t wr_chan_freq; @@ -743,7 +747,8 @@ struct rsu_rx_radiotap_header { } __packed __aligned(8); #define RSU_RX_RADIOTAP_PRESENT \ - (1 << IEEE80211_RADIOTAP_FLAGS | \ + (1 << IEEE80211_RADIOTAP_TSFT | \ + 1 << IEEE80211_RADIOTAP_FLAGS | \ 1 << IEEE80211_RADIOTAP_RATE | \ 1 << IEEE80211_RADIOTAP_CHANNEL | \ 1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) From owner-svn-src-head@freebsd.org Sat Dec 10 13:30:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAF87C7053A; Sat, 10 Dec 2016 13:30:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA6A111C; Sat, 10 Dec 2016 13:30:19 +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 uBADUIwB064048; Sat, 10 Dec 2016 13:30:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBADUIDU064047; Sat, 10 Dec 2016 13:30:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101330.uBADUIDU064047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 13:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309807 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 13:30:19 -0000 Author: bapt Date: Sat Dec 10 13:30:18 2016 New Revision: 309807 URL: https://svnweb.freebsd.org/changeset/base/309807 Log: Regen after 309805 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Dec 10 13:30:16 2016 (r309806) +++ head/share/man/man5/src.conf.5 Sat Dec 10 13:30:18 2016 (r309807) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 306729 2016-10-05 20:12:00Z emaste .\" $FreeBSD$ -.Dd December 9, 2016 +.Dd December 10, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -268,6 +268,12 @@ Set to not build .It Va WITHOUT_CAPSICUM .\" from FreeBSD: head/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson Set to not build Capsicum support into system programs. +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_CASPER +.El .It Va WITHOUT_CASPER .\" from FreeBSD: head/tools/build/options/WITHOUT_CASPER 258838 2013-12-02 08:21:28Z pjd Set to not build Casper program and related libraries. From owner-svn-src-head@freebsd.org Sat Dec 10 16:20:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9958AC709F3; Sat, 10 Dec 2016 16:20:41 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 35AFF1C43; Sat, 10 Dec 2016 16:20:41 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAGKe5O033787; Sat, 10 Dec 2016 16:20:40 GMT (envelope-from def@FreeBSD.org) Received: (from def@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAGKdUg033773; Sat, 10 Dec 2016 16:20:39 GMT (envelope-from def@FreeBSD.org) Message-Id: <201612101620.uBAGKdUg033773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: def set sender to def@FreeBSD.org using -f From: Konrad Witaszczyk Date: Sat, 10 Dec 2016 16:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309818 - in head: etc/defaults etc/rc.d sbin sbin/decryptcore sbin/dumpon sbin/savecore share/man/man5 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/ddb sys/dev/null sys/geo... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 16:20:41 -0000 Author: def Date: Sat Dec 10 16:20:39 2016 New Revision: 309818 URL: https://svnweb.freebsd.org/changeset/base/309818 Log: Add support for encrypted kernel crash dumps. Changes include modifications in kernel crash dump routines, dumpon(8) and savecore(8). A new tool called decryptcore(8) was added. A new DIOCSKERNELDUMP I/O control was added to send a kernel crash dump configuration in the diocskerneldump_arg structure to the kernel. The old DIOCSKERNELDUMP I/O control was renamed to DIOCSKERNELDUMP_FREEBSD11 for backward ABI compatibility. dumpon(8) generates an one-time random symmetric key and encrypts it using an RSA public key in capability mode. Currently only AES-256-CBC is supported but EKCD was designed to implement support for other algorithms in the future. The public key is chosen using the -k flag. The dumpon rc(8) script can do this automatically during startup using the dumppubkey rc.conf(5) variable. Once the keys are calculated dumpon sends them to the kernel via DIOCSKERNELDUMP I/O control. When the kernel receives the DIOCSKERNELDUMP I/O control it generates a random IV and sets up the key schedule for the specified algorithm. Each time the kernel tries to write a crash dump to the dump device, the IV is replaced by a SHA-256 hash of the previous value. This is intended to make a possible differential cryptanalysis harder since it is possible to write multiple crash dumps without reboot by repeating the following commands: # sysctl debug.kdb.enter=1 db> call doadump(0) db> continue # savecore A kernel dump key consists of an algorithm identifier, an IV and an encrypted symmetric key. The kernel dump key size is included in a kernel dump header. The size is an unsigned 32-bit integer and it is aligned to a block size. The header structure has 512 bytes to match the block size so it was required to make a panic string 4 bytes shorter to add a new field to the header structure. If the kernel dump key size in the header is nonzero it is assumed that the kernel dump key is placed after the first header on the dump device and the core dump is encrypted. Separate functions were implemented to write the kernel dump header and the kernel dump key as they need to be unencrypted. The dump_write function encrypts data if the kernel was compiled with the EKCD option. Encrypted kernel textdumps are not supported due to the way they are constructed which makes it impossible to use the CBC mode for encryption. It should be also noted that textdumps don't contain sensitive data by design as a user decides what information should be dumped. savecore(8) writes the kernel dump key to a key.# file if its size in the header is nonzero. # is the number of the current core dump. decryptcore(8) decrypts the core dump using a private RSA key and the kernel dump key. This is performed by a child process in capability mode. If the decryption was not successful the parent process removes a partially decrypted core dump. Description on how to encrypt crash dumps was added to the decryptcore(8), dumpon(8), rc.conf(5) and savecore(8) manual pages. EKCD was tested on amd64 using bhyve and i386, mipsel and sparc64 using QEMU. The feature still has to be tested on arm and arm64 as it wasn't possible to run FreeBSD due to the problems with QEMU emulation and lack of hardware. Designed by: def, pjd Reviewed by: cem, oshogbo, pjd Partial review: delphij, emaste, jhb, kib Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D4712 Added: head/sbin/decryptcore/ head/sbin/decryptcore/Makefile (contents, props changed) head/sbin/decryptcore/decryptcore.8 (contents, props changed) head/sbin/decryptcore/decryptcore.c (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/dumpon head/sbin/Makefile head/sbin/dumpon/Makefile head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c head/sbin/savecore/savecore.8 head/sbin/savecore/savecore.c head/share/man/man5/rc.conf.5 head/sys/amd64/amd64/minidump_machdep.c head/sys/arm/arm/minidump_machdep.c head/sys/arm64/arm64/minidump_machdep.c head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/ddb/db_textdump.c head/sys/dev/null/null.c head/sys/geom/geom_dev.c head/sys/i386/i386/minidump_machdep.c head/sys/kern/kern_dump.c head/sys/kern/kern_shutdown.c head/sys/mips/mips/minidump_machdep.c head/sys/sparc64/sparc64/dump_machdep.c head/sys/sys/conf.h head/sys/sys/disk.h head/sys/sys/kerneldump.h Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Dec 10 15:33:36 2016 (r309817) +++ head/etc/defaults/rc.conf Sat Dec 10 16:20:39 2016 (r309818) @@ -607,6 +607,8 @@ chkprintcap_enable="NO" # Run chkprintca chkprintcap_flags="-d" # Create missing directories by default. dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO). dumpdir="/var/crash" # Directory where crash dumps are to be stored +dumppubkey="" # Public key for encrypted kernel crash dumps. + # See dumpon(8) for more details. savecore_enable="YES" # Extract core from dump devices if any savecore_flags="-m 10" # Used if dumpdev is enabled above, and present. # By default, only the 10 most recent kernel dumps Modified: head/etc/rc.d/dumpon ============================================================================== --- head/etc/rc.d/dumpon Sat Dec 10 15:33:36 2016 (r309817) +++ head/etc/rc.d/dumpon Sat Dec 10 16:20:39 2016 (r309818) @@ -16,7 +16,12 @@ stop_cmd="dumpon_stop" dumpon_try() { - if /sbin/dumpon "${1}" ; then + if [ -n "${dumppubkey}" ]; then + /sbin/dumpon -k "${dumppubkey}" "${1}" + else + /sbin/dumpon "${1}" + fi + if [ $? -eq 0 ]; then # Make a symlink in devfs for savecore ln -fs "${1}" /dev/dumpdev return 0 Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Sat Dec 10 15:33:36 2016 (r309817) +++ head/sbin/Makefile Sat Dec 10 16:20:39 2016 (r309818) @@ -83,6 +83,7 @@ SUBDIR.${MK_IPFW}+= natd SUBDIR.${MK_ISCSI}+= iscontrol SUBDIR.${MK_NAND}+= nandfs SUBDIR.${MK_NAND}+= newfs_nandfs +SUBDIR.${MK_OPENSSL}+= decryptcore SUBDIR.${MK_PF}+= pfctl SUBDIR.${MK_PF}+= pflogd SUBDIR.${MK_QUOTAS}+= quotacheck Added: head/sbin/decryptcore/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/decryptcore/Makefile Sat Dec 10 16:20:39 2016 (r309818) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +PROG= decryptcore + +LIBADD= crypto pjdlog + +MAN= decryptcore.8 + +CFLAGS+=-I${.CURDIR}/../../lib/libpjdlog + +WARNS?= 6 + +.include Added: head/sbin/decryptcore/decryptcore.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/decryptcore/decryptcore.8 Sat Dec 10 16:20:39 2016 (r309818) @@ -0,0 +1,114 @@ +.\" Copyright (c) 2016 Konrad Witaszczyk +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 10, 2016 +.Dt DECRYPTCORE 8 +.Os +.Sh NAME +.Nm decryptcore +.Nd "decrypt a core dump of the operating system" +.Sh SYNOPSIS +.Nm +.Op Fl Lv +.Fl p Ar privatekeyfile +.Fl k Ar keyfile +.Fl e Ar encryptedcore +.Fl c Ar core +.Nm +.Op Fl Lv +.Op Fl d Ar crashdir +.Fl p Ar privatekeyfile +.Fl n Ar dumpnr +.Sh DESCRIPTION +The +.Nm +first decrypts +.Ar keyfile +using +.Ar privatekeyfile +and then uses the resulting key to decrypt +.Ar encryptedcore +saved by +.Xr savecore 8 . +Result is saved in +.Ar core . +.Pp +Alternatively a user can decrypt a core dump numbered +.Ar dumpnr +from the +.Ar crashdir +directory. +In this case a dump key from the +.Pa key.# +file is used and the result is saved in the +.Pa vmcore.# +file where +.Dq # +corresponds to +.Ar dumpnr . +.Pp +The +.Nm +utility can be started with the following command line arguments: +.Bl -tag -width ".Fl e Ar encryptedcore" +.It Fl L +Write log messages to +.Xr syslogd 8 . +.It Fl v +Print or log verbose/debugging information. +This option can be specified multiple times to raise the verbosity +level. +.It Fl p Ar privatekeyfile +Specify location of a private key file which will be used to decrypt a dump key +file. +.It Fl k Ar keyfile +Specify location of a dump key file. +.It Fl e Ar encrytpedcore +Specify location of an encrypted core. +.It Fl c Ar core +Specify location of a resulting decrypted core dump. +.It Fl d Ar crashdir +Specify an alternative crash dump directory. The default crash dump directory is +.Pa /var/crash . +.It Fl n Ar dumpnr +Specify a number of a crash dump to be decrypted. +.El +.Sh EXIT STATUS +The +.Nm +utility exits 0 on success, and >0 if an error occurs. +.Sh SEE ALSO +.Xr capsicum 4 , +.Xr dumpon 8 , +.Xr kgdb 1 , +.Xr savecore 8 , +.Xr syslogd 8 +.Sh AUTHORS +The +.Nm +was implemented by +.An -nosplit +.An Konrad Witaszczyk Aq Mt def@FreeBSD.org . Added: head/sbin/decryptcore/decryptcore.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/decryptcore/decryptcore.c Sat Dec 10 16:20:39 2016 (r309818) @@ -0,0 +1,373 @@ +/*- + * Copyright (c) 2016 Konrad Witaszczyk + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "pjdlog.h" + +#define DECRYPTCORE_CRASHDIR "/var/crash" + +static void +usage(void) +{ + + pjdlog_exitx(1, + "usage: decryptcore [-Lv] -p privatekeyfile -k keyfile -e encryptedcore -c core\n" + " decryptcore [-Lv] [-d crashdir] -p privatekeyfile -n dumpnr"); +} + +static int +wait_for_process(pid_t pid) +{ + int status; + + if (waitpid(pid, &status, WUNTRACED | WEXITED) == -1) { + pjdlog_errno(LOG_ERR, "Unable to wait for a child process"); + return (1); + } + + if (WIFEXITED(status)) + return (WEXITSTATUS(status)); + + return (1); +} + +static struct kerneldumpkey * +read_key(int kfd) +{ + struct kerneldumpkey *kdk; + ssize_t size; + size_t kdksize; + + PJDLOG_ASSERT(kfd >= 0); + + kdksize = sizeof(*kdk); + kdk = calloc(1, kdksize); + if (kdk == NULL) { + pjdlog_errno(LOG_ERR, "Unable to allocate kernel dump key"); + goto failed; + } + + size = read(kfd, kdk, kdksize); + if (size == (ssize_t)kdksize) { + kdk->kdk_encryptedkeysize = dtoh32(kdk->kdk_encryptedkeysize); + kdksize += (size_t)kdk->kdk_encryptedkeysize; + kdk = realloc(kdk, kdksize); + if (kdk == NULL) { + pjdlog_errno(LOG_ERR, "Unable to reallocate kernel dump key"); + goto failed; + } + size += read(kfd, &kdk->kdk_encryptedkey, + kdk->kdk_encryptedkeysize); + } + if (size != (ssize_t)kdksize) { + pjdlog_errno(LOG_ERR, "Unable to read key"); + goto failed; + } + + return (kdk); +failed: + free(kdk); + return (NULL); +} + +static bool +decrypt(const char *privkeyfile, const char *keyfile, const char *input, + const char *output) +{ + uint8_t buf[KERNELDUMP_BUFFER_SIZE], key[KERNELDUMP_KEY_MAX_SIZE]; + EVP_CIPHER_CTX ctx; + const EVP_CIPHER *cipher; + FILE *fp; + struct kerneldumpkey *kdk; + RSA *privkey; + int ifd, kfd, ofd, olen, privkeysize; + ssize_t bytes; + pid_t pid; + + PJDLOG_ASSERT(privkeyfile != NULL); + PJDLOG_ASSERT(keyfile != NULL); + PJDLOG_ASSERT(input != NULL); + PJDLOG_ASSERT(output != NULL); + + privkey = NULL; + + /* + * Decrypt a core dump in a child process so we can unlink a partially + * decrypted core if the child process fails. + */ + pid = fork(); + if (pid == -1) { + pjdlog_errno(LOG_ERR, "Unable to create child process"); + return (false); + } + + if (pid > 0) + return (wait_for_process(pid) == 0); + + kfd = open(keyfile, O_RDONLY); + if (kfd == -1) { + pjdlog_errno(LOG_ERR, "Unable to open %s", keyfile); + goto failed; + } + ifd = open(input, O_RDONLY); + if (ifd == -1) { + pjdlog_errno(LOG_ERR, "Unable to open %s", input); + goto failed; + } + ofd = open(output, O_WRONLY | O_CREAT | O_TRUNC, 0600); + if (ofd == -1) { + pjdlog_errno(LOG_ERR, "Unable to open %s", output); + goto failed; + } + fp = fopen(privkeyfile, "r"); + if (fp == NULL) { + pjdlog_errno(LOG_ERR, "Unable to open %s", privkeyfile); + goto failed; + } + + if (cap_enter() < 0 && errno != ENOSYS) { + pjdlog_errno(LOG_ERR, "Unable to enter capability mode"); + goto failed; + } + + privkey = RSA_new(); + if (privkey == NULL) { + pjdlog_error("Unable to allocate an RSA structure: %s", + ERR_error_string(ERR_get_error(), NULL)); + goto failed; + } + EVP_CIPHER_CTX_init(&ctx); + + kdk = read_key(kfd); + close(kfd); + if (kdk == NULL) + goto failed; + + privkey = PEM_read_RSAPrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + if (privkey == NULL) { + pjdlog_error("Unable to read data from %s.", privkeyfile); + goto failed; + } + + privkeysize = RSA_size(privkey); + if (privkeysize != (int)kdk->kdk_encryptedkeysize) { + pjdlog_error("RSA modulus size mismatch: equals %db and should be %ub.", + 8 * privkeysize, 8 * kdk->kdk_encryptedkeysize); + goto failed; + } + + switch (kdk->kdk_encryption) { + case KERNELDUMP_ENC_AES_256_CBC: + cipher = EVP_aes_256_cbc(); + break; + default: + pjdlog_error("Invalid encryption algorithm."); + goto failed; + } + + if (RSA_private_decrypt(kdk->kdk_encryptedkeysize, + kdk->kdk_encryptedkey, key, privkey, + RSA_PKCS1_PADDING) != sizeof(key)) { + pjdlog_error("Unable to decrypt key: %s", + ERR_error_string(ERR_get_error(), NULL)); + goto failed; + } + RSA_free(privkey); + privkey = NULL; + + EVP_DecryptInit_ex(&ctx, cipher, NULL, key, kdk->kdk_iv); + EVP_CIPHER_CTX_set_padding(&ctx, 0); + + explicit_bzero(key, sizeof(key)); + + do { + bytes = read(ifd, buf, sizeof(buf)); + if (bytes < 0) { + pjdlog_errno(LOG_ERR, "Unable to read data from %s", + input); + goto failed; + } else if (bytes == 0) { + break; + } + + if (bytes > 0) { + if (EVP_DecryptUpdate(&ctx, buf, &olen, buf, + bytes) == 0) { + pjdlog_error("Unable to decrypt core."); + goto failed; + } + } else { + if (EVP_DecryptFinal_ex(&ctx, buf, &olen) == 0) { + pjdlog_error("Unable to decrypt core."); + goto failed; + } + } + + if (olen == 0) + continue; + + if (write(ofd, buf, olen) != olen) { + pjdlog_errno(LOG_ERR, "Unable to write data to %s", + output); + goto failed; + } + } while (bytes > 0); + + explicit_bzero(buf, sizeof(buf)); + EVP_CIPHER_CTX_cleanup(&ctx); + exit(0); +failed: + explicit_bzero(key, sizeof(key)); + explicit_bzero(buf, sizeof(buf)); + RSA_free(privkey); + EVP_CIPHER_CTX_cleanup(&ctx); + exit(1); +} + +int +main(int argc, char **argv) +{ + char core[PATH_MAX], encryptedcore[PATH_MAX], keyfile[PATH_MAX]; + struct stat sb; + const char *crashdir, *dumpnr, *privatekey; + int ch, debug; + size_t ii; + bool usesyslog; + + pjdlog_init(PJDLOG_MODE_STD); + pjdlog_prefix_set("(decryptcore) "); + + debug = 0; + *core = '\0'; + crashdir = NULL; + dumpnr = NULL; + *encryptedcore = '\0'; + *keyfile = '\0'; + privatekey = NULL; + usesyslog = false; + while ((ch = getopt(argc, argv, "Lc:d:e:k:n:p:v")) != -1) { + switch (ch) { + case 'L': + usesyslog = true; + break; + case 'c': + strncpy(core, optarg, sizeof(core)); + break; + case 'd': + crashdir = optarg; + break; + case 'e': + strncpy(encryptedcore, optarg, sizeof(encryptedcore)); + break; + case 'k': + strncpy(keyfile, optarg, sizeof(keyfile)); + break; + case 'n': + dumpnr = optarg; + break; + case 'p': + privatekey = optarg; + break; + case 'v': + debug++; + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (argc != 0) + usage(); + + /* Verify mutually exclusive options. */ + if ((crashdir != NULL || dumpnr != NULL) && + (*keyfile != '\0' || *encryptedcore != '\0' || *core != '\0')) { + usage(); + } + + /* + * Set key, encryptedcore and core file names using crashdir and dumpnr. + */ + if (dumpnr != NULL) { + for (ii = 0; ii < strnlen(dumpnr, PATH_MAX); ii++) { + if (isdigit((int)dumpnr[ii]) == 0) + usage(); + } + + if (crashdir == NULL) + crashdir = DECRYPTCORE_CRASHDIR; + PJDLOG_VERIFY(snprintf(keyfile, sizeof(keyfile), + "%s/key.%s", crashdir, dumpnr) > 0); + PJDLOG_VERIFY(snprintf(core, sizeof(core), + "%s/vmcore.%s", crashdir, dumpnr) > 0); + PJDLOG_VERIFY(snprintf(encryptedcore, sizeof(encryptedcore), + "%s/vmcore_encrypted.%s", crashdir, dumpnr) > 0); + } + + if (privatekey == NULL || *keyfile == '\0' || *encryptedcore == '\0' || + *core == '\0') { + usage(); + } + + if (usesyslog) + pjdlog_mode_set(PJDLOG_MODE_SYSLOG); + pjdlog_debug_set(debug); + + if (!decrypt(privatekey, keyfile, encryptedcore, core)) { + if (stat(core, &sb) == 0 && unlink(core) != 0) + pjdlog_exit(1, "Unable to remove core"); + exit(1); + } + + pjdlog_fini(); + + exit(0); +} Modified: head/sbin/dumpon/Makefile ============================================================================== --- head/sbin/dumpon/Makefile Sat Dec 10 15:33:36 2016 (r309817) +++ head/sbin/dumpon/Makefile Sat Dec 10 16:20:39 2016 (r309818) @@ -1,7 +1,15 @@ # $FreeBSD$ +.include + PACKAGE=runtime PROG= dumpon + +.if ${MK_OPENSSL} != "no" +LIBADD= crypto +CFLAGS+=-DHAVE_CRYPTO +.endif + MAN= dumpon.8 .include Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Sat Dec 10 15:33:36 2016 (r309817) +++ head/sbin/dumpon/dumpon.8 Sat Dec 10 16:20:39 2016 (r309818) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 3, 2016 +.Dd December 10, 2016 .Dt DUMPON 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Sh SYNOPSIS .Nm .Op Fl v +.Op Fl k Ar public_key_file .Ar special_file .Nm .Op Fl v @@ -56,7 +57,9 @@ normally occur from the system multi-use .Pa /etc/rc , controlled by the .Dq dumpdev -variable in the boot time configuration file +and +.Dq dumppubkey +variables in the boot time configuration file .Pa /etc/rc.conf . .Pp The default type of kernel crash dump is the mini crash dump. @@ -82,6 +85,35 @@ total amount of physical memory as repor variable. .Pp The +.Op Fl k Ar public_key_file +flag causes +.Nm +to generate a one-time key for kernel crash dump encryption. +The key will be replaced by a new one when the +.Nm +utility is run again. +The key is encrypted using +.Ar public_key_file . +This process is sandboxed using +.Xr capsicum 4 . +Both plain and encrypted keys are sent to the kernel using +.Dv DIOCSKERNELDUMP +.Xr ioctl 2 . +A user can specify the +.Ar public_key_file +in the +.Dq dumppubkey +variable defined in +.Pa /etc/rc.conf +for use with the +.Pa /etc/rc.d/dumpon +.Xr rc 8 +script. +This flag requires a kernel compiled with the +.Dv EKCD +kernel option. +.Pp +The .Fl l flag causes .Nm @@ -140,13 +172,95 @@ standard swap areas .It Pa /etc/rc.conf boot-time system configuration .El +.Sh EXAMPLES +In order to generate an RSA private key a user can use the +.Xr genrsa 1 +tool: +.Pp +.Dl # openssl genrsa -out private.pem 4096 +.Pp +A public key can be extracted from the private key using the +.Xr rsa 1 +tool: +.Pp +.Dl # openssl rsa -in private.pem -out public.pem -pubout +.Pp +Once the RSA keys are created the private key should be moved to a safe place. +Now +.Pa public.pem +can be used by +.Nm +to configure encrypted kernel crash dumps: +.Pp +.Dl # dumpon -k public.pem /dev/ada0s1b +.Pp +It is recommended to test if the kernel saves encrypted crash dumps using the +current configuration. +The easiest way to do that is to cause a kernel panic using the +.Xr ddb 4 +debugger: +.Pp +.Dl # sysctl debug.kdb.panic=1 +.Pp +In the debugger the following commands should be typed to write a core dump and +reboot: +.Pp +.Dl db> call doadump(0) +.Dl db> reset +.Pp +After reboot +.Xr savecore 8 +should be able to save the core dump in the core directory which is +.Pa /var/crash +by default: +.Pp +.Dl # savecore /var/crash /dev/ada0s1b +.Pp +Three files should be created in the core directory: +.Pa info.# , +.Pa key.# +and +.Pa vmcore_encrypted.# +where +.Dq # +is the number of the last core dump saved by +.Xr savecore 8 . +The +.Pa vmcore_encrypted.# +can be decrypted using the +.Xr decryptcore 8 +utility: +.Pp +.Dl # decryptcore -p private.pem -k key.# -e vmcore_encrypted.# -c vmcore.# +.Pp +or shorter: +.Pp +.Dl # decryptcore -p private.pem -n # +.Pp +The +.Pa vmcore.# +can be now examined using +.Xr kgdb 1 : +.Pp +.Dl # kgdb /usr/obj/sys/GENERIC/kernel.debug vmcore.# +.Pp +or shorter: +.Pp +.Dl # kgdb -n # /usr/obj/sys/GENERIC/kernel.debug +.Pp +The core was decrypted properly if +.Xr kgdb 1 +does not print any errors. .Sh SEE ALSO +.Xr kgdb 1 , +.Xr ddb 4 , .Xr fstab 5 , .Xr rc.conf 5 , .Xr config 8 , .Xr init 8 , .Xr loader 8 , .Xr rc 8 , +.Xr decryptcore 8 , .Xr savecore 8 , .Xr swapon 8 , .Xr panic 9 Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Sat Dec 10 15:33:36 2016 (r309817) +++ head/sbin/dumpon/dumpon.c Sat Dec 10 16:20:39 2016 (r309818) @@ -42,13 +42,16 @@ static char sccsid[] = "From: @(#)swapon __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include #include #include #include +#include #include #include #include @@ -56,13 +59,19 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef HAVE_CRYPTO +#include +#include +#include +#endif + static int verbose; static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n", - "usage: dumpon [-v] special_file", + "usage: dumpon [-v] [-k public_key_file] special_file", " dumpon [-v] off", " dumpon [-v] -l"); exit(EX_USAGE); @@ -94,6 +103,59 @@ check_size(int fd, const char *fn) } } +#ifdef HAVE_CRYPTO +static void +genkey(const char *pubkeyfile, struct diocskerneldump_arg *kda) +{ + FILE *fp; + RSA *pubkey; + + assert(pubkeyfile != NULL); + assert(kda != NULL); + + fp = NULL; + pubkey = NULL; + + fp = fopen(pubkeyfile, "r"); + if (fp == NULL) + err(1, "Unable to open %s", pubkeyfile); + + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "Unable to enter capability mode"); + + pubkey = RSA_new(); + if (pubkey == NULL) { + errx(1, "Unable to allocate an RSA structure: %s", + ERR_error_string(ERR_get_error(), NULL)); + } + + pubkey = PEM_read_RSA_PUBKEY(fp, &pubkey, NULL, NULL); + fclose(fp); + fp = NULL; + if (pubkey == NULL) + errx(1, "Unable to read data from %s.", pubkeyfile); + + kda->kda_encryptedkeysize = RSA_size(pubkey); + if (kda->kda_encryptedkeysize > KERNELDUMP_ENCKEY_MAX_SIZE) { + errx(1, "Public key has to be at most %db long.", + 8 * KERNELDUMP_ENCKEY_MAX_SIZE); + } + + kda->kda_encryptedkey = calloc(1, kda->kda_encryptedkeysize); + if (kda->kda_encryptedkey == NULL) + err(1, "Unable to allocate encrypted key"); + + kda->kda_encryption = KERNELDUMP_ENC_AES_256_CBC; + arc4random_buf(kda->kda_key, sizeof(kda->kda_key)); + if (RSA_public_encrypt(sizeof(kda->kda_key), kda->kda_key, + kda->kda_encryptedkey, pubkey, + RSA_PKCS1_PADDING) != (int)kda->kda_encryptedkeysize) { + errx(1, "Unable to encrypt the one-time key."); + } + RSA_free(pubkey); +} +#endif + static void listdumpdev(void) { @@ -123,13 +185,20 @@ listdumpdev(void) int main(int argc, char *argv[]) { + struct diocskerneldump_arg kda; + const char *pubkeyfile; int ch; int i, fd; - u_int u; int do_listdumpdev = 0; + bool enable; + + pubkeyfile = NULL; - while ((ch = getopt(argc, argv, "lv")) != -1) + while ((ch = getopt(argc, argv, "k:lv")) != -1) switch((char)ch) { + case 'k': + pubkeyfile = optarg; + break; case 'l': do_listdumpdev = 1; break; @@ -151,7 +220,15 @@ main(int argc, char *argv[]) if (argc != 1) usage(); - if (strcmp(argv[0], "off") != 0) { + enable = (strcmp(argv[0], "off") != 0); +#ifndef HAVE_CRYPTO + if (pubkeyfile != NULL) { + enable = false; + warnx("Unable to use the public key. Recompile dumpon with OpenSSL support."); + } +#endif + + if (enable) { char tmp[PATH_MAX]; char *dumpdev; @@ -171,18 +248,32 @@ main(int argc, char *argv[]) if (fd < 0) err(EX_OSFILE, "%s", dumpdev); check_size(fd, dumpdev); - u = 0; - i = ioctl(fd, DIOCSKERNELDUMP, &u); - u = 1; - i = ioctl(fd, DIOCSKERNELDUMP, &u); + bzero(&kda, sizeof(kda)); + + kda.kda_enable = 0; + i = ioctl(fd, DIOCSKERNELDUMP, &kda); + explicit_bzero(&kda, sizeof(kda)); + +#ifdef HAVE_CRYPTO + if (pubkeyfile != NULL) + genkey(pubkeyfile, &kda); +#endif + + kda.kda_enable = 1; + i = ioctl(fd, DIOCSKERNELDUMP, &kda); + explicit_bzero(kda.kda_encryptedkey, kda.kda_encryptedkeysize); + free(kda.kda_encryptedkey); + explicit_bzero(&kda, sizeof(kda)); if (i == 0 && verbose) printf("kernel dumps on %s\n", dumpdev); } else { fd = open(_PATH_DEVNULL, O_RDONLY); if (fd < 0) err(EX_OSFILE, "%s", _PATH_DEVNULL); - u = 0; - i = ioctl(fd, DIOCSKERNELDUMP, &u); + + kda.kda_enable = 0; + i = ioctl(fd, DIOCSKERNELDUMP, &kda); + explicit_bzero(&kda, sizeof(kda)); if (i == 0 && verbose) printf("kernel dumps disabled\n"); } Modified: head/sbin/savecore/savecore.8 ============================================================================== --- head/sbin/savecore/savecore.8 Sat Dec 10 15:33:36 2016 (r309817) +++ head/sbin/savecore/savecore.8 Sat Dec 10 16:20:39 2016 (r309818) @@ -28,7 +28,7 @@ .\" From: @(#)savecore.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd December 10, 2016 .Dt SAVECORE 8 .Os .Sh NAME @@ -119,6 +119,10 @@ If it passes these checks, it saves the .Ar directory Ns Pa /vmcore.# and information about the core in .Ar directory Ns Pa /info.# . +If the core is encrypted, it saves the dump key in +.Ar directory Ns Pa /key.# . +The core can be later decrypted using +.Xr decryptcore 8 . For kernel textdumps generated with the .Xr textdump 4 facility, output will be stored in the @@ -166,6 +170,7 @@ is meant to be called near the end of th .Xr xo_parse_args 3 , .Xr textdump 4 , .Xr tar 5 , +.Xr decryptcore 8 , .Xr dumpon 8 , .Xr syslogd 8 .Sh HISTORY Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Sat Dec 10 15:33:36 2016 (r309817) +++ head/sbin/savecore/savecore.c Sat Dec 10 16:20:39 2016 (r309818) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -183,6 +184,28 @@ writebounds(int bounds) { fclose(fp); } +static bool +writekey(const char *keyname, uint8_t *dumpkey, uint32_t dumpkeysize) +{ + int fd; + + fd = open(keyname, O_WRONLY | O_CREAT | O_TRUNC, 0600); + if (fd == -1) { + syslog(LOG_ERR, "Unable to open %s to write the key: %m.", + keyname); + return (false); + } + + if (write(fd, dumpkey, dumpkeysize) != (ssize_t)dumpkeysize) { + syslog(LOG_ERR, "Unable to write the key to %s: %m.", keyname); + close(fd); + return (false); + } + + close(fd); + return (true); +} + static off_t file_size(const char *path) { @@ -238,8 +261,11 @@ symlinks_remove(void) { (void)unlink("info.last"); + (void)unlink("key.last"); (void)unlink("vmcore.last"); (void)unlink("vmcore.last.gz"); + (void)unlink("vmcore_encrypted.last"); + (void)unlink("vmcore_encrypted.last.gz"); (void)unlink("textdump.tar.last"); (void)unlink("textdump.tar.last.gz"); } @@ -292,8 +318,8 @@ check_space(const char *savedir, off_t d #define BLOCKMASK (~(BLOCKSIZE-1)) static int -DoRegularFile(int fd, off_t dumpsize, char *buf, const char *device, - const char *filename, FILE *fp) +DoRegularFile(int fd, bool isencrypted, off_t dumpsize, char *buf, + const char *device, const char *filename, FILE *fp) { int he, hs, nr, nw, wl; off_t dmpcnt, origsize; @@ -315,7 +341,7 @@ DoRegularFile(int fd, off_t dumpsize, ch nerr++; return (-1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Dec 10 17:06:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24080C71782; Sat, 10 Dec 2016 17:06:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E7E62164B; Sat, 10 Dec 2016 17:06:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAH6u2p054364; Sat, 10 Dec 2016 17:06:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAH6utm054363; Sat, 10 Dec 2016 17:06:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612101706.uBAH6utm054363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 10 Dec 2016 17:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309821 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 17:06:57 -0000 Author: avos Date: Sat Dec 10 17:06:55 2016 New Revision: 309821 URL: https://svnweb.freebsd.org/changeset/base/309821 Log: rsu: increase Rx buffer size from 8k to 30k. This is required for USB Rx aggregation (and fixes 'could not allocate RX mbuf' / few other failures). While here, reduce the number of Rx buffers from 100 to 1 - the driver never uses more than one Rx buffer. Tested with Asus USB-N10. Modified: head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 16:41:55 2016 (r309820) +++ head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 17:06:55 2016 (r309821) @@ -688,10 +688,10 @@ struct r92s_add_ba_req { /* * Driver definitions. */ -#define RSU_RX_LIST_COUNT 100 +#define RSU_RX_LIST_COUNT 1 #define RSU_TX_LIST_COUNT 32 -#define RSU_RXBUFSZ (8 * 1024) +#define RSU_RXBUFSZ (30 * 1024) #define RSU_TXBUFSZ \ ((sizeof(struct r92s_tx_desc) + IEEE80211_MAX_LEN + 3) & ~3) From owner-svn-src-head@freebsd.org Sat Dec 10 17:59:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D251BC70522; Sat, 10 Dec 2016 17:59:35 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1EEE1C05; Sat, 10 Dec 2016 17:59:35 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAHxYZm074191; Sat, 10 Dec 2016 17:59:34 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAHxYrj074190; Sat, 10 Dec 2016 17:59:34 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612101759.uBAHxYrj074190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 10 Dec 2016 17:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309822 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 17:59:35 -0000 Author: gonzo Date: Sat Dec 10 17:59:34 2016 New Revision: 309822 URL: https://svnweb.freebsd.org/changeset/base/309822 Log: [iwn] Perform BUS_DMASYNC_PREREAD when initializing RX buffer BUS_DMASYNC_PREREAD is required when setting up RX buffer, otherwise data provided by card can be overwritten by data evicted from cache Also use proper tag when setting up RX descriptor Reviewed by: adrian, avos, ivadasz Differential Revision: https://reviews.freebsd.org/D8717 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sat Dec 10 17:06:55 2016 (r309821) +++ head/sys/dev/iwn/if_iwn.c Sat Dec 10 17:59:34 2016 (r309822) @@ -1910,6 +1910,9 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, goto fail; } + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_PREREAD); + /* Set physical address of RX buffer (256-byte aligned). */ ring->desc[i] = htole32(paddr >> 8); } @@ -3040,14 +3043,19 @@ iwn_rx_done(struct iwn_softc *sc, struct if (error != 0 && error != EFBIG) { panic("%s: could not load old RX mbuf", __func__); } + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_PREREAD); /* Physical address may have changed. */ ring->desc[ring->cur] = htole32(paddr >> 8); - bus_dmamap_sync(ring->data_dmat, ring->desc_dma.map, + bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); counter_u64_add(ic->ic_ierrors, 1); return; } + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_PREREAD); + m = data->m; data->m = m1; /* Update RX descriptor. */ From owner-svn-src-head@freebsd.org Sat Dec 10 18:07:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFA79C70789; Sat, 10 Dec 2016 18:07:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEA8D104C; Sat, 10 Dec 2016 18:07:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAI7Giq078190; Sat, 10 Dec 2016 18:07:16 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAI7God078186; Sat, 10 Dec 2016 18:07:16 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612101807.uBAI7God078186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 10 Dec 2016 18:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309823 - in head/sys/dev: evdev syscons vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 18:07:18 -0000 Author: gonzo Date: Sat Dec 10 18:07:16 2016 New Revision: 309823 URL: https://svnweb.freebsd.org/changeset/base/309823 Log: [evdev] Adds evdev support to sysmouse(4) driver For horizontal (T-axis) wheel reporting which is not supported by sysmouse protocol kern.evdev.sysmouse_t_axis sysctl is introduced. It can take following values: 0 - no T-axis events (default) 1 - T-axis events are originated in ums(4) driver. 2 - T-axis events are originated in psm(4) driver. Submitted by: Vladimir Kondratiev MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8597 Modified: head/sys/dev/evdev/evdev.c head/sys/dev/evdev/evdev.h head/sys/dev/syscons/sysmouse.c head/sys/dev/vt/vt_sysmouse.c Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Sat Dec 10 17:59:34 2016 (r309822) +++ head/sys/dev/evdev/evdev.c Sat Dec 10 18:07:16 2016 (r309823) @@ -63,11 +63,14 @@ enum evdev_sparse_result MALLOC_DEFINE(M_EVDEV, "evdev", "evdev memory"); int evdev_rcpt_mask = EVDEV_RCPT_SYSMOUSE | EVDEV_RCPT_KBDMUX; +int evdev_sysmouse_t_axis = 0; SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW, 0, "Evdev args"); SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RW, &evdev_rcpt_mask, 0, "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " "bit2 - mouse hardware, bit3 - keyboard hardware"); +SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, + &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); static void evdev_start_repeat(struct evdev_dev *, uint16_t); static void evdev_stop_repeat(struct evdev_dev *); Modified: head/sys/dev/evdev/evdev.h ============================================================================== --- head/sys/dev/evdev/evdev.h Sat Dec 10 17:59:34 2016 (r309822) +++ head/sys/dev/evdev/evdev.h Sat Dec 10 18:07:16 2016 (r309823) @@ -56,6 +56,22 @@ typedef void (evdev_keycode_t)(struct ev #define EVDEV_RCPT_HW_MOUSE (1<<2) #define EVDEV_RCPT_HW_KBD (1<<3) extern int evdev_rcpt_mask; +/* + * Sysmouse protocol does not support horizontal wheel movement reporting. + * To overcome this limitation different drivers use different sysmouse proto + * extensions. Set kern.evdev.sysmouse_t_axis to tell sysmouse evdev driver + * which protocol extension is used. + * 0 - do not extract horizontal wheel movement (default). + * 1 - ums(4) horizontal wheel encoding. T-axis is mapped to buttons 6 and 7 + * 2 - psm(4) wheels encoding: z = 1,-1 - vert. wheel, z = 2,-2 - horiz. wheel + */ +enum +{ + EVDEV_SYSMOUSE_T_AXIS_NONE = 0, + EVDEV_SYSMOUSE_T_AXIS_UMS = 1, + EVDEV_SYSMOUSE_T_AXIS_PSM = 2, +}; +extern int evdev_sysmouse_t_axis; #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR #define ABS_MT_LAST ABS_MT_TOOL_Y Modified: head/sys/dev/syscons/sysmouse.c ============================================================================== --- head/sys/dev/syscons/sysmouse.c Sat Dec 10 17:59:34 2016 (r309822) +++ head/sys/dev/syscons/sysmouse.c Sat Dec 10 18:07:16 2016 (r309823) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_evdev.h" #include "opt_syscons.h" #include @@ -43,6 +44,11 @@ __FBSDID("$FreeBSD$"); #include +#ifdef EVDEV_SUPPORT +#include +#include +#endif + #ifndef SC_NO_SYSMOUSE /* local variables */ @@ -50,6 +56,72 @@ static struct tty *sysmouse_tty; static int mouse_level; /* sysmouse protocol level */ static mousestatus_t mouse_status; +#ifdef EVDEV_SUPPORT +static struct evdev_dev *sysmouse_evdev; + +static void +smdev_evdev_init(void) +{ + int i; + + sysmouse_evdev = evdev_alloc(); + evdev_set_name(sysmouse_evdev, "System mouse"); + evdev_set_phys(sysmouse_evdev, "sysmouse"); + evdev_set_id(sysmouse_evdev, BUS_VIRTUAL, 0, 0, 0); + evdev_support_prop(sysmouse_evdev, INPUT_PROP_POINTER); + evdev_support_event(sysmouse_evdev, EV_SYN); + evdev_support_event(sysmouse_evdev, EV_REL); + evdev_support_event(sysmouse_evdev, EV_KEY); + evdev_support_rel(sysmouse_evdev, REL_X); + evdev_support_rel(sysmouse_evdev, REL_Y); + evdev_support_rel(sysmouse_evdev, REL_WHEEL); + evdev_support_rel(sysmouse_evdev, REL_HWHEEL); + for (i = 0; i < 8; i++) + evdev_support_key(sysmouse_evdev, BTN_MOUSE + i); + if (evdev_register(sysmouse_evdev)) { + evdev_free(sysmouse_evdev); + sysmouse_evdev = NULL; + } +} + +static void +smdev_evdev_write(int x, int y, int z, int buttons) +{ + + if (sysmouse_evdev == NULL || !(evdev_rcpt_mask & EVDEV_RCPT_SYSMOUSE)) + return; + + evdev_push_event(sysmouse_evdev, EV_REL, REL_X, x); + evdev_push_event(sysmouse_evdev, EV_REL, REL_Y, y); + switch (evdev_sysmouse_t_axis) { + case EVDEV_SYSMOUSE_T_AXIS_PSM: + switch (z) { + case 1: + case -1: + evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); + break; + case 2: + case -2: + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, z / 2); + break; + } + break; + case EVDEV_SYSMOUSE_T_AXIS_UMS: + /* XXX: Edge triggering should be used here */ + if (buttons & (1 << 5)) + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1); + else if (buttons & (1 << 6)) + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, -1); + /* PASSTHROUGH */ + case EVDEV_SYSMOUSE_T_AXIS_NONE: + default: + evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); + } + evdev_push_mouse_btn(sysmouse_evdev, buttons); + evdev_sync(sysmouse_evdev); +} +#endif + static void smdev_close(struct tty *tp) { @@ -170,6 +242,9 @@ sm_attach_mouse(void *unused) return; sysmouse_tty = tty_alloc(&smdev_ttydevsw, NULL); tty_makedev(sysmouse_tty, NULL, "sysmouse"); +#ifdef EVDEV_SUPPORT + smdev_evdev_init(); +#endif } SYSINIT(sysmouse, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, sm_attach_mouse, NULL); @@ -220,7 +295,14 @@ sysmouse_event(mouse_info_t *info) mouse_status.flags |= ((x || y || z) ? MOUSE_POSCHANGED : 0) | (mouse_status.obutton ^ mouse_status.button); flags = mouse_status.flags; - if (flags == 0 || !tty_opened(sysmouse_tty)) + if (flags == 0) + goto done; + +#ifdef EVDEV_SUPPORT + smdev_evdev_write(x, y, z, mouse_status.button); +#endif + + if (!tty_opened(sysmouse_tty)) goto done; /* the first five bytes are compatible with MouseSystems' */ Modified: head/sys/dev/vt/vt_sysmouse.c ============================================================================== --- head/sys/dev/vt/vt_sysmouse.c Sat Dec 10 17:59:34 2016 (r309822) +++ head/sys/dev/vt/vt_sysmouse.c Sat Dec 10 18:07:16 2016 (r309823) @@ -33,6 +33,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_evdev.h" + #include #include #include @@ -50,6 +52,11 @@ __FBSDID("$FreeBSD$"); #include +#ifdef EVDEV_SUPPORT +#include +#include +#endif + static d_open_t sysmouse_open; static d_close_t sysmouse_close; static d_read_t sysmouse_read; @@ -81,6 +88,72 @@ static MALLOC_DEFINE(M_SYSMOUSE, "sysmou static unsigned char *sysmouse_buffer; static unsigned int sysmouse_start, sysmouse_length; +#ifdef EVDEV_SUPPORT +static struct evdev_dev *sysmouse_evdev; + +static void +sysmouse_evdev_init(void) +{ + int i; + + sysmouse_evdev = evdev_alloc(); + evdev_set_name(sysmouse_evdev, "System mouse"); + evdev_set_phys(sysmouse_evdev, "sysmouse"); + evdev_set_id(sysmouse_evdev, BUS_VIRTUAL, 0, 0, 0); + evdev_support_prop(sysmouse_evdev, INPUT_PROP_POINTER); + evdev_support_event(sysmouse_evdev, EV_SYN); + evdev_support_event(sysmouse_evdev, EV_REL); + evdev_support_event(sysmouse_evdev, EV_KEY); + evdev_support_rel(sysmouse_evdev, REL_X); + evdev_support_rel(sysmouse_evdev, REL_Y); + evdev_support_rel(sysmouse_evdev, REL_WHEEL); + evdev_support_rel(sysmouse_evdev, REL_HWHEEL); + for (i = 0; i < 8; i++) + evdev_support_key(sysmouse_evdev, BTN_MOUSE + i); + if (evdev_register(sysmouse_evdev)) { + evdev_free(sysmouse_evdev); + sysmouse_evdev = NULL; + } +} + +static void +sysmouse_evdev_store(int x, int y, int z, int buttons) +{ + + if (sysmouse_evdev == NULL || !(evdev_rcpt_mask & EVDEV_RCPT_SYSMOUSE)) + return; + + evdev_push_event(sysmouse_evdev, EV_REL, REL_X, x); + evdev_push_event(sysmouse_evdev, EV_REL, REL_Y, y); + switch (evdev_sysmouse_t_axis) { + case EVDEV_SYSMOUSE_T_AXIS_PSM: + switch (z) { + case 1: + case -1: + evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); + break; + case 2: + case -2: + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, z / 2); + break; + } + break; + case EVDEV_SYSMOUSE_T_AXIS_UMS: + /* XXX: Edge triggering should be used here */ + if (buttons & (1 << 5)) + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1); + else if (buttons & (1 << 6)) + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, -1); + /* PASSTHROUGH */ + case EVDEV_SYSMOUSE_T_AXIS_NONE: + default: + evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); + } + evdev_push_mouse_btn(sysmouse_evdev, buttons); + evdev_sync(sysmouse_evdev); +} +#endif + static int sysmouse_buf_read(struct uio *uio, unsigned int length) { @@ -170,6 +243,9 @@ sysmouse_process_event(mouse_info_t *mi) if (sysmouse_status.flags == 0) goto done; +#ifdef EVDEV_SUPPORT + sysmouse_evdev_store(x, y, z, sysmouse_status.button); +#endif /* The first five bytes are compatible with MouseSystems. */ buf[0] = MOUSE_MSC_SYNC | @@ -404,6 +480,9 @@ sysmouse_drvinit(void *unused) cv_init(&sysmouse_sleep, "sysmrd"); make_dev(&sysmouse_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "sysmouse"); +#ifdef EVDEV_SUPPORT + sysmouse_evdev_init(); +#endif } SYSINIT(sysmouse, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, sysmouse_drvinit, NULL); From owner-svn-src-head@freebsd.org Sat Dec 10 18:29:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8CFDC70E20; Sat, 10 Dec 2016 18:29:40 +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 8B0231BB6; Sat, 10 Dec 2016 18:29:40 +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 uBAITd4t086358; Sat, 10 Dec 2016 18:29:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAITdMo086356; Sat, 10 Dec 2016 18:29:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612101829.uBAITdMo086356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 10 Dec 2016 18:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309824 - in head: . lib/libc++ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 18:29:40 -0000 Author: bapt Date: Sat Dec 10 18:29:39 2016 New Revision: 309824 URL: https://svnweb.freebsd.org/changeset/base/309824 Log: Now that external gcc directly natively links to libc++ we can remove the dirty hack made to fake libstdc++ Modified: head/Makefile.inc1 head/lib/libc++/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Dec 10 18:07:16 2016 (r309823) +++ head/Makefile.inc1 Sat Dec 10 18:29:39 2016 (r309824) @@ -591,7 +591,7 @@ XCFLAGS+= -B${WORLDTMP}/usr/lib # XXX: This should be checking MK_GNUCXX == no .if ${X_COMPILER_VERSION} >= 40800 XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ - -nostdinc++ -L${WORLDTMP}/../lib/libc++ + -nostdinc++ .endif .elif ${WANT_COMPILER_TYPE} == clang || \ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang) Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Sat Dec 10 18:07:16 2016 (r309823) +++ head/lib/libc++/Makefile Sat Dec 10 18:29:39 2016 (r309824) @@ -242,14 +242,4 @@ EXT+= ${HDRDIR}/ext/${hdr} .endfor EXTDIR= ${CXXINCLUDEDIR}/ext -.if ${MK_GNUCXX} == "no" && ${COMPILER_TYPE} == "gcc" -CLEANFILES+= libstdc++.so libstdc++.a - -afterinstall: - ${INSTALL_SYMLINK} ${DESTDIR}${LIBDIR}/lib${LIB}.so \ - ${.OBJDIR}/libstdc++.so - ${INSTALL_SYMLINK} ${DESTDIR}${LIBDIR}/lib${LIB}.a \ - ${.OBJDIR}/libstdc++.a -.endif - .include From owner-svn-src-head@freebsd.org Sat Dec 10 18:47:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4638EC71361; Sat, 10 Dec 2016 18:47:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 06F771765; Sat, 10 Dec 2016 18:47:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAIlEEj094637; Sat, 10 Dec 2016 18:47:14 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAIlEFb094635; Sat, 10 Dec 2016 18:47:14 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612101847.uBAIlEFb094635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 10 Dec 2016 18:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309825 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 18:47:15 -0000 Author: avos Date: Sat Dec 10 18:47:13 2016 New Revision: 309825 URL: https://svnweb.freebsd.org/changeset/base/309825 Log: rsu: add promiscuous mode support. - Add partial promiscuous mode support (no management frames; they cannot be received by the firmware and net80211 at the same time). - Add monitor mode support (all frames). Tested with Asus, USB-N10. Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 18:29:39 2016 (r309824) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 18:47:13 2016 (r309825) @@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$"); * * TODO: * o tx a-mpdu - * o monitor / hostap / ibss / mesh + * o hostap / ibss / mesh * o power-save operation */ @@ -175,6 +175,7 @@ static void rsu_getradiocaps(struct ieee static void rsu_set_channel(struct ieee80211com *); static void rsu_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void rsu_scan_mindwell(struct ieee80211_scan_state *); +static void rsu_update_promisc(struct ieee80211com *); static uint8_t rsu_get_multi_pos(const uint8_t[]); static void rsu_set_multi(struct rsu_softc *); static void rsu_update_mcast(struct ieee80211com *); @@ -202,6 +203,9 @@ static int rsu_read_rom(struct rsu_softc static int rsu_fw_cmd(struct rsu_softc *, uint8_t, void *, int); static void rsu_calib_task(void *, int); static void rsu_tx_task(void *, int); +static void rsu_set_led(struct rsu_softc *, int); +static int rsu_monitor_newstate(struct ieee80211vap *, + enum ieee80211_state, int); static int rsu_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int rsu_key_alloc(struct ieee80211vap *, struct ieee80211_key *, ieee80211_keyix *, ieee80211_keyix *); @@ -244,6 +248,9 @@ static struct mbuf * static void rsu_txeof(struct usb_xfer *, struct rsu_data *); static int rsu_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); +static void rsu_rxfilter_init(struct rsu_softc *); +static void rsu_rxfilter_set(struct rsu_softc *, uint32_t, uint32_t); +static void rsu_rxfilter_refresh(struct rsu_softc *); static void rsu_init(struct rsu_softc *); static int rsu_tx_start(struct rsu_softc *, struct ieee80211_node *, struct mbuf *, struct rsu_data *); @@ -536,6 +543,7 @@ rsu_attach(device_t self) /* Set device capabilities. */ ic->ic_caps = IEEE80211_C_STA | /* station mode */ + IEEE80211_C_MONITOR | /* monitor mode supported */ #if 0 IEEE80211_C_BGSCAN | /* Background scan. */ #endif @@ -582,6 +590,7 @@ rsu_attach(device_t self) ic->ic_scan_mindwell = rsu_scan_mindwell; ic->ic_vap_create = rsu_vap_create; ic->ic_vap_delete = rsu_vap_delete; + ic->ic_update_promisc = rsu_update_promisc; ic->ic_update_mcast = rsu_update_mcast; ic->ic_parent = rsu_parent; ic->ic_transmit = rsu_transmit; @@ -688,7 +697,10 @@ rsu_vap_create(struct ieee80211com *ic, /* override state transition machine */ uvp->newstate = vap->iv_newstate; - vap->iv_newstate = rsu_newstate; + if (opmode == IEEE80211_M_MONITOR) + vap->iv_newstate = rsu_monitor_newstate; + else + vap->iv_newstate = rsu_newstate; vap->iv_key_alloc = rsu_key_alloc; vap->iv_key_set = rsu_key_set; vap->iv_key_delete = rsu_key_delete; @@ -759,9 +771,30 @@ rsu_getradiocaps(struct ieee80211com *ic } static void -rsu_set_channel(struct ieee80211com *ic __unused) +rsu_set_channel(struct ieee80211com *ic) { - /* We are unable to switch channels, yet. */ + struct rsu_softc *sc = ic->ic_softc; + + /* + * Only need to set the channel in Monitor mode. AP scanning and auth + * are already taken care of by their respective firmware commands. + */ + if (ic->ic_opmode == IEEE80211_M_MONITOR) { + struct r92s_set_channel cmd; + int error; + + cmd.channel = IEEE80211_CHAN2IEEE(ic->ic_curchan); + + RSU_LOCK(sc); + error = rsu_fw_cmd(sc, R92S_CMD_SET_CHANNEL, &cmd, + sizeof(cmd)); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: error %d setting channel\n", __func__, + error); + } + RSU_UNLOCK(sc); + } } static void @@ -782,6 +815,17 @@ rsu_scan_mindwell(struct ieee80211_scan_ /* NB: don't try to abort scan; wait for firmware to finish */ } +static void +rsu_update_promisc(struct ieee80211com *ic) +{ + struct rsu_softc *sc = ic->ic_softc; + + RSU_LOCK(sc); + if (sc->sc_running) + rsu_rxfilter_refresh(sc); + RSU_UNLOCK(sc); +} + /* * The same as rtwn_get_multi_pos() / rtwn_set_multi(). */ @@ -1343,6 +1387,47 @@ rsu_set_fw_power_state(struct rsu_softc return (error); } +static void +rsu_set_led(struct rsu_softc *sc, int on) +{ + rsu_write_1(sc, R92S_LEDCFG, + (rsu_read_1(sc, R92S_LEDCFG) & 0xf0) | (!on << 3)); +} + +static int +rsu_monitor_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, + int arg) +{ + struct ieee80211com *ic = vap->iv_ic; + struct rsu_softc *sc = ic->ic_softc; + struct rsu_vap *uvp = RSU_VAP(vap); + + if (vap->iv_state != nstate) { + IEEE80211_UNLOCK(ic); + RSU_LOCK(sc); + + switch (nstate) { + case IEEE80211_S_INIT: + sc->sc_vap_is_running = 0; + rsu_set_led(sc, 0); + break; + case IEEE80211_S_RUN: + sc->sc_vap_is_running = 1; + rsu_set_led(sc, 1); + break; + default: + /* NOTREACHED */ + break; + } + rsu_rxfilter_refresh(sc); + + RSU_UNLOCK(sc); + IEEE80211_LOCK(ic); + } + + return (uvp->newstate(vap, nstate, arg)); +} + static int rsu_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { @@ -1376,6 +1461,12 @@ rsu_newstate(struct ieee80211vap *vap, e RSU_LOCK(sc); /* Disassociate from our current BSS. */ rsu_disconnect(sc); + usb_pause_mtx(&sc->sc_mtx, USB_MS_TO_TICKS(10)); + + /* Refresh Rx filter (may be modified by firmware). */ + sc->sc_vap_is_running = 0; + rsu_rxfilter_refresh(sc); + /* Reinstall static keys. */ if (sc->sc_running) rsu_reinit_static_keys(sc); @@ -2030,6 +2121,11 @@ rsu_event_join_bss(struct rsu_softc *sc, __func__, ether_sprintf(rsp->bss.macaddr), tmp); /* XXX is this required? What's the top two bits for again? */ ni->ni_associd = tmp | 0xc000; + + /* Refresh Rx filter (was changed by firmware). */ + sc->sc_vap_is_running = 1; + rsu_rxfilter_refresh(sc); + RSU_UNLOCK(sc); ieee80211_new_state(vap, IEEE80211_S_RUN, IEEE80211_FC0_SUBTYPE_ASSOC_RESP); @@ -3329,6 +3425,65 @@ rsu_raw_xmit(struct ieee80211_node *ni, } static void +rsu_rxfilter_init(struct rsu_softc *sc) +{ + uint32_t reg; + + RSU_ASSERT_LOCKED(sc); + + /* Setup multicast filter. */ + rsu_set_multi(sc); + + /* Adjust Rx filter. */ + reg = rsu_read_4(sc, R92S_RCR); + reg &= ~R92S_RCR_AICV; + reg |= R92S_RCR_APP_PHYSTS; + rsu_write_4(sc, R92S_RCR, reg); + + /* Update dynamic Rx filter parts. */ + rsu_rxfilter_refresh(sc); +} + +static void +rsu_rxfilter_set(struct rsu_softc *sc, uint32_t clear, uint32_t set) +{ + /* NB: firmware can touch this register too. */ + rsu_write_4(sc, R92S_RCR, + (rsu_read_4(sc, R92S_RCR) & ~clear) | set); +} + +static void +rsu_rxfilter_refresh(struct rsu_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint32_t mask_all, mask_min; + + RSU_ASSERT_LOCKED(sc); + + /* NB: RCR_AMF / RXFLTMAP_MGT are used by firmware. */ + mask_all = R92S_RCR_ACF | R92S_RCR_AAP; + mask_min = R92S_RCR_APM; + if (sc->sc_vap_is_running) + mask_min |= R92S_RCR_CBSSID; + else + mask_all |= R92S_RCR_ADF; + + if (ic->ic_opmode == IEEE80211_M_MONITOR) { + uint16_t rxfltmap; + if (sc->sc_vap_is_running) + rxfltmap = 0; + else + rxfltmap = R92S_RXFLTMAP_MGT_DEF; + rsu_write_2(sc, R92S_RXFLTMAP_MGT, rxfltmap); + } + + if (ic->ic_promisc == 0 && ic->ic_opmode != IEEE80211_M_MONITOR) + rsu_rxfilter_set(sc, mask_all, mask_min); + else + rsu_rxfilter_set(sc, mask_min, mask_all); +} + +static void rsu_init(struct rsu_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; @@ -3394,12 +3549,8 @@ rsu_init(struct rsu_softc *sc) goto fail; } - /* Append PHY status. */ - rsu_write_4(sc, R92S_RCR, - rsu_read_4(sc, R92S_RCR) | 0x02000000); - - /* Setup multicast filter (must be done after firmware loading). */ - rsu_set_multi(sc); + /* Initialize Rx filter. */ + rsu_rxfilter_init(sc); /* Set PS mode fully active */ error = rsu_set_fw_power_state(sc, RSU_PWR_ACTIVE); @@ -3433,6 +3584,7 @@ rsu_stop(struct rsu_softc *sc) RSU_ASSERT_LOCKED(sc); sc->sc_running = 0; + sc->sc_vap_is_running = 0; sc->sc_calibrating = 0; taskqueue_cancel_timeout(taskqueue_thread, &sc->calib_task, NULL); taskqueue_cancel(taskqueue_thread, &sc->tx_task, NULL); Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 18:29:39 2016 (r309824) +++ head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 18:47:13 2016 (r309825) @@ -54,6 +54,12 @@ #define R92S_TIMECTRL 0x0080 #define R92S_TSFTR (R92S_TIMECTRL + 0x000) +#define R92S_FIFOCTRL 0x00a0 +#define R92S_RXFLTMAP_MGT (R92S_FIFOCTRL + 0x076) +#define R92S_RXFLTMAP_CTL (R92S_FIFOCTRL + 0x078) +#define R92S_RXFLTMAP_DATA (R92S_FIFOCTRL + 0x07a) +#define R92S_RXFLTMAP_MESH (R92S_FIFOCTRL + 0x07c) + #define R92S_SECURITY 0x0240 #define R92S_CAMCMD (R92S_SECURITY + 0x000) #define R92S_CAMWRITE (R92S_SECURITY + 0x004) @@ -63,6 +69,7 @@ #define R92S_GPIO_CTRL (R92S_GP + 0x00c) #define R92S_GPIO_IO_SEL (R92S_GP + 0x00e) #define R92S_MAC_PINMUX_CTRL (R92S_GP + 0x011) +#define R92S_LEDCFG (R92S_GP + 0x012) #define R92S_IOCMD_CTRL 0x0370 #define R92S_IOCMD_DATA 0x0374 @@ -141,6 +148,29 @@ #define R92S_TCR_IMEM_RDY 0x20 #define R92S_TCR_FWRDY 0x80 +/* Bits for R92S_RCR. */ +#define R92S_RCR_AAP 0x00000001 +#define R92S_RCR_APM 0x00000002 +#define R92S_RCR_AM 0x00000004 +#define R92S_RCR_AB 0x00000008 +#define R92S_RCR_ACRC32 0x00000020 +#define R92S_RCR_AICV 0x00001000 +#define R92S_RCR_APP_ICV 0x00010000 +#define R92S_RCR_APP_MIC 0x00020000 +#define R92S_RCR_ADF 0x00040000 +#define R92S_RCR_ACF 0x00080000 +#define R92S_RCR_AMF 0x00100000 +#define R92S_RCR_ADD3 0x00200000 +#define R92S_RCR_APWRMGT 0x00400000 +#define R92S_RCR_CBSSID 0x00800000 +#define R92S_RCR_APP_PHYSTS 0x02000000 +#define R92S_RCR_ENMBID 0x08000000 + +/* Bits for R92S_RXFLTMAP*. */ +#define R92S_RXFLTMAP_MGT_DEF 0x3f3f +#define R92S_RXFLTMAP_FW(subtype) \ + (1 << ((subtype) >> IEEE80211_FC0_SUBTYPE_SHIFT)) + /* Bits for R92S_GPIO_IO_SEL. */ #define R92S_GPIO_WPS 0x10 @@ -546,6 +576,11 @@ struct r92s_set_pwr_mode { uint8_t bcn_pass_time; } __packed; +/* Structure for R92S_CMD_SET_CHANNEL. */ +struct r92s_set_channel { + uint32_t channel; +} __packed; + /* Structure for event R92S_EVENT_JOIN_BSS. */ struct r92s_event_join_bss { uint32_t next; @@ -817,6 +852,7 @@ struct rsu_softc { int sc_currssi; u_int sc_running:1, + sc_vap_is_running:1, sc_calibrating:1, sc_active_scan:1, sc_extra_scan:1; From owner-svn-src-head@freebsd.org Sat Dec 10 18:57:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20E7DC71769; Sat, 10 Dec 2016 18:57:34 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF9CD1CE4; Sat, 10 Dec 2016 18:57:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x241.google.com with SMTP id f73so13553001ioe.2; Sat, 10 Dec 2016 10:57:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=3M7nVPkXZ5dXe2amEV0iFatXdN7WVzZO2lEyWTGzkKU=; b=AxhS7dNQ+sIynNi5X2XLhDvZ+t2FlGFV6sXZA+7NWfxfz1NwAQIG9Ahk7RpdSfCbZW z81fewHbvLIWYTx/FMRDdzNiUI4fyioSNKFfd4CCUhdpzKtqUnxcaq22xKncCbg2vn/C w5pQ8DoTokmzxTIhYlNlgBMKAXuQT5eRruqcb7AXvn5hGDfCj6wnc5G90CGUK0/Zqoa/ r43NUKV04qWE4CjW1hehzl7nrzu7a+fjA7MkS0qr3rgbJO45N9YJsyttYuK9f72Obk0K MRaFZgD2y6YqmXqSOBgIjYZkvonnhuW2UNjBif9pGEL+NMjMEym4tTvf7yyBzoX2Bm9z WF7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3M7nVPkXZ5dXe2amEV0iFatXdN7WVzZO2lEyWTGzkKU=; b=fL3ED0Ie3VyrR3ZFlIoEEIWXw5HBoOKFe6rTbAzgzlpW1AcACp+rRZ5qcCqbhLzahf Phy7FByVkGuKPcF8Q7XugT/P4BZW4xdY3TYeyOsgziwAytQBvB3L4BbaB44cR94FWc6l uk5RQWQR0nyvbYuUzXD7H4ysdqFA0AJ1wNPJK4p8S4HkMe8M4w0yfEwWiyTCicm1r3bV 4rk3JIzNlcnc4YwId9wNl/KQx8s00dQNmcHMd67Z0dlB8+clClKotjWdLC6fXCcSYF9t WDv/DUmkz00qwDjj8hVV+OXw/QoUguGU/bEDWzuJRsRAAJ1NPD3aUoNAG/q4jiNYPvKN XMww== X-Gm-Message-State: AKaTC01taxJn1wExRCDAmXYk4/SltSKcb1iIHX0FZBv+qRfT/IZxFtf+RH+5IpaLgyVRuAQpNm0VygWtIcp5AQ== X-Received: by 10.36.58.85 with SMTP id m82mr3843414itm.29.1481396252803; Sat, 10 Dec 2016 10:57:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.150.129 with HTTP; Sat, 10 Dec 2016 10:57:32 -0800 (PST) In-Reply-To: <201612101847.uBAIlEFb094635@repo.freebsd.org> References: <201612101847.uBAIlEFb094635@repo.freebsd.org> From: Adrian Chadd Date: Sat, 10 Dec 2016 10:57:32 -0800 Message-ID: Subject: Re: svn commit: r309825 - head/sys/dev/usb/wlan To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 18:57:34 -0000 Would you mind updating the manpage to state this monitor/promisc difference in the LIMITATIONS section, or something? Thanks! -a On 10 December 2016 at 10:47, Andriy Voskoboinyk wrote: > Author: avos > Date: Sat Dec 10 18:47:13 2016 > New Revision: 309825 > URL: https://svnweb.freebsd.org/changeset/base/309825 > > Log: > rsu: add promiscuous mode support. > > - Add partial promiscuous mode support (no management frames; > they cannot be received by the firmware and net80211 at the same time). > - Add monitor mode support (all frames). > > Tested with Asus, USB-N10. > > Modified: > head/sys/dev/usb/wlan/if_rsu.c > head/sys/dev/usb/wlan/if_rsureg.h > > Modified: head/sys/dev/usb/wlan/if_rsu.c > ============================================================================== > --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 18:29:39 2016 (r309824) > +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 18:47:13 2016 (r309825) > @@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$"); > * > * TODO: > * o tx a-mpdu > - * o monitor / hostap / ibss / mesh > + * o hostap / ibss / mesh > * o power-save operation > */ > > @@ -175,6 +175,7 @@ static void rsu_getradiocaps(struct ieee > static void rsu_set_channel(struct ieee80211com *); > static void rsu_scan_curchan(struct ieee80211_scan_state *, unsigned long); > static void rsu_scan_mindwell(struct ieee80211_scan_state *); > +static void rsu_update_promisc(struct ieee80211com *); > static uint8_t rsu_get_multi_pos(const uint8_t[]); > static void rsu_set_multi(struct rsu_softc *); > static void rsu_update_mcast(struct ieee80211com *); > @@ -202,6 +203,9 @@ static int rsu_read_rom(struct rsu_softc > static int rsu_fw_cmd(struct rsu_softc *, uint8_t, void *, int); > static void rsu_calib_task(void *, int); > static void rsu_tx_task(void *, int); > +static void rsu_set_led(struct rsu_softc *, int); > +static int rsu_monitor_newstate(struct ieee80211vap *, > + enum ieee80211_state, int); > static int rsu_newstate(struct ieee80211vap *, enum ieee80211_state, int); > static int rsu_key_alloc(struct ieee80211vap *, struct ieee80211_key *, > ieee80211_keyix *, ieee80211_keyix *); > @@ -244,6 +248,9 @@ static struct mbuf * > static void rsu_txeof(struct usb_xfer *, struct rsu_data *); > static int rsu_raw_xmit(struct ieee80211_node *, struct mbuf *, > const struct ieee80211_bpf_params *); > +static void rsu_rxfilter_init(struct rsu_softc *); > +static void rsu_rxfilter_set(struct rsu_softc *, uint32_t, uint32_t); > +static void rsu_rxfilter_refresh(struct rsu_softc *); > static void rsu_init(struct rsu_softc *); > static int rsu_tx_start(struct rsu_softc *, struct ieee80211_node *, > struct mbuf *, struct rsu_data *); > @@ -536,6 +543,7 @@ rsu_attach(device_t self) > /* Set device capabilities. */ > ic->ic_caps = > IEEE80211_C_STA | /* station mode */ > + IEEE80211_C_MONITOR | /* monitor mode supported */ > #if 0 > IEEE80211_C_BGSCAN | /* Background scan. */ > #endif > @@ -582,6 +590,7 @@ rsu_attach(device_t self) > ic->ic_scan_mindwell = rsu_scan_mindwell; > ic->ic_vap_create = rsu_vap_create; > ic->ic_vap_delete = rsu_vap_delete; > + ic->ic_update_promisc = rsu_update_promisc; > ic->ic_update_mcast = rsu_update_mcast; > ic->ic_parent = rsu_parent; > ic->ic_transmit = rsu_transmit; > @@ -688,7 +697,10 @@ rsu_vap_create(struct ieee80211com *ic, > > /* override state transition machine */ > uvp->newstate = vap->iv_newstate; > - vap->iv_newstate = rsu_newstate; > + if (opmode == IEEE80211_M_MONITOR) > + vap->iv_newstate = rsu_monitor_newstate; > + else > + vap->iv_newstate = rsu_newstate; > vap->iv_key_alloc = rsu_key_alloc; > vap->iv_key_set = rsu_key_set; > vap->iv_key_delete = rsu_key_delete; > @@ -759,9 +771,30 @@ rsu_getradiocaps(struct ieee80211com *ic > } > > static void > -rsu_set_channel(struct ieee80211com *ic __unused) > +rsu_set_channel(struct ieee80211com *ic) > { > - /* We are unable to switch channels, yet. */ > + struct rsu_softc *sc = ic->ic_softc; > + > + /* > + * Only need to set the channel in Monitor mode. AP scanning and auth > + * are already taken care of by their respective firmware commands. > + */ > + if (ic->ic_opmode == IEEE80211_M_MONITOR) { > + struct r92s_set_channel cmd; > + int error; > + > + cmd.channel = IEEE80211_CHAN2IEEE(ic->ic_curchan); > + > + RSU_LOCK(sc); > + error = rsu_fw_cmd(sc, R92S_CMD_SET_CHANNEL, &cmd, > + sizeof(cmd)); > + if (error != 0) { > + device_printf(sc->sc_dev, > + "%s: error %d setting channel\n", __func__, > + error); > + } > + RSU_UNLOCK(sc); > + } > } > > static void > @@ -782,6 +815,17 @@ rsu_scan_mindwell(struct ieee80211_scan_ > /* NB: don't try to abort scan; wait for firmware to finish */ > } > > +static void > +rsu_update_promisc(struct ieee80211com *ic) > +{ > + struct rsu_softc *sc = ic->ic_softc; > + > + RSU_LOCK(sc); > + if (sc->sc_running) > + rsu_rxfilter_refresh(sc); > + RSU_UNLOCK(sc); > +} > + > /* > * The same as rtwn_get_multi_pos() / rtwn_set_multi(). > */ > @@ -1343,6 +1387,47 @@ rsu_set_fw_power_state(struct rsu_softc > return (error); > } > > +static void > +rsu_set_led(struct rsu_softc *sc, int on) > +{ > + rsu_write_1(sc, R92S_LEDCFG, > + (rsu_read_1(sc, R92S_LEDCFG) & 0xf0) | (!on << 3)); > +} > + > +static int > +rsu_monitor_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, > + int arg) > +{ > + struct ieee80211com *ic = vap->iv_ic; > + struct rsu_softc *sc = ic->ic_softc; > + struct rsu_vap *uvp = RSU_VAP(vap); > + > + if (vap->iv_state != nstate) { > + IEEE80211_UNLOCK(ic); > + RSU_LOCK(sc); > + > + switch (nstate) { > + case IEEE80211_S_INIT: > + sc->sc_vap_is_running = 0; > + rsu_set_led(sc, 0); > + break; > + case IEEE80211_S_RUN: > + sc->sc_vap_is_running = 1; > + rsu_set_led(sc, 1); > + break; > + default: > + /* NOTREACHED */ > + break; > + } > + rsu_rxfilter_refresh(sc); > + > + RSU_UNLOCK(sc); > + IEEE80211_LOCK(ic); > + } > + > + return (uvp->newstate(vap, nstate, arg)); > +} > + > static int > rsu_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) > { > @@ -1376,6 +1461,12 @@ rsu_newstate(struct ieee80211vap *vap, e > RSU_LOCK(sc); > /* Disassociate from our current BSS. */ > rsu_disconnect(sc); > + usb_pause_mtx(&sc->sc_mtx, USB_MS_TO_TICKS(10)); > + > + /* Refresh Rx filter (may be modified by firmware). */ > + sc->sc_vap_is_running = 0; > + rsu_rxfilter_refresh(sc); > + > /* Reinstall static keys. */ > if (sc->sc_running) > rsu_reinit_static_keys(sc); > @@ -2030,6 +2121,11 @@ rsu_event_join_bss(struct rsu_softc *sc, > __func__, ether_sprintf(rsp->bss.macaddr), tmp); > /* XXX is this required? What's the top two bits for again? */ > ni->ni_associd = tmp | 0xc000; > + > + /* Refresh Rx filter (was changed by firmware). */ > + sc->sc_vap_is_running = 1; > + rsu_rxfilter_refresh(sc); > + > RSU_UNLOCK(sc); > ieee80211_new_state(vap, IEEE80211_S_RUN, > IEEE80211_FC0_SUBTYPE_ASSOC_RESP); > @@ -3329,6 +3425,65 @@ rsu_raw_xmit(struct ieee80211_node *ni, > } > > static void > +rsu_rxfilter_init(struct rsu_softc *sc) > +{ > + uint32_t reg; > + > + RSU_ASSERT_LOCKED(sc); > + > + /* Setup multicast filter. */ > + rsu_set_multi(sc); > + > + /* Adjust Rx filter. */ > + reg = rsu_read_4(sc, R92S_RCR); > + reg &= ~R92S_RCR_AICV; > + reg |= R92S_RCR_APP_PHYSTS; > + rsu_write_4(sc, R92S_RCR, reg); > + > + /* Update dynamic Rx filter parts. */ > + rsu_rxfilter_refresh(sc); > +} > + > +static void > +rsu_rxfilter_set(struct rsu_softc *sc, uint32_t clear, uint32_t set) > +{ > + /* NB: firmware can touch this register too. */ > + rsu_write_4(sc, R92S_RCR, > + (rsu_read_4(sc, R92S_RCR) & ~clear) | set); > +} > + > +static void > +rsu_rxfilter_refresh(struct rsu_softc *sc) > +{ > + struct ieee80211com *ic = &sc->sc_ic; > + uint32_t mask_all, mask_min; > + > + RSU_ASSERT_LOCKED(sc); > + > + /* NB: RCR_AMF / RXFLTMAP_MGT are used by firmware. */ > + mask_all = R92S_RCR_ACF | R92S_RCR_AAP; > + mask_min = R92S_RCR_APM; > + if (sc->sc_vap_is_running) > + mask_min |= R92S_RCR_CBSSID; > + else > + mask_all |= R92S_RCR_ADF; > + > + if (ic->ic_opmode == IEEE80211_M_MONITOR) { > + uint16_t rxfltmap; > + if (sc->sc_vap_is_running) > + rxfltmap = 0; > + else > + rxfltmap = R92S_RXFLTMAP_MGT_DEF; > + rsu_write_2(sc, R92S_RXFLTMAP_MGT, rxfltmap); > + } > + > + if (ic->ic_promisc == 0 && ic->ic_opmode != IEEE80211_M_MONITOR) > + rsu_rxfilter_set(sc, mask_all, mask_min); > + else > + rsu_rxfilter_set(sc, mask_min, mask_all); > +} > + > +static void > rsu_init(struct rsu_softc *sc) > { > struct ieee80211com *ic = &sc->sc_ic; > @@ -3394,12 +3549,8 @@ rsu_init(struct rsu_softc *sc) > goto fail; > } > > - /* Append PHY status. */ > - rsu_write_4(sc, R92S_RCR, > - rsu_read_4(sc, R92S_RCR) | 0x02000000); > - > - /* Setup multicast filter (must be done after firmware loading). */ > - rsu_set_multi(sc); > + /* Initialize Rx filter. */ > + rsu_rxfilter_init(sc); > > /* Set PS mode fully active */ > error = rsu_set_fw_power_state(sc, RSU_PWR_ACTIVE); > @@ -3433,6 +3584,7 @@ rsu_stop(struct rsu_softc *sc) > RSU_ASSERT_LOCKED(sc); > > sc->sc_running = 0; > + sc->sc_vap_is_running = 0; > sc->sc_calibrating = 0; > taskqueue_cancel_timeout(taskqueue_thread, &sc->calib_task, NULL); > taskqueue_cancel(taskqueue_thread, &sc->tx_task, NULL); > > Modified: head/sys/dev/usb/wlan/if_rsureg.h > ============================================================================== > --- head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 18:29:39 2016 (r309824) > +++ head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 18:47:13 2016 (r309825) > @@ -54,6 +54,12 @@ > #define R92S_TIMECTRL 0x0080 > #define R92S_TSFTR (R92S_TIMECTRL + 0x000) > > +#define R92S_FIFOCTRL 0x00a0 > +#define R92S_RXFLTMAP_MGT (R92S_FIFOCTRL + 0x076) > +#define R92S_RXFLTMAP_CTL (R92S_FIFOCTRL + 0x078) > +#define R92S_RXFLTMAP_DATA (R92S_FIFOCTRL + 0x07a) > +#define R92S_RXFLTMAP_MESH (R92S_FIFOCTRL + 0x07c) > + > #define R92S_SECURITY 0x0240 > #define R92S_CAMCMD (R92S_SECURITY + 0x000) > #define R92S_CAMWRITE (R92S_SECURITY + 0x004) > @@ -63,6 +69,7 @@ > #define R92S_GPIO_CTRL (R92S_GP + 0x00c) > #define R92S_GPIO_IO_SEL (R92S_GP + 0x00e) > #define R92S_MAC_PINMUX_CTRL (R92S_GP + 0x011) > +#define R92S_LEDCFG (R92S_GP + 0x012) > > #define R92S_IOCMD_CTRL 0x0370 > #define R92S_IOCMD_DATA 0x0374 > @@ -141,6 +148,29 @@ > #define R92S_TCR_IMEM_RDY 0x20 > #define R92S_TCR_FWRDY 0x80 > > +/* Bits for R92S_RCR. */ > +#define R92S_RCR_AAP 0x00000001 > +#define R92S_RCR_APM 0x00000002 > +#define R92S_RCR_AM 0x00000004 > +#define R92S_RCR_AB 0x00000008 > +#define R92S_RCR_ACRC32 0x00000020 > +#define R92S_RCR_AICV 0x00001000 > +#define R92S_RCR_APP_ICV 0x00010000 > +#define R92S_RCR_APP_MIC 0x00020000 > +#define R92S_RCR_ADF 0x00040000 > +#define R92S_RCR_ACF 0x00080000 > +#define R92S_RCR_AMF 0x00100000 > +#define R92S_RCR_ADD3 0x00200000 > +#define R92S_RCR_APWRMGT 0x00400000 > +#define R92S_RCR_CBSSID 0x00800000 > +#define R92S_RCR_APP_PHYSTS 0x02000000 > +#define R92S_RCR_ENMBID 0x08000000 > + > +/* Bits for R92S_RXFLTMAP*. */ > +#define R92S_RXFLTMAP_MGT_DEF 0x3f3f > +#define R92S_RXFLTMAP_FW(subtype) \ > + (1 << ((subtype) >> IEEE80211_FC0_SUBTYPE_SHIFT)) > + > /* Bits for R92S_GPIO_IO_SEL. */ > #define R92S_GPIO_WPS 0x10 > > @@ -546,6 +576,11 @@ struct r92s_set_pwr_mode { > uint8_t bcn_pass_time; > } __packed; > > +/* Structure for R92S_CMD_SET_CHANNEL. */ > +struct r92s_set_channel { > + uint32_t channel; > +} __packed; > + > /* Structure for event R92S_EVENT_JOIN_BSS. */ > struct r92s_event_join_bss { > uint32_t next; > @@ -817,6 +852,7 @@ struct rsu_softc { > int sc_currssi; > > u_int sc_running:1, > + sc_vap_is_running:1, > sc_calibrating:1, > sc_active_scan:1, > sc_extra_scan:1; > From owner-svn-src-head@freebsd.org Sat Dec 10 19:06:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59763C71A4E; Sat, 10 Dec 2016 19:06:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-qk0-f182.google.com (mail-qk0-f182.google.com [209.85.220.182]) (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 1E5BD1208; Sat, 10 Dec 2016 19:06:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-qk0-f182.google.com with SMTP id n204so48569279qke.2; Sat, 10 Dec 2016 11:06:24 -0800 (PST) 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=G+JZ/MYwhCUWYnPqIePQEdTvTBgSR9J+0YCkYD2RSF4=; b=NAma0DZMCSp9hklC19MEl6fhY73AHSoTP7mop3UG9VM4AD4av/qHKwy/jMJHmfDfwD 902Yu1CnwfYQmX01iEDzT5NtOcBB0IJLY8JeaNQTxdZaqvbntvtQmTvzS+0jCkgrz829 1MVjpf25+hOTkezh0uHLv19hmsPIe52Ox/2OfN2CaCOQUAZapf3WIFGoMsS0rkpYaa6x nagLUzD+TYiR8wS5Etcb1BLxOz7wwf0bIQhfAvuCcYy2wbSYpw8s0Mi7Oprped5gAFwy AqEwweNIA5Rtrh4F0qLmPtjk6NSxpiAI14sowKZNyn311AXxlRMNcwEQYfE5MZIFHye7 VC9w== X-Gm-Message-State: AKaTC01UfLQC7sEpLQscq09x/FWhiAw/RWzG0TaveXNaFjACKfT4IQfC1VF5w0bRra+TNA== X-Received: by 10.55.115.6 with SMTP id o6mr81260249qkc.271.1481391166855; Sat, 10 Dec 2016 09:32:46 -0800 (PST) Received: from mail-qt0-f170.google.com (mail-qt0-f170.google.com. [209.85.216.170]) by smtp.gmail.com with ESMTPSA id n191sm22554386qke.19.2016.12.10.09.32.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Dec 2016 09:32:46 -0800 (PST) Received: by mail-qt0-f170.google.com with SMTP id w33so43317196qtc.3; Sat, 10 Dec 2016 09:32:46 -0800 (PST) X-Received: by 10.237.53.253 with SMTP id d58mr74986766qte.29.1481391166449; Sat, 10 Dec 2016 09:32:46 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.200.58.165 with HTTP; Sat, 10 Dec 2016 09:32:46 -0800 (PST) In-Reply-To: <201612101620.uBAGKdUg033773@repo.freebsd.org> References: <201612101620.uBAGKdUg033773@repo.freebsd.org> From: Conrad Meyer Date: Sat, 10 Dec 2016 09:32:46 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309818 - in head: etc/defaults etc/rc.d sbin sbin/decryptcore sbin/dumpon sbin/savecore share/man/man5 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/ddb sys/dev/null sys/geo... To: Konrad Witaszczyk Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 19:06:25 -0000 On Sat, Dec 10, 2016 at 8:20 AM, Konrad Witaszczyk wrote: > Author: def > Date: Sat Dec 10 16:20:39 2016 > New Revision: 309818 > URL: https://svnweb.freebsd.org/changeset/base/309818 > > Log: > Add support for encrypted kernel crash dumps. Awesome! Thank you for developing and committing this. Conrad From owner-svn-src-head@freebsd.org Sat Dec 10 19:14:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87213C71CCE; Sat, 10 Dec 2016 19:14:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 56B1E1984; Sat, 10 Dec 2016 19:14:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAJEpjS007115; Sat, 10 Dec 2016 19:14:51 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAJEpUK007114; Sat, 10 Dec 2016 19:14:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612101914.uBAJEpUK007114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 10 Dec 2016 19:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309826 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 19:14:52 -0000 Author: avos Date: Sat Dec 10 19:14:51 2016 New Revision: 309826 URL: https://svnweb.freebsd.org/changeset/base/309826 Log: rsu(4): refresh the manpage. - Add monitor mode into the list of supported modes. - Describe promiscuous mode limitations in CAVEATS section. Reported by: adrian Modified: head/share/man/man4/rsu.4 Modified: head/share/man/man4/rsu.4 ============================================================================== --- head/share/man/man4/rsu.4 Sat Dec 10 18:47:13 2016 (r309825) +++ head/share/man/man4/rsu.4 Sat Dec 10 19:14:51 2016 (r309826) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd December 5, 2016 +.Dd December 10, 2016 .Dt RSU 4 .Os .Sh NAME @@ -78,6 +78,12 @@ Also known as mode, this is used when associating with an access point, through which all traffic passes. This mode is the default. +.It monitor mode +In this mode the driver is able to receive packets without +associating with an access point. +This disables the internal receive filter and enables the card to +capture packets from networks which it wouldn't normally have access to, +or to scan for access points. .El .Pp The @@ -183,3 +189,9 @@ The .Nm driver currently does not support 802.11n transmit aggregation, either A-MSDU or A-MPDU. +.Pp +The +.Nm +driver does not capture management frames in non-monitor modes; +without this limitation some firmware functions (e.g., 'join bss') +will not work properly. From owner-svn-src-head@freebsd.org Sat Dec 10 19:18:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA4FDC71D64; Sat, 10 Dec 2016 19:18:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B0AD1B25; Sat, 10 Dec 2016 19:18:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x241.google.com with SMTP id p13so13623544ioi.0; Sat, 10 Dec 2016 11:18:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Giwz3wr6mey+aGspW2KKQpgZmztRgbXiZkyWhpPyV2w=; b=EAzONAwWHV9wmoYrWXLatP9Oramz47Ppze8zNk7BPPQTgpgxabItLDHLeup30UyOZb BuywE6Y752m3bBYmHtHlGIISUow70AwlMETbDBn2febIzQTCzWhppEcURBze4FaKs94U 6XCXPqN0WsG1Ehwv9fYqHEJpnlXDBIyiX7ED8AOMJTx6MwRJ4tQnep4kKqxdTgTfVoos VJ6JG2VyhWqPA6jMoTPcrAR4JU5cCFQXtxOs2wezntkbT4QgqzLyKX1XtCHqwebJUKjw 73UXuDjDEoiTFG9Aau609RLXRbKUbvU4LS76sF9peLA98vBV2W0/0upxEwdxsj03VI8H 1nDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Giwz3wr6mey+aGspW2KKQpgZmztRgbXiZkyWhpPyV2w=; b=Y+N+wAL8BtStzpOuhGxFzar5HfckAt7dmxp839V4mGYs9Ztlm+kdTcbd3Im904Q+r5 B6YM4+89CU7EqRUC0rkmk+rpCr5OKTHhk1r6plP5AMS+1XgVkmQI7HsaSA/dwhUG86y3 EzJ3VtTsjNWktHX0xpkVnOGiGy8P+fmw9jLacSI04+a9YQ5qWoI9T76l5moLh+VfJ2Og F0z+gxSt9/HzVG6iiLrSIeZh4K0DcL+VEmbMv+WXPdDJ6x6AsN8hZC4AlZIZWwlm27Jb 9Hf+PjzEX0QzC8ZgErh1tx9KdjDImmfe4Bd/HgReoUnhYYpy4rL7JgMSEq6VksiMv8V3 +QXg== X-Gm-Message-State: AKaTC02R0O0UcNpmfmD3UquWeVYVweUmtSISKivH2ze37WTS/dSwqPr0eCs5AH3QMgFHFTwZzHkE9f9IVYo6FQ== X-Received: by 10.107.192.196 with SMTP id q187mr32713896iof.129.1481397531384; Sat, 10 Dec 2016 11:18:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.150.129 with HTTP; Sat, 10 Dec 2016 11:18:50 -0800 (PST) In-Reply-To: References: <201612101847.uBAIlEFb094635@repo.freebsd.org> From: Adrian Chadd Date: Sat, 10 Dec 2016 11:18:50 -0800 Message-ID: Subject: Re: svn commit: r309825 - head/sys/dev/usb/wlan To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 19:18:52 -0000 thanks! -a On 10 December 2016 at 11:15, Andriy Voskoboinyk wrote: > Sat, 10 Dec 2016 20:57:32 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd > : > > Done in r309826. > > >> Would you mind updating the manpage to state this monitor/promisc >> difference in the LIMITATIONS section, or something? >> >> Thanks! >> >> >> >> -a >> >> >> On 10 December 2016 at 10:47, Andriy Voskoboinyk wrot= e: >>> >>> Author: avos >>> Date: Sat Dec 10 18:47:13 2016 >>> New Revision: 309825 >>> URL: https://svnweb.freebsd.org/changeset/base/309825 >>> >>> Log: >>> rsu: add promiscuous mode support. >>> >>> - Add partial promiscuous mode support (no management frames; >>> they cannot be received by the firmware and net80211 at the same time= ). >>> - Add monitor mode support (all frames). >>> >>> Tested with Asus, USB-N10. >>> >>> Modified: >>> head/sys/dev/usb/wlan/if_rsu.c >>> head/sys/dev/usb/wlan/if_rsureg.h >>> >>> Modified: head/sys/dev/usb/wlan/if_rsu.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 18:29:39 2016 >>> (r309824) >>> +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 18:47:13 2016 >>> (r309825) >>> @@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$"); >>> * >>> * TODO: >>> * o tx a-mpdu >>> - * o monitor / hostap / ibss / mesh >>> + * o hostap / ibss / mesh >>> * o power-save operation >>> */ >>> >>> @@ -175,6 +175,7 @@ static void rsu_getradiocaps(struct ieee >>> static void rsu_set_channel(struct ieee80211com *); >>> static void rsu_scan_curchan(struct ieee80211_scan_state *, unsigne= d >>> long); >>> static void rsu_scan_mindwell(struct ieee80211_scan_state *); >>> +static void rsu_update_promisc(struct ieee80211com *); >>> static uint8_t rsu_get_multi_pos(const uint8_t[]); >>> static void rsu_set_multi(struct rsu_softc *); >>> static void rsu_update_mcast(struct ieee80211com *); >>> @@ -202,6 +203,9 @@ static int rsu_read_rom(struct rsu_softc >>> static int rsu_fw_cmd(struct rsu_softc *, uint8_t, void *, int); >>> static void rsu_calib_task(void *, int); >>> static void rsu_tx_task(void *, int); >>> +static void rsu_set_led(struct rsu_softc *, int); >>> +static int rsu_monitor_newstate(struct ieee80211vap *, >>> + enum ieee80211_state, int); >>> static int rsu_newstate(struct ieee80211vap *, enum ieee80211_stat= e, >>> int); >>> static int rsu_key_alloc(struct ieee80211vap *, struct ieee80211_k= ey >>> *, >>> ieee80211_keyix *, ieee80211_keyix *); >>> @@ -244,6 +248,9 @@ static struct mbuf * >>> static void rsu_txeof(struct usb_xfer *, struct rsu_data *); >>> static int rsu_raw_xmit(struct ieee80211_node *, struct mbuf *, >>> const struct ieee80211_bpf_params *); >>> +static void rsu_rxfilter_init(struct rsu_softc *); >>> +static void rsu_rxfilter_set(struct rsu_softc *, uint32_t, uint32_t= ); >>> +static void rsu_rxfilter_refresh(struct rsu_softc *); >>> static void rsu_init(struct rsu_softc *); >>> static int rsu_tx_start(struct rsu_softc *, struct ieee80211_node = *, >>> struct mbuf *, struct rsu_data *); >>> @@ -536,6 +543,7 @@ rsu_attach(device_t self) >>> /* Set device capabilities. */ >>> ic->ic_caps =3D >>> IEEE80211_C_STA | /* station mode */ >>> + IEEE80211_C_MONITOR | /* monitor mode supported */ >>> #if 0 >>> IEEE80211_C_BGSCAN | /* Background scan. */ >>> #endif >>> @@ -582,6 +590,7 @@ rsu_attach(device_t self) >>> ic->ic_scan_mindwell =3D rsu_scan_mindwell; >>> ic->ic_vap_create =3D rsu_vap_create; >>> ic->ic_vap_delete =3D rsu_vap_delete; >>> + ic->ic_update_promisc =3D rsu_update_promisc; >>> ic->ic_update_mcast =3D rsu_update_mcast; >>> ic->ic_parent =3D rsu_parent; >>> ic->ic_transmit =3D rsu_transmit; >>> @@ -688,7 +697,10 @@ rsu_vap_create(struct ieee80211com *ic, >>> >>> /* override state transition machine */ >>> uvp->newstate =3D vap->iv_newstate; >>> - vap->iv_newstate =3D rsu_newstate; >>> + if (opmode =3D=3D IEEE80211_M_MONITOR) >>> + vap->iv_newstate =3D rsu_monitor_newstate; >>> + else >>> + vap->iv_newstate =3D rsu_newstate; >>> vap->iv_key_alloc =3D rsu_key_alloc; >>> vap->iv_key_set =3D rsu_key_set; >>> vap->iv_key_delete =3D rsu_key_delete; >>> @@ -759,9 +771,30 @@ rsu_getradiocaps(struct ieee80211com *ic >>> } >>> >>> static void >>> -rsu_set_channel(struct ieee80211com *ic __unused) >>> +rsu_set_channel(struct ieee80211com *ic) >>> { >>> - /* We are unable to switch channels, yet. */ >>> + struct rsu_softc *sc =3D ic->ic_softc; >>> + >>> + /* >>> + * Only need to set the channel in Monitor mode. AP scanning an= d >>> auth >>> + * are already taken care of by their respective firmware >>> commands. >>> + */ >>> + if (ic->ic_opmode =3D=3D IEEE80211_M_MONITOR) { >>> + struct r92s_set_channel cmd; >>> + int error; >>> + >>> + cmd.channel =3D IEEE80211_CHAN2IEEE(ic->ic_curchan); >>> + >>> + RSU_LOCK(sc); >>> + error =3D rsu_fw_cmd(sc, R92S_CMD_SET_CHANNEL, &cmd, >>> + sizeof(cmd)); >>> + if (error !=3D 0) { >>> + device_printf(sc->sc_dev, >>> + "%s: error %d setting channel\n", __func__, >>> + error); >>> + } >>> + RSU_UNLOCK(sc); >>> + } >>> } >>> >>> static void >>> @@ -782,6 +815,17 @@ rsu_scan_mindwell(struct ieee80211_scan_ >>> /* NB: don't try to abort scan; wait for firmware to finish */ >>> } >>> >>> +static void >>> +rsu_update_promisc(struct ieee80211com *ic) >>> +{ >>> + struct rsu_softc *sc =3D ic->ic_softc; >>> + >>> + RSU_LOCK(sc); >>> + if (sc->sc_running) >>> + rsu_rxfilter_refresh(sc); >>> + RSU_UNLOCK(sc); >>> +} >>> + >>> /* >>> * The same as rtwn_get_multi_pos() / rtwn_set_multi(). >>> */ >>> @@ -1343,6 +1387,47 @@ rsu_set_fw_power_state(struct rsu_softc >>> return (error); >>> } >>> >>> +static void >>> +rsu_set_led(struct rsu_softc *sc, int on) >>> +{ >>> + rsu_write_1(sc, R92S_LEDCFG, >>> + (rsu_read_1(sc, R92S_LEDCFG) & 0xf0) | (!on << 3)); >>> +} >>> + >>> +static int >>> +rsu_monitor_newstate(struct ieee80211vap *vap, enum ieee80211_state >>> nstate, >>> + int arg) >>> +{ >>> + struct ieee80211com *ic =3D vap->iv_ic; >>> + struct rsu_softc *sc =3D ic->ic_softc; >>> + struct rsu_vap *uvp =3D RSU_VAP(vap); >>> + >>> + if (vap->iv_state !=3D nstate) { >>> + IEEE80211_UNLOCK(ic); >>> + RSU_LOCK(sc); >>> + >>> + switch (nstate) { >>> + case IEEE80211_S_INIT: >>> + sc->sc_vap_is_running =3D 0; >>> + rsu_set_led(sc, 0); >>> + break; >>> + case IEEE80211_S_RUN: >>> + sc->sc_vap_is_running =3D 1; >>> + rsu_set_led(sc, 1); >>> + break; >>> + default: >>> + /* NOTREACHED */ >>> + break; >>> + } >>> + rsu_rxfilter_refresh(sc); >>> + >>> + RSU_UNLOCK(sc); >>> + IEEE80211_LOCK(ic); >>> + } >>> + >>> + return (uvp->newstate(vap, nstate, arg)); >>> +} >>> + >>> static int >>> rsu_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, in= t >>> arg) >>> { >>> @@ -1376,6 +1461,12 @@ rsu_newstate(struct ieee80211vap *vap, e >>> RSU_LOCK(sc); >>> /* Disassociate from our current BSS. */ >>> rsu_disconnect(sc); >>> + usb_pause_mtx(&sc->sc_mtx, USB_MS_TO_TICKS(10)); >>> + >>> + /* Refresh Rx filter (may be modified by firmware). */ >>> + sc->sc_vap_is_running =3D 0; >>> + rsu_rxfilter_refresh(sc); >>> + >>> /* Reinstall static keys. */ >>> if (sc->sc_running) >>> rsu_reinit_static_keys(sc); >>> @@ -2030,6 +2121,11 @@ rsu_event_join_bss(struct rsu_softc *sc, >>> __func__, ether_sprintf(rsp->bss.macaddr), tmp); >>> /* XXX is this required? What's the top two bits for again? */ >>> ni->ni_associd =3D tmp | 0xc000; >>> + >>> + /* Refresh Rx filter (was changed by firmware). */ >>> + sc->sc_vap_is_running =3D 1; >>> + rsu_rxfilter_refresh(sc); >>> + >>> RSU_UNLOCK(sc); >>> ieee80211_new_state(vap, IEEE80211_S_RUN, >>> IEEE80211_FC0_SUBTYPE_ASSOC_RESP); >>> @@ -3329,6 +3425,65 @@ rsu_raw_xmit(struct ieee80211_node *ni, >>> } >>> >>> static void >>> +rsu_rxfilter_init(struct rsu_softc *sc) >>> +{ >>> + uint32_t reg; >>> + >>> + RSU_ASSERT_LOCKED(sc); >>> + >>> + /* Setup multicast filter. */ >>> + rsu_set_multi(sc); >>> + >>> + /* Adjust Rx filter. */ >>> + reg =3D rsu_read_4(sc, R92S_RCR); >>> + reg &=3D ~R92S_RCR_AICV; >>> + reg |=3D R92S_RCR_APP_PHYSTS; >>> + rsu_write_4(sc, R92S_RCR, reg); >>> + >>> + /* Update dynamic Rx filter parts. */ >>> + rsu_rxfilter_refresh(sc); >>> +} >>> + >>> +static void >>> +rsu_rxfilter_set(struct rsu_softc *sc, uint32_t clear, uint32_t set) >>> +{ >>> + /* NB: firmware can touch this register too. */ >>> + rsu_write_4(sc, R92S_RCR, >>> + (rsu_read_4(sc, R92S_RCR) & ~clear) | set); >>> +} >>> + >>> +static void >>> +rsu_rxfilter_refresh(struct rsu_softc *sc) >>> +{ >>> + struct ieee80211com *ic =3D &sc->sc_ic; >>> + uint32_t mask_all, mask_min; >>> + >>> + RSU_ASSERT_LOCKED(sc); >>> + >>> + /* NB: RCR_AMF / RXFLTMAP_MGT are used by firmware. */ >>> + mask_all =3D R92S_RCR_ACF | R92S_RCR_AAP; >>> + mask_min =3D R92S_RCR_APM; >>> + if (sc->sc_vap_is_running) >>> + mask_min |=3D R92S_RCR_CBSSID; >>> + else >>> + mask_all |=3D R92S_RCR_ADF; >>> + >>> + if (ic->ic_opmode =3D=3D IEEE80211_M_MONITOR) { >>> + uint16_t rxfltmap; >>> + if (sc->sc_vap_is_running) >>> + rxfltmap =3D 0; >>> + else >>> + rxfltmap =3D R92S_RXFLTMAP_MGT_DEF; >>> + rsu_write_2(sc, R92S_RXFLTMAP_MGT, rxfltmap); >>> + } >>> + >>> + if (ic->ic_promisc =3D=3D 0 && ic->ic_opmode !=3D IEEE80211_M_M= ONITOR) >>> + rsu_rxfilter_set(sc, mask_all, mask_min); >>> + else >>> + rsu_rxfilter_set(sc, mask_min, mask_all); >>> +} >>> + >>> +static void >>> rsu_init(struct rsu_softc *sc) >>> { >>> struct ieee80211com *ic =3D &sc->sc_ic; >>> @@ -3394,12 +3549,8 @@ rsu_init(struct rsu_softc *sc) >>> goto fail; >>> } >>> >>> - /* Append PHY status. */ >>> - rsu_write_4(sc, R92S_RCR, >>> - rsu_read_4(sc, R92S_RCR) | 0x02000000); >>> - >>> - /* Setup multicast filter (must be done after firmware loading)= . >>> */ >>> - rsu_set_multi(sc); >>> + /* Initialize Rx filter. */ >>> + rsu_rxfilter_init(sc); >>> >>> /* Set PS mode fully active */ >>> error =3D rsu_set_fw_power_state(sc, RSU_PWR_ACTIVE); >>> @@ -3433,6 +3584,7 @@ rsu_stop(struct rsu_softc *sc) >>> RSU_ASSERT_LOCKED(sc); >>> >>> sc->sc_running =3D 0; >>> + sc->sc_vap_is_running =3D 0; >>> sc->sc_calibrating =3D 0; >>> taskqueue_cancel_timeout(taskqueue_thread, &sc->calib_task, >>> NULL); >>> taskqueue_cancel(taskqueue_thread, &sc->tx_task, NULL); >>> >>> Modified: head/sys/dev/usb/wlan/if_rsureg.h >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 18:29:39 2016 >>> (r309824) >>> +++ head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 18:47:13 2016 >>> (r309825) >>> @@ -54,6 +54,12 @@ >>> #define R92S_TIMECTRL 0x0080 >>> #define R92S_TSFTR (R92S_TIMECTRL + 0x000) >>> >>> +#define R92S_FIFOCTRL 0x00a0 >>> +#define R92S_RXFLTMAP_MGT (R92S_FIFOCTRL + 0x076) >>> +#define R92S_RXFLTMAP_CTL (R92S_FIFOCTRL + 0x078) >>> +#define R92S_RXFLTMAP_DATA (R92S_FIFOCTRL + 0x07a) >>> +#define R92S_RXFLTMAP_MESH (R92S_FIFOCTRL + 0x07c) >>> + >>> #define R92S_SECURITY 0x0240 >>> #define R92S_CAMCMD (R92S_SECURITY + 0x000) >>> #define R92S_CAMWRITE (R92S_SECURITY + 0x004) >>> @@ -63,6 +69,7 @@ >>> #define R92S_GPIO_CTRL (R92S_GP + 0x00c) >>> #define R92S_GPIO_IO_SEL (R92S_GP + 0x00e) >>> #define R92S_MAC_PINMUX_CTRL (R92S_GP + 0x011) >>> +#define R92S_LEDCFG (R92S_GP + 0x012) >>> >>> #define R92S_IOCMD_CTRL 0x0370 >>> #define R92S_IOCMD_DATA 0x0374 >>> @@ -141,6 +148,29 @@ >>> #define R92S_TCR_IMEM_RDY 0x20 >>> #define R92S_TCR_FWRDY 0x80 >>> >>> +/* Bits for R92S_RCR. */ >>> +#define R92S_RCR_AAP 0x00000001 >>> +#define R92S_RCR_APM 0x00000002 >>> +#define R92S_RCR_AM 0x00000004 >>> +#define R92S_RCR_AB 0x00000008 >>> +#define R92S_RCR_ACRC32 0x00000020 >>> +#define R92S_RCR_AICV 0x00001000 >>> +#define R92S_RCR_APP_ICV 0x00010000 >>> +#define R92S_RCR_APP_MIC 0x00020000 >>> +#define R92S_RCR_ADF 0x00040000 >>> +#define R92S_RCR_ACF 0x00080000 >>> +#define R92S_RCR_AMF 0x00100000 >>> +#define R92S_RCR_ADD3 0x00200000 >>> +#define R92S_RCR_APWRMGT 0x00400000 >>> +#define R92S_RCR_CBSSID 0x00800000 >>> +#define R92S_RCR_APP_PHYSTS 0x02000000 >>> +#define R92S_RCR_ENMBID 0x08000000 >>> + >>> +/* Bits for R92S_RXFLTMAP*. */ >>> +#define R92S_RXFLTMAP_MGT_DEF 0x3f3f >>> +#define R92S_RXFLTMAP_FW(subtype) \ >>> + (1 << ((subtype) >> IEEE80211_FC0_SUBTYPE_SHIFT)) >>> + >>> /* Bits for R92S_GPIO_IO_SEL. */ >>> #define R92S_GPIO_WPS 0x10 >>> >>> @@ -546,6 +576,11 @@ struct r92s_set_pwr_mode { >>> uint8_t bcn_pass_time; >>> } __packed; >>> >>> +/* Structure for R92S_CMD_SET_CHANNEL. */ >>> +struct r92s_set_channel { >>> + uint32_t channel; >>> +} __packed; >>> + >>> /* Structure for event R92S_EVENT_JOIN_BSS. */ >>> struct r92s_event_join_bss { >>> uint32_t next; >>> @@ -817,6 +852,7 @@ struct rsu_softc { >>> int sc_currssi; >>> >>> u_int sc_running:1, >>> + sc_vap_is_running:1, >>> sc_calibrating:1, >>> sc_active_scan:1, >>> sc_extra_scan:1; From owner-svn-src-head@freebsd.org Sat Dec 10 19:20:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBC4CC71EE4; Sat, 10 Dec 2016 19:20:48 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 849441CF5; Sat, 10 Dec 2016 19:20:48 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x241.google.com with SMTP id y124so13669026iof.1; Sat, 10 Dec 2016 11:20:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=cc:message-id:from:to:in-reply-to:content-transfer-encoding :mime-version:subject:date:references; bh=mSevRXV5orJFgdX5GchulMUeEU2hvkN19UgXNfsJcT0=; b=G9rTQ/D+bpc2+l0VuM0B+ukcSoCxT7NlkucQgOyXDZqxL4w2NzMp2yRw9H1eB7nK5P coBBGErOWgO1VRWreyTbEH+CwI2HFGjPpu5gPQ/NFY7LZ+Hpa9oGq7m/KbYb9J6PkHkf GyK0lp1mDEhpZ8k3yPrnjR0EYupHiZUc+0kYfguSzEr15twDZl32QC3utcEv9qofo0xi wsGXLl8IAYOb+F6XAKlRr8hWO/jhqT/VY65PgE8M9mOcy/kI6VYkdw0tikYdp7X85ySZ lP/aFVlYFO62/LjRoGt5qNsG3lPJBDRE1aKMZISHMi5bx9yzZT1mULCyidad7+if1Kb+ r2WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:cc:message-id:from:to:in-reply-to :content-transfer-encoding:mime-version:subject:date:references; bh=mSevRXV5orJFgdX5GchulMUeEU2hvkN19UgXNfsJcT0=; b=NjN0U7hiZhSBfXnvWZkgKbucfXGqv8N3jO3BVBZn+/i8Sks86uKQIjUssSGfas1yoH sEslCni0yiMt+5DN+jj6myeWQDhmqBnLfTJghzIW59ILploL0ZK88iEluCwfUp8WZIXY 54KDywSJ1WY3Bd3EXqPM+l4eeda2NUbHzxKRtGJZOnRFATBP3R+ZRZAi5YjN5rOoOd6B PBW0DrRa8EUuyjYZL/8T1pLIZSeJalUpz6SiY20NnIqqdsTHZ9+8iokFlHpoA1xF/6xB e8cnRSkvUSU3eksOZ2lcG2eZpqH6eQpKVK45xqKQ4t+XATsqdXsQZfCfdFL7LwAfz6fn thjA== X-Gm-Message-State: AKaTC02mYfOVBdkKso25riz9Gvl3CYsHIvO8ZgewSPw8l2aSXWr/yuaM1xa0USk+GYXdOA== X-Received: by 10.107.181.77 with SMTP id e74mr37468651iof.99.1481397647746; Sat, 10 Dec 2016 11:20:47 -0800 (PST) Received: from blackstar.knownspace (50-80-150-234.client.mchsi.com. [50.80.150.234]) by smtp.gmail.com with ESMTPSA id k205sm3725767ita.15.2016.12.10.11.20.46 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 10 Dec 2016 11:20:47 -0800 (PST) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <043C7408-A0FA-4316-B24B-3A181146FE20@gmail.com> From: Justin Hibbits To: Konrad Witaszczyk In-Reply-To: <201612101620.uBAGKdUg033773@repo.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r309818 - in head: etc/defaults etc/rc.d sbin sbin/decryptcore sbin/dumpon sbin/savecore share/man/man5 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/ddb sys/dev/null sys/geo... Date: Sat, 10 Dec 2016 13:20:50 -0600 References: <201612101620.uBAGKdUg033773@repo.freebsd.org> X-Mailer: Apple Mail (2.936) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 19:20:48 -0000 On Dec 10, 2016, at 10:20 AM, Konrad Witaszczyk wrote: > Author: def > Date: Sat Dec 10 16:20:39 2016 > New Revision: 309818 > URL: https://svnweb.freebsd.org/changeset/base/309818 > > Log: > Add support for encrypted kernel crash dumps. > > Changes include modifications in kernel crash dump routines, > dumpon(8) and > savecore(8). A new tool called decryptcore(8) was added. > > A new DIOCSKERNELDUMP I/O control was added to send a kernel crash > dump > configuration in the diocskerneldump_arg structure to the kernel. > The old DIOCSKERNELDUMP I/O control was renamed to > DIOCSKERNELDUMP_FREEBSD11 for > backward ABI compatibility. > > dumpon(8) generates an one-time random symmetric key and encrypts > it using > an RSA public key in capability mode. Currently only AES-256-CBC is > supported > but EKCD was designed to implement support for other algorithms in > the future. > The public key is chosen using the -k flag. The dumpon rc(8) script > can do this > automatically during startup using the dumppubkey rc.conf(5) > variable. Once the > keys are calculated dumpon sends them to the kernel via > DIOCSKERNELDUMP I/O > control. > > When the kernel receives the DIOCSKERNELDUMP I/O control it > generates a random > IV and sets up the key schedule for the specified algorithm. Each > time the > kernel tries to write a crash dump to the dump device, the IV is > replaced by > a SHA-256 hash of the previous value. This is intended to make a > possible > differential cryptanalysis harder since it is possible to write > multiple crash > dumps without reboot by repeating the following commands: > # sysctl debug.kdb.enter=1 > db> call doadump(0) > db> continue > # savecore > > A kernel dump key consists of an algorithm identifier, an IV and an > encrypted > symmetric key. The kernel dump key size is included in a kernel > dump header. > The size is an unsigned 32-bit integer and it is aligned to a block > size. > The header structure has 512 bytes to match the block size so it > was required to > make a panic string 4 bytes shorter to add a new field to the > header structure. > If the kernel dump key size in the header is nonzero it is assumed > that the > kernel dump key is placed after the first header on the dump device > and the core > dump is encrypted. > > Separate functions were implemented to write the kernel dump header > and the > kernel dump key as they need to be unencrypted. The dump_write > function encrypts > data if the kernel was compiled with the EKCD option. Encrypted > kernel textdumps > are not supported due to the way they are constructed which makes > it impossible > to use the CBC mode for encryption. It should be also noted that > textdumps don't > contain sensitive data by design as a user decides what information > should be > dumped. > > savecore(8) writes the kernel dump key to a key.# file if its size > in the header > is nonzero. # is the number of the current core dump. > > decryptcore(8) decrypts the core dump using a private RSA key and > the kernel > dump key. This is performed by a child process in capability mode. > If the decryption was not successful the parent process removes a > partially > decrypted core dump. > > Description on how to encrypt crash dumps was added to the > decryptcore(8), > dumpon(8), rc.conf(5) and savecore(8) manual pages. > > EKCD was tested on amd64 using bhyve and i386, mipsel and sparc64 > using QEMU. > The feature still has to be tested on arm and arm64 as it wasn't > possible to run > FreeBSD due to the problems with QEMU emulation and lack of hardware. > > Designed by: def, pjd > Reviewed by: cem, oshogbo, pjd > Partial review: delphij, emaste, jhb, kib > Approved by: pjd (mentor) > Differential Revision: https://reviews.freebsd.org/D4712 > > Added: > head/sbin/decryptcore/ > head/sbin/decryptcore/Makefile (contents, props changed) > head/sbin/decryptcore/decryptcore.8 (contents, props changed) > head/sbin/decryptcore/decryptcore.c (contents, props changed) > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/dumpon > head/sbin/Makefile > head/sbin/dumpon/Makefile > head/sbin/dumpon/dumpon.8 > head/sbin/dumpon/dumpon.c > head/sbin/savecore/savecore.8 > head/sbin/savecore/savecore.c > head/share/man/man5/rc.conf.5 > head/sys/amd64/amd64/minidump_machdep.c > head/sys/arm/arm/minidump_machdep.c > head/sys/arm64/arm64/minidump_machdep.c > head/sys/conf/NOTES > head/sys/conf/files > head/sys/conf/options > head/sys/ddb/db_textdump.c > head/sys/dev/null/null.c > head/sys/geom/geom_dev.c > head/sys/i386/i386/minidump_machdep.c > head/sys/kern/kern_dump.c > head/sys/kern/kern_shutdown.c > head/sys/mips/mips/minidump_machdep.c > head/sys/sparc64/sparc64/dump_machdep.c > head/sys/sys/conf.h > head/sys/sys/disk.h > head/sys/sys/kerneldump.h Nice! Any reason you left out PowerPC from this list though? - Justin From owner-svn-src-head@freebsd.org Sat Dec 10 20:19:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAAE4C7119A; Sat, 10 Dec 2016 20:19:58 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C550E1AEB; Sat, 10 Dec 2016 20:19:58 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAKJvOh031782; Sat, 10 Dec 2016 20:19:57 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAKJvif031781; Sat, 10 Dec 2016 20:19:57 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612102019.uBAKJvif031781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 10 Dec 2016 20:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309827 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 20:19:59 -0000 Author: avos Date: Sat Dec 10 20:19:57 2016 New Revision: 309827 URL: https://svnweb.freebsd.org/changeset/base/309827 Log: rsu: use bitmap for all debug messages. - Replace all remaining DPRINTF(N)'s with RSU_DPRINTF. - Add new RSU_DEBUG_USB flag to track error codes returned by usbd_do_request_flags(). - Improve few messages. Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 19:14:51 2016 (r309826) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 20:19:57 2016 (r309827) @@ -68,9 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include "usbdevs.h" -#define USB_DEBUG_VAR rsu_debug -#include - #include #ifdef USB_DEBUG @@ -103,6 +100,7 @@ TUNABLE_INT("hw.usb.rsu.enable_11n", &rs #define RSU_DEBUG_FWDBG 0x00000200 #define RSU_DEBUG_AMPDU 0x00000400 #define RSU_DEBUG_KEY 0x00000800 +#define RSU_DEBUG_USB 0x00001000 static const STRUCT_USB_HOST_ID rsu_devs[] = { #define RSU_HT_NOT_SUPPORTED 0 @@ -665,8 +663,9 @@ rsu_do_request(struct rsu_softc *sc, str req, data, 0, NULL, 250 /* ms */); if (err == 0 || err == USB_ERR_NOT_CONFIGURED) break; - DPRINTFN(1, "Control request failed, %s (retrying)\n", - usbd_errstr(err)); + RSU_DPRINTF(sc, RSU_DEBUG_USB, + "Control request failed, %s (retries left: %d)\n", + usbd_errstr(err), ntries); rsu_ms_delay(sc, 10); } @@ -1207,7 +1206,7 @@ rsu_read_rom(struct rsu_softc *sc) } } #ifdef USB_DEBUG - if (rsu_debug >= 5) { + if (rsu_debug & RSU_DEBUG_RESET) { /* Dump ROM content. */ printf("\n"); for (i = 0; i < sizeof(sc->rom); i++) @@ -1294,7 +1293,7 @@ rsu_calib_task(void *arg, int pending __ rsu_read_1(sc, R92S_GPIO_IO_SEL) & ~R92S_GPIO_WPS); reg = rsu_read_1(sc, R92S_GPIO_CTRL); if (reg != 0xff && (reg & R92S_GPIO_WPS)) - DPRINTF(("WPS PBC is pushed\n")); + RSU_DPRINTF(sc, RSU_DEBUG_CALIB, "WPS PBC is pushed\n"); #endif /* Read current signal level. */ if (rsu_fw_iocmd(sc, 0xf4000001) == 0) { @@ -2113,7 +2112,7 @@ rsu_event_join_bss(struct rsu_softc *sc, tmp = le32toh(rsp->associd); if (tmp >= vap->iv_max_aid) { - DPRINTF("Assoc ID overflow\n"); + RSU_DPRINTF(sc, RSU_DEBUG_ANY, "Assoc ID overflow\n"); tmp = 1; } RSU_DPRINTF(sc, RSU_DEBUG_STATE | RSU_DEBUG_FWCMD, @@ -2306,8 +2305,9 @@ rsu_rx_copy_to_mbuf(struct rsu_softc *sc m = m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { - device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n", - __func__); + device_printf(sc->sc_dev, + "%s: could not allocate RX mbuf, totlen %d\n", + __func__, totlen); goto fail; } @@ -2490,7 +2490,7 @@ rsu_rxeof(struct usb_xfer *xfer, struct usbd_xfer_status(xfer, &len, NULL, NULL, NULL); if (__predict_false(len < sizeof(*stat))) { - DPRINTF("xfer too short %d\n", len); + RSU_DPRINTF(sc, RSU_DEBUG_RX, "xfer too short %d\n", len); counter_u64_add(ic->ic_ierrors, 1); return (NULL); } @@ -3251,8 +3251,9 @@ rsu_load_firmware(struct rsu_softc *sc) error = EINVAL; goto fail; } - DPRINTF("FW V%d %02x-%02x %02x:%02x\n", le16toh(hdr->version), - hdr->month, hdr->day, hdr->hour, hdr->minute); + RSU_DPRINTF(sc, RSU_DEBUG_FW, "FW V%d %02x-%02x %02x:%02x\n", + le16toh(hdr->version), hdr->month, hdr->day, hdr->hour, + hdr->minute); /* Make sure that driver and firmware are in sync. */ if (hdr->privsz != htole32(sizeof(*dmem))) { From owner-svn-src-head@freebsd.org Sat Dec 10 20:21:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B65F1C7138F; Sat, 10 Dec 2016 20:21:25 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (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 32D171F83; Sat, 10 Dec 2016 20:21:24 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f66.google.com with SMTP id x143so2854905lfd.1; Sat, 10 Dec 2016 12:21:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=McsLxqCh2s82D0bZ4nwEN1V2kg/FyFhBXCyoiWTIXi0=; b=YH33wwey1GDT30ric9KWPbW9PbKJtibWu/D4GuAJQa/JuPSVYhDeGkuYnPjmBAk/bk PZI2w/OVS4IbEyWSiJw9TG0+xYFYCSkynscTqIJqP8hbXm0Bb+zRmpFTIgFjwLtGQXqE S2YfxOv5OhkaITMb/6lsMd5yyekUJ8ljPCdutMPtdCrqTRoP1sEIoi7EsMx43Am5yQr5 9tm8SAP80VenAAROBsTcOQds5+eqfc87wkj11l5mtm90MbniJ/CQMNYFUX783p3GaYrc lwfwz09fLT0fIhDKmPiNRNHH3O0DVgCx3PuljCOQBg5LFRAgsQQghzkd+yGTFUrKpxtD nyEQ== X-Gm-Message-State: AKaTC00GJc4UYjgtv8FduLlaU8Teg442hXBuHeUfnwF/IICITYh2vfcIUy2v45YlEAnnNw== X-Received: by 10.25.74.193 with SMTP id x184mr29265460lfa.146.1481397331569; Sat, 10 Dec 2016 11:15:31 -0800 (PST) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id e94sm7491614lji.40.2016.12.10.11.15.30 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 10 Dec 2016 11:15:31 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Adrian Chadd" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r309825 - head/sys/dev/usb/wlan References: <201612101847.uBAIlEFb094635@repo.freebsd.org> Date: Sat, 10 Dec 2016 21:15:40 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 20:21:25 -0000 Sat, 10 Dec 2016 20:57:32 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd = : Done in r309826. > Would you mind updating the manpage to state this monitor/promisc > difference in the LIMITATIONS section, or something? > > Thanks! > > > > -a > > > On 10 December 2016 at 10:47, Andriy Voskoboinyk = > wrote: >> Author: avos >> Date: Sat Dec 10 18:47:13 2016 >> New Revision: 309825 >> URL: https://svnweb.freebsd.org/changeset/base/309825 >> >> Log: >> rsu: add promiscuous mode support. >> >> - Add partial promiscuous mode support (no management frames; >> they cannot be received by the firmware and net80211 at the same = >> time). >> - Add monitor mode support (all frames). >> >> Tested with Asus, USB-N10. >> >> Modified: >> head/sys/dev/usb/wlan/if_rsu.c >> head/sys/dev/usb/wlan/if_rsureg.h >> >> Modified: head/sys/dev/usb/wlan/if_rsu.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 18:29:39 2016 = = >> (r309824) >> +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 18:47:13 2016 = = >> (r309825) >> @@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$"); >> * >> * TODO: >> * o tx a-mpdu >> - * o monitor / hostap / ibss / mesh >> + * o hostap / ibss / mesh >> * o power-save operation >> */ >> >> @@ -175,6 +175,7 @@ static void rsu_getradiocaps(struct ieee >> static void rsu_set_channel(struct ieee80211com *); >> static void rsu_scan_curchan(struct ieee80211_scan_state *, = >> unsigned long); >> static void rsu_scan_mindwell(struct ieee80211_scan_state *); >> +static void rsu_update_promisc(struct ieee80211com *); >> static uint8_t rsu_get_multi_pos(const uint8_t[]); >> static void rsu_set_multi(struct rsu_softc *); >> static void rsu_update_mcast(struct ieee80211com *); >> @@ -202,6 +203,9 @@ static int rsu_read_rom(struct rsu_softc >> static int rsu_fw_cmd(struct rsu_softc *, uint8_t, void *, int);= >> static void rsu_calib_task(void *, int); >> static void rsu_tx_task(void *, int); >> +static void rsu_set_led(struct rsu_softc *, int); >> +static int rsu_monitor_newstate(struct ieee80211vap *, >> + enum ieee80211_state, int); >> static int rsu_newstate(struct ieee80211vap *, enum = >> ieee80211_state, int); >> static int rsu_key_alloc(struct ieee80211vap *, struct = >> ieee80211_key *, >> ieee80211_keyix *, ieee80211_keyix *); >> @@ -244,6 +248,9 @@ static struct mbuf * >> static void rsu_txeof(struct usb_xfer *, struct rsu_data *); >> static int rsu_raw_xmit(struct ieee80211_node *, struct mbuf *, >> const struct ieee80211_bpf_params *); >> +static void rsu_rxfilter_init(struct rsu_softc *); >> +static void rsu_rxfilter_set(struct rsu_softc *, uint32_t, = >> uint32_t); >> +static void rsu_rxfilter_refresh(struct rsu_softc *); >> static void rsu_init(struct rsu_softc *); >> static int rsu_tx_start(struct rsu_softc *, struct ieee80211_nod= e = >> *, >> struct mbuf *, struct rsu_data *); >> @@ -536,6 +543,7 @@ rsu_attach(device_t self) >> /* Set device capabilities. */ >> ic->ic_caps =3D >> IEEE80211_C_STA | /* station mode */ >> + IEEE80211_C_MONITOR | /* monitor mode supported */ >> #if 0 >> IEEE80211_C_BGSCAN | /* Background scan. */ >> #endif >> @@ -582,6 +590,7 @@ rsu_attach(device_t self) >> ic->ic_scan_mindwell =3D rsu_scan_mindwell; >> ic->ic_vap_create =3D rsu_vap_create; >> ic->ic_vap_delete =3D rsu_vap_delete; >> + ic->ic_update_promisc =3D rsu_update_promisc; >> ic->ic_update_mcast =3D rsu_update_mcast; >> ic->ic_parent =3D rsu_parent; >> ic->ic_transmit =3D rsu_transmit; >> @@ -688,7 +697,10 @@ rsu_vap_create(struct ieee80211com *ic, >> >> /* override state transition machine */ >> uvp->newstate =3D vap->iv_newstate; >> - vap->iv_newstate =3D rsu_newstate; >> + if (opmode =3D=3D IEEE80211_M_MONITOR) >> + vap->iv_newstate =3D rsu_monitor_newstate; >> + else >> + vap->iv_newstate =3D rsu_newstate; >> vap->iv_key_alloc =3D rsu_key_alloc; >> vap->iv_key_set =3D rsu_key_set; >> vap->iv_key_delete =3D rsu_key_delete; >> @@ -759,9 +771,30 @@ rsu_getradiocaps(struct ieee80211com *ic >> } >> >> static void >> -rsu_set_channel(struct ieee80211com *ic __unused) >> +rsu_set_channel(struct ieee80211com *ic) >> { >> - /* We are unable to switch channels, yet. */ >> + struct rsu_softc *sc =3D ic->ic_softc; >> + >> + /* >> + * Only need to set the channel in Monitor mode. AP scanning = = >> and auth >> + * are already taken care of by their respective firmware = >> commands. >> + */ >> + if (ic->ic_opmode =3D=3D IEEE80211_M_MONITOR) { >> + struct r92s_set_channel cmd; >> + int error; >> + >> + cmd.channel =3D IEEE80211_CHAN2IEEE(ic->ic_curchan); >> + >> + RSU_LOCK(sc); >> + error =3D rsu_fw_cmd(sc, R92S_CMD_SET_CHANNEL, &cmd, >> + sizeof(cmd)); >> + if (error !=3D 0) { >> + device_printf(sc->sc_dev, >> + "%s: error %d setting channel\n", __func_= _, >> + error); >> + } >> + RSU_UNLOCK(sc); >> + } >> } >> >> static void >> @@ -782,6 +815,17 @@ rsu_scan_mindwell(struct ieee80211_scan_ >> /* NB: don't try to abort scan; wait for firmware to finish *= / >> } >> >> +static void >> +rsu_update_promisc(struct ieee80211com *ic) >> +{ >> + struct rsu_softc *sc =3D ic->ic_softc; >> + >> + RSU_LOCK(sc); >> + if (sc->sc_running) >> + rsu_rxfilter_refresh(sc); >> + RSU_UNLOCK(sc); >> +} >> + >> /* >> * The same as rtwn_get_multi_pos() / rtwn_set_multi(). >> */ >> @@ -1343,6 +1387,47 @@ rsu_set_fw_power_state(struct rsu_softc >> return (error); >> } >> >> +static void >> +rsu_set_led(struct rsu_softc *sc, int on) >> +{ >> + rsu_write_1(sc, R92S_LEDCFG, >> + (rsu_read_1(sc, R92S_LEDCFG) & 0xf0) | (!on << 3)); >> +} >> + >> +static int >> +rsu_monitor_newstate(struct ieee80211vap *vap, enum ieee80211_state = = >> nstate, >> + int arg) >> +{ >> + struct ieee80211com *ic =3D vap->iv_ic; >> + struct rsu_softc *sc =3D ic->ic_softc; >> + struct rsu_vap *uvp =3D RSU_VAP(vap); >> + >> + if (vap->iv_state !=3D nstate) { >> + IEEE80211_UNLOCK(ic); >> + RSU_LOCK(sc); >> + >> + switch (nstate) { >> + case IEEE80211_S_INIT: >> + sc->sc_vap_is_running =3D 0; >> + rsu_set_led(sc, 0); >> + break; >> + case IEEE80211_S_RUN: >> + sc->sc_vap_is_running =3D 1; >> + rsu_set_led(sc, 1); >> + break; >> + default: >> + /* NOTREACHED */ >> + break; >> + } >> + rsu_rxfilter_refresh(sc); >> + >> + RSU_UNLOCK(sc); >> + IEEE80211_LOCK(ic); >> + } >> + >> + return (uvp->newstate(vap, nstate, arg)); >> +} >> + >> static int >> rsu_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, = = >> int arg) >> { >> @@ -1376,6 +1461,12 @@ rsu_newstate(struct ieee80211vap *vap, e >> RSU_LOCK(sc); >> /* Disassociate from our current BSS. */ >> rsu_disconnect(sc); >> + usb_pause_mtx(&sc->sc_mtx, USB_MS_TO_TICKS(10)); >> + >> + /* Refresh Rx filter (may be modified by firmware). *= / >> + sc->sc_vap_is_running =3D 0; >> + rsu_rxfilter_refresh(sc); >> + >> /* Reinstall static keys. */ >> if (sc->sc_running) >> rsu_reinit_static_keys(sc); >> @@ -2030,6 +2121,11 @@ rsu_event_join_bss(struct rsu_softc *sc, >> __func__, ether_sprintf(rsp->bss.macaddr), tmp); >> /* XXX is this required? What's the top two bits for again? *= / >> ni->ni_associd =3D tmp | 0xc000; >> + >> + /* Refresh Rx filter (was changed by firmware). */ >> + sc->sc_vap_is_running =3D 1; >> + rsu_rxfilter_refresh(sc); >> + >> RSU_UNLOCK(sc); >> ieee80211_new_state(vap, IEEE80211_S_RUN, >> IEEE80211_FC0_SUBTYPE_ASSOC_RESP); >> @@ -3329,6 +3425,65 @@ rsu_raw_xmit(struct ieee80211_node *ni, >> } >> >> static void >> +rsu_rxfilter_init(struct rsu_softc *sc) >> +{ >> + uint32_t reg; >> + >> + RSU_ASSERT_LOCKED(sc); >> + >> + /* Setup multicast filter. */ >> + rsu_set_multi(sc); >> + >> + /* Adjust Rx filter. */ >> + reg =3D rsu_read_4(sc, R92S_RCR); >> + reg &=3D ~R92S_RCR_AICV; >> + reg |=3D R92S_RCR_APP_PHYSTS; >> + rsu_write_4(sc, R92S_RCR, reg); >> + >> + /* Update dynamic Rx filter parts. */ >> + rsu_rxfilter_refresh(sc); >> +} >> + >> +static void >> +rsu_rxfilter_set(struct rsu_softc *sc, uint32_t clear, uint32_t set)= >> +{ >> + /* NB: firmware can touch this register too. */ >> + rsu_write_4(sc, R92S_RCR, >> + (rsu_read_4(sc, R92S_RCR) & ~clear) | set); >> +} >> + >> +static void >> +rsu_rxfilter_refresh(struct rsu_softc *sc) >> +{ >> + struct ieee80211com *ic =3D &sc->sc_ic; >> + uint32_t mask_all, mask_min; >> + >> + RSU_ASSERT_LOCKED(sc); >> + >> + /* NB: RCR_AMF / RXFLTMAP_MGT are used by firmware. */ >> + mask_all =3D R92S_RCR_ACF | R92S_RCR_AAP; >> + mask_min =3D R92S_RCR_APM; >> + if (sc->sc_vap_is_running) >> + mask_min |=3D R92S_RCR_CBSSID; >> + else >> + mask_all |=3D R92S_RCR_ADF; >> + >> + if (ic->ic_opmode =3D=3D IEEE80211_M_MONITOR) { >> + uint16_t rxfltmap; >> + if (sc->sc_vap_is_running) >> + rxfltmap =3D 0; >> + else >> + rxfltmap =3D R92S_RXFLTMAP_MGT_DEF; >> + rsu_write_2(sc, R92S_RXFLTMAP_MGT, rxfltmap); >> + } >> + >> + if (ic->ic_promisc =3D=3D 0 && ic->ic_opmode !=3D IEEE80211_M= _MONITOR) >> + rsu_rxfilter_set(sc, mask_all, mask_min); >> + else >> + rsu_rxfilter_set(sc, mask_min, mask_all); >> +} >> + >> +static void >> rsu_init(struct rsu_softc *sc) >> { >> struct ieee80211com *ic =3D &sc->sc_ic; >> @@ -3394,12 +3549,8 @@ rsu_init(struct rsu_softc *sc) >> goto fail; >> } >> >> - /* Append PHY status. */ >> - rsu_write_4(sc, R92S_RCR, >> - rsu_read_4(sc, R92S_RCR) | 0x02000000); >> - >> - /* Setup multicast filter (must be done after firmware = >> loading). */ >> - rsu_set_multi(sc); >> + /* Initialize Rx filter. */ >> + rsu_rxfilter_init(sc); >> >> /* Set PS mode fully active */ >> error =3D rsu_set_fw_power_state(sc, RSU_PWR_ACTIVE); >> @@ -3433,6 +3584,7 @@ rsu_stop(struct rsu_softc *sc) >> RSU_ASSERT_LOCKED(sc); >> >> sc->sc_running =3D 0; >> + sc->sc_vap_is_running =3D 0; >> sc->sc_calibrating =3D 0; >> taskqueue_cancel_timeout(taskqueue_thread, &sc->calib_task, = >> NULL); >> taskqueue_cancel(taskqueue_thread, &sc->tx_task, NULL); >> >> Modified: head/sys/dev/usb/wlan/if_rsureg.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 18:29:39 2016 = = >> (r309824) >> +++ head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 10 18:47:13 2016 = = >> (r309825) >> @@ -54,6 +54,12 @@ >> #define R92S_TIMECTRL 0x0080 >> #define R92S_TSFTR (R92S_TIMECTRL + 0x000) >> >> +#define R92S_FIFOCTRL 0x00a0 >> +#define R92S_RXFLTMAP_MGT (R92S_FIFOCTRL + 0x076) >> +#define R92S_RXFLTMAP_CTL (R92S_FIFOCTRL + 0x078) >> +#define R92S_RXFLTMAP_DATA (R92S_FIFOCTRL + 0x07a) >> +#define R92S_RXFLTMAP_MESH (R92S_FIFOCTRL + 0x07c) >> + >> #define R92S_SECURITY 0x0240 >> #define R92S_CAMCMD (R92S_SECURITY + 0x000) >> #define R92S_CAMWRITE (R92S_SECURITY + 0x004) >> @@ -63,6 +69,7 @@ >> #define R92S_GPIO_CTRL (R92S_GP + 0x00c) >> #define R92S_GPIO_IO_SEL (R92S_GP + 0x00e) >> #define R92S_MAC_PINMUX_CTRL (R92S_GP + 0x011) >> +#define R92S_LEDCFG (R92S_GP + 0x012) >> >> #define R92S_IOCMD_CTRL 0x0370 >> #define R92S_IOCMD_DATA 0x0374 >> @@ -141,6 +148,29 @@ >> #define R92S_TCR_IMEM_RDY 0x20 >> #define R92S_TCR_FWRDY 0x80 >> >> +/* Bits for R92S_RCR. */ >> +#define R92S_RCR_AAP 0x00000001 >> +#define R92S_RCR_APM 0x00000002 >> +#define R92S_RCR_AM 0x00000004 >> +#define R92S_RCR_AB 0x00000008 >> +#define R92S_RCR_ACRC32 0x00000020 >> +#define R92S_RCR_AICV 0x00001000 >> +#define R92S_RCR_APP_ICV 0x00010000 >> +#define R92S_RCR_APP_MIC 0x00020000 >> +#define R92S_RCR_ADF 0x00040000 >> +#define R92S_RCR_ACF 0x00080000 >> +#define R92S_RCR_AMF 0x00100000 >> +#define R92S_RCR_ADD3 0x00200000 >> +#define R92S_RCR_APWRMGT 0x00400000 >> +#define R92S_RCR_CBSSID 0x00800000 >> +#define R92S_RCR_APP_PHYSTS 0x02000000 >> +#define R92S_RCR_ENMBID 0x08000000 >> + >> +/* Bits for R92S_RXFLTMAP*. */ >> +#define R92S_RXFLTMAP_MGT_DEF 0x3f3f >> +#define R92S_RXFLTMAP_FW(subtype) \ >> + (1 << ((subtype) >> IEEE80211_FC0_SUBTYPE_SHIFT)) >> + >> /* Bits for R92S_GPIO_IO_SEL. */ >> #define R92S_GPIO_WPS 0x10 >> >> @@ -546,6 +576,11 @@ struct r92s_set_pwr_mode { >> uint8_t bcn_pass_time; >> } __packed; >> >> +/* Structure for R92S_CMD_SET_CHANNEL. */ >> +struct r92s_set_channel { >> + uint32_t channel; >> +} __packed; >> + >> /* Structure for event R92S_EVENT_JOIN_BSS. */ >> struct r92s_event_join_bss { >> uint32_t next; >> @@ -817,6 +852,7 @@ struct rsu_softc { >> int sc_currssi; >> >> u_int sc_running:1, >> + sc_vap_is_running:1, >> sc_calibrating:1, >> sc_active_scan:1, >> sc_extra_scan:1; From owner-svn-src-head@freebsd.org Sat Dec 10 20:35:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EF4FC716C8 for ; Sat, 10 Dec 2016 20:35:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAB6F1A0C for ; Sat, 10 Dec 2016 20:35:09 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x234.google.com with SMTP id g23so15301840wme.1 for ; Sat, 10 Dec 2016 12:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IKDbtrQa4tpKDtmTygeVseYxEfNHWa3TzkCF4CI6HQY=; b=058d8A/H0YRCBpUmNILHgi/95QYzbc3EMbrZAksiT+IlDn4zZGH29efUrjDWukktKv 4IRhKEPnAsZ1S1cuwvoLoHJ9lh7IU4XXw4/JrUxj38iHaxCL+mVxsBoBTlKfvUTmJQbs 6pDVRTJ6366pCL5JZzldhFVLlrwQNboY/Sb8bzEArU8JrsV+tuC4ExLFr3p5nFqkCcqb lUilXMgBve504zwYmhEFdg+LAF3Uh8q6x7wmbVoWU65r4lnwqQWhs423o8Z9t9TF7tuJ w1QUn2HIdwlBmuoF5GmhgwupUDxRRj4cucQfeGwrEntuWDys21h/hZE6JgHNoah9NMzV DGQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IKDbtrQa4tpKDtmTygeVseYxEfNHWa3TzkCF4CI6HQY=; b=LGWt30FwAzFEeZJJxs7D6GG6+po+AR3CZPEFKkuOgIsUXuGLsB6FOwkSMI9U6/dC6L n/o7uirYfb1yAuAmks8juKnSVAgHSwY/2i4WccxjSFd/LrB/7/KRLXHlWmL0hs+OqhwM 9wnKuOR6rhWs+VSjH0jFFkIrFnajKmynrrwo+BGUdhOfjkOAxT4fMSXhqymju6y7M9DN Y0q74VNnzG/TfNHYCBRjV8B+SM96Ltf81xAr62i6ZCzSISKDcnpQ+OpRXGEMR6qtobar Za/eTr0/dGywI3LGxFryIKjXp5gvUZ0mRGQ2F27wJBkwgnciTportM7jxx3UCJ7wRfoW LYAA== X-Gm-Message-State: AKaTC00VF2QTGNN3caLJvOL2PhhKAgNQEkNP9vYTGBvWiuE895xuT6GYQgSt1fco9L/cuFb3nEmjpCIdzi+9ic94 X-Received: by 10.28.150.69 with SMTP id y66mr12379462wmd.107.1481402105280; Sat, 10 Dec 2016 12:35:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.253.65 with HTTP; Sat, 10 Dec 2016 12:35:04 -0800 (PST) In-Reply-To: <201610211827.u9LIRUUi010303@repo.freebsd.org> References: <201610211827.u9LIRUUi010303@repo.freebsd.org> From: Oliver Pinter Date: Sat, 10 Dec 2016 21:35:04 +0100 Message-ID: Subject: Re: svn commit: r307745 - head/sys/kern To: Hiren Panchasara Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Lohith Bellad Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 20:35:10 -0000 On 10/21/16, Hiren Panchasara wrote: > Author: hiren > Date: Fri Oct 21 18:27:30 2016 > New Revision: 307745 > URL: https://svnweb.freebsd.org/changeset/base/307745 > > Log: > Rework r306337. > > In sendit(), if mp->msg_control is present, then in sockargs() we are > allocating mbuf to store mp->msg_control. Later in kern_sendit(), call > to getsock_cap(), will check validity of file pointer passed, if this > fails EBADF is returned but mbuf allocated in sockargs() is not freed. > Made code changes to free the same. > > Since freeing control mbuf in sendit() after checking (control != NULL) > may lead to double freeing of control mbuf in sendit(), we can free > control mbuf in kern_sendit() if there are any errors in the routine. > > Submitted by: Lohith Bellad > Reviewed by: glebius > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D8152 Hi Hiren! What's the status of the MFC? I not see them (this and r306337) in 11-STABLE nor in 10-STABLE branch. Thanks, Oliver > > Modified: > head/sys/kern/uipc_syscalls.c > > Modified: head/sys/kern/uipc_syscalls.c > ============================================================================== > --- head/sys/kern/uipc_syscalls.c Fri Oct 21 17:44:47 2016 (r307744) > +++ head/sys/kern/uipc_syscalls.c Fri Oct 21 18:27:30 2016 (r307745) > @@ -762,8 +762,10 @@ kern_sendit(struct thread *td, int s, st > cap_rights_set(&rights, CAP_CONNECT); > } > error = getsock_cap(td, s, &rights, &fp, NULL, NULL); > - if (error != 0) > + if (error != 0) { > + m_freem(control); > return (error); > + } > so = (struct socket *)fp->f_data; > > #ifdef KTRACE > @@ -774,12 +776,16 @@ kern_sendit(struct thread *td, int s, st > if (mp->msg_name != NULL) { > error = mac_socket_check_connect(td->td_ucred, so, > mp->msg_name); > - if (error != 0) > + if (error != 0) { > + m_freem(control); > goto bad; > + } > } > error = mac_socket_check_send(td->td_ucred, so); > - if (error != 0) > + if (error != 0) { > + m_freem(control); > goto bad; > + } > #endif > > auio.uio_iov = mp->msg_iov; > @@ -793,6 +799,7 @@ kern_sendit(struct thread *td, int s, st > for (i = 0; i < mp->msg_iovlen; i++, iov++) { > if ((auio.uio_resid += iov->iov_len) < 0) { > error = EINVAL; > + m_freem(control); > goto bad; > } > } > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sat Dec 10 20:53:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 050D2C71B2A; Sat, 10 Dec 2016 20:53:53 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from troz.pl (troz.pl [37.187.125.115]) by mx1.freebsd.org (Postfix) with ESMTP id AF75F12D9; Sat, 10 Dec 2016 20:53:52 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from [192.168.0.2] (unknown [185.118.250.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by troz.pl (Postfix) with ESMTPSA id 77D42B54; Sat, 10 Dec 2016 21:53:51 +0100 (CET) Subject: Re: svn commit: r309818 - in head: etc/defaults etc/rc.d sbin sbin/decryptcore sbin/dumpon sbin/savecore share/man/man5 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/ddb sys/dev/null sys/geo... To: Justin Hibbits References: <201612101620.uBAGKdUg033773@repo.freebsd.org> <043C7408-A0FA-4316-B24B-3A181146FE20@gmail.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Konrad Witaszczyk Message-ID: <56f24e51-140c-5e30-08df-9ffa0bdf73bb@FreeBSD.org> Date: Sat, 10 Dec 2016 21:53:43 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <043C7408-A0FA-4316-B24B-3A181146FE20@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pcBACHb1tJsCBK53djlXx7bFX6AgLnw9n" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 20:53:53 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pcBACHb1tJsCBK53djlXx7bFX6AgLnw9n Content-Type: multipart/mixed; boundary="Sv7Dmm0KL9WeHtg4HHVPQFfDn0REoR9hj"; protected-headers="v1" From: Konrad Witaszczyk To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56f24e51-140c-5e30-08df-9ffa0bdf73bb@FreeBSD.org> Subject: Re: svn commit: r309818 - in head: etc/defaults etc/rc.d sbin sbin/decryptcore sbin/dumpon sbin/savecore share/man/man5 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/ddb sys/dev/null sys/geo... References: <201612101620.uBAGKdUg033773@repo.freebsd.org> <043C7408-A0FA-4316-B24B-3A181146FE20@gmail.com> In-Reply-To: <043C7408-A0FA-4316-B24B-3A181146FE20@gmail.com> --Sv7Dmm0KL9WeHtg4HHVPQFfDn0REoR9hj Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12/10/2016 20:20, Justin Hibbits wrote: > On Dec 10, 2016, at 10:20 AM, Konrad Witaszczyk wrote: >> Author: def >> Date: Sat Dec 10 16:20:39 2016 >> New Revision: 309818 >> URL: https://svnweb.freebsd.org/changeset/base/309818 >> >> Log: >> Add support for encrypted kernel crash dumps. >> >> Changes include modifications in kernel crash dump routines, dumpon(8= ) and >> savecore(8). A new tool called decryptcore(8) was added. >> >> A new DIOCSKERNELDUMP I/O control was added to send a kernel crash du= mp >> configuration in the diocskerneldump_arg structure to the kernel. >> The old DIOCSKERNELDUMP I/O control was renamed to DIOCSKERNELDUMP_FR= EEBSD11 >> for >> backward ABI compatibility. >> >> dumpon(8) generates an one-time random symmetric key and encrypts it = using >> an RSA public key in capability mode. Currently only AES-256-CBC is s= upported >> but EKCD was designed to implement support for other algorithms in th= e future. >> The public key is chosen using the -k flag. The dumpon rc(8) script c= an do this >> automatically during startup using the dumppubkey rc.conf(5) variable= =2E Once >> the >> keys are calculated dumpon sends them to the kernel via DIOCSKERNELDU= MP I/O >> control. >> >> When the kernel receives the DIOCSKERNELDUMP I/O control it generates= a random >> IV and sets up the key schedule for the specified algorithm. Each tim= e the >> kernel tries to write a crash dump to the dump device, the IV is repl= aced by >> a SHA-256 hash of the previous value. This is intended to make a poss= ible >> differential cryptanalysis harder since it is possible to write multi= ple crash >> dumps without reboot by repeating the following commands: >> # sysctl debug.kdb.enter=3D1 >> db> call doadump(0) >> db> continue >> # savecore >> >> A kernel dump key consists of an algorithm identifier, an IV and an e= ncrypted >> symmetric key. The kernel dump key size is included in a kernel dump = header. >> The size is an unsigned 32-bit integer and it is aligned to a block s= ize. >> The header structure has 512 bytes to match the block size so it was >> required to >> make a panic string 4 bytes shorter to add a new field to the header = structure. >> If the kernel dump key size in the header is nonzero it is assumed th= at the >> kernel dump key is placed after the first header on the dump device a= nd the >> core >> dump is encrypted. >> >> Separate functions were implemented to write the kernel dump header a= nd the >> kernel dump key as they need to be unencrypted. The dump_write functi= on >> encrypts >> data if the kernel was compiled with the EKCD option. Encrypted kerne= l >> textdumps >> are not supported due to the way they are constructed which makes it = impossible >> to use the CBC mode for encryption. It should be also noted that text= dumps >> don't >> contain sensitive data by design as a user decides what information s= hould be >> dumped. >> >> savecore(8) writes the kernel dump key to a key.# file if its size in= the >> header >> is nonzero. # is the number of the current core dump. >> >> decryptcore(8) decrypts the core dump using a private RSA key and the= kernel >> dump key. This is performed by a child process in capability mode. >> If the decryption was not successful the parent process removes a par= tially >> decrypted core dump. >> >> Description on how to encrypt crash dumps was added to the decryptcor= e(8), >> dumpon(8), rc.conf(5) and savecore(8) manual pages. >> >> EKCD was tested on amd64 using bhyve and i386, mipsel and sparc64 usi= ng QEMU. >> The feature still has to be tested on arm and arm64 as it wasn't poss= ible to >> run >> FreeBSD due to the problems with QEMU emulation and lack of hardware.= >> >> Designed by: def, pjd >> Reviewed by: cem, oshogbo, pjd >> Partial review: delphij, emaste, jhb, kib >> Approved by: pjd (mentor) >> Differential Revision: https://reviews.freebsd.org/D4712 >> >> Added: >> head/sbin/decryptcore/ >> head/sbin/decryptcore/Makefile (contents, props changed) >> head/sbin/decryptcore/decryptcore.8 (contents, props changed) >> head/sbin/decryptcore/decryptcore.c (contents, props changed) >> Modified: >> head/etc/defaults/rc.conf >> head/etc/rc.d/dumpon >> head/sbin/Makefile >> head/sbin/dumpon/Makefile >> head/sbin/dumpon/dumpon.8 >> head/sbin/dumpon/dumpon.c >> head/sbin/savecore/savecore.8 >> head/sbin/savecore/savecore.c >> head/share/man/man5/rc.conf.5 >> head/sys/amd64/amd64/minidump_machdep.c >> head/sys/arm/arm/minidump_machdep.c >> head/sys/arm64/arm64/minidump_machdep.c >> head/sys/conf/NOTES >> head/sys/conf/files >> head/sys/conf/options >> head/sys/ddb/db_textdump.c >> head/sys/dev/null/null.c >> head/sys/geom/geom_dev.c >> head/sys/i386/i386/minidump_machdep.c >> head/sys/kern/kern_dump.c >> head/sys/kern/kern_shutdown.c >> head/sys/mips/mips/minidump_machdep.c >> head/sys/sparc64/sparc64/dump_machdep.c >> head/sys/sys/conf.h >> head/sys/sys/disk.h >> head/sys/sys/kerneldump.h > > Nice! Any reason you left out PowerPC from this list though? The architectures that I listed implement separate minidump functions in = their MD code. I had to change them to implement EKCD. ppc and pc98 are not the= case and we don't have minidumps in riscv yet. It means that EKCD should also = work on ppc. Of course all architectures supported by FreeBSD should be verified. Howe= ver it is mandatory to test all changes in MD code. --Sv7Dmm0KL9WeHtg4HHVPQFfDn0REoR9hj-- --pcBACHb1tJsCBK53djlXx7bFX6AgLnw9n Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE/bUwFm9Qs8vtm2934cEiWwsmpPAFAlhMa1dfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEZE QjUzMDE2NkY1MEIzQ0JFRDlCNkY3N0UxQzEyMjVCMEIyNkE0RjAACgkQ4cEiWwsm pPDT/hAAi1OCLs5w/uEoTE3MnPYhR97vEL7ylWK+GjXib0SsX7GFqwJDdKz8WhnB HOyih74jXpCSywewvASjAWO2VGrZjLhaLZySyKODoj1lt4QUuXlVkX6Pf75/URfu poEWKUArv3EzTO229zBFBrwB+YQh9hNeD76ssSdjREap3AHgrMuNqjO0l4tfQqG2 fCE7Xa7+YGHVHABoeLkfD7769+Js+cq7v32dHhC+LP+VXbhLkK0bFK9Z+U33p/n5 WdWR5Ly2Fs+B/v8/WTZUCwwac6q+ogs//gIqAfatXJ65a6a6ed1APNQk9qnsdLpi ByUayad7JDm/4x4YWfxJ9zvYNZhRUSuKs2BDIgt2n9NULLQd3ILj0xT33NfANBjQ ZNDJYcoZWk+cv2DvxD8nPCcxVwdeTgMopZtQ91+Gp6IrL2CXTNjygODUDllegHAn Jmf64f0yCd9m/02og//W6GveT5IHV44WdeA99b5vzJay+ZAHcsd9b0YEllrBXW+k rwXBcEYaBl0I0vHu+bMN/Ga/bmOJLCVCD4qQR2LwNJtvryT+7JFb8yyxfXbuEet/ FjwdidF35VAZD9xvK6b4TYhw+xjan6sIY4TrRd7VKFPmgjMy16ILt1Er3kZo0xLc TCyMjEgA38NQrrd8anwkw+5Sp/OkxIjEMJzJ0U3cAgVY1jAL8Ds= =krDr -----END PGP SIGNATURE----- --pcBACHb1tJsCBK53djlXx7bFX6AgLnw9n-- From owner-svn-src-head@freebsd.org Sat Dec 10 21:11:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3A89C71149; Sat, 10 Dec 2016 21:11:40 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 789381E2E; Sat, 10 Dec 2016 21:11:40 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id a20so3044546wme.2; Sat, 10 Dec 2016 13:11:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=V5NAYGeD9vHZ7kGiCrCbfAtGQlpR3pRhuNqqk0/8neg=; b=0sgg3VjJV8/RWiV3A9oTxjUHvBmTHeLCcefH9Eta7tWLks/LMIiUG1QMjzDQp9AHbk j1QRMtFTkRInZJY2s+l/mQwqqcSSTQg1zKol4g9ROWA0UP2ixfWiPvdrn4UA2MDdpYct wmqTe+1T5IhrrS/5uxh6dDwtvKQKUwWKhnfaHQPXKmT/Wbht2WD8VUgxiZ6A2RyGCi4X IBCnW9fC5ArOBmNLL5GAw1XOMFzCSWwOj11KfnqrLynRbSm7D9flmU18VqWMAM+6xr8W Z23AVd/jS/fUBPMkfY7KUXmjd7TTac7/EOCsyFG7f1EBVGjNoseke+QWV+7h9WCigotU JliQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=V5NAYGeD9vHZ7kGiCrCbfAtGQlpR3pRhuNqqk0/8neg=; b=Ha/Z5wHLndo268+PfHQsZZyPfyUHfYZybunYAmyoGdSytcPmyu/El0eD30C8bjyyzU Dq1WzLcNjv4emBSmf+qqlTrCJBWVuKcg43g8wRsQ5+lffCD4ejcGEPCfyJIQwVwSi3I0 0loqYDExHgMHaV4hwisrLadxB9kfq80q9QJ93DcdEn84ew+vTk5R6Ulpa0DRCvAUEIq4 HTeGBGxtWifais38lPbTQhHTLnbIhbsAGTfkPO3uQbSM9qn4algK9553BL25K0U5E3Pk 0sNCHmrVtowlSiIpOUZtQIl/hC18UcRYciTDLTpi0Army3JMED15lo5BS5GmPJHwC5q/ eMRA== X-Gm-Message-State: AKaTC018omPejbP0jLbwv39Doj3y1PEzmNzfxjSUSFSkn1KWXPEonq7Lmnp2fS20QFjMUQ== X-Received: by 10.28.146.201 with SMTP id u192mr12584109wmd.142.1481404298736; Sat, 10 Dec 2016 13:11:38 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id n5sm27465037wmf.0.2016.12.10.13.11.37 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 10 Dec 2016 13:11:38 -0800 (PST) Date: Sat, 10 Dec 2016 22:11:35 +0100 From: Mateusz Guzik To: Gleb Smirnoff Cc: Fabien Thomas , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r309143 - head/sys/libkern Message-ID: <20161210211135.GB29677@dft-labs.eu> References: <201611251349.uAPDnX09042110@repo.freebsd.org> <20161125160010.GA3307@dft-labs.eu> <20161207194121.GM27748@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161207194121.GM27748@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 21:11:41 -0000 On Wed, Dec 07, 2016 at 11:41:21AM -0800, Gleb Smirnoff wrote: > On Fri, Nov 25, 2016 at 05:00:10PM +0100, Mateusz Guzik wrote: > M> On Fri, Nov 25, 2016 at 01:49:33PM +0000, Fabien Thomas wrote: > M> > Author: fabient > M> > Date: Fri Nov 25 13:49:33 2016 > M> > New Revision: 309143 > M> > URL: https://svnweb.freebsd.org/changeset/base/309143 > M> > > M> > Log: > M> > In a dual processor system (2*6 cores) during IPSec throughput tests, > M> > we see a lot of contention on the arc4 lock, used to generate the IV > M> > of the ESP output packets. > M> > > M> > The idea of this patch is to split this mutex in order to reduce the > M> > contention on this lock. > M> > > M> > +MALLOC_DEFINE(M_ARC4RANDOM, "arc4random", "arc4random structures"); > M> > > M> > -static u_int8_t arc4_randbyte(void); > M> > +struct arc4_s { > M> > + u_int8_t i, j; > M> > + int numruns; > M> > + u_int8_t sbox[256]; > M> > + time_t t_reseed; > M> > + > M> > + struct mtx mtx; > M> > +}; > M> > + > M> > M> Why is the lock at the end? Right now you got false sharing with the > M> next entry. > M> > M> That said, I suggest: > M> 1. moving thelock to the beginning > M> 2. annotating the struct with __aligned(CACHE_LINE_SIZE) > > It could be even better not to allocate them with regular malloc at all, > but to put them into the per cpu areas. I haven't tried, but looks like > the DPCPU mechanism defined in sys/pcpu.h would fit that well. > Oh. Now that I read your comment I re-read the patch and it looks like indeed the patch allocate the struct for each online cpu, so perhaps it should indeed migrate and automagically get numa friendly at some point. This prompts me to look some more and I think this does not really scale, just got rid of an issue immediately visible with lock profiling. arc4rand contains: [..] if (reseed || atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, ARC4_ENTR_SEED)) { ARC4_FOREACH(arc4) arc4_randomstir(arc4); } Which on amd64 always dirties the cacheline containing arc4rand_iniseed_state. In my kernel the relevant cacheline is: ffffffff81583f80 b vn_io_fault_prefault ffffffff81583f88 b vn_io_faults_cnt ffffffff81583f90 B arc4rand_iniseed_state ffffffff81583f98 b arc4inst ^^^^^^ the array ffffffff81583fa0 b inet_ntoa.buf ffffffff81583fb0 b static_ltree That is, not only competing cpus do the atomic op, they additionally ping pong the cacheline when computing the address of the target object. At the very least, attempting atomic_cmpset_int only if it the initial condition holds should improve things. The lock array pointer can be __read_mostly-ified after the macro gets sorted out. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Dec 10 21:13:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3335C712E8; Sat, 10 Dec 2016 21:13:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 4D8B41062; Sat, 10 Dec 2016 21:13:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBALDPu9061707 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 10 Dec 2016 23:13:25 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBALDPu9061707 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBALDPva061706; Sat, 10 Dec 2016 23:13:25 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 10 Dec 2016 23:13:25 +0200 From: Konstantin Belousov To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309745 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20161210211325.GT54029@kib.kiev.ua> References: <201612091758.uB9HwYC0087384@repo.freebsd.org> <20161209184117.GJ54029@kib.kiev.ua> <20161209185636.GJ27748@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161209185636.GJ27748@FreeBSD.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 21:13:30 -0000 On Fri, Dec 09, 2016 at 10:56:36AM -0800, Gleb Smirnoff wrote: > Yes, this is expected. The interface isn't designed to be precise. So if > we hit limit, the next second result will be 20345 events exceeded the rate > instead of 20346 events. Note that the interface may legitimately give errors in the other direction as well, see below. The initial read of cr_ticks is racy, so one thread noting the condition of >= hz and executing counter_u64_zero() might race with another thread not observing the condition and executing counter_u64_add() in parallel. I believe this is possible even on relatively ordered arches like x86. Now, since counter_u64_add() is not atomic for the pcpu cell update (e.g. on x86), increment of the current pcpu cell might race with zeroing it, resulting in the old value of the counter cell to survive the change of ticks second. The end result is that events counted in the previous second would be transferred to the next second despite the reset, and cause unmerited rate check trigger. At very least, the function annotation should contain a warning to use it only for informational messages. From owner-svn-src-head@freebsd.org Sat Dec 10 21:19:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E3ACC713E7; Sat, 10 Dec 2016 21:19:28 +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 3D89713AD; Sat, 10 Dec 2016 21:19:28 +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 uBALJRcK056012; Sat, 10 Dec 2016 21:19:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBALJRhm056011; Sat, 10 Dec 2016 21:19:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201612102119.uBALJRhm056011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 10 Dec 2016 21:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309833 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 21:19:28 -0000 Author: mav Date: Sat Dec 10 21:19:27 2016 New Revision: 309833 URL: https://svnweb.freebsd.org/changeset/base/309833 Log: Add missed vfs.zfs.zfetch.max_idistance sysctl. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Sat Dec 10 21:13:50 2016 (r309832) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Sat Dec 10 21:19:27 2016 (r309833) @@ -64,6 +64,8 @@ SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, m &zfetch_min_sec_reap, 0, "Min time before stream reclaim"); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_distance, CTLFLAG_RWTUN, &zfetch_max_distance, 0, "Max bytes to prefetch per stream"); +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_idistance, CTLFLAG_RWTUN, + &zfetch_max_idistance, 0, "Max bytes to prefetch indirects for per stream"); SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, array_rd_sz, CTLFLAG_RWTUN, &zfetch_array_rd_sz, 0, "Number of bytes in a array_read at which we stop prefetching"); From owner-svn-src-head@freebsd.org Sat Dec 10 22:03:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA015C71D19; Sat, 10 Dec 2016 22:03:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B99B31733; Sat, 10 Dec 2016 22:03:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAM3iiL075929; Sat, 10 Dec 2016 22:03:44 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAM3ixZ075928; Sat, 10 Dec 2016 22:03:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612102203.uBAM3ixZ075928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 10 Dec 2016 22:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309835 - head/contrib/llvm/lib/Bitcode/Writer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 22:03:46 -0000 Author: dim Date: Sat Dec 10 22:03:44 2016 New Revision: 309835 URL: https://svnweb.freebsd.org/changeset/base/309835 Log: Tentatively apply https://reviews.llvm.org/D18730 to work around gcc PR 70528 (bogus error: constructor required before non-static data member). This should fix buildworld with the external gcc package. Reported by: https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/ Modified: head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h Modified: head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h ============================================================================== --- head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h Sat Dec 10 21:23:21 2016 (r309834) +++ head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h Sat Dec 10 22:03:44 2016 (r309835) @@ -95,7 +95,7 @@ private: /// Number of strings in the prefix of the metadata range. unsigned NumStrings = 0; - MDRange() = default; + MDRange() {} explicit MDRange(unsigned First) : First(First) {} }; SmallDenseMap FunctionMDInfo; From owner-svn-src-head@freebsd.org Sat Dec 10 22:05:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E3BCC71DE6; Sat, 10 Dec 2016 22:05:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3D7D818E1; Sat, 10 Dec 2016 22:05:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAM5OMY076024; Sat, 10 Dec 2016 22:05:24 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAM5Om1076022; Sat, 10 Dec 2016 22:05:24 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201612102205.uBAM5Om1076022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 10 Dec 2016 22:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309836 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 22:05:25 -0000 Author: jilles Date: Sat Dec 10 22:05:24 2016 New Revision: 309836 URL: https://svnweb.freebsd.org/changeset/base/309836 Log: Add some tests for reaper functionality (in procctl()). MFC after: 1 week Added: head/tests/sys/kern/reaper.c (contents, props changed) Modified: head/tests/sys/kern/Makefile Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Sat Dec 10 22:03:44 2016 (r309835) +++ head/tests/sys/kern/Makefile Sat Dec 10 22:05:24 2016 (r309836) @@ -8,6 +8,7 @@ TESTSDIR= ${TESTSBASE}/sys/kern ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= ptrace_test +ATF_TESTS_C+= reaper PLAIN_TESTS_C+= subr_unit_test ATF_TESTS_C+= unix_seqpacket_test ATF_TESTS_C+= unix_passfd_test Added: head/tests/sys/kern/reaper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/reaper.c Sat Dec 10 22:05:24 2016 (r309836) @@ -0,0 +1,494 @@ +/*- + * Copyright (c) 2016 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +ATF_TC_WITHOUT_HEAD(reaper_wait_child_first); +ATF_TC_BODY(reaper_wait_child_first, tc) +{ + pid_t parent, child, grandchild, pid; + int status, r; + int pip[2]; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + r = pipe(pip); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pip[1]) != 0) + _exit(100); + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) { + if (read(pip[0], &(uint8_t){ 0 }, 1) != 0) + _exit(102); + if (getppid() != parent) + _exit(103); + _exit(2); + } else + _exit(3); + } + + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; + ATF_CHECK_EQ(3, r); + + r = close(pip[1]); + ATF_REQUIRE_EQ(0, r); + + pid = waitpid(-1, &status, 0); + ATF_REQUIRE(pid > 0 && pid != child); + r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; + ATF_CHECK_EQ(2, r); + + r = close(pip[0]); + ATF_REQUIRE_EQ(0, r); +} + +ATF_TC_WITHOUT_HEAD(reaper_wait_grandchild_first); +ATF_TC_BODY(reaper_wait_grandchild_first, tc) +{ + pid_t parent, child, grandchild, pid; + int status, r; + + /* Be paranoid. */ + pid = waitpid(-1, NULL, WNOHANG); + ATF_REQUIRE(pid == -1 && errno == ECHILD); + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + grandchild = fork(); + if (grandchild == -1) + _exit(101); + else if (grandchild == 0) + _exit(2); + else { + if (waitid(P_PID, grandchild, NULL, + WNOWAIT | WEXITED) != 0) + _exit(102); + _exit(3); + } + } + + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; + ATF_CHECK_EQ(3, r); + + pid = waitpid(-1, &status, 0); + ATF_REQUIRE(pid > 0 && pid != child); + r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; + ATF_CHECK_EQ(2, r); +} + +ATF_TC_WITHOUT_HEAD(reaper_status); +ATF_TC_BODY(reaper_status, tc) +{ + struct procctl_reaper_status st; + ssize_t sr; + pid_t parent, child, pid; + int r, status; + int pip[2]; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_STATUS, &st); + ATF_REQUIRE_EQ(0, r); + ATF_CHECK_EQ(0, st.rs_flags & REAPER_STATUS_OWNED); + ATF_CHECK(st.rs_children > 0); + ATF_CHECK(st.rs_descendants > 0); + ATF_CHECK(st.rs_descendants >= st.rs_children); + ATF_CHECK(st.rs_reaper != parent); + ATF_CHECK(st.rs_reaper > 0); + + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + r = procctl(P_PID, parent, PROC_REAP_STATUS, &st); + ATF_REQUIRE_EQ(0, r); + ATF_CHECK_EQ(REAPER_STATUS_OWNED, + st.rs_flags & (REAPER_STATUS_OWNED | REAPER_STATUS_REALINIT)); + ATF_CHECK_EQ(0, st.rs_children); + ATF_CHECK_EQ(0, st.rs_descendants); + ATF_CHECK(st.rs_reaper == parent); + ATF_CHECK_EQ(-1, st.rs_pid); + + r = pipe(pip); + ATF_REQUIRE_EQ(0, r); + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pip[0]) != 0) + _exit(100); + if (procctl(P_PID, parent, PROC_REAP_STATUS, &st) != 0) + _exit(101); + if (write(pip[1], &st, sizeof(st)) != (ssize_t)sizeof(st)) + _exit(102); + if (procctl(P_PID, getpid(), PROC_REAP_STATUS, &st) != 0) + _exit(103); + if (write(pip[1], &st, sizeof(st)) != (ssize_t)sizeof(st)) + _exit(104); + _exit(0); + } + r = close(pip[1]); + ATF_REQUIRE_EQ(0, r); + + sr = read(pip[0], &st, sizeof(st)); + ATF_REQUIRE_EQ((ssize_t)sizeof(st), sr); + ATF_CHECK_EQ(REAPER_STATUS_OWNED, + st.rs_flags & (REAPER_STATUS_OWNED | REAPER_STATUS_REALINIT)); + ATF_CHECK_EQ(1, st.rs_children); + ATF_CHECK_EQ(1, st.rs_descendants); + ATF_CHECK(st.rs_reaper == parent); + ATF_CHECK_EQ(child, st.rs_pid); + sr = read(pip[0], &st, sizeof(st)); + ATF_REQUIRE_EQ((ssize_t)sizeof(st), sr); + ATF_CHECK_EQ(0, + st.rs_flags & (REAPER_STATUS_OWNED | REAPER_STATUS_REALINIT)); + ATF_CHECK_EQ(1, st.rs_children); + ATF_CHECK_EQ(1, st.rs_descendants); + ATF_CHECK(st.rs_reaper == parent); + ATF_CHECK_EQ(child, st.rs_pid); + + r = close(pip[0]); + ATF_REQUIRE_EQ(0, r); + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + ATF_CHECK_EQ(0, status); + + r = procctl(P_PID, parent, PROC_REAP_STATUS, &st); + ATF_REQUIRE_EQ(0, r); + ATF_CHECK_EQ(REAPER_STATUS_OWNED, + st.rs_flags & (REAPER_STATUS_OWNED | REAPER_STATUS_REALINIT)); + ATF_CHECK_EQ(0, st.rs_children); + ATF_CHECK_EQ(0, st.rs_descendants); + ATF_CHECK(st.rs_reaper == parent); + ATF_CHECK_EQ(-1, st.rs_pid); +} + +ATF_TC_WITHOUT_HEAD(reaper_getpids); +ATF_TC_BODY(reaper_getpids, tc) +{ + struct procctl_reaper_pidinfo info[10]; + ssize_t sr; + pid_t parent, child, grandchild, pid; + int r, status, childidx; + int pipa[2], pipb[2]; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(0, info[0].pi_flags & REAPER_PIDINFO_VALID); + + r = pipe(pipa); + ATF_REQUIRE_EQ(0, r); + r = pipe(pipb); + ATF_REQUIRE_EQ(0, r); + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pipa[1]) != 0) + _exit(100); + if (close(pipb[0]) != 0) + _exit(100); + if (read(pipa[0], &(uint8_t){ 0 }, 1) != 1) + _exit(101); + grandchild = fork(); + if (grandchild == -1) + _exit(102); + if (grandchild == 0) { + if (write(pipb[1], &(uint8_t){ 0 }, 1) != 1) + _exit(103); + if (read(pipa[0], &(uint8_t){ 0 }, 1) != 1) + _exit(104); + _exit(0); + } + for (;;) + pause(); + } + r = close(pipa[0]); + ATF_REQUIRE_EQ(0, r); + r = close(pipb[1]); + ATF_REQUIRE_EQ(0, r); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID | REAPER_PIDINFO_CHILD, + info[0].pi_flags & (REAPER_PIDINFO_VALID | REAPER_PIDINFO_CHILD)); + ATF_CHECK_EQ(child, info[0].pi_pid); + ATF_CHECK_EQ(child, info[0].pi_subtree); + ATF_CHECK_EQ(0, info[1].pi_flags & REAPER_PIDINFO_VALID); + + sr = write(pipa[1], &(uint8_t){ 0 }, 1); + ATF_REQUIRE_EQ(1, sr); + sr = read(pipb[0], &(uint8_t){ 0 }, 1); + ATF_REQUIRE_EQ(1, sr); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID, + info[0].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID, + info[1].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(0, info[2].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(child, info[0].pi_subtree); + ATF_CHECK_EQ(child, info[1].pi_subtree); + childidx = info[1].pi_pid == child ? 1 : 0; + ATF_CHECK_EQ(REAPER_PIDINFO_CHILD, + info[childidx].pi_flags & REAPER_PIDINFO_CHILD); + ATF_CHECK_EQ(0, info[childidx ^ 1].pi_flags & REAPER_PIDINFO_CHILD); + ATF_CHECK(info[childidx].pi_pid == child); + grandchild = info[childidx ^ 1].pi_pid; + ATF_CHECK(grandchild > 0); + ATF_CHECK(grandchild != child); + ATF_CHECK(grandchild != parent); + + r = kill(child, SIGTERM); + ATF_REQUIRE_EQ(0, r); + + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID, + info[0].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(0, info[1].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(child, info[0].pi_subtree); + ATF_CHECK_EQ(REAPER_PIDINFO_CHILD, + info[0].pi_flags & REAPER_PIDINFO_CHILD); + ATF_CHECK_EQ(grandchild, info[0].pi_pid); + + sr = write(pipa[1], &(uint8_t){ 0 }, 1); + ATF_REQUIRE_EQ(1, sr); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(REAPER_PIDINFO_VALID, + info[0].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(0, info[1].pi_flags & REAPER_PIDINFO_VALID); + ATF_CHECK_EQ(child, info[0].pi_subtree); + ATF_CHECK_EQ(REAPER_PIDINFO_CHILD, + info[0].pi_flags & REAPER_PIDINFO_CHILD); + ATF_CHECK_EQ(grandchild, info[0].pi_pid); + + pid = waitpid(grandchild, &status, 0); + ATF_REQUIRE_EQ(grandchild, pid); + ATF_CHECK_EQ(0, status); + + memset(info, '\0', sizeof(info)); + r = procctl(P_PID, parent, PROC_REAP_GETPIDS, + &(struct procctl_reaper_pids){ + .rp_count = sizeof(info) / sizeof(info[0]), + .rp_pids = info + }); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(0, info[0].pi_flags & REAPER_PIDINFO_VALID); + + r = close(pipa[1]); + ATF_REQUIRE_EQ(0, r); + r = close(pipb[0]); + ATF_REQUIRE_EQ(0, r); +} + +ATF_TC_WITHOUT_HEAD(reaper_kill_badsig); +ATF_TC_BODY(reaper_kill_badsig, tc) +{ + struct procctl_reaper_kill params; + pid_t parent; + int r; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + params.rk_sig = -1; + params.rk_flags = 0; + r = procctl(P_PID, parent, PROC_REAP_KILL, ¶ms); + ATF_CHECK(r == -1 && errno == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(reaper_kill_sigzero); +ATF_TC_BODY(reaper_kill_sigzero, tc) +{ + struct procctl_reaper_kill params; + pid_t parent; + int r; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + params.rk_sig = 0; + params.rk_flags = 0; + r = procctl(P_PID, parent, PROC_REAP_KILL, ¶ms); + ATF_CHECK(r == -1 && errno == EINVAL); +} + +ATF_TC_WITHOUT_HEAD(reaper_kill_empty); +ATF_TC_BODY(reaper_kill_empty, tc) +{ + struct procctl_reaper_kill params; + pid_t parent; + int r; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + params.rk_sig = SIGTERM; + params.rk_flags = 0; + params.rk_killed = 77; + r = procctl(P_PID, parent, PROC_REAP_KILL, ¶ms); + ATF_CHECK(r == -1 && errno == ESRCH); + ATF_CHECK_EQ(0, params.rk_killed); +} + +ATF_TC_WITHOUT_HEAD(reaper_kill_normal); +ATF_TC_BODY(reaper_kill_normal, tc) +{ + struct procctl_reaper_kill params; + ssize_t sr; + pid_t parent, child, grandchild, pid; + int r, status; + int pip[2]; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(0, r); + + r = pipe(pip); + ATF_REQUIRE_EQ(0, r); + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + if (close(pip[0]) != 0) + _exit(100); + grandchild = fork(); + if (grandchild == -1) + _exit(101); + if (grandchild == 0) { + if (write(pip[1], &(uint8_t){ 0 }, 1) != 1) + _exit(102); + for (;;) + pause(); + } + for (;;) + pause(); + } + r = close(pip[1]); + ATF_REQUIRE_EQ(0, r); + + sr = read(pip[0], &(uint8_t){ 0 }, 1); + ATF_REQUIRE_EQ(1, sr); + + params.rk_sig = SIGTERM; + params.rk_flags = 0; + params.rk_killed = 77; + r = procctl(P_PID, parent, PROC_REAP_KILL, ¶ms); + ATF_CHECK_EQ(0, r); + ATF_CHECK_EQ(2, params.rk_killed); + + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(child, pid); + ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM); + + pid = waitpid(-1, &status, 0); + ATF_REQUIRE(pid > 0); + ATF_CHECK(pid != parent); + ATF_CHECK(pid != child); + ATF_CHECK(WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM); + + r = close(pip[0]); + ATF_REQUIRE_EQ(0, r); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, reaper_wait_child_first); + ATF_TP_ADD_TC(tp, reaper_wait_grandchild_first); + ATF_TP_ADD_TC(tp, reaper_status); + ATF_TP_ADD_TC(tp, reaper_getpids); + ATF_TP_ADD_TC(tp, reaper_kill_badsig); + ATF_TP_ADD_TC(tp, reaper_kill_sigzero); + ATF_TP_ADD_TC(tp, reaper_kill_empty); + ATF_TP_ADD_TC(tp, reaper_kill_normal); + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Sat Dec 10 22:08:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B168CC71E5F; Sat, 10 Dec 2016 22:08:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D1EB1A71; Sat, 10 Dec 2016 22:08:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAM8XPk076160; Sat, 10 Dec 2016 22:08:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAM8XER076159; Sat, 10 Dec 2016 22:08:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612102208.uBAM8XER076159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 10 Dec 2016 22:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309837 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 22:08:34 -0000 Author: ngie Date: Sat Dec 10 22:08:33 2016 New Revision: 309837 URL: https://svnweb.freebsd.org/changeset/base/309837 Log: Change the process limits for RLIMIT_MEMLOCK to RLIM_INFINITY when executing :mincore_resid The default process limits in FreeBSD is 64kB for unprivileged users, which empirically is too low to run the :mincore_resid testcase. Process limits are inherited, so even though the default limit for root users is RLIM_INFINITY, the inherited limit with "sudo" with the default login.conf will be 64kB. Use setrlimit to set rlim_max for RLIMIT_MEMLOCK to RLIM_INFINITY to avoid ENOMEM issues when calling mlock to wire the mmap'ed address space. setrlimit requires root access to increase rlim_max, so require root privileges when running the test Discovered when executing the tests with sudo, e.g. "sudo kyua test -k /usr/tests/lib/libc/sys/Kyuafile mincore_test" MFC after: 2 weeks Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Dec 10 22:05:24 2016 (r309836) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Dec 10 22:08:33 2016 (r309837) @@ -144,6 +144,9 @@ ATF_TC_WITH_CLEANUP(mincore_resid); ATF_TC_HEAD(mincore_resid, tc) { atf_tc_set_md_var(tc, "descr", "Test page residency with mincore(2)"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(mincore_resid, tc) @@ -155,6 +158,13 @@ ATF_TC_BODY(mincore_resid, tc) struct rlimit rlim; ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, &rlim) == 0); +#ifdef __FreeBSD__ + /* + * Bump the mlock limit to unlimited so the rest of the testcase + * passes instead of failing on the mlock call. + */ + rlim.rlim_max = RLIM_INFINITY; +#endif rlim.rlim_cur = rlim.rlim_max; ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, &rlim) == 0); @@ -206,8 +216,9 @@ ATF_TC_BODY(mincore_resid, tc) "might be low on memory"); #ifdef __FreeBSD__ - ATF_REQUIRE_MSG(mlock(addr, npgs * page) == 0, "mlock failed: %s", - strerror(errno)); + if (mlock(addr, npgs * page) == -1 && errno != ENOMEM) + atf_tc_skip("could not wire anonymous test area, system might " + "be low on memory"); #endif ATF_REQUIRE(check_residency(addr, npgs) == npgs); ATF_REQUIRE(munmap(addr, npgs * page) == 0); From owner-svn-src-head@freebsd.org Sat Dec 10 22:31:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 263ABC708B4; Sat, 10 Dec 2016 22:31:51 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 010821904; Sat, 10 Dec 2016 22:31:50 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBAMVojP085123; Sat, 10 Dec 2016 22:31:50 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBAMVoxg085122; Sat, 10 Dec 2016 22:31:50 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612102231.uBAMVoxg085122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 10 Dec 2016 22:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309838 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 22:31:51 -0000 Author: avos Date: Sat Dec 10 22:31:49 2016 New Revision: 309838 URL: https://svnweb.freebsd.org/changeset/base/309838 Log: rsu: various initialization fixes. - Do not ignore initialization errors; call ieee80211_stop() when initialization failed. - Use usb_pause_mtx() instead of DELAY() while waiting for firmware loading; this fixes system freeze during firmware startup. - Do not execute rsu_stop() when device is powered off; fixes 'unknown board type (rfconfig=0xff)' error when the device is reattached. Tested with Asus USB-N10. Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 22:08:33 2016 (r309837) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 10 22:31:49 2016 (r309838) @@ -249,7 +249,7 @@ static int rsu_raw_xmit(struct ieee80211 static void rsu_rxfilter_init(struct rsu_softc *); static void rsu_rxfilter_set(struct rsu_softc *, uint32_t, uint32_t); static void rsu_rxfilter_refresh(struct rsu_softc *); -static void rsu_init(struct rsu_softc *); +static int rsu_init(struct rsu_softc *); static int rsu_tx_start(struct rsu_softc *, struct ieee80211_node *, struct mbuf *, struct rsu_data *); static int rsu_transmit(struct ieee80211com *, struct mbuf *); @@ -620,9 +620,7 @@ rsu_detach(device_t self) struct rsu_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - RSU_LOCK(sc); rsu_stop(sc); - RSU_UNLOCK(sc); usbd_transfer_unsetup(sc->sc_xfer, RSU_N_TRANSFER); @@ -2921,20 +2919,17 @@ static void rsu_parent(struct ieee80211com *ic) { struct rsu_softc *sc = ic->ic_softc; - int startall = 0; - RSU_LOCK(sc); if (ic->ic_nrunning > 0) { - if (!sc->sc_running) { - rsu_init(sc); - startall = 1; + if (rsu_init(sc) == 0) + ieee80211_start_all(ic); + else { + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + if (vap != NULL) + ieee80211_stop(vap); } - } else if (sc->sc_running) + } else rsu_stop(sc); - RSU_UNLOCK(sc); - - if (startall) - ieee80211_start_all(ic); } /* @@ -3484,7 +3479,7 @@ rsu_rxfilter_refresh(struct rsu_softc *s rsu_rxfilter_set(sc, mask_min, mask_all); } -static void +static int rsu_init(struct rsu_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; @@ -3493,7 +3488,12 @@ rsu_init(struct rsu_softc *sc) int error; int i; - RSU_ASSERT_LOCKED(sc); + RSU_LOCK(sc); + + if (sc->sc_running) { + RSU_UNLOCK(sc); + return (0); + } /* Ensure the mbuf queue is drained */ rsu_drain_mbufq(sc); @@ -3538,7 +3538,7 @@ rsu_init(struct rsu_softc *sc) rsu_write_region_1(sc, R92S_MACID, macaddr, IEEE80211_ADDR_LEN); /* It really takes 1.5 seconds for the firmware to boot: */ - rsu_ms_delay(sc, 2000); + usb_pause_mtx(&sc->sc_mtx, USB_MS_TO_TICKS(2000)); RSU_DPRINTF(sc, RSU_DEBUG_RESET, "%s: setting MAC address to %s\n", __func__, @@ -3570,11 +3570,16 @@ rsu_init(struct rsu_softc *sc) /* We're ready to go. */ sc->sc_running = 1; - return; + RSU_UNLOCK(sc); + + return (0); fail: /* Need to stop all failed transfers, if any */ for (i = 0; i != RSU_N_TRANSFER; i++) usbd_transfer_stop(sc->sc_xfer[i]); + RSU_UNLOCK(sc); + + return (error); } static void @@ -3582,7 +3587,11 @@ rsu_stop(struct rsu_softc *sc) { int i; - RSU_ASSERT_LOCKED(sc); + RSU_LOCK(sc); + if (!sc->sc_running) { + RSU_UNLOCK(sc); + return; + } sc->sc_running = 0; sc->sc_vap_is_running = 0; @@ -3605,6 +3614,7 @@ rsu_stop(struct rsu_softc *sc) /* Ensure the mbuf queue is drained */ rsu_drain_mbufq(sc); + RSU_UNLOCK(sc); } /* From owner-svn-src-head@freebsd.org Sat Dec 10 23:25:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BEF5C71D0B for ; Sat, 10 Dec 2016 23:25:31 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23AC714F0 for ; Sat, 10 Dec 2016 23:25:31 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22e.google.com with SMTP id f82so19193640wmf.1 for ; Sat, 10 Dec 2016 15:25:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YG1Ggtrx4iI8dYArVxd1PX0SoNFLRGGkcez7CYzQj7c=; b=JGI6ot/dypJH7NwhstQuLjXAWj+F1hJRcs7KwZULFtCT74a2IkAV+Hov62xwpPKYIQ z0SjfOVBZzEJo/Ci5oeT7f4vdSYM787h/HWy9tzK2GhB4xqj5GlF3KbCOhiuam0y0zog DqDk/KCjAZ7cbvi44fkP97Ax6VuZkYGQjnIoXbjHW3WU8kKK3HIB4ra9GoKNTKe5aCNq iV382Y0eLIo3mKvgYm2poFdCrXklEXtMAOY4kbLcnq98NQgQjA58Fg6qBMmm0eTH/cWJ CRZbJG/QfhcdOTNF4rPbFHxL8RO03dZLLn+ycoeQ357eruZRor/zzs59udEn5LHTAtWW /d5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YG1Ggtrx4iI8dYArVxd1PX0SoNFLRGGkcez7CYzQj7c=; b=U2kewPrN71kmxPhQuq2l/Tz+ftXiQAja4V8XsF22ld4/hbf2tBC4d5sH1HGRCi0uyt /2rJ7uJV0E2XtPArnNlcrdjqz2kMTZ6FJYZ3TIr4icALl+5BghEXEB0/FMgPQNn09WMg To7z2RQmgWvzw35xK9uM3Zms6mmXgp1aKjnFSyVX3xxGsLcbJw9B0+v9rgXx64RrPCCn /TdZXJLG2jLyEtZ5N9LbzYkBioIc8WMGNrQ8UrdV0vlCzbo/rUzj0MGtskF2fihL0OJ+ GpQaNn1gHOFZj6uZ9kbUUivkrfwgsX10v1XqRTi0skpPnUVP36Z5QpLvOfWSSEsFKDoW YsjQ== X-Gm-Message-State: AKaTC025ObdhkOiMpNaaaT5J3yWWj9t8vnK+n4Pm+8rVmPFKeXgB0x2rXylJUFu97R3uBO2AbP9koAfP93gKUriS X-Received: by 10.28.150.69 with SMTP id y66mr12679188wmd.107.1481412329255; Sat, 10 Dec 2016 15:25:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.253.65 with HTTP; Sat, 10 Dec 2016 15:25:28 -0800 (PST) In-Reply-To: <201610162059.u9GKxSr2065027@repo.freebsd.org> References: <201610162059.u9GKxSr2065027@repo.freebsd.org> From: Oliver Pinter Date: Sun, 11 Dec 2016 00:25:28 +0100 Message-ID: Subject: Re: svn commit: r307402 - head/usr.sbin/bsdconfig/share To: Devin Teske Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 23:25:31 -0000 On 10/16/16, Devin Teske wrote: > Author: dteske > Date: Sun Oct 16 20:59:28 2016 > New Revision: 307402 > URL: https://svnweb.freebsd.org/changeset/base/307402 > > Log: > Guard against bad service name argument(s) to load_rc_config() > > MFC after: 3 days > X-MFC-to: stable/11 stable/10 Is this MFC still needed? The 3 days already expired. > > Modified: > head/usr.sbin/bsdconfig/share/sysrc.subr > > Modified: head/usr.sbin/bsdconfig/share/sysrc.subr > ============================================================================== > --- head/usr.sbin/bsdconfig/share/sysrc.subr Sun Oct 16 19:50:10 > 2016 (r307401) > +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sun Oct 16 20:59:28 > 2016 (r307402) > @@ -256,7 +256,9 @@ f_sysrc_service_configs() > last_name= > print_name() { > local name="$1" > - [ "$name" = "$last_name" ] && return > + case "$name" in > + ""|.|..|*/*|"$last_name") return ;; > + esac > echo "$name" >&9 > last_name="$name" > } > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sat Dec 10 23:26:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E386C71D8C; Sat, 10 Dec 2016 23:26:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2271169B; Sat, 10 Dec 2016 23:26:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBANQZnl008553; Sat, 10 Dec 2016 23:26:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBANQZLE008552; Sat, 10 Dec 2016 23:26:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612102326.uBANQZLE008552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 10 Dec 2016 23:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309839 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 23:26:36 -0000 Author: ngie Date: Sat Dec 10 23:26:34 2016 New Revision: 309839 URL: https://svnweb.freebsd.org/changeset/base/309839 Log: free/NULL out variables prior to calling strdup to avoid leaking memory if arguments are specified more than once with "camcontrol timestamp". CID: 1366829, 1366831 MFC after: 1 week Modified: head/sbin/camcontrol/timestamp.c Modified: head/sbin/camcontrol/timestamp.c ============================================================================== --- head/sbin/camcontrol/timestamp.c Sat Dec 10 22:31:49 2016 (r309838) +++ head/sbin/camcontrol/timestamp.c Sat Dec 10 23:26:34 2016 (r309839) @@ -336,6 +336,11 @@ timestamp(struct cam_device *device, int int single_arg = 0; int do_utc = 0; +#define FREE(x) do { \ + free(x); \ + x = NULL; \ +} while(0) + while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'r': { @@ -358,6 +363,7 @@ timestamp(struct cam_device *device, int } case 'f': { single_arg++; + FREE(format_string); format_string = strdup(optarg); if (format_string == NULL) { warn("Error allocating memory for format " @@ -369,6 +375,7 @@ timestamp(struct cam_device *device, int } case 'm': { single_arg++; + FREE(format_string); format_string = strdup(MIL); if (format_string == NULL) { warn("Error allocating memory"); @@ -382,6 +389,7 @@ timestamp(struct cam_device *device, int break; } case 'T': + FREE(timestamp_string); timestamp_string = strdup(optarg); if (timestamp_string == NULL) { warn("Error allocating memory for format " @@ -395,6 +403,8 @@ timestamp(struct cam_device *device, int } } +#undef FREE + if (action == -1) { warnx("Must specify an action, either -r or -s"); error = 1; From owner-svn-src-head@freebsd.org Sat Dec 10 23:49:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77635C7144B for ; Sat, 10 Dec 2016 23:49:15 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wj0-x22d.google.com (mail-wj0-x22d.google.com [IPv6:2a00:1450:400c:c01::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FF4B12BA for ; Sat, 10 Dec 2016 23:49:15 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wj0-x22d.google.com with SMTP id v7so43242090wjy.2 for ; Sat, 10 Dec 2016 15:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UIRWT7Qlb4L1V4BBbiU9h6axJ2uJtTB3G1T0kWq2AF0=; b=zlfhbgCUu5F851/L+ZvxdKSAD+y3VXCbMJkQLfWINiIP3Oz8Nz3hQCiu4piml8ewum watzc709PmVOntZFv3TEdD42LDSNj8wlduvDwMkeumaVH6IUADLdN8IsU0/3SnyKYwRB FPNC4d//aGbXCNuY0kPj7MvOwer9N4lRiKUwIHh27gRWnFuWUtpO0DHoqPje6X0P2/8d /3c3jKqCWFVvX8M+BB4i8L3NJOWW6aSGq+OveucgEm7MXQ4UQ4yK8iHa2bvT+cjucc5/ TaQOeaHXZh13llaSgI9VcWpZqzPbyJcnVZo1uqkZa6Xc++TyJx63lsSaRGYicSkn7gAk qHuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UIRWT7Qlb4L1V4BBbiU9h6axJ2uJtTB3G1T0kWq2AF0=; b=mf0QMufkuyNQDm6A6HGquzb5madqTuaNlsCGWE5xaieF2FpYCUbC9COVwO/Y+PVkbz CaPMr5R/5woJKHjAKeG75+9cTj/OUWXnU7zw6pnyPQ9vAEYEuZzUuO9yaVdDN97ZIk8F SC7U4s90B97u31o/K4uPdkvlOBg653o2p1ueNpkyNlPgtgOjdOkL6UKYWpRP1TWNVN1q uCmOnNmnMYnzWMFl+yICAYZB7/Wcb6XaTE67NIjiaGsOqOskxQ14wDfR0VxMHwrt5vpv rxu+teoEDGy1JSTkJNX5M4TZm/KmLoR8YCuW0g7CaohW15OLm7d3E/dk1ujJetHGxVLe 8wBw== X-Gm-Message-State: AKaTC03yv+VpWaN58DUk7/lSEnwZrUm0m5Ck1d+KA2aaX1By5/HNC0yik/NlBP9zBzfkcLYw/UiEHOXR/asNooVG X-Received: by 10.194.0.43 with SMTP id 11mr74353932wjb.218.1481413753483; Sat, 10 Dec 2016 15:49:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.253.65 with HTTP; Sat, 10 Dec 2016 15:49:12 -0800 (PST) In-Reply-To: <201610201942.u9KJgQOR062772@repo.freebsd.org> References: <201610201942.u9KJgQOR062772@repo.freebsd.org> From: Oliver Pinter Date: Sun, 11 Dec 2016 00:49:12 +0100 Message-ID: Subject: Re: svn commit: r307684 - head/sbin/camcontrol To: "Kenneth D. Merry" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 23:49:15 -0000 On 10/20/16, Kenneth D. Merry wrote: > Author: ken > Date: Thu Oct 20 19:42:26 2016 > New Revision: 307684 > URL: https://svnweb.freebsd.org/changeset/base/307684 > > Log: > For CCBs allocated on the stack, we need to clear the entire CCB, not > just > the header. Otherwise stack garbage can lead to random flags getting > set. > > This showed up as 'camcontrol rescan all' failing with EINVAL because the > address type wasn't CAM_DATA_VADDR. > > sbin/camcontrol/camcontrol.c: > In rescan_or_reset_bus(), bzero the stack-allocated CCBs before > use instead of clearing the body. > > MFC after: 3 days > Sponsored by: Spectra Logic The MFC of this commit is missed both for 10-STABLE and 11-STABLE. Is this still in plan to do? > > Modified: > head/sbin/camcontrol/camcontrol.c > > Modified: head/sbin/camcontrol/camcontrol.c > ============================================================================== > --- head/sbin/camcontrol/camcontrol.c Thu Oct 20 18:43:12 2016 (r307683) > +++ head/sbin/camcontrol/camcontrol.c Thu Oct 20 19:42:26 2016 (r307684) > @@ -3139,6 +3139,8 @@ rescan_or_reset_bus(path_id_t bus, int r > return(1); > } > > + bzero(&ccb, sizeof(ccb)); > + > if (bus != CAM_BUS_WILDCARD) { > ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; > ccb.ccb_h.path_id = bus; > @@ -3181,7 +3183,7 @@ rescan_or_reset_bus(path_id_t bus, int r > * no-op, sending a rescan to the xpt bus would result in a status of > * CAM_REQ_INVALID. > */ > - CCB_CLEAR_ALL_EXCEPT_HDR(&matchccb.cdm); > + bzero(&matchccb, sizeof(matchccb)); > matchccb.ccb_h.func_code = XPT_DEV_MATCH; > matchccb.ccb_h.path_id = CAM_BUS_WILDCARD; > bufsize = sizeof(struct dev_match_result) * 20; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sat Dec 10 23:53:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71719C715FF for ; Sat, 10 Dec 2016 23:53:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D6551709 for ; Sat, 10 Dec 2016 23:53:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id y124so14480854iof.1 for ; Sat, 10 Dec 2016 15:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Lb+VNcrmfY/lZh3tzmjyPJZC8zrqD4nYJZKKI74M0cY=; b=U/ht+C+o7LUPvhmmTgfnAYwQatf9MSvYO8Zs585beJkTki6fK6REqrlr5+NXi0xyB3 9XzOYqmnxAj+Wp1lfYTnc9gr9yaMagr9hDfZh75uIFuBTAawMbSBisTGn21KjBYZ8l1u DAaA+SLylHth6ty7x1unwxo2vGNfzKXIsocuQH+v5u8vNVwhbDi+L8JEZdUzZ8VEE0oZ IygkR4ewknVlNlOf1yj2osL7mZIcX8e8INFFYIJd4H1+VtaBX1w19alF3WouCudkmNx7 3344GbEn2phNMdS1jLrv9BS8FyhIyS/rGdz/Of5lDXM+QG63nK2mcp3tHSSW+RjsK1nM FNsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Lb+VNcrmfY/lZh3tzmjyPJZC8zrqD4nYJZKKI74M0cY=; b=TJIdmnFKDwPaZq4KLqU2jlFOJF3wbi0yD/aI7LzesfxKtGTnSNds63OALNgmvGnW2M Wwx5VWnj/WZH16OOToge7o1CeHy+KYuz1L/sk/0W9tznoNQh5M9eVWuiicD2FFaF/LUe ln/h5Md/u7MSZPGE0cGl0xnRWqKbGt33MqT4ONpQvuh2f6M3LUTAZt/FVl1HHGj3qPXF 7ZDim5ZIebbLGjEVTVvNWapbK1NsgCulAU/wfLYaCnbY9osrskbMu71ytsYZrgGGRCN+ M0U5DNHSJ42zF/B8HTKzUbYduOASasA5Z4MRutMc6UkqA7vZ6Mh5cV2Qx4zeMj79XvBz KSzw== X-Gm-Message-State: AKaTC00i9TYgfoxOxD/aVdWcDwncgV6ZiAIoh5PZ3Hikydhhxh+4BWeHRzQ+5ETxQng1PWgYPcxp5Py9ylwD2A== X-Received: by 10.36.122.135 with SMTP id a129mr4418559itc.103.1481414000541; Sat, 10 Dec 2016 15:53:20 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.31.199 with HTTP; Sat, 10 Dec 2016 15:53:20 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <201612102326.uBANQZLE008552@repo.freebsd.org> References: <201612102326.uBANQZLE008552@repo.freebsd.org> From: Warner Losh Date: Sat, 10 Dec 2016 16:53:20 -0700 X-Google-Sender-Auth: IDiApwquLthBHJgsGDql72vZDW4 Message-ID: Subject: Re: svn commit: r309839 - head/sbin/camcontrol To: Ngie Cooper Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 23:53:21 -0000 Why not just unconditionally free them? You don't need to NULL them out. That would save a IMHO bogus macro. On Sat, Dec 10, 2016 at 4:26 PM, Ngie Cooper wrote: > Author: ngie > Date: Sat Dec 10 23:26:34 2016 > New Revision: 309839 > URL: https://svnweb.freebsd.org/changeset/base/309839 > > Log: > free/NULL out variables prior to calling strdup to avoid leaking memory > if arguments are specified more than once with "camcontrol timestamp". > > CID: 1366829, 1366831 > MFC after: 1 week > > Modified: > head/sbin/camcontrol/timestamp.c > > Modified: head/sbin/camcontrol/timestamp.c > ============================================================================== > --- head/sbin/camcontrol/timestamp.c Sat Dec 10 22:31:49 2016 (r309838) > +++ head/sbin/camcontrol/timestamp.c Sat Dec 10 23:26:34 2016 (r309839) > @@ -336,6 +336,11 @@ timestamp(struct cam_device *device, int > int single_arg = 0; > int do_utc = 0; > > +#define FREE(x) do { \ > + free(x); \ > + x = NULL; \ > +} while(0) > + > while ((c = getopt(argc, argv, combinedopt)) != -1) { > switch (c) { > case 'r': { > @@ -358,6 +363,7 @@ timestamp(struct cam_device *device, int > } > case 'f': { > single_arg++; > + FREE(format_string); > format_string = strdup(optarg); > if (format_string == NULL) { > warn("Error allocating memory for format " > @@ -369,6 +375,7 @@ timestamp(struct cam_device *device, int > } > case 'm': { > single_arg++; > + FREE(format_string); > format_string = strdup(MIL); > if (format_string == NULL) { > warn("Error allocating memory"); > @@ -382,6 +389,7 @@ timestamp(struct cam_device *device, int > break; > } > case 'T': > + FREE(timestamp_string); > timestamp_string = strdup(optarg); > if (timestamp_string == NULL) { > warn("Error allocating memory for format " > @@ -395,6 +403,8 @@ timestamp(struct cam_device *device, int > } > } > > +#undef FREE > + > if (action == -1) { > warnx("Must specify an action, either -r or -s"); > error = 1; > From owner-svn-src-head@freebsd.org Sat Dec 10 23:55:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2798DC71681; Sat, 10 Dec 2016 23:55:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E77D318AD; Sat, 10 Dec 2016 23:55:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id p66so6438021pga.2; Sat, 10 Dec 2016 15:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=00S0p+HUTzvPJ80K4JZ/QbE9gJxefc89X6gcCLlLt7g=; b=FlHyPr64uOxXWg9K78M35JFfpJNcLHk11ilahQbhCaKJuFOh1Nxx6pO0wo4iyHL9XQ TivGpRFke1D8PMOBIGyAnXeYDMPak0fhVMFdtCBEnMP5P2ei83iVK/ZtCbx7UW4GKRwa CVIIEoOuhPrQRt5H3uY1lvX3FNhMoRRvFZl0HbGoQZ32erQBspSaDEGLXkmn104F5BRD HEJgzIh2mtJJDzIUdQEAKLUlpecSYCTxm4dabvNT8UejbFA1mSD5qdLlGhrCAMqzMoWd vb9xVCDnzs1LWS/P1EjMrLl1hxm+KLmp+gxsAE/f4lFH0Vj9S3druXuRR/V1sddKfJqC XjpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=00S0p+HUTzvPJ80K4JZ/QbE9gJxefc89X6gcCLlLt7g=; b=WaDFUevf6mPjtOr4w40aDPUiIhUDf53SlSrPnQ5cHyJs5dnKNQpD+S7uvImyK/8vbl emIP7dVYzDzivicVvhK3MCnUD8UVnxOkYNAGzyfq0HDE2mVkqPIkCw7o/IiR2EU3BJv2 rWuUs8DumnNUNznUa+I1S+eQNQUCQT9AgbpmOVCCQFVlxOFm4X8ymYZRE1MA9ra08c+X 7u86dzLfJUuXy0RCQ8fpJGFFJbV/xrYq/DB/3uE/j9bRrQX53MZTZaYvBl5Xg25mtAIk yFmp899Vys2iKuaQslKsXbCYBJDPcydUs+eHrdk6HqH4P8UZJmTAQHbuip8n25nVVCHZ eYRw== X-Gm-Message-State: AKaTC03pZqyDZhRLKpPV3wX8MI4TNVpK7hAFOe2Oc8cejHKUereyeBBcOg0MwuxegHVuYQ== X-Received: by 10.84.136.1 with SMTP id 1mr172583909plk.152.1481414136585; Sat, 10 Dec 2016 15:55:36 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 24sm66701652pfh.41.2016.12.10.15.55.35 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Dec 2016 15:55:35 -0800 (PST) Subject: Re: svn commit: r309839 - head/sbin/camcontrol Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7F40E1E1-9577-44EB-A04F-64DF1B924528"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Sat, 10 Dec 2016 15:55:34 -0800 Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <76B56104-3592-46A3-920D-9F55353A8842@gmail.com> References: <201612102326.uBANQZLE008552@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 23:55:37 -0000 --Apple-Mail=_7F40E1E1-9577-44EB-A04F-64DF1B924528 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 10, 2016, at 15:53, Warner Losh wrote: >=20 > Why not just unconditionally free them? You don't need to NULL them > out. That would save a IMHO bogus macro. Yeah, you=E2=80=99re right. I=E2=80=99m doing it out of habit to avoid = access after free. -Ngie --Apple-Mail=_7F40E1E1-9577-44EB-A04F-64DF1B924528 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJYTJX2AAoJEPWDqSZpMIYVLJQQAJXTUfo0W1/aFLmKf3SCl97i 7JhvFTXaghUzFFWe+ISHrDBK7hXSZLm1oZZssViNFIxZUANLcsdB0zFM7oc/wtOU lAQ0wGAIIEpKWVCfpxuznSWlOiaJMkVEw7v8hgv8LNHFLIQv3Skv/2/4cKbyWTE+ 98GKIHPgD4Bp3wexrhdgBYqyM4eQn3PV6GYH50eRy2PoKyvc6XGspUS2E2aiFkAt ezkTBxuBC5MKRWqXPPPKGsdSfTJg1qNslCGCqnG4GF/RwJoHx58QZzdPJMGWGcVT lolKBoYET8djnj2NEs3tayJAvXb9C6h14VRlJZH8vyM44fuG57gGkrWzDXxNrYEl 7HB0f2g9WAhOpIXSfBPxs1tdDXyFI079EPww9Xtp6apDOkG8WRSBsgS9VOuuK/br 2WoQPHhzWZJH1a95TfRPrZc7fm7BCDgPXKqmYWV8EURK5WknOSMdMPRSeHY/j996 kdUiho2MxnPpty0CwpjDhWm9gP/ZGDopaHUlNE0va7cRuAmVKsYc0rFNuckMFods p7eTuoAjHsPV1Pr3zJW6rKbUVL/b/LY+H36GKePEuxEbmNBfKxj9R2G30VMV7J7C ImjhmMxzZsi8Bx7+/RRZgOgZBd54x4XKjaGq4+3A1Jes4iYj4H3HaA9NdMYZYLcY 34sDfd2VO/D0ZK5BxxBb =3KCq -----END PGP SIGNATURE----- --Apple-Mail=_7F40E1E1-9577-44EB-A04F-64DF1B924528-- From owner-svn-src-head@freebsd.org Sat Dec 10 23:58:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5430BC718EB; Sat, 10 Dec 2016 23:58:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23F671A60; Sat, 10 Dec 2016 23:58:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBANwE6k020420; Sat, 10 Dec 2016 23:58:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBANwE7g020419; Sat, 10 Dec 2016 23:58:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612102358.uBANwE7g020419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 10 Dec 2016 23:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309840 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 23:58:15 -0000 Author: ngie Date: Sat Dec 10 23:58:14 2016 New Revision: 309840 URL: https://svnweb.freebsd.org/changeset/base/309840 Log: Cut to the chase and just call free instead of free(x) + x = NULL NULLing out x wasn't required as the memory was immediately scribbled over with strdup in the following call. MFC after: 1 week Submitted by: imp Modified: head/sbin/camcontrol/timestamp.c Modified: head/sbin/camcontrol/timestamp.c ============================================================================== --- head/sbin/camcontrol/timestamp.c Sat Dec 10 23:26:34 2016 (r309839) +++ head/sbin/camcontrol/timestamp.c Sat Dec 10 23:58:14 2016 (r309840) @@ -336,11 +336,6 @@ timestamp(struct cam_device *device, int int single_arg = 0; int do_utc = 0; -#define FREE(x) do { \ - free(x); \ - x = NULL; \ -} while(0) - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { case 'r': { @@ -363,7 +358,7 @@ timestamp(struct cam_device *device, int } case 'f': { single_arg++; - FREE(format_string); + free(format_string); format_string = strdup(optarg); if (format_string == NULL) { warn("Error allocating memory for format " @@ -375,7 +370,7 @@ timestamp(struct cam_device *device, int } case 'm': { single_arg++; - FREE(format_string); + free(format_string); format_string = strdup(MIL); if (format_string == NULL) { warn("Error allocating memory"); @@ -389,7 +384,7 @@ timestamp(struct cam_device *device, int break; } case 'T': - FREE(timestamp_string); + free(timestamp_string); timestamp_string = strdup(optarg); if (timestamp_string == NULL) { warn("Error allocating memory for format " @@ -403,8 +398,6 @@ timestamp(struct cam_device *device, int } } -#undef FREE - if (action == -1) { warnx("Must specify an action, either -r or -s"); error = 1;