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 =====