From owner-svn-src-head@freebsd.org Sun Sep 15 01:02:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E497D4FD8; Sun, 15 Sep 2019 01:02:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WB0p0XNCz3CGY; Sun, 15 Sep 2019 01:02:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAFBF3AC; Sun, 15 Sep 2019 01:02:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8F121Pj052528; Sun, 15 Sep 2019 01:02:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8F121j0052527; Sun, 15 Sep 2019 01:02:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201909150102.x8F121j0052527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 15 Sep 2019 01:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352342 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 352342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 01:02:02 -0000 Author: ian Date: Sun Sep 15 01:02:01 2019 New Revision: 352342 URL: https://svnweb.freebsd.org/changeset/base/352342 Log: Make the ti_sysc device quiet. It's an internal utility pseudo-device that makes the upstream FDT data work right, so we don't need to see a couple dozen instances of it spam the dmesg at boot time unless it's a verbose boot. Modified: head/sys/arm/ti/ti_sysc.c Modified: head/sys/arm/ti/ti_sysc.c ============================================================================== --- head/sys/arm/ti/ti_sysc.c Sat Sep 14 21:49:42 2019 (r352341) +++ head/sys/arm/ti/ti_sysc.c Sun Sep 15 01:02:01 2019 (r352342) @@ -71,6 +71,9 @@ ti_sysc_probe(device_t dev) return (ENXIO); device_set_desc(dev, "TI SYSC Interconnect"); + if (!bootverbose) + device_quiet(dev); + return (BUS_PROBE_DEFAULT); } From owner-svn-src-head@freebsd.org Sun Sep 15 02:59:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19333DC138; Sun, 15 Sep 2019 02:59:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WDcn6xpvz3McW; Sun, 15 Sep 2019 02:59:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1CE419CD; Sun, 15 Sep 2019 02:59:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8F2xrD8018989; Sun, 15 Sep 2019 02:59:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8F2xrSe018987; Sun, 15 Sep 2019 02:59:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909150259.x8F2xrSe018987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 15 Sep 2019 02:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352350 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 352350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 02:59:54 -0000 Author: kevans Date: Sun Sep 15 02:59:53 2019 New Revision: 352350 URL: https://svnweb.freebsd.org/changeset/base/352350 Log: rangelock: add rangelock_cookie_assert A future change to posixshm to add file sealing (in DIFF_21391[0] and child) will move locking out of shm_dotruncate as kern_shm_open() will require the lock to be held across the dotruncate until the seal is actually applied. For this, the cookie is passed into shm_dotruncate_locked which asserts RCA_WLOCKED. [0] Name changed to protect the innocent, hopefully, from getting autoclosed due to this reference... Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D21628 Modified: head/sys/kern/kern_rangelock.c head/sys/sys/rangelock.h Modified: head/sys/kern/kern_rangelock.c ============================================================================== --- head/sys/kern/kern_rangelock.c Sun Sep 15 02:48:15 2019 (r352349) +++ head/sys/kern/kern_rangelock.c Sun Sep 15 02:59:53 2019 (r352350) @@ -299,3 +299,35 @@ rangelock_trywlock(struct rangelock *lock, off_t start return (rangelock_enqueue(lock, start, end, RL_LOCK_WRITE, ilk, true)); } + +#ifdef INVARIANT_SUPPORT +void +_rangelock_cookie_assert(void *cookie, int what, const char *file, int line) +{ + struct rl_q_entry *entry; + int flags; + + MPASS(cookie != NULL); + entry = cookie; + flags = entry->rl_q_flags; + switch (what) { + case RCA_LOCKED: + if ((flags & RL_LOCK_GRANTED) == 0) + panic("rangelock not held @ %s:%d\n", file, line); + break; + case RCA_RLOCKED: + if ((flags & (RL_LOCK_GRANTED | RL_LOCK_READ)) != + (RL_LOCK_GRANTED | RL_LOCK_READ)) + panic("rangelock not rlocked @ %s:%d\n", file, line); + break; + case RCA_WLOCKED: + if ((flags & (RL_LOCK_GRANTED | RL_LOCK_WRITE)) != + (RL_LOCK_GRANTED | RL_LOCK_WRITE)) + panic("rangelock not wlocked @ %s:%d\n", file, line); + break; + default: + panic("Unknown rangelock assertion: %d @ %s:%d", what, file, + line); + } +} +#endif /* INVARIANT_SUPPORT */ Modified: head/sys/sys/rangelock.h ============================================================================== --- head/sys/sys/rangelock.h Sun Sep 15 02:48:15 2019 (r352349) +++ head/sys/sys/rangelock.h Sun Sep 15 02:59:53 2019 (r352350) @@ -82,6 +82,29 @@ void *rangelock_wlock(struct rangelock *lock, off_t st void *rangelock_trywlock(struct rangelock *lock, off_t start, off_t end, struct mtx *ilk); void rlqentry_free(struct rl_q_entry *rlqe); +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +void _rangelock_cookie_assert(void *cookie, int what, const char *file, + int line); +#endif + +#ifdef INVARIANTS +#define rangelock_cookie_assert_(cookie, what, file, line) \ + _rangelock_cookie_assert((cookie), (what), (file), (line)) +#else +#define rangelock_cookie_assert_(cookie, what, file, line) (void)0 +#endif + +#define rangelock_cookie_assert(cookie, what) \ + rangelock_cookie_assert_((cookie), (what), __FILE__, __LINE__) + +/* + * Assertion flags. + */ +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +#define RCA_LOCKED 0x0001 +#define RCA_RLOCKED 0x0002 +#define RCA_WLOCKED 0x0004 +#endif #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Sun Sep 15 18:29:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66C04F439B; Sun, 15 Sep 2019 18:29:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WdFk20MBz4b4q; Sun, 15 Sep 2019 18:29:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27DB7C35C; Sun, 15 Sep 2019 18:29:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8FITkga075570; Sun, 15 Sep 2019 18:29:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8FITkE6075569; Sun, 15 Sep 2019 18:29:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909151829.x8FITkE6075569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 15 Sep 2019 18:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352361 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 18:29:46 -0000 Author: tuexen Date: Sun Sep 15 18:29:45 2019 New Revision: 352361 URL: https://svnweb.freebsd.org/changeset/base/352361 Log: When the IP layer calls back into the SCTP layer to perform the SCTP checksum computation, do not assume that the IP header chain and the SCTP common header are in contiguous memory although the SCTP lays out the mbuf chains that way. If there are IP-level options inserted by the IP layer, the constraint is not fulfilled anymore. This issues was found by running syzkaller. Thanks to markj@ who is running an instance which also provides kernel dumps. This allowed me to find this issue. MFC after: 3 days Modified: head/sys/netinet/sctp_crc32.c Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Sun Sep 15 17:59:03 2019 (r352360) +++ head/sys/netinet/sctp_crc32.c Sun Sep 15 18:29:45 2019 (r352361) @@ -132,16 +132,16 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t offset) SCTP_STAT_INCR(sctps_sendswcrc); offset += offsetof(struct sctphdr, checksum); - if (offset + sizeof(uint32_t) > (uint32_t)(m->m_len)) { + if (offset + sizeof(uint32_t) > (uint32_t)(m->m_pkthdr.len)) { #ifdef INVARIANTS - panic("sctp_delayed_cksum(): m->m_len: %d, offset: %u.", - m->m_len, offset); + panic("sctp_delayed_cksum(): m->m_pkthdr.len: %d, offset: %u.", + m->m_pkthdr.len, offset); #else - SCTP_PRINTF("sctp_delayed_cksum(): m->m_len: %d, offset: %u.\n", - m->m_len, offset); + SCTP_PRINTF("sctp_delayed_cksum(): m->m_pkthdr.len: %d, offset: %u.\n", + m->m_pkthdr.len, offset); #endif return; } - *(uint32_t *)(m->m_data + offset) = checksum; + m_copyback(m, (int)offset, (int)sizeof(uint32_t), (caddr_t)&checksum); } #endif From owner-svn-src-head@freebsd.org Sun Sep 15 19:38:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDAF3F56C2; Sun, 15 Sep 2019 19:38:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Wfml5qZ7z4dPS; Sun, 15 Sep 2019 19:38:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A688ACF79; Sun, 15 Sep 2019 19:38:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8FJcFUg016910; Sun, 15 Sep 2019 19:38:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8FJcFLA016909; Sun, 15 Sep 2019 19:38:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201909151938.x8FJcFLA016909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 15 Sep 2019 19:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352363 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 352363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 19:38:16 -0000 Author: ian Date: Sun Sep 15 19:38:15 2019 New Revision: 352363 URL: https://svnweb.freebsd.org/changeset/base/352363 Log: Apply a runtime patch to the FDT data for imx6 to fix iomuxc problems. The latest imported FDT data defines a node for an iomuxc-gpr device, which we don't support (or need, right now) in addition to the usual iomuxc device. Unfortunately, the dts improperly assigns overlapping ranges of mmio space to both devices. The -gpr device is also a syscon and simple_mfd device. At runtime the simple_mfd driver attaches for the iomuxc-gpr node, then when the real iomuxc driver comes along later, it fails to attach because it tries to allocate its register space, and it's already partially in use by the bogus instance of simple_mfd. This change works around the problem by simply disabling the node for the iomuxc-gpr device, since we don't need it for anything. Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sun Sep 15 19:16:42 2019 (r352362) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sun Sep 15 19:38:15 2019 (r352363) @@ -148,12 +148,43 @@ fix_fdt_interrupt_data(void) OF_setprop(socnode, "interrupt-parent", &gicxref, sizeof(gicxref)); } +static void +fix_fdt_iomuxc_data(void) +{ + phandle_t node; + + /* + * The linux dts defines two nodes with the same mmio address range, + * iomuxc-gpr and the regular iomuxc. The -grp node is a simple_mfd and + * a syscon, but it only has access to a small subset of the iomuxc + * registers, so it can't serve as the accessor for the iomuxc driver's + * register IO. But right now, the simple_mfd driver attaches first, + * preventing the real iomuxc driver from allocating its mmio register + * range because it partially overlaps with the -gpr range. + * + * For now, by far the easiest thing to do to keep imx6 working is to + * just disable the iomuxc-gpr node because we don't have a driver for + * it anyway, we just need to prevent attachment of simple_mfd. + * + * If we ever write a -gpr driver, this code should probably switch to + * modifying the reg property so that the range covers all the iomuxc + * regs, then the -gpr driver can be a regular syscon driver that iomuxc + * uses for register access. + */ + node = OF_finddevice("/soc/aips-bus@2000000/iomuxc-gpr@20e0000"); + if (node != -1) + OF_setprop(node, "status", "disabled", sizeof("disabled")); +} + static int imx6_attach(platform_t plat) { /* Fix soc interrupt-parent property. */ fix_fdt_interrupt_data(); + + /* Fix iomuxc-gpr and iomuxc nodes both using the same mmio range. */ + fix_fdt_iomuxc_data(); /* Inform the MPCore timer driver that its clock is variable. */ arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES); From owner-svn-src-head@freebsd.org Sun Sep 15 19:41:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A730F590B; Sun, 15 Sep 2019 19:41:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Wfrz39hBz4djr; Sun, 15 Sep 2019 19:41:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5146AD0EB; Sun, 15 Sep 2019 19:41:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8FJftq4019369; Sun, 15 Sep 2019 19:41:55 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8FJfsVf019366; Sun, 15 Sep 2019 19:41:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201909151941.x8FJfsVf019366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 15 Sep 2019 19:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352364 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 352364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 19:41:55 -0000 Author: delphij Date: Sun Sep 15 19:41:54 2019 New Revision: 352364 URL: https://svnweb.freebsd.org/changeset/base/352364 Log: Avoid mixing cluster numbers and sector numbers. Makes code more readable. Obtained from: NetBSD MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/boot.c head/sbin/fsck_msdosfs/dir.c head/sbin/fsck_msdosfs/dosfs.h Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sun Sep 15 19:38:15 2019 (r352363) +++ head/sbin/fsck_msdosfs/boot.c Sun Sep 15 19:41:54 2019 (r352364) @@ -259,12 +259,18 @@ readboot(int dosfs, struct bootblock *boot) return FSFATAL; } - boot->ClusterOffset = (boot->bpbRootDirEnts * 32 + + boot->FirstCluster = (boot->bpbRootDirEnts * 32 + boot->bpbBytesPerSec - 1) / boot->bpbBytesPerSec + - boot->bpbResSectors + boot->bpbFATs * boot->FATsecs - - CLUST_FIRST * boot->bpbSecPerClust; - boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) / - boot->bpbSecPerClust; + boot->bpbResSectors + boot->bpbFATs * boot->FATsecs; + + if (boot->FirstCluster + boot->bpbSecPerClust > boot->NumSectors) { + pfatal("Cluster offset too large (%u clusters)\n", + boot->FirstCluster); + return FSFATAL; + } + + boot->NumClusters = (boot->NumSectors - boot->FirstCluster) / boot->bpbSecPerClust + + CLUST_FIRST; if (boot->flags & FAT32) boot->ClustMask = CLUST32_MASK; Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Sun Sep 15 19:38:15 2019 (r352363) +++ head/sbin/fsck_msdosfs/dir.c Sun Sep 15 19:41:54 2019 (r352364) @@ -317,7 +317,8 @@ delete(int f, struct bootblock *boot, struct fatEntry break; e = delbuf + endoff; } - off = startcl * boot->bpbSecPerClust + boot->ClusterOffset; + off = (startcl - CLUST_FIRST) * boot->bpbSecPerClust + boot->FirstCluster; + off *= boot->bpbBytesPerSec; if (lseek(f, off, SEEK_SET) != off) { perr("Unable to lseek to %" PRId64, off); @@ -457,7 +458,7 @@ check_subdirectory(int f, struct bootblock *boot, stru off = boot->bpbResSectors + boot->bpbFATs * boot->FATsecs; } else { - off = cl * boot->bpbSecPerClust + boot->ClusterOffset; + off = (cl - CLUST_FIRST) * boot->bpbSecPerClust + boot->FirstCluster; } /* @@ -538,7 +539,7 @@ readDosDirSection(int f, struct bootblock *boot, struc boot->FATsecs; } else { last = boot->bpbSecPerClust * boot->bpbBytesPerSec; - off = cl * boot->bpbSecPerClust + boot->ClusterOffset; + off = (cl - CLUST_FIRST) * boot->bpbSecPerClust + boot->FirstCluster; } off *= boot->bpbBytesPerSec; @@ -1069,8 +1070,9 @@ reconnect(int dosfs, struct bootblock *boot, struct fa lfcl = (lostDir->head < boot->NumClusters) ? lostDir->head : 0; return FSERROR; } - lfoff = lfcl * boot->ClusterSize - + boot->ClusterOffset * boot->bpbBytesPerSec; + lfoff = (lfcl - CLUST_FIRST) * boot->ClusterSize + + boot->FirstCluster * boot->bpbBytesPerSec; + if (lseek(dosfs, lfoff, SEEK_SET) != lfoff || (size_t)read(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) { perr("could not read LOST.DIR"); Modified: head/sbin/fsck_msdosfs/dosfs.h ============================================================================== --- head/sbin/fsck_msdosfs/dosfs.h Sun Sep 15 19:38:15 2019 (r352363) +++ head/sbin/fsck_msdosfs/dosfs.h Sun Sep 15 19:41:54 2019 (r352364) @@ -74,7 +74,7 @@ struct bootblock { u_int32_t NumSectors; /* how many sectors are there */ u_int32_t FATsecs; /* how many sectors are in FAT */ u_int32_t NumFatEntries; /* how many entries really are there */ - u_int ClusterOffset; /* at what sector would sector 0 start */ + u_int FirstCluster; /* at what sector is Cluster CLUST_FIRST */ u_int ClusterSize; /* Cluster size in bytes */ /* Now some statistics: */ From owner-svn-src-head@freebsd.org Sun Sep 15 19:51:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 292D0F5B30; Sun, 15 Sep 2019 19:51:28 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Wg400KRwz4f1M; Sun, 15 Sep 2019 19:51:27 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x42a.google.com with SMTP id q17so32051176wrx.10; Sun, 15 Sep 2019 12:51:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=KzjvpXZG64egbQj8VLds/UlPe8g1aEn1lsg+BKn33H8=; b=Oesxu/L1RAI0O9r+b0NKvGW6nmJZZRxeRYC0yzkUKdoWsybLKnH6tl7o0oNU6u6yHA qe09CTH2o9U4ZZzQDHVXuzzCALSYjRsHe2qU1vTogryYbRUPH1WtB5MOIcMm4e8pm45B 9qM8HTnl8g8IuBxK3lR4gYxmwVfUCcDURmAZKoVRrrL+zsnmSP9m14OiM5NthFsNyhuk AJaSYVt2MdPxVHxX8w+ptc2QFdIZUKyEDwUiUK1dP+4q/yKyccwBtVglKnze1AhHyXLE dhqHQ5g4LfbNAIxae9CPZLErGXMXJMfZeurkWKAxmjh+PhG9e+wto06s/90QVzPGsdFE epsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=KzjvpXZG64egbQj8VLds/UlPe8g1aEn1lsg+BKn33H8=; b=Psu8F3pLRFjUva2FoAFCu+lF8JWDjhI3iQppmG0n735O0pMkn9X1OV2qicl2vYIcpP i/WpsW+7dSRrG3toiv5JcOoW3RCD5Z32lMZhfuM2kGLXwUywTUlsL2aiwsJQ8uNHQrRs I3Uu518Li25m9JvsXVlGhV3DIVkr8SRWlSiLcy+WpSmOYIWcNls7/ajvV+uCJgtJ+Zxj EU8mA9VRoRAcYbpbHqDGLg3wU7OeHRxpb4tlZZqZgqLyrob/wev5Xu7Ye3fR5+lhEsDP FFYAHHeHku8J68vyXFJouu3s+LspUMPx0O3bokCMMsc/1H5VUw/Sq12UHZ5A9by7rG3m +AWg== X-Gm-Message-State: APjAAAXqUGSF1H0fnZF5j8W2+YUImXqdZ3Vp/Ttvzs3Et0nD5Z3Rzge+ b5Lp1uLebkdLPen8QoILr3pR+TF5 X-Google-Smtp-Source: APXvYqzL98rRSoId7iHUMNoe/UneNczVyG1aRxdQJKav3KY0StiNi11rYfic6OXrCgYLss+oRHvjCA== X-Received: by 2002:a5d:694e:: with SMTP id r14mr9205175wrw.34.1568577084944; Sun, 15 Sep 2019 12:51:24 -0700 (PDT) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id d28sm44274058wrb.95.2019.09.15.12.51.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2019 12:51:24 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sun, 15 Sep 2019 20:51:22 +0100 From: Edward Tomasz Napierala To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r352337 - in head: share/man/man3 sys/sys tests/sys/sys Message-ID: <20190915195122.GA60633@v2> Mail-Followup-To: Conrad Meyer , src-committers , svn-src-all , svn-src-head References: <201909141923.x8EJNkVx049506@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46Wg400KRwz4f1M X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 19:51:28 -0000 On 0914T1532, Conrad Meyer wrote: > One correction: > > On Sat, Sep 14, 2019 at 12:23 PM Edward Tomasz Napierala > wrote: > > > > Author: trasz > > Date: Sat Sep 14 19:23:46 2019 > > New Revision: 352337 > > URL: https://svnweb.freebsd.org/changeset/base/352337 > > > > Log: > > Introduce arb(3), the Array-based Red-Black Tree macros: similar > > to the traditional tree(3) RB trees, but using an array (preallocated, > > linear chunk of memory) to store the tree. > > > > This avoids allocation overhead, improves memory locality, > > and makes it trivially easy to share/transfer/copy the entire tree > > without the need for marshalling. The downside is that the size > > is fixed at initialization time; there is no mechanism to resize > > it. > > > > This is one of the dependencies for the new stats(3) framework > > (https://reviews.freebsd.org/D20477). > > > > Reviewed by: bcr (man pages), markj > > Discussed with: cem > > This should read: "Objected to by: cem" Sorry, I misunderstood your last comment as withdrawing your objection, my mistake. From owner-svn-src-head@freebsd.org Sun Sep 15 23:56:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 964C7EBE92; Sun, 15 Sep 2019 23:56:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WmVw3VX1z3NYf; Sun, 15 Sep 2019 23:56:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B321FEB7; Sun, 15 Sep 2019 23:56:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8FNueld070713; Sun, 15 Sep 2019 23:56:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8FNuen4070712; Sun, 15 Sep 2019 23:56:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909152356.x8FNuen4070712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 15 Sep 2019 23:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352369 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 352369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 23:56:40 -0000 Author: mav Date: Sun Sep 15 23:56:39 2019 New Revision: 352369 URL: https://svnweb.freebsd.org/changeset/base/352369 Log: Relax TX draining in ns8250_bus_transmit(). Since TX interrupt is generated when THRE is set, wait for TEMT set means wait for full character transmission time. At low speeds that may take awhile, burning CPU time while holding sc_hwmtx lock, also congested. This is partial revert of r317659. PR: 240121 MFC after: 2 weeks Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Sun Sep 15 21:32:19 2019 (r352368) +++ head/sys/dev/uart/uart_dev_ns8250.c Sun Sep 15 23:56:39 2019 (r352369) @@ -1029,13 +1029,8 @@ ns8250_bus_transmit(struct uart_softc *sc) bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - if (sc->sc_txdatasz > 1) { - if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0) - ns8250_drain(bas, UART_DRAIN_TRANSMITTER); - } else { - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) - DELAY(4); - } + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) + DELAY(4); for (i = 0; i < sc->sc_txdatasz; i++) { uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); From owner-svn-src-head@freebsd.org Mon Sep 16 00:32:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E517ED00E; Mon, 16 Sep 2019 00:32:24 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WnJ80xfdz3Q19; Mon, 16 Sep 2019 00:32:24 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 035E7185C0; Mon, 16 Sep 2019 00:32:24 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8G0WNT3093990; Mon, 16 Sep 2019 00:32:23 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8G0WNNY093989; Mon, 16 Sep 2019 00:32:23 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201909160032.x8G0WNNY093989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 16 Sep 2019 00:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352370 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 352370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 00:32:24 -0000 Author: sjg Date: Mon Sep 16 00:32:23 2019 New Revision: 352370 URL: https://svnweb.freebsd.org/changeset/base/352370 Log: Document logic for __DEFAULT_DEPENDENT_OPTIONS Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D21640 Modified: head/share/mk/bsd.mkopt.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Sun Sep 15 23:56:39 2019 (r352369) +++ head/share/mk/bsd.mkopt.mk Mon Sep 16 00:32:23 2019 (r352370) @@ -11,12 +11,16 @@ # For each option FOO in __DEFAULT_NO_OPTIONS, MK_FOO is set to "no", # unless WITH_FOO is defined, in which case it is set to "yes". # +# For each entry FOO/BAR in __DEFAULT_DEPENDENT_OPTIONS, +# MK_FOO is set to "no" if WITHOUT_FOO is defined, +# "yes" if WITH_FOO is defined, otherwise the value of MK_BAR. +# # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and # MK_FOO is set to "no" regardless of which list it was in. # -# Both __DEFAULT_YES_OPTIONS and __DEFAULT_NO_OPTIONS are undef'd -# after all this processing, allowing this file to be included -# multiple times with different lists. +# All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and +# __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing, +# allowing this file to be included multiple times with different lists. # # Other parts of the build system will set BROKEN_OPTIONS to a list # of options that are broken on this platform. This will not be unset From owner-svn-src-head@freebsd.org Mon Sep 16 00:36:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6864AED271; Mon, 16 Sep 2019 00:36:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WnP920V2z3QGP; Mon, 16 Sep 2019 00:36:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f54.google.com with SMTP id r26so74649591ioh.8; Sun, 15 Sep 2019 17:36:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=re6LHFQDMlTUnSirnF1PaeXdZMPt5ZQJ2vC7hiiqHik=; b=qS9V7EZnuVXJ1DTIt77OrhDuGk0fkAaGKuNgkxsB+npc0tLtxl1jnwSUqji+9gS3ov iah3LtrYxrVKNb9czs7DNx1/nPLXH5xXfj/+k3nddKqKUz5YpfbjUOsIZ/xwMwPFZxx4 +t2zPHD+jox7jZepcw1ZW3K0VfC0vlDT9nR1d0E+VMSbZuso4IFmPOozozb3+TXC9XRn UzY/H7Myj9zEVctgmmfJCjJQ8yG3PbUNDwBJhxdyU1XVpL60ikd3vHLmnzFLQYbjHUNj 0OJ3zOZY0il4Hcu/ZyIYLFKsyQJN6yWJ5IlIlakcdDPzmpnt6kON/A9r6LEIS1ekaNl5 VbBQ== X-Gm-Message-State: APjAAAXilyu69st1Hws5RaK4f2TbyrvETPqhqjm1dlvLd1wQcR1TZF/J Hl9RJoiYWSpsAILoY1wsewxIofnE X-Google-Smtp-Source: APXvYqzUoS4GYIAhE+lHD0uNUH4Z2c4m7yD0FM5I0N0F8FJHxxle7DE315l2FytFUMbC2JoSrgsLzA== X-Received: by 2002:a6b:f40f:: with SMTP id i15mr3148740iog.244.1568594203467; Sun, 15 Sep 2019 17:36:43 -0700 (PDT) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com. [209.85.166.45]) by smtp.gmail.com with ESMTPSA id z11sm31731372ioi.88.2019.09.15.17.36.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Sep 2019 17:36:43 -0700 (PDT) Received: by mail-io1-f45.google.com with SMTP id b136so74866491iof.3; Sun, 15 Sep 2019 17:36:43 -0700 (PDT) X-Received: by 2002:a02:8502:: with SMTP id g2mr17879917jai.87.1568594202946; Sun, 15 Sep 2019 17:36:42 -0700 (PDT) MIME-Version: 1.0 References: <201909141923.x8EJNkVx049506@repo.freebsd.org> <20190915195122.GA60633@v2> In-Reply-To: <20190915195122.GA60633@v2> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 15 Sep 2019 17:36:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352337 - in head: share/man/man3 sys/sys tests/sys/sys To: Edward Tomasz Napierala Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46WnP920V2z3QGP X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 00:36:45 -0000 On Sun, Sep 15, 2019 at 12:51 PM Edward Tomasz Napierala wrote: > On 0914T1532, Conrad Meyer wrote: > > On Sat, Sep 14, 2019 at 12:23 PM Edward Tomasz Napierala > > wrote: > > > URL: https://svnweb.freebsd.org/changeset/base/352337 > > > > > > Log: > > > Introduce arb(3), the Array-based Red-Black Tree macros: similar > > > to the traditional tree(3) RB trees, but using an array (preallocated, > > > linear chunk of memory) to store the tree. > > > ... > > > > > > Reviewed by: bcr (man pages), markj > > > Discussed with: cem > > > ... > > > Differential Revision: https://reviews.freebsd.org/D20324 > > > > This should read: "Objected to by: cem" > > Sorry, I misunderstood your last comment as withdrawing your objection, > my mistake. The comment that starts with "I'm still skeptical?" "Less objectionable" doesn't mean "not objectionable." Maybe I could have been more explicit, sorry for the confusion. Conrad From owner-svn-src-head@freebsd.org Mon Sep 16 06:42:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F743F56AB; Mon, 16 Sep 2019 06:42:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WxVf0z2Sz4DNp; Mon, 16 Sep 2019 06:42:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 049331C6A7; Mon, 16 Sep 2019 06:42:02 +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 x8G6g1vD013776; Mon, 16 Sep 2019 06:42:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8G6g1oK013775; Mon, 16 Sep 2019 06:42:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909160642.x8G6g1oK013775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Sep 2019 06:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352384 - head/lib/libc/yp X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/yp X-SVN-Commit-Revision: 352384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 06:42:02 -0000 Author: kib Date: Mon Sep 16 06:42:01 2019 New Revision: 352384 URL: https://svnweb.freebsd.org/changeset/base/352384 Log: Increase the size of the send and receive buffers for YP client rpc calls to max allowed UDP datagram size. Since max allowed size both for keys and values where increased, the old sizes of around 1K cause ypmatch(3) failures, while plain maps fetches work. The buffers were reduced in r34146 from default UDP rpcclient values to 1024/2304 due to the key and value size being 1K. Reviewed by: slavash Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21586 Modified: head/lib/libc/yp/yplib.c Modified: head/lib/libc/yp/yplib.c ============================================================================== --- head/lib/libc/yp/yplib.c Mon Sep 16 06:23:52 2019 (r352383) +++ head/lib/libc/yp/yplib.c Mon Sep 16 06:42:01 2019 (r352384) @@ -526,7 +526,7 @@ gotit: tv.tv_usec = 0; ysd->dom_socket = RPC_ANYSOCK; ysd->dom_client = clntudp_bufcreate(&ysd->dom_server_addr, - YPPROG, YPVERS, tv, &ysd->dom_socket, 1280, 2304); + YPPROG, YPVERS, tv, &ysd->dom_socket, 65507, 65507); if (ysd->dom_client == NULL) { clnt_pcreateerror("clntudp_create"); ysd->dom_vers = -1; From owner-svn-src-head@freebsd.org Mon Sep 16 07:08:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EDADF604B; Mon, 16 Sep 2019 07:08:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Wy4m0QcSz4FSs; Mon, 16 Sep 2019 07:08:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id CDB6E973D; Mon, 16 Sep 2019 07:08:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 3EDB6B704C; Mon, 16 Sep 2019 09:08:06 +0200 (CEST) Date: Mon, 16 Sep 2019 09:08:06 +0200 From: Baptiste Daroussin To: Dimitry Andric Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352341 - head/contrib/libedit Message-ID: <20190916070805.ykasrsmqdol3jwqt@ivaldir.net> References: <201909142149.x8ELnhqE035300@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zzllgpaayqdv4sjx" Content-Disposition: inline In-Reply-To: <201909142149.x8ELnhqE035300@repo.freebsd.org> User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 07:08:08 -0000 --zzllgpaayqdv4sjx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 14, 2019 at 09:49:43PM +0000, Dimitry Andric wrote: > Author: dim > Date: Sat Sep 14 21:49:42 2019 > New Revision: 352341 > URL: https://svnweb.freebsd.org/changeset/base/352341 >=20 > Log: > Fix arm and aarch64 builds of libedit after r352275 > =20 > On arm and arm64, where chars are unsigned by default, buildworld dies > with: > =20 > --- terminal.o --- > /usr/src/contrib/libedit/terminal.c:569:41: error: comparison of > integers of different signs: 'wint_t' (aka 'int') and 'wchar_t' (aka > 'unsigned int') [-Werror,-Wsign-compare] > el->el_cursor.v][where & 0370] !=3D > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ > /usr/src/contrib/libedit/terminal.c:659:28: error: comparison of > integers of different signs: 'wint_t' (aka 'int') and 'wchar_t' (aka > 'unsigned int') [-Werror,-Wsign-compare] > [el->el_cursor.h] =3D=3D MB_FILL_C= HAR) > ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ > =20 > Fix this by making MB_FILL_CHAR a wint_t, so no casting is needed. > =20 > Note that in https://reviews.freebsd.org/D21584 this was also proposed > by Yuichiro Naito . > =20 > Reviewed by: bapt > Subscribers: naito.yuichiro_gmail.com, ml_vishwin.info > MFC after: 3 weeks > X-MFC-With: r352275 > Differential Revision: https://reviews.freebsd.org/D21657 >=20 Just for completeness it was also approved by christos@NetBSD (upstream) --zzllgpaayqdv4sjx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAl1/NNMACgkQY4mL3PG3 PlrTaBAAtSpZxpx+klDe7Ic8UnmaYCPlu2pp4JVx55Zo5INSHmJBFnIKn38NZkjo KmnaQafSQVePFhyO93ZO6tLkb7rwsfvhwDVzkEHzvfLHlk5qeTDD57zH0nmhS/T2 MeXthJsKck3HP3BCA2v5LCEFXcjB1TiLRNG5v+/8897XbZPv7388xusHTMRjRKMW 111DVTfeiMFqFp2iFqXF+gcH0xEQy3dNv4cI+CBoHza2kD82r3jyt+K4KvhcdO79 VkWDX0yaQw0Hx99sZkP7DWywiAHHRS9tg7vDzPYZ5kYP1qqujkEqF0wAvc4mW8e3 sryAHrkX23PhBVqvhjIWHKxzbIVFzpTVxntbBIlPJo728e/7zOIVljqOH6V/PCRC w48un16RmsxfHzNTSuFa3NKkDTBDfxhDRMPzWOED00+X3dZvgUTJQbtyk9DyA8wd IDvsjcZ3bkZDtEZhJB7jwrMHd6QBeo3cvGXwQEjuJMAdDHXurrCpEaIDzLTHI71U Rrk0I0pd6r0f5zyE/dA9pMVLF5e5w8idMk4smPVzpBBgFRy6TtAq/i/60IqvTeAf cUs1bFimAJqc8Q+DQgLZvBEDO7R0JiD0v8I0EDtXaOJiwILQwWfqgNrpJCoRkRcp gEg0WiwsG3XOe9zkyuXBm9yCYb3VixVhZaCugc5j1P5i/0m+Xmk= =9ch+ -----END PGP SIGNATURE----- --zzllgpaayqdv4sjx-- From owner-svn-src-head@freebsd.org Mon Sep 16 07:32:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50EBAF664E; Mon, 16 Sep 2019 07:32:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WycJ1W30z4GPP; Mon, 16 Sep 2019 07:32:00 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17D5F1CE4D; Mon, 16 Sep 2019 07:32:00 +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 x8G7Vxg0042222; Mon, 16 Sep 2019 07:31:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8G7VxIe042221; Mon, 16 Sep 2019 07:31:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909160731.x8G7VxIe042221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 16 Sep 2019 07:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352385 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 352385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 07:32:00 -0000 Author: bapt Date: Mon Sep 16 07:31:59 2019 New Revision: 352385 URL: https://svnweb.freebsd.org/changeset/base/352385 Log: Do not use our custom completion function, it is not needed anymore Modified: head/bin/sh/histedit.c Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Mon Sep 16 06:42:01 2019 (r352384) +++ head/bin/sh/histedit.c Mon Sep 16 07:31:59 2019 (r352385) @@ -122,7 +122,7 @@ histedit(void) el_set(el, EL_PROMPT, getprompt); el_set(el, EL_ADDFN, "sh-complete", "Filename completion", - _el_fn_sh_complete); + _el_fn_complete); } else { bad: out2fmt_flush("sh: can't initialize editing\n"); From owner-svn-src-head@freebsd.org Mon Sep 16 08:18:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1FDCF830A; Mon, 16 Sep 2019 08:18:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WzdT57hqz4Jpj; Mon, 16 Sep 2019 08:18:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93AB01D73A; Mon, 16 Sep 2019 08:18:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8G8I5pg067146; Mon, 16 Sep 2019 08:18:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8G8I5KO067145; Mon, 16 Sep 2019 08:18:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909160818.x8G8I5KO067145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 16 Sep 2019 08:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352386 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 08:18:05 -0000 Author: tuexen Date: Mon Sep 16 08:18:05 2019 New Revision: 352386 URL: https://svnweb.freebsd.org/changeset/base/352386 Log: Don't write to memory outside of the allocated array for SACK blocks. Obtained from: rrs@ MFC after: 3 days Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_sack.c Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Mon Sep 16 07:31:59 2019 (r352385) +++ head/sys/netinet/tcp_sack.c Mon Sep 16 08:18:05 2019 (r352386) @@ -235,7 +235,7 @@ tcp_update_dsack_list(struct tcpcb *tp, tcp_seq rcv_st saved_blks[n].start = mid_blk.start; saved_blks[n++].end = mid_blk.end; } - for (j = 0; (j < tp->rcv_numsacks) && (j < MAX_SACK_BLKS-1); j++) { + for (j = 0; (j < tp->rcv_numsacks) && (n < MAX_SACK_BLKS); j++) { if (((SEQ_LT(tp->sackblks[j].end, mid_blk.start) || SEQ_GT(tp->sackblks[j].start, mid_blk.end)) && (SEQ_GT(tp->sackblks[j].start, tp->rcv_nxt)))) From owner-svn-src-head@freebsd.org Mon Sep 16 12:44:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CD46FFC96; Mon, 16 Sep 2019 12:44:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X5Y86cq3z4bvv; Mon, 16 Sep 2019 12:44:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C696C20735; Mon, 16 Sep 2019 12:44:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GCiicG056193; Mon, 16 Sep 2019 12:44:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GCiiEv056192; Mon, 16 Sep 2019 12:44:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909161244.x8GCiiEv056192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Sep 2019 12:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352387 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 12:44:45 -0000 Author: kevans Date: Mon Sep 16 12:44:44 2019 New Revision: 352387 URL: https://svnweb.freebsd.org/changeset/base/352387 Log: Fix 20190507 UPDATING entry The rc mechanism for loading kernel modules is actually called 'kld_list', not 'kld_load' Reported by: yuripv Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Sep 16 08:18:05 2019 (r352386) +++ head/UPDATING Mon Sep 16 12:44:44 2019 (r352387) @@ -89,8 +89,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 20190507: The tap(4) driver has been folded into tun(4), and the module has been - renamed to tuntap. You should update any kld_load="if_tap" or - kld_load="if_tun" entries in /etc/rc.conf, if_tap_load="YES" or + renamed to tuntap. You should update any kld_list="if_tap" or + kld_list="if_tun" entries in /etc/rc.conf, if_tap_load="YES" or if_tun_load="YES" entries in /boot/loader.conf to load the if_tuntap module instead, and "device tap" or "device tun" entries in kernel config files to select the tuntap device instead. From owner-svn-src-head@freebsd.org Mon Sep 16 12:51:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E2DBFFFB3; Mon, 16 Sep 2019 12:51:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X5hz2jC2z4cBC; Mon, 16 Sep 2019 12:51:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4079F2078D; Mon, 16 Sep 2019 12:51:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GCpVMJ058891; Mon, 16 Sep 2019 12:51:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GCpUKh058887; Mon, 16 Sep 2019 12:51:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909161251.x8GCpUKh058887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 16 Sep 2019 12:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352389 - head/release/packages X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/packages X-SVN-Commit-Revision: 352389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 12:51:31 -0000 Author: manu Date: Mon Sep 16 12:51:30 2019 New Revision: 352389 URL: https://svnweb.freebsd.org/changeset/base/352389 Log: pkgbase: Move cap_mkdb from runtime to utilities POST-INSTALL Since login and login.conf moved to the utilities packages move also the post-install related commands. Reported by: mj-mailinglist@gmx.de Reviewed by: bapt Added: head/release/packages/utilities.ucl (contents, props changed) Modified: head/release/packages/runtime.ucl Modified: head/release/packages/runtime.ucl ============================================================================== --- head/release/packages/runtime.ucl Mon Sep 16 12:51:28 2019 (r352388) +++ head/release/packages/runtime.ucl Mon Sep 16 12:51:30 2019 (r352389) @@ -18,7 +18,6 @@ desc = < Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF5A4121656; Mon, 16 Sep 2019 13:10:03 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X66M4gy5z4dHb; Mon, 16 Sep 2019 13:10:03 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83DAA20AC3; Mon, 16 Sep 2019 13:10:03 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GDA3NM071382; Mon, 16 Sep 2019 13:10:03 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GDA3PK071381; Mon, 16 Sep 2019 13:10:03 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201909161310.x8GDA3PK071381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Mon, 16 Sep 2019 13:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352391 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 352391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 13:10:03 -0000 Author: yuripv Date: Mon Sep 16 13:10:03 2019 New Revision: 352391 URL: https://svnweb.freebsd.org/changeset/base/352391 Log: sbuf(9): fix sbuf_drain_func typedef markup Reviewed by: 0mp (previous version) Differential Revision: https://reviews.freebsd.org/D21569 Modified: head/share/man/man9/sbuf.9 Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Mon Sep 16 12:54:44 2019 (r352390) +++ head/share/man/man9/sbuf.9 Mon Sep 16 13:10:03 2019 (r352391) @@ -65,7 +65,12 @@ .Sh SYNOPSIS .In sys/types.h .In sys/sbuf.h -.Ft typedef\ int ( sbuf_drain_func ) ( void\ *arg, const\ char\ *data, int\ len ) ; +.Ft typedef int +.Fo (sbuf_drain_func) +.Fa "void *arg" +.Fa "const char *data" +.Fa "int len" +.Fc .Pp .Ft struct sbuf * .Fo sbuf_new From owner-svn-src-head@freebsd.org Mon Sep 16 13:26:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4624121C72; Mon, 16 Sep 2019 13:26:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X6TH5hnjz4fJ3; Mon, 16 Sep 2019 13:26:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A237320E82; Mon, 16 Sep 2019 13:26:27 +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 x8GDQRdZ084855; Mon, 16 Sep 2019 13:26:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GDQRdl084854; Mon, 16 Sep 2019 13:26:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909161326.x8GDQRdl084854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Sep 2019 13:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352393 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 352393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 13:26:28 -0000 Author: kib Date: Mon Sep 16 13:26:27 2019 New Revision: 352393 URL: https://svnweb.freebsd.org/changeset/base/352393 Log: nfscl_loadattrcache: fix rest of the cases to not call vnode_pager_setsize() under the node mutex. r248567 moved some calls of vnode_pager_setsize() after the node lock is unlocked, do the rest now. Reported and tested by: peterj Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Mon Sep 16 13:10:34 2019 (r352392) +++ head/sys/fs/nfsclient/nfs_clport.c Mon Sep 16 13:26:27 2019 (r352393) @@ -511,10 +511,10 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt * zero np->n_attrstamp to indicate that * the attributes are stale. */ - vap->va_size = np->n_size; + nsize = vap->va_size = np->n_size; + setnsize = 1; np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); - vnode_pager_setsize(vp, np->n_size); } else if (np->n_flag & NMODIFIED) { /* * We've modified the file: Use the larger @@ -526,7 +526,8 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - vnode_pager_setsize(vp, np->n_size); + nsize = np->n_size; + setnsize = 1; } else if (vap->va_size < np->n_size) { /* * When shrinking the size, the call to @@ -538,9 +539,9 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt np->n_flag |= NSIZECHANGED; setnsize = 1; } else { - np->n_size = vap->va_size; + nsize = np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; - vnode_pager_setsize(vp, np->n_size); + setnsize = 1; } } else { np->n_size = vap->va_size; From owner-svn-src-head@freebsd.org Mon Sep 16 14:51:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B62A1245FB; Mon, 16 Sep 2019 14:51:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X8Mp0tvXz3HXV; Mon, 16 Sep 2019 14:51:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02BA821E18; Mon, 16 Sep 2019 14:51:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GEpnp0043083; Mon, 16 Sep 2019 14:51:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GEpn6O043081; Mon, 16 Sep 2019 14:51:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909161451.x8GEpn6O043081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 Sep 2019 14:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352404 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 352404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 14:51:50 -0000 Author: asomers Date: Mon Sep 16 14:51:49 2019 New Revision: 352404 URL: https://svnweb.freebsd.org/changeset/base/352404 Log: fusefs: fix some minor issues with fuse_vnode_setparent * When unparenting a vnode, actually clear the flag. AFAIK this is basically a no-op because we only unparent a vnode when reclaiming it or when unlinking. * There's no need to call fuse_vnode_setparent during reclaim, because we're about to free the vnode data anyway. Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21630 Modified: head/sys/fs/fuse/fuse_node.h head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_node.h ============================================================================== --- head/sys/fs/fuse/fuse_node.h Mon Sep 16 14:51:24 2019 (r352403) +++ head/sys/fs/fuse/fuse_node.h Mon Sep 16 14:51:49 2019 (r352404) @@ -174,6 +174,8 @@ fuse_vnode_setparent(struct vnode *vp, struct vnode *d MPASS(dvp->v_type == VDIR); VTOFUD(vp)->parent_nid = VTOI(dvp); VTOFUD(vp)->flag |= FN_PARENT_NID; + } else { + VTOFUD(vp)->flag &= ~FN_PARENT_NID; } } Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Mon Sep 16 14:51:24 2019 (r352403) +++ head/sys/fs/fuse/fuse_vnops.c Mon Sep 16 14:51:49 2019 (r352404) @@ -1525,11 +1525,10 @@ fuse_vnop_reclaim(struct vop_reclaim_args *ap) fuse_filehandle_close(vp, fufh, td, NULL); } - if ((!fuse_isdeadfs(vp)) && (fvdat->nlookup)) { + if (!fuse_isdeadfs(vp) && fvdat->nlookup > 0) { fuse_internal_forget_send(vnode_mount(vp), td, NULL, VTOI(vp), fvdat->nlookup); } - fuse_vnode_setparent(vp, NULL); cache_purge(vp); vfs_hash_remove(vp); fuse_vnode_destroy(vp); From owner-svn-src-head@freebsd.org Mon Sep 16 15:03:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 882AE124E96; Mon, 16 Sep 2019 15:03:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X8d03VqHz3JYf; Mon, 16 Sep 2019 15:03:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BF4322026; Mon, 16 Sep 2019 15:03:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GF3GGS052035; Mon, 16 Sep 2019 15:03:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GF3C9J052007; Mon, 16 Sep 2019 15:03:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909161503.x8GF3C9J052007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 16 Sep 2019 15:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352406 - in head: share/man/man9 sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm64/arm64 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/virtio/balloon sys/i386/i386 sys/m... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm64/arm64 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/virtio/balloon sys/i386/i386 sys/mips/mips sys/powerpc/aim ... X-SVN-Commit-Revision: 352406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 15:03:16 -0000 Author: markj Date: Mon Sep 16 15:03:12 2019 New Revision: 352406 URL: https://svnweb.freebsd.org/changeset/base/352406 Log: Fix a couple of nits in r352110. - Remove a dead variable from the amd64 pmap_extract_and_hold(). - Fix grammar in the vm_page_wire man page. Reported by: alc Reviewed by: alc, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21639 Modified: head/share/man/man9/vm_page_wire.9 head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/arm/arm/pmap-v4.c head/sys/arm/arm/pmap-v6.c head/sys/arm64/arm64/pmap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/i386/i386/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/riscv/riscv/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_pagequeue.h head/sys/vm/vm_swapout.c Modified: head/share/man/man9/vm_page_wire.9 ============================================================================== --- head/share/man/man9/vm_page_wire.9 Mon Sep 16 15:00:11 2019 (r352405) +++ head/share/man/man9/vm_page_wire.9 Mon Sep 16 15:03:12 2019 (r352406) @@ -51,7 +51,7 @@ The .Fn vm_page_wire and .Fn vm_page_wire_mapped -function wire the page, prevent it from being reclaimed by the page +functions wire the page, which prevents it from being reclaimed by the page daemon or when its containing object is destroyed. Both functions require that the page belong to an object. The Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/amd64/amd64/pmap.c Mon Sep 16 15:03:12 2019 (r352406) @@ -3064,10 +3064,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ { pd_entry_t pde, *pdep; pt_entry_t pte, PG_RW, PG_V; - vm_paddr_t pa; vm_page_t m; - pa = 0; m = NULL; PG_RW = pmap_rw_bit(pmap); PG_V = pmap_valid_bit(pmap); @@ -5806,7 +5804,7 @@ retry: ("pmap_enter: no PV entry for %#lx", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if ((vm_page_aflags(om) & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) @@ -6989,7 +6987,7 @@ pmap_remove_pages(pmap_t pmap) pvh->pv_gen++; if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) - if ((mt->aflags & PGA_WRITEABLE) != 0 && + if ((vm_page_aflags(mt) & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&mt->md.pv_list)) vm_page_aflag_clear(mt, PGA_WRITEABLE); } @@ -7007,7 +7005,7 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap, 1); TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; - if ((m->aflags & PGA_WRITEABLE) != 0 && + if ((vm_page_aflags(m) & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -7138,7 +7136,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (FALSE); return (pmap_page_test_mappings(m, FALSE, TRUE)); } @@ -7207,7 +7205,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; lock = VM_PAGE_TO_PV_LIST_LOCK(m); pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : @@ -7690,7 +7688,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(VM_PAGE_TO_PHYS(m)); Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/amd64/include/pmap.h Mon Sep 16 15:03:12 2019 (r352406) @@ -423,7 +423,8 @@ extern int pmap_pcid_enabled; extern int invpcid_works; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) +#define pmap_page_is_write_mapped(m) \ + (((m)->astate.flags & PGA_WRITEABLE) != 0) #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) struct thread; Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/arm/arm/pmap-v4.c Mon Sep 16 15:03:12 2019 (r352406) @@ -4104,7 +4104,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; if (m->md.pvh_attrs & PVF_MOD) pmap_clearbit(m, PVF_MOD); @@ -4143,7 +4143,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (vm_page_xbusied(m) || (m->aflags & PGA_WRITEABLE) != 0) + if (vm_page_xbusied(m) || (vm_page_aflags(m) & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); } Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/arm/arm/pmap-v6.c Mon Sep 16 15:03:12 2019 (r352406) @@ -5197,7 +5197,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTE2s can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); rv = pmap_is_modified_pvh(&m->md) || @@ -5540,7 +5540,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && !pmap_page_is_write_mapped(m)) return; rw_wlock(&pvh_global_lock); sched_pin(); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/arm64/arm64/pmap.c Mon Sep 16 15:03:12 2019 (r352406) @@ -3333,7 +3333,7 @@ havel3: pv = pmap_pvh_remove(&om->md, pmap, va); if ((m->oflags & VPO_UNMANAGED) != 0) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if ((vm_page_aflags(om) & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) @@ -4372,7 +4372,7 @@ pmap_remove_pages(pmap_t pmap) pvh->pv_gen++; if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) - if ((mt->aflags & PGA_WRITEABLE) != 0 && + if (vm_page_aflags(mt) & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&mt->md.pv_list)) vm_page_aflag_clear(mt, PGA_WRITEABLE); } @@ -4394,7 +4394,7 @@ pmap_remove_pages(pmap_t pmap) TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; - if ((m->aflags & PGA_WRITEABLE) != 0 && + if (vm_page_aflags(m) & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh( @@ -4534,7 +4534,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (FALSE); return (pmap_page_test_mappings(m, FALSE, TRUE)); } @@ -4600,7 +4600,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; lock = VM_PAGE_TO_PV_LIST_LOCK(m); pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : @@ -4977,7 +4977,7 @@ pmap_clear_modify(vm_page_t m) * set. If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(VM_PAGE_TO_PHYS(m)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Sep 16 15:03:12 2019 (r352406) @@ -1718,12 +1718,10 @@ dmu_read_pages(objset_t *os, uint64_t object, vm_page_ bcopy((char *)db->db_data + bufoff, va, PAGESIZE); zfs_unmap_page(sf); m->valid = VM_PAGE_BITS_ALL; - vm_page_lock(m); if ((m->busy_lock & VPB_BIT_WAITERS) != 0) vm_page_activate(m); else vm_page_deactivate(m); - vm_page_unlock(m); } *rbehind = i; @@ -1838,12 +1836,10 @@ dmu_read_pages(objset_t *os, uint64_t object, vm_page_ } zfs_unmap_page(sf); m->valid = VM_PAGE_BITS_ALL; - vm_page_lock(m); if ((m->busy_lock & VPB_BIT_WAITERS) != 0) vm_page_activate(m); else vm_page_deactivate(m); - vm_page_unlock(m); } *rahead = i; zfs_vmobject_wunlock(vmobj); Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Mon Sep 16 15:03:12 2019 (r352406) @@ -332,8 +332,6 @@ vtballoon_inflate(struct vtballoon_softc *sc, int npag sc->vtballoon_page_frames[i] = VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT; - KASSERT(m->queue == PQ_NONE, - ("%s: allocated page %p on queue", __func__, m)); TAILQ_INSERT_TAIL(&sc->vtballoon_pages, m, plinks.q); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/i386/i386/pmap.c Mon Sep 16 15:03:12 2019 (r352406) @@ -3752,7 +3752,7 @@ __CONCAT(PMTYPE, enter)(pmap_t pmap, vm_offset_t va, v ("pmap_enter: no PV entry for %#x", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if ((vm_page_aflags(om) & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) @@ -4848,7 +4848,7 @@ __CONCAT(PMTYPE, is_modified)(vm_page_t m) * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); rv = pmap_is_modified_pvh(&m->md) || @@ -4979,7 +4979,7 @@ __CONCAT(PMTYPE, remove_write)(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); sched_pin(); @@ -5291,7 +5291,7 @@ __CONCAT(PMTYPE, clear_modify)(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); sched_pin(); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/mips/mips/pmap.c Mon Sep 16 15:03:12 2019 (r352406) @@ -2164,7 +2164,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v pv = pmap_pvh_remove(&om->md, pmap, va); if (!pte_test(&newpte, PTE_MANAGED)) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if (vm_page_aflags(m) & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list)) vm_page_aflag_clear(om, PGA_WRITEABLE); } @@ -2934,7 +2934,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -2999,7 +2999,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTEs can have PTE_D set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); rv = pmap_testbit(m, PTE_D); @@ -3143,7 +3143,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * write busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -3270,7 +3270,7 @@ retry: * determine if the address is MINCORE_REFERENCED. */ m = PHYS_TO_VM_PAGE(pa); - if ((m->aflags & PGA_REFERENCED) != 0) + if ((vm_page_aflags(m) & PGA_REFERENCED) != 0) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; } if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/powerpc/aim/mmu_oea.c Mon Sep 16 15:03:12 2019 (r352406) @@ -1319,7 +1319,7 @@ moea_is_modified(mmu_t mmu, vm_page_t m) * is clear, no PTEs can have PTE_CHG set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); rv = moea_query_bit(m, PTE_CHG); @@ -1355,7 +1355,7 @@ moea_clear_modify(mmu_t mmu, vm_page_t m) * set. If the object containing the page is locked and the page is * not exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); moea_clear_bit(m, PTE_CHG); @@ -1382,7 +1382,7 @@ moea_remove_write(mmu_t mmu, vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); lo = moea_attr_fetch(m); @@ -1915,7 +1915,8 @@ moea_remove_all(mmu_t mmu, vm_page_t m) moea_pvo_remove(pvo, -1); PMAP_UNLOCK(pmap); } - if ((m->aflags & PGA_WRITEABLE) && moea_query_bit(m, PTE_CHG)) { + if ((vm_page_aflags(m) & PGA_WRITEABLE) != 0 && + moea_query_bit(m, PTE_CHG)) { moea_attr_clear(m, PTE_CHG); vm_page_dirty(m); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Sep 16 15:03:12 2019 (r352406) @@ -1467,7 +1467,7 @@ out: * Flush the page from the instruction cache if this page is * mapped executable and cacheable. */ - if (pmap != kernel_pmap && !(m->aflags & PGA_EXECUTABLE) && + if (pmap != kernel_pmap && (vm_page_aflags(m) & PGA_EXECUTABLE) != 0 && (pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { vm_page_aflag_set(m, PGA_EXECUTABLE); moea64_syncicache(mmu, pmap, va, VM_PAGE_TO_PHYS(m), PAGE_SIZE); @@ -1688,7 +1688,7 @@ moea64_is_modified(mmu_t mmu, vm_page_t m) * is clear, no PTEs can have LPTE_CHG set. */ VM_OBJECT_ASSERT_LOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (FALSE); return (moea64_query_bit(mmu, m, LPTE_CHG)); } @@ -1722,7 +1722,7 @@ moea64_clear_modify(mmu_t mmu, vm_page_t m) * set. If the object containing the page is locked and the page is * not exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; moea64_clear_bit(mmu, m, LPTE_CHG); } @@ -1746,7 +1746,7 @@ moea64_remove_write(mmu_t mmu, vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; powerpc_sync(); PV_PAGE_LOCK(m); @@ -2240,7 +2240,8 @@ moea64_pvo_protect(mmu_t mmu, pmap_t pm, struct pvo_e if (refchg < 0) refchg = (oldprot & VM_PROT_WRITE) ? LPTE_CHG : 0; - if (pm != kernel_pmap && pg != NULL && !(pg->aflags & PGA_EXECUTABLE) && + if (pm != kernel_pmap && pg != NULL && + (vm_page_aflags(pg) & PGA_EXECUTABLE) == 0 && (pvo->pvo_pte.pa & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { if ((pg->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(pg, PGA_EXECUTABLE); @@ -2454,7 +2455,8 @@ moea64_remove_all(mmu_t mmu, vm_page_t m) } KASSERT(!pmap_page_is_mapped(m), ("Page still has mappings")); - KASSERT(!(m->aflags & PGA_WRITEABLE), ("Page still writable")); + KASSERT((vm_page_aflags(m) & PGA_WRITEABLE) == 0, + ("Page still writable")); PV_PAGE_UNLOCK(m); /* Clean up UMA allocations */ Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/powerpc/booke/pmap.c Mon Sep 16 15:03:12 2019 (r352406) @@ -2694,7 +2694,7 @@ mmu_booke_remove_write(mmu_t mmu, vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { @@ -3040,7 +3040,7 @@ mmu_booke_is_modified(mmu_t mmu, vm_page_t m) * is clear, no PTEs can be modified. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (rv); rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { @@ -3119,7 +3119,7 @@ mmu_booke_clear_modify(mmu_t mmu, vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PG_AWRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/riscv/riscv/pmap.c Mon Sep 16 15:03:12 2019 (r352406) @@ -2825,7 +2825,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v ("pmap_enter: no PV entry for %#lx", va)); if ((new_l3 & PTE_SW_MANAGED) == 0) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if ((vm_page_aflags(om) & PGA_WRITEABLE) == 0 && TAILQ_EMPTY(&om->md.pv_list)) vm_page_aflag_clear(om, PGA_WRITEABLE); } @@ -3556,7 +3556,7 @@ pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entr if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[Ln_ENTRIES]; mt++) if (TAILQ_EMPTY(&mt->md.pv_list) && - (mt->aflags & PGA_WRITEABLE) != 0) + (vm_page_aflags(mt) & PGA_WRITEABLE) != 0) vm_page_aflag_clear(mt, PGA_WRITEABLE); } mpte = pmap_remove_pt_page(pmap, pv->pv_va); @@ -3574,7 +3574,7 @@ pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entr TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; if (TAILQ_EMPTY(&m->md.pv_list) && - (m->aflags & PGA_WRITEABLE) != 0) { + (vm_page_aflags(m) & PGA_WRITEABLE) != 0) { pvh = pa_to_pvh(m->phys_addr); if (TAILQ_EMPTY(&pvh->pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -3789,7 +3789,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (FALSE); return (pmap_page_test_mappings(m, FALSE, TRUE)); } @@ -3855,7 +3855,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; lock = VM_PAGE_TO_PV_LIST_LOCK(m); pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : @@ -4115,7 +4115,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(VM_PAGE_TO_PHYS(m)); Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/sparc64/sparc64/pmap.c Mon Sep 16 15:03:12 2019 (r352406) @@ -2121,7 +2121,7 @@ pmap_is_modified(vm_page_t m) * is clear, no TTEs can have TD_W set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return (rv); rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { @@ -2204,7 +2204,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { @@ -2232,7 +2232,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) return; rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/vm/swap_pager.c Mon Sep 16 15:03:12 2019 (r352406) @@ -1648,12 +1648,6 @@ swp_pager_force_dirty(vm_page_t m) { vm_page_dirty(m); -#ifdef INVARIANTS - vm_page_lock(m); - if (!vm_page_wired(m) && m->queue == PQ_NONE) - panic("page %p is neither wired nor queued", m); - vm_page_unlock(m); -#endif vm_page_xunbusy(m); swap_pager_unswapped(m); } Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/vm/vm_fault.c Mon Sep 16 15:03:12 2019 (r352406) @@ -153,9 +153,7 @@ release_page(struct faultstate *fs) { vm_page_xunbusy(fs->m); - vm_page_lock(fs->m); vm_page_deactivate(fs->m); - vm_page_unlock(fs->m); fs->m = NULL; } @@ -376,9 +374,7 @@ vm_fault_populate_cleanup(vm_object_t object, vm_pinde for (pidx = first, m = vm_page_lookup(object, pidx); pidx <= last; pidx++, m = vm_page_next(m)) { vm_fault_populate_check_page(m); - vm_page_lock(m); vm_page_deactivate(m); - vm_page_unlock(m); vm_page_xunbusy(m); } } @@ -1325,9 +1321,7 @@ readrest: if ((fault_flags & VM_FAULT_WIRE) != 0) { vm_page_wire(fs.m); } else { - vm_page_lock(fs.m); vm_page_activate(fs.m); - vm_page_unlock(fs.m); } if (m_hold != NULL) { *m_hold = fs.m; Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/vm/vm_mmap.c Mon Sep 16 15:03:12 2019 (r352406) @@ -935,9 +935,9 @@ RestartScan: * and set PGA_REFERENCED before the call to * pmap_is_referenced(). */ - if ((m->aflags & PGA_REFERENCED) != 0 || + if ((vm_page_aflags(m) & PGA_REFERENCED) != 0 || pmap_is_referenced(m) || - (m->aflags & PGA_REFERENCED) != 0) + (vm_page_aflags(m) & PGA_REFERENCED) != 0) mincoreinfo |= MINCORE_REFERENCED_OTHER; } if (object != NULL) Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/vm/vm_object.c Mon Sep 16 15:03:12 2019 (r352406) @@ -2312,9 +2312,9 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) * sysctl is only meant to give an * approximation of the system anyway. */ - if (m->queue == PQ_ACTIVE) + if (m->astate.queue == PQ_ACTIVE) kvo->kvo_active++; - else if (m->queue == PQ_INACTIVE) + else if (m->astate.queue == PQ_INACTIVE) kvo->kvo_inactive++; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Sep 16 15:00:11 2019 (r352405) +++ head/sys/vm/vm_page.c Mon Sep 16 15:03:12 2019 (r352406) @@ -73,11 +73,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include #include +#include #include #include #include @@ -130,6 +131,34 @@ static int vm_min_waiters; static int vm_severe_waiters; static int vm_pageproc_waiters; +static SYSCTL_NODE(_vm_stats, OID_AUTO, page, CTLFLAG_RD, 0, + "VM page stats"); + +static counter_u64_t pqstate_commit_aborts = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, commit_aborts, CTLFLAG_RD, + &pqstate_commit_aborts, + "Failed page queue state updates"); + +static counter_u64_t queue_ops = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, queue_ops, CTLFLAG_RD, + &queue_ops, + "Batched queue operations"); + +static counter_u64_t null_queue_ops = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, null_queue_ops, CTLFLAG_RD, + &null_queue_ops, + "Batched queue operations with no effect"); + +static void +counter_startup(void) +{ + + pqstate_commit_aborts = counter_u64_alloc(M_WAITOK); + queue_ops = counter_u64_alloc(M_WAITOK); + null_queue_ops = counter_u64_alloc(M_WAITOK); +} +SYSINIT(page_counters, SI_SUB_CPU, SI_ORDER_ANY, counter_startup, NULL); + /* * bogus page -- for I/O to/from partially complete buffers, * or for paging into sparsely invalid regions. @@ -158,16 +187,17 @@ static uma_zone_t fakepg_zone; static void vm_page_alloc_check(vm_page_t m); static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); -static void vm_page_dequeue_complete(vm_page_t m); static void vm_page_enqueue(vm_page_t m, uint8_t queue); static void vm_page_init(void *dummy); static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); static void vm_page_insert_radixdone(vm_page_t m, vm_object_t object, vm_page_t mpred); -static void vm_page_mvqueue(vm_page_t m, uint8_t queue); +static void vm_page_mvqueue(vm_page_t m, const uint8_t queue, + const uint16_t nflag); static int vm_page_reclaim_run(int req_class, int domain, u_long npages, vm_page_t m_run, vm_paddr_t high); +static bool vm_page_release_toq(vm_page_t m, uint8_t queue, bool noreuse); static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, int req); static int vm_page_zone_import(void *arg, void **store, int cnt, int domain, @@ -440,10 +470,10 @@ vm_page_init_marker(vm_page_t marker, int queue, uint8 { bzero(marker, sizeof(*marker)); - marker->flags = PG_MARKER; - marker->aflags = aflags; marker->busy_lock = VPB_SINGLE_EXCLUSIVER; - marker->queue = queue; + marker->astate.flags = aflags; + marker->astate.queue = queue; + marker->flags = PG_MARKER; } static void @@ -513,9 +543,10 @@ vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segi m->object = NULL; m->ref_count = 0; m->busy_lock = VPB_UNBUSIED; - m->flags = m->aflags = 0; + m->flags = 0; m->phys_addr = pa; - m->queue = PQ_NONE; + m->astate.flags = 0; + m->astate.queue = PQ_NONE; m->psind = 0; m->segind = segind; m->order = VM_NFREEORDER; @@ -1152,7 +1183,7 @@ vm_page_initfake(vm_page_t m, vm_paddr_t paddr, vm_mem goto memattr; } m->phys_addr = paddr; - m->queue = PQ_NONE; + m->astate.queue = PQ_NONE; /* Fictitious pages don't use "segind". */ m->flags = PG_FICTITIOUS; /* Fictitious pages don't use "order" or "pool". */ @@ -1239,12 +1270,10 @@ vm_page_readahead_finish(vm_page_t m) * have shown that deactivating the page is usually the best choice, * unless the page is wanted by another thread. */ - vm_page_lock(m); if ((m->busy_lock & VPB_BIT_WAITERS) != 0) vm_page_activate(m); else vm_page_deactivate(m); - vm_page_unlock(m); vm_page_xunbusy(m); } @@ -1607,7 +1636,7 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm mnew->pindex = pindex; atomic_set_int(&mnew->ref_count, VPRC_OBJREF); mold = vm_radix_replace(&object->rtree, mnew); - KASSERT(mold->queue == PQ_NONE, + KASSERT(mold->astate.queue == PQ_NONE, ("vm_page_replace: old page %p is on a paging queue", mold)); /* Keep the resident page list in sorted order. */ @@ -1883,7 +1912,7 @@ found: if ((req & VM_ALLOC_NODUMP) != 0) flags |= PG_NODUMP; m->flags = flags; - m->aflags = 0; + m->astate.flags = 0; m->oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? VPO_UNMANAGED : 0; m->busy_lock = VPB_UNBUSIED; @@ -1899,7 +1928,7 @@ found: vm_wire_add(1); m->ref_count = 1; } - m->act_count = 0; + m->astate.act_count = 0; if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { @@ -2093,12 +2122,12 @@ found: memattr = object->memattr; } for (m = m_ret; m < &m_ret[npages]; m++) { - m->aflags = 0; + m->astate.flags = 0; m->flags = (m->flags | PG_NODUMP) & flags; m->busy_lock = busy_lock; if ((req & VM_ALLOC_WIRED) != 0) m->ref_count = 1; - m->act_count = 0; + m->astate.act_count = 0; m->oflags = oflags; if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { @@ -2141,9 +2170,10 @@ vm_page_alloc_check(vm_page_t m) { KASSERT(m->object == NULL, ("page %p has object", m)); - KASSERT(m->queue == PQ_NONE && (m->aflags & PGA_QUEUE_STATE_MASK) == 0, + KASSERT(m->astate.queue == PQ_NONE && + (m->astate.flags & PGA_QUEUE_STATE_MASK) == 0, ("page %p has unexpected queue %d, flags %#x", - m, m->queue, (m->aflags & PGA_QUEUE_STATE_MASK))); + m, m->astate.queue, (m->astate.flags & PGA_QUEUE_STATE_MASK))); KASSERT(m->ref_count == 0, ("page %p has references", m)); KASSERT(!vm_page_busied(m), ("page %p is busy", m)); KASSERT(m->dirty == 0, ("page %p is dirty", m)); @@ -2217,7 +2247,7 @@ again: /* * Initialize the page. Only the PG_ZERO flag is inherited. */ - m->aflags = 0; + m->astate.flags = 0; flags = 0; if ((req & VM_ALLOC_ZERO) != 0) flags = PG_ZERO; @@ -2396,8 +2426,7 @@ retry: vm_reserv_size(level)) - pa); #endif } else if (object->memattr == VM_MEMATTR_DEFAULT && - vm_page_queue(m) != PQ_NONE && !vm_page_busied(m) && - !vm_page_wired(m)) { + !vm_page_busied(m) && !vm_page_wired(m)) { /* * The page is allocated but eligible for * relocation. Extend the current run by one @@ -2545,8 +2574,7 @@ retry: error = EINVAL; else if (object->memattr != VM_MEMATTR_DEFAULT) error = EINVAL; - else if (vm_page_queue(m) != PQ_NONE && - !vm_page_busied(m) && !vm_page_wired(m)) { + else if (!vm_page_busied(m) && !vm_page_wired(m)) { KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, ("page %p has an unexpected memattr", m)); @@ -2607,7 +2635,7 @@ retry: error = EBUSY; goto unlock; } - m_new->aflags = m->aflags & + m_new->astate.flags = m->astate.flags & ~PGA_QUEUE_STATE_MASK; KASSERT(m_new->oflags == VPO_UNMANAGED, ("page %p is managed", m_new)); @@ -3075,65 +3103,141 @@ vm_waitpfault(struct domainset *dset, int timo) mtx_unlock(&vm_domainset_lock); } -static struct vm_pagequeue * -vm_page_pagequeue(vm_page_t m) +bool +vm_page_pqstate_commit(vm_page_t m, vm_page_astate_t *old, vm_page_astate_t new) { + vm_page_t next; + struct vm_pagequeue *pq; + int mask; - uint8_t queue; + if (old->queue != PQ_NONE && old->queue != new.queue) { + new.flags &= ~PGA_ENQUEUED; - if ((queue = atomic_load_8(&m->queue)) == PQ_NONE) - return (NULL); - return (&vm_pagequeue_domain(m)->vmd_pagequeues[queue]); + pq = _vm_page_pagequeue(m, old->queue); + + /* + * The physical queue state might change at any point before the + * page queue lock is acquired, so we must verify that the lock + * is correct before proceeding. Once the page's queue index is + * changed, the page queue lock we hold will no longer + * synchronize the physical queue state of the page, so we must + * awkwardly remove the page from the queue and put it back if + * the commit fails. + */ + vm_pagequeue_lock(pq); + if (__predict_false(m->astate.queue != old->queue)) { + vm_pagequeue_unlock(pq); + *old = vm_page_astate_load(m); + return (false); + } + if (__predict_true((m->astate.flags & PGA_ENQUEUED) != 0)) { + next = TAILQ_NEXT(m, plinks.q); + TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); + } + if (__predict_false(!vm_page_astate_fcmpset(m, old, new))) { + if ((old->flags & PGA_ENQUEUED) != 0) { + if (next == NULL) + TAILQ_INSERT_TAIL(&pq->pq_pl, m, + plinks.q); + else + TAILQ_INSERT_BEFORE(next, m, plinks.q); + } + vm_pagequeue_unlock(pq); + counter_u64_add(pqstate_commit_aborts, 1); + return (false); + } + if ((old->flags & PGA_ENQUEUED) != 0) + vm_pagequeue_cnt_dec(pq); + vm_pagequeue_unlock(pq); + } else if (__predict_false(!vm_page_astate_fcmpset(m, old, new))) { + counter_u64_add(pqstate_commit_aborts, 1); + return (false); + } + + if (new.queue != PQ_NONE) { + mask = new.flags & PGA_QUEUE_OP_MASK; + if (mask != 0 && (old->flags & mask) != mask) + vm_page_pqbatch_submit(m, new.queue); + } + + return (true); } static inline void -vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_page_t m) +vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_page_t m, uint8_t queue) { + vm_page_t next; struct vm_domain *vmd; - uint8_t qflags; + vm_page_astate_t old, new; CRITICAL_ASSERT(curthread); vm_pagequeue_assert_locked(pq); + old = vm_page_astate_load(m); +retry: + if (__predict_false(old.queue != queue)) + return; + KASSERT(pq == _vm_page_pagequeue(m, queue), + ("page %p does not belong to queue %p", m, pq)); + KASSERT(old.queue != PQ_NONE || (old.flags & PGA_QUEUE_STATE_MASK) == 0, + ("page %p has unexpected queue state", m)); + /* - * The page daemon is allowed to set m->queue = PQ_NONE without - * the page queue lock held. In this case it is about to free the page, - * which must not have any queue state. + * Update the page's queue state before modifying the page queues + * themselves, to avoid having to roll back updates when a queue state + * update fails and requires a retry. */ - qflags = atomic_load_8(&m->aflags); - KASSERT(pq == vm_page_pagequeue(m) || - (qflags & PGA_QUEUE_STATE_MASK) == 0, - ("page %p doesn't belong to queue %p but has aflags %#x", - m, pq, qflags)); + new = old; + if ((old.flags & PGA_DEQUEUE) != 0) { + new.queue = PQ_NONE; + new.flags &= ~PGA_QUEUE_STATE_MASK; + if (__predict_true((old.flags & PGA_ENQUEUED) != 0)) { + next = TAILQ_NEXT(m, plinks.q); + TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); + } + if (__predict_false(!vm_page_astate_fcmpset(m, &old, new))) { + if ((old.flags & PGA_ENQUEUED) != 0) { + if (next == NULL) + TAILQ_INSERT_TAIL(&pq->pq_pl, m, + plinks.q); + else + TAILQ_INSERT_BEFORE(next, m, plinks.q); + } + counter_u64_add(pqstate_commit_aborts, 1); + goto retry; + } + if ((old.flags & PGA_ENQUEUED) != 0) + vm_pagequeue_cnt_dec(pq); + counter_u64_add(queue_ops, 1); + } else if ((old.flags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) { + new.flags |= PGA_ENQUEUED; + new.flags &= ~(PGA_REQUEUE | PGA_REQUEUE_HEAD); + if (__predict_false(!vm_page_astate_fcmpset(m, &old, new))) { + counter_u64_add(pqstate_commit_aborts, 1); + goto retry; + } - if ((qflags & PGA_DEQUEUE) != 0) { - if (__predict_true((qflags & PGA_ENQUEUED) != 0)) - vm_pagequeue_remove(pq, m); - vm_page_dequeue_complete(m); - } else if ((qflags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) { - if ((qflags & PGA_ENQUEUED) != 0) + if ((old.flags & PGA_ENQUEUED) != 0) TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - else { + else vm_pagequeue_cnt_inc(pq); - vm_page_aflag_set(m, PGA_ENQUEUED); - } /* - * Give PGA_REQUEUE_HEAD precedence over PGA_REQUEUE. - * In particular, if both flags are set in close succession, - * only PGA_REQUEUE_HEAD will be applied, even if it was set - * first. + * Give PGA_REQUEUE_HEAD precedence over PGA_REQUEUE. In + * particular, if both flags are set in close succession, only + * PGA_REQUEUE_HEAD will be applied, even if it was set first. */ - if ((qflags & PGA_REQUEUE_HEAD) != 0) { - KASSERT(m->queue == PQ_INACTIVE, + if ((old.flags & PGA_REQUEUE_HEAD) != 0) { + KASSERT(old.queue == PQ_INACTIVE, ("head enqueue not supported for page %p", m)); vmd = vm_pagequeue_domain(m); TAILQ_INSERT_BEFORE(&vmd->vmd_inacthead, m, plinks.q); - } else + } else { TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); - - vm_page_aflag_clear(m, qflags & (PGA_REQUEUE | - PGA_REQUEUE_HEAD)); + } + counter_u64_add(queue_ops, 1); + } else { + counter_u64_add(null_queue_ops, 1); } } @@ -3141,15 +3245,10 @@ static void vm_pqbatch_process(struct vm_pagequeue *pq, struct vm_batchqueue *bq, uint8_t queue) { - vm_page_t m; int i; - for (i = 0; i < bq->bq_cnt; i++) { - m = bq->bq_pa[i]; - if (__predict_false(m->queue != queue)) - continue; - vm_pqbatch_process_page(pq, m); - } + for (i = 0; i < bq->bq_cnt; i++) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Sep 16 15:04:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B003A124F32; Mon, 16 Sep 2019 15:04:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X8fp4w6Fz3Jhl; Mon, 16 Sep 2019 15:04:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C07422027; Mon, 16 Sep 2019 15:04:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GF4o12052353; Mon, 16 Sep 2019 15:04:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GF4kZk052320; Mon, 16 Sep 2019 15:04:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909161504.x8GF4kZk052320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 16 Sep 2019 15:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352407 - in head: share/man/man9 sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm64/arm64 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/virtio/balloon sys/i386/i386 sys/m... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm64/arm64 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/virtio/balloon sys/i386/i386 sys/mips/mips sys/powerpc/aim ... X-SVN-Commit-Revision: 352407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 15:04:50 -0000 Author: markj Date: Mon Sep 16 15:04:45 2019 New Revision: 352407 URL: https://svnweb.freebsd.org/changeset/base/352407 Log: Revert r352406, which contained changes I didn't intend to commit. Modified: head/share/man/man9/vm_page_wire.9 head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/arm/arm/pmap-v4.c head/sys/arm/arm/pmap-v6.c head/sys/arm64/arm64/pmap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/i386/i386/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/riscv/riscv/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_pagequeue.h head/sys/vm/vm_swapout.c Modified: head/share/man/man9/vm_page_wire.9 ============================================================================== --- head/share/man/man9/vm_page_wire.9 Mon Sep 16 15:03:12 2019 (r352406) +++ head/share/man/man9/vm_page_wire.9 Mon Sep 16 15:04:45 2019 (r352407) @@ -51,7 +51,7 @@ The .Fn vm_page_wire and .Fn vm_page_wire_mapped -functions wire the page, which prevents it from being reclaimed by the page +function wire the page, prevent it from being reclaimed by the page daemon or when its containing object is destroyed. Both functions require that the page belong to an object. The Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/amd64/amd64/pmap.c Mon Sep 16 15:04:45 2019 (r352407) @@ -3064,8 +3064,10 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ { pd_entry_t pde, *pdep; pt_entry_t pte, PG_RW, PG_V; + vm_paddr_t pa; vm_page_t m; + pa = 0; m = NULL; PG_RW = pmap_rw_bit(pmap); PG_V = pmap_valid_bit(pmap); @@ -5804,7 +5806,7 @@ retry: ("pmap_enter: no PV entry for %#lx", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); - if ((vm_page_aflags(om) & PGA_WRITEABLE) != 0 && + if ((om->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) @@ -6987,7 +6989,7 @@ pmap_remove_pages(pmap_t pmap) pvh->pv_gen++; if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) - if ((vm_page_aflags(mt) & PGA_WRITEABLE) != 0 && + if ((mt->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&mt->md.pv_list)) vm_page_aflag_clear(mt, PGA_WRITEABLE); } @@ -7005,7 +7007,7 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap, 1); TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; - if ((vm_page_aflags(m) & PGA_WRITEABLE) != 0 && + if ((m->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -7136,7 +7138,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); return (pmap_page_test_mappings(m, FALSE, TRUE)); } @@ -7205,7 +7207,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; lock = VM_PAGE_TO_PV_LIST_LOCK(m); pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : @@ -7688,7 +7690,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(VM_PAGE_TO_PHYS(m)); Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/amd64/include/pmap.h Mon Sep 16 15:04:45 2019 (r352407) @@ -423,8 +423,7 @@ extern int pmap_pcid_enabled; extern int invpcid_works; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) -#define pmap_page_is_write_mapped(m) \ - (((m)->astate.flags & PGA_WRITEABLE) != 0) +#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) struct thread; Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/arm/arm/pmap-v4.c Mon Sep 16 15:04:45 2019 (r352407) @@ -4104,7 +4104,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; if (m->md.pvh_attrs & PVF_MOD) pmap_clearbit(m, PVF_MOD); @@ -4143,7 +4143,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (vm_page_xbusied(m) || (vm_page_aflags(m) & PGA_WRITEABLE) != 0) + if (vm_page_xbusied(m) || (m->aflags & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); } Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/arm/arm/pmap-v6.c Mon Sep 16 15:04:45 2019 (r352407) @@ -5197,7 +5197,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTE2s can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); rv = pmap_is_modified_pvh(&m->md) || @@ -5540,7 +5540,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && !pmap_page_is_write_mapped(m)) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); sched_pin(); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/arm64/arm64/pmap.c Mon Sep 16 15:04:45 2019 (r352407) @@ -3333,7 +3333,7 @@ havel3: pv = pmap_pvh_remove(&om->md, pmap, va); if ((m->oflags & VPO_UNMANAGED) != 0) free_pv_entry(pmap, pv); - if ((vm_page_aflags(om) & PGA_WRITEABLE) != 0 && + if ((om->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) @@ -4372,7 +4372,7 @@ pmap_remove_pages(pmap_t pmap) pvh->pv_gen++; if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) - if (vm_page_aflags(mt) & PGA_WRITEABLE) != 0 && + if ((mt->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&mt->md.pv_list)) vm_page_aflag_clear(mt, PGA_WRITEABLE); } @@ -4394,7 +4394,7 @@ pmap_remove_pages(pmap_t pmap) TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; - if (vm_page_aflags(m) & PGA_WRITEABLE) != 0 && + if ((m->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh( @@ -4534,7 +4534,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); return (pmap_page_test_mappings(m, FALSE, TRUE)); } @@ -4600,7 +4600,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; lock = VM_PAGE_TO_PV_LIST_LOCK(m); pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : @@ -4977,7 +4977,7 @@ pmap_clear_modify(vm_page_t m) * set. If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(VM_PAGE_TO_PHYS(m)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Sep 16 15:04:45 2019 (r352407) @@ -1718,10 +1718,12 @@ dmu_read_pages(objset_t *os, uint64_t object, vm_page_ bcopy((char *)db->db_data + bufoff, va, PAGESIZE); zfs_unmap_page(sf); m->valid = VM_PAGE_BITS_ALL; + vm_page_lock(m); if ((m->busy_lock & VPB_BIT_WAITERS) != 0) vm_page_activate(m); else vm_page_deactivate(m); + vm_page_unlock(m); } *rbehind = i; @@ -1836,10 +1838,12 @@ dmu_read_pages(objset_t *os, uint64_t object, vm_page_ } zfs_unmap_page(sf); m->valid = VM_PAGE_BITS_ALL; + vm_page_lock(m); if ((m->busy_lock & VPB_BIT_WAITERS) != 0) vm_page_activate(m); else vm_page_deactivate(m); + vm_page_unlock(m); } *rahead = i; zfs_vmobject_wunlock(vmobj); Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Mon Sep 16 15:04:45 2019 (r352407) @@ -332,6 +332,8 @@ vtballoon_inflate(struct vtballoon_softc *sc, int npag sc->vtballoon_page_frames[i] = VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT; + KASSERT(m->queue == PQ_NONE, + ("%s: allocated page %p on queue", __func__, m)); TAILQ_INSERT_TAIL(&sc->vtballoon_pages, m, plinks.q); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/i386/i386/pmap.c Mon Sep 16 15:04:45 2019 (r352407) @@ -3752,7 +3752,7 @@ __CONCAT(PMTYPE, enter)(pmap_t pmap, vm_offset_t va, v ("pmap_enter: no PV entry for %#x", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); - if ((vm_page_aflags(om) & PGA_WRITEABLE) != 0 && + if ((om->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) @@ -4848,7 +4848,7 @@ __CONCAT(PMTYPE, is_modified)(vm_page_t m) * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); rv = pmap_is_modified_pvh(&m->md) || @@ -4979,7 +4979,7 @@ __CONCAT(PMTYPE, remove_write)(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); sched_pin(); @@ -5291,7 +5291,7 @@ __CONCAT(PMTYPE, clear_modify)(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); sched_pin(); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/mips/mips/pmap.c Mon Sep 16 15:04:45 2019 (r352407) @@ -2164,7 +2164,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v pv = pmap_pvh_remove(&om->md, pmap, va); if (!pte_test(&newpte, PTE_MANAGED)) free_pv_entry(pmap, pv); - if (vm_page_aflags(m) & PGA_WRITEABLE) != 0 && + if ((om->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list)) vm_page_aflag_clear(om, PGA_WRITEABLE); } @@ -2934,7 +2934,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -2999,7 +2999,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTEs can have PTE_D set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); rv = pmap_testbit(m, PTE_D); @@ -3143,7 +3143,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * write busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -3270,7 +3270,7 @@ retry: * determine if the address is MINCORE_REFERENCED. */ m = PHYS_TO_VM_PAGE(pa); - if ((vm_page_aflags(m) & PGA_REFERENCED) != 0) + if ((m->aflags & PGA_REFERENCED) != 0) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; } if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/powerpc/aim/mmu_oea.c Mon Sep 16 15:04:45 2019 (r352407) @@ -1319,7 +1319,7 @@ moea_is_modified(mmu_t mmu, vm_page_t m) * is clear, no PTEs can have PTE_CHG set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); rv = moea_query_bit(m, PTE_CHG); @@ -1355,7 +1355,7 @@ moea_clear_modify(mmu_t mmu, vm_page_t m) * set. If the object containing the page is locked and the page is * not exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); moea_clear_bit(m, PTE_CHG); @@ -1382,7 +1382,7 @@ moea_remove_write(mmu_t mmu, vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); lo = moea_attr_fetch(m); @@ -1915,8 +1915,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) moea_pvo_remove(pvo, -1); PMAP_UNLOCK(pmap); } - if ((vm_page_aflags(m) & PGA_WRITEABLE) != 0 && - moea_query_bit(m, PTE_CHG)) { + if ((m->aflags & PGA_WRITEABLE) && moea_query_bit(m, PTE_CHG)) { moea_attr_clear(m, PTE_CHG); vm_page_dirty(m); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Sep 16 15:04:45 2019 (r352407) @@ -1467,7 +1467,7 @@ out: * Flush the page from the instruction cache if this page is * mapped executable and cacheable. */ - if (pmap != kernel_pmap && (vm_page_aflags(m) & PGA_EXECUTABLE) != 0 && + if (pmap != kernel_pmap && !(m->aflags & PGA_EXECUTABLE) && (pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { vm_page_aflag_set(m, PGA_EXECUTABLE); moea64_syncicache(mmu, pmap, va, VM_PAGE_TO_PHYS(m), PAGE_SIZE); @@ -1688,7 +1688,7 @@ moea64_is_modified(mmu_t mmu, vm_page_t m) * is clear, no PTEs can have LPTE_CHG set. */ VM_OBJECT_ASSERT_LOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); return (moea64_query_bit(mmu, m, LPTE_CHG)); } @@ -1722,7 +1722,7 @@ moea64_clear_modify(mmu_t mmu, vm_page_t m) * set. If the object containing the page is locked and the page is * not exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; moea64_clear_bit(mmu, m, LPTE_CHG); } @@ -1746,7 +1746,7 @@ moea64_remove_write(mmu_t mmu, vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; powerpc_sync(); PV_PAGE_LOCK(m); @@ -2240,8 +2240,7 @@ moea64_pvo_protect(mmu_t mmu, pmap_t pm, struct pvo_e if (refchg < 0) refchg = (oldprot & VM_PROT_WRITE) ? LPTE_CHG : 0; - if (pm != kernel_pmap && pg != NULL && - (vm_page_aflags(pg) & PGA_EXECUTABLE) == 0 && + if (pm != kernel_pmap && pg != NULL && !(pg->aflags & PGA_EXECUTABLE) && (pvo->pvo_pte.pa & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { if ((pg->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(pg, PGA_EXECUTABLE); @@ -2455,8 +2454,7 @@ moea64_remove_all(mmu_t mmu, vm_page_t m) } KASSERT(!pmap_page_is_mapped(m), ("Page still has mappings")); - KASSERT((vm_page_aflags(m) & PGA_WRITEABLE) == 0, - ("Page still writable")); + KASSERT(!(m->aflags & PGA_WRITEABLE), ("Page still writable")); PV_PAGE_UNLOCK(m); /* Clean up UMA allocations */ Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/powerpc/booke/pmap.c Mon Sep 16 15:04:45 2019 (r352407) @@ -2694,7 +2694,7 @@ mmu_booke_remove_write(mmu_t mmu, vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { @@ -3040,7 +3040,7 @@ mmu_booke_is_modified(mmu_t mmu, vm_page_t m) * is clear, no PTEs can be modified. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (rv); rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { @@ -3119,7 +3119,7 @@ mmu_booke_clear_modify(mmu_t mmu, vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PG_AWRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/riscv/riscv/pmap.c Mon Sep 16 15:04:45 2019 (r352407) @@ -2825,7 +2825,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v ("pmap_enter: no PV entry for %#lx", va)); if ((new_l3 & PTE_SW_MANAGED) == 0) free_pv_entry(pmap, pv); - if ((vm_page_aflags(om) & PGA_WRITEABLE) == 0 && + if ((om->aflags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list)) vm_page_aflag_clear(om, PGA_WRITEABLE); } @@ -3556,7 +3556,7 @@ pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entr if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[Ln_ENTRIES]; mt++) if (TAILQ_EMPTY(&mt->md.pv_list) && - (vm_page_aflags(mt) & PGA_WRITEABLE) != 0) + (mt->aflags & PGA_WRITEABLE) != 0) vm_page_aflag_clear(mt, PGA_WRITEABLE); } mpte = pmap_remove_pt_page(pmap, pv->pv_va); @@ -3574,7 +3574,7 @@ pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entr TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; if (TAILQ_EMPTY(&m->md.pv_list) && - (vm_page_aflags(m) & PGA_WRITEABLE) != 0) { + (m->aflags & PGA_WRITEABLE) != 0) { pvh = pa_to_pvh(m->phys_addr); if (TAILQ_EMPTY(&pvh->pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -3789,7 +3789,7 @@ pmap_is_modified(vm_page_t m) * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); return (pmap_page_test_mappings(m, FALSE, TRUE)); } @@ -3855,7 +3855,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; lock = VM_PAGE_TO_PV_LIST_LOCK(m); pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : @@ -4115,7 +4115,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(VM_PAGE_TO_PHYS(m)); Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/sparc64/sparc64/pmap.c Mon Sep 16 15:04:45 2019 (r352407) @@ -2121,7 +2121,7 @@ pmap_is_modified(vm_page_t m) * is clear, no TTEs can have TD_W set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (rv); rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { @@ -2204,7 +2204,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if ((m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { @@ -2232,7 +2232,7 @@ pmap_remove_write(vm_page_t m) * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (vm_page_aflags(m) & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/vm/swap_pager.c Mon Sep 16 15:04:45 2019 (r352407) @@ -1648,6 +1648,12 @@ swp_pager_force_dirty(vm_page_t m) { vm_page_dirty(m); +#ifdef INVARIANTS + vm_page_lock(m); + if (!vm_page_wired(m) && m->queue == PQ_NONE) + panic("page %p is neither wired nor queued", m); + vm_page_unlock(m); +#endif vm_page_xunbusy(m); swap_pager_unswapped(m); } Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/vm/vm_fault.c Mon Sep 16 15:04:45 2019 (r352407) @@ -153,7 +153,9 @@ release_page(struct faultstate *fs) { vm_page_xunbusy(fs->m); + vm_page_lock(fs->m); vm_page_deactivate(fs->m); + vm_page_unlock(fs->m); fs->m = NULL; } @@ -374,7 +376,9 @@ vm_fault_populate_cleanup(vm_object_t object, vm_pinde for (pidx = first, m = vm_page_lookup(object, pidx); pidx <= last; pidx++, m = vm_page_next(m)) { vm_fault_populate_check_page(m); + vm_page_lock(m); vm_page_deactivate(m); + vm_page_unlock(m); vm_page_xunbusy(m); } } @@ -1321,7 +1325,9 @@ readrest: if ((fault_flags & VM_FAULT_WIRE) != 0) { vm_page_wire(fs.m); } else { + vm_page_lock(fs.m); vm_page_activate(fs.m); + vm_page_unlock(fs.m); } if (m_hold != NULL) { *m_hold = fs.m; Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/vm/vm_mmap.c Mon Sep 16 15:04:45 2019 (r352407) @@ -935,9 +935,9 @@ RestartScan: * and set PGA_REFERENCED before the call to * pmap_is_referenced(). */ - if ((vm_page_aflags(m) & PGA_REFERENCED) != 0 || + if ((m->aflags & PGA_REFERENCED) != 0 || pmap_is_referenced(m) || - (vm_page_aflags(m) & PGA_REFERENCED) != 0) + (m->aflags & PGA_REFERENCED) != 0) mincoreinfo |= MINCORE_REFERENCED_OTHER; } if (object != NULL) Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/vm/vm_object.c Mon Sep 16 15:04:45 2019 (r352407) @@ -2312,9 +2312,9 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) * sysctl is only meant to give an * approximation of the system anyway. */ - if (m->astate.queue == PQ_ACTIVE) + if (m->queue == PQ_ACTIVE) kvo->kvo_active++; - else if (m->astate.queue == PQ_INACTIVE) + else if (m->queue == PQ_INACTIVE) kvo->kvo_inactive++; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Sep 16 15:03:12 2019 (r352406) +++ head/sys/vm/vm_page.c Mon Sep 16 15:04:45 2019 (r352407) @@ -73,12 +73,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include #include -#include #include #include #include @@ -131,34 +130,6 @@ static int vm_min_waiters; static int vm_severe_waiters; static int vm_pageproc_waiters; -static SYSCTL_NODE(_vm_stats, OID_AUTO, page, CTLFLAG_RD, 0, - "VM page stats"); - -static counter_u64_t pqstate_commit_aborts = EARLY_COUNTER; -SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, commit_aborts, CTLFLAG_RD, - &pqstate_commit_aborts, - "Failed page queue state updates"); - -static counter_u64_t queue_ops = EARLY_COUNTER; -SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, queue_ops, CTLFLAG_RD, - &queue_ops, - "Batched queue operations"); - -static counter_u64_t null_queue_ops = EARLY_COUNTER; -SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, null_queue_ops, CTLFLAG_RD, - &null_queue_ops, - "Batched queue operations with no effect"); - -static void -counter_startup(void) -{ - - pqstate_commit_aborts = counter_u64_alloc(M_WAITOK); - queue_ops = counter_u64_alloc(M_WAITOK); - null_queue_ops = counter_u64_alloc(M_WAITOK); -} -SYSINIT(page_counters, SI_SUB_CPU, SI_ORDER_ANY, counter_startup, NULL); - /* * bogus page -- for I/O to/from partially complete buffers, * or for paging into sparsely invalid regions. @@ -187,17 +158,16 @@ static uma_zone_t fakepg_zone; static void vm_page_alloc_check(vm_page_t m); static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); +static void vm_page_dequeue_complete(vm_page_t m); static void vm_page_enqueue(vm_page_t m, uint8_t queue); static void vm_page_init(void *dummy); static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); static void vm_page_insert_radixdone(vm_page_t m, vm_object_t object, vm_page_t mpred); -static void vm_page_mvqueue(vm_page_t m, const uint8_t queue, - const uint16_t nflag); +static void vm_page_mvqueue(vm_page_t m, uint8_t queue); static int vm_page_reclaim_run(int req_class, int domain, u_long npages, vm_page_t m_run, vm_paddr_t high); -static bool vm_page_release_toq(vm_page_t m, uint8_t queue, bool noreuse); static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, int req); static int vm_page_zone_import(void *arg, void **store, int cnt, int domain, @@ -470,10 +440,10 @@ vm_page_init_marker(vm_page_t marker, int queue, uint8 { bzero(marker, sizeof(*marker)); - marker->busy_lock = VPB_SINGLE_EXCLUSIVER; - marker->astate.flags = aflags; - marker->astate.queue = queue; marker->flags = PG_MARKER; + marker->aflags = aflags; + marker->busy_lock = VPB_SINGLE_EXCLUSIVER; + marker->queue = queue; } static void @@ -543,10 +513,9 @@ vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segi m->object = NULL; m->ref_count = 0; m->busy_lock = VPB_UNBUSIED; - m->flags = 0; + m->flags = m->aflags = 0; m->phys_addr = pa; - m->astate.flags = 0; - m->astate.queue = PQ_NONE; + m->queue = PQ_NONE; m->psind = 0; m->segind = segind; m->order = VM_NFREEORDER; @@ -1183,7 +1152,7 @@ vm_page_initfake(vm_page_t m, vm_paddr_t paddr, vm_mem goto memattr; } m->phys_addr = paddr; - m->astate.queue = PQ_NONE; + m->queue = PQ_NONE; /* Fictitious pages don't use "segind". */ m->flags = PG_FICTITIOUS; /* Fictitious pages don't use "order" or "pool". */ @@ -1270,10 +1239,12 @@ vm_page_readahead_finish(vm_page_t m) * have shown that deactivating the page is usually the best choice, * unless the page is wanted by another thread. */ + vm_page_lock(m); if ((m->busy_lock & VPB_BIT_WAITERS) != 0) vm_page_activate(m); else vm_page_deactivate(m); + vm_page_unlock(m); vm_page_xunbusy(m); } @@ -1636,7 +1607,7 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm mnew->pindex = pindex; atomic_set_int(&mnew->ref_count, VPRC_OBJREF); mold = vm_radix_replace(&object->rtree, mnew); - KASSERT(mold->astate.queue == PQ_NONE, + KASSERT(mold->queue == PQ_NONE, ("vm_page_replace: old page %p is on a paging queue", mold)); /* Keep the resident page list in sorted order. */ @@ -1912,7 +1883,7 @@ found: if ((req & VM_ALLOC_NODUMP) != 0) flags |= PG_NODUMP; m->flags = flags; - m->astate.flags = 0; + m->aflags = 0; m->oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? VPO_UNMANAGED : 0; m->busy_lock = VPB_UNBUSIED; @@ -1928,7 +1899,7 @@ found: vm_wire_add(1); m->ref_count = 1; } - m->astate.act_count = 0; + m->act_count = 0; if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { @@ -2122,12 +2093,12 @@ found: memattr = object->memattr; } for (m = m_ret; m < &m_ret[npages]; m++) { - m->astate.flags = 0; + m->aflags = 0; m->flags = (m->flags | PG_NODUMP) & flags; m->busy_lock = busy_lock; if ((req & VM_ALLOC_WIRED) != 0) m->ref_count = 1; - m->astate.act_count = 0; + m->act_count = 0; m->oflags = oflags; if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { @@ -2170,10 +2141,9 @@ vm_page_alloc_check(vm_page_t m) { KASSERT(m->object == NULL, ("page %p has object", m)); - KASSERT(m->astate.queue == PQ_NONE && - (m->astate.flags & PGA_QUEUE_STATE_MASK) == 0, + KASSERT(m->queue == PQ_NONE && (m->aflags & PGA_QUEUE_STATE_MASK) == 0, ("page %p has unexpected queue %d, flags %#x", - m, m->astate.queue, (m->astate.flags & PGA_QUEUE_STATE_MASK))); + m, m->queue, (m->aflags & PGA_QUEUE_STATE_MASK))); KASSERT(m->ref_count == 0, ("page %p has references", m)); KASSERT(!vm_page_busied(m), ("page %p is busy", m)); KASSERT(m->dirty == 0, ("page %p is dirty", m)); @@ -2247,7 +2217,7 @@ again: /* * Initialize the page. Only the PG_ZERO flag is inherited. */ - m->astate.flags = 0; + m->aflags = 0; flags = 0; if ((req & VM_ALLOC_ZERO) != 0) flags = PG_ZERO; @@ -2426,7 +2396,8 @@ retry: vm_reserv_size(level)) - pa); #endif } else if (object->memattr == VM_MEMATTR_DEFAULT && - !vm_page_busied(m) && !vm_page_wired(m)) { + vm_page_queue(m) != PQ_NONE && !vm_page_busied(m) && + !vm_page_wired(m)) { /* * The page is allocated but eligible for * relocation. Extend the current run by one @@ -2574,7 +2545,8 @@ retry: error = EINVAL; else if (object->memattr != VM_MEMATTR_DEFAULT) error = EINVAL; - else if (!vm_page_busied(m) && !vm_page_wired(m)) { + else if (vm_page_queue(m) != PQ_NONE && + !vm_page_busied(m) && !vm_page_wired(m)) { KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, ("page %p has an unexpected memattr", m)); @@ -2635,7 +2607,7 @@ retry: error = EBUSY; goto unlock; } - m_new->astate.flags = m->astate.flags & + m_new->aflags = m->aflags & ~PGA_QUEUE_STATE_MASK; KASSERT(m_new->oflags == VPO_UNMANAGED, ("page %p is managed", m_new)); @@ -3103,141 +3075,65 @@ vm_waitpfault(struct domainset *dset, int timo) mtx_unlock(&vm_domainset_lock); } -bool -vm_page_pqstate_commit(vm_page_t m, vm_page_astate_t *old, vm_page_astate_t new) +static struct vm_pagequeue * +vm_page_pagequeue(vm_page_t m) { - vm_page_t next; - struct vm_pagequeue *pq; - int mask; - if (old->queue != PQ_NONE && old->queue != new.queue) { - new.flags &= ~PGA_ENQUEUED; + uint8_t queue; - pq = _vm_page_pagequeue(m, old->queue); - - /* - * The physical queue state might change at any point before the - * page queue lock is acquired, so we must verify that the lock - * is correct before proceeding. Once the page's queue index is - * changed, the page queue lock we hold will no longer - * synchronize the physical queue state of the page, so we must - * awkwardly remove the page from the queue and put it back if - * the commit fails. - */ - vm_pagequeue_lock(pq); - if (__predict_false(m->astate.queue != old->queue)) { - vm_pagequeue_unlock(pq); - *old = vm_page_astate_load(m); - return (false); - } - if (__predict_true((m->astate.flags & PGA_ENQUEUED) != 0)) { - next = TAILQ_NEXT(m, plinks.q); - TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - } - if (__predict_false(!vm_page_astate_fcmpset(m, old, new))) { - if ((old->flags & PGA_ENQUEUED) != 0) { - if (next == NULL) - TAILQ_INSERT_TAIL(&pq->pq_pl, m, - plinks.q); - else - TAILQ_INSERT_BEFORE(next, m, plinks.q); - } - vm_pagequeue_unlock(pq); - counter_u64_add(pqstate_commit_aborts, 1); - return (false); - } - if ((old->flags & PGA_ENQUEUED) != 0) - vm_pagequeue_cnt_dec(pq); - vm_pagequeue_unlock(pq); - } else if (__predict_false(!vm_page_astate_fcmpset(m, old, new))) { - counter_u64_add(pqstate_commit_aborts, 1); - return (false); - } - - if (new.queue != PQ_NONE) { - mask = new.flags & PGA_QUEUE_OP_MASK; - if (mask != 0 && (old->flags & mask) != mask) - vm_page_pqbatch_submit(m, new.queue); - } - - return (true); + if ((queue = atomic_load_8(&m->queue)) == PQ_NONE) + return (NULL); + return (&vm_pagequeue_domain(m)->vmd_pagequeues[queue]); } static inline void -vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_page_t m, uint8_t queue) +vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_page_t m) { - vm_page_t next; struct vm_domain *vmd; - vm_page_astate_t old, new; + uint8_t qflags; CRITICAL_ASSERT(curthread); vm_pagequeue_assert_locked(pq); - old = vm_page_astate_load(m); -retry: - if (__predict_false(old.queue != queue)) - return; - KASSERT(pq == _vm_page_pagequeue(m, queue), - ("page %p does not belong to queue %p", m, pq)); - KASSERT(old.queue != PQ_NONE || (old.flags & PGA_QUEUE_STATE_MASK) == 0, - ("page %p has unexpected queue state", m)); - /* - * Update the page's queue state before modifying the page queues - * themselves, to avoid having to roll back updates when a queue state - * update fails and requires a retry. + * The page daemon is allowed to set m->queue = PQ_NONE without + * the page queue lock held. In this case it is about to free the page, + * which must not have any queue state. */ - new = old; - if ((old.flags & PGA_DEQUEUE) != 0) { - new.queue = PQ_NONE; - new.flags &= ~PGA_QUEUE_STATE_MASK; - if (__predict_true((old.flags & PGA_ENQUEUED) != 0)) { - next = TAILQ_NEXT(m, plinks.q); - TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - } - if (__predict_false(!vm_page_astate_fcmpset(m, &old, new))) { - if ((old.flags & PGA_ENQUEUED) != 0) { - if (next == NULL) - TAILQ_INSERT_TAIL(&pq->pq_pl, m, - plinks.q); - else - TAILQ_INSERT_BEFORE(next, m, plinks.q); - } - counter_u64_add(pqstate_commit_aborts, 1); - goto retry; - } - if ((old.flags & PGA_ENQUEUED) != 0) - vm_pagequeue_cnt_dec(pq); - counter_u64_add(queue_ops, 1); - } else if ((old.flags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) { - new.flags |= PGA_ENQUEUED; - new.flags &= ~(PGA_REQUEUE | PGA_REQUEUE_HEAD); - if (__predict_false(!vm_page_astate_fcmpset(m, &old, new))) { - counter_u64_add(pqstate_commit_aborts, 1); - goto retry; - } + qflags = atomic_load_8(&m->aflags); + KASSERT(pq == vm_page_pagequeue(m) || + (qflags & PGA_QUEUE_STATE_MASK) == 0, + ("page %p doesn't belong to queue %p but has aflags %#x", + m, pq, qflags)); - if ((old.flags & PGA_ENQUEUED) != 0) + if ((qflags & PGA_DEQUEUE) != 0) { + if (__predict_true((qflags & PGA_ENQUEUED) != 0)) + vm_pagequeue_remove(pq, m); + vm_page_dequeue_complete(m); + } else if ((qflags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) { + if ((qflags & PGA_ENQUEUED) != 0) TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - else + else { vm_pagequeue_cnt_inc(pq); + vm_page_aflag_set(m, PGA_ENQUEUED); + } /* - * Give PGA_REQUEUE_HEAD precedence over PGA_REQUEUE. In - * particular, if both flags are set in close succession, only - * PGA_REQUEUE_HEAD will be applied, even if it was set first. + * Give PGA_REQUEUE_HEAD precedence over PGA_REQUEUE. + * In particular, if both flags are set in close succession, + * only PGA_REQUEUE_HEAD will be applied, even if it was set + * first. */ - if ((old.flags & PGA_REQUEUE_HEAD) != 0) { - KASSERT(old.queue == PQ_INACTIVE, + if ((qflags & PGA_REQUEUE_HEAD) != 0) { + KASSERT(m->queue == PQ_INACTIVE, ("head enqueue not supported for page %p", m)); vmd = vm_pagequeue_domain(m); TAILQ_INSERT_BEFORE(&vmd->vmd_inacthead, m, plinks.q); - } else { + } else TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); - } - counter_u64_add(queue_ops, 1); - } else { - counter_u64_add(null_queue_ops, 1); + + vm_page_aflag_clear(m, qflags & (PGA_REQUEUE | + PGA_REQUEUE_HEAD)); } } @@ -3245,10 +3141,15 @@ static void vm_pqbatch_process(struct vm_pagequeue *pq, struct vm_batchqueue *bq, uint8_t queue) { + vm_page_t m; int i; - for (i = 0; i < bq->bq_cnt; i++) - vm_pqbatch_process_page(pq, bq->bq_pa[i], queue); + for (i = 0; i < bq->bq_cnt; i++) { + m = bq->bq_pa[i]; + if (__predict_false(m->queue != queue)) + continue; + vm_pqbatch_process_page(pq, m); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Sep 16 15:06:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28D7E124FD6; Mon, 16 Sep 2019 15:06:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X8hX0JN6z3JrJ; Mon, 16 Sep 2019 15:06:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E28D82202D; Mon, 16 Sep 2019 15:06:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GF6JYv052659; Mon, 16 Sep 2019 15:06:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GF6Jpa052657; Mon, 16 Sep 2019 15:06:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909161506.x8GF6Jpa052657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 16 Sep 2019 15:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352408 - in head: share/man/man9 sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/amd64/amd64 X-SVN-Commit-Revision: 352408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 15:06:20 -0000 Author: markj Date: Mon Sep 16 15:06:19 2019 New Revision: 352408 URL: https://svnweb.freebsd.org/changeset/base/352408 Log: Fix a couple of nits in r352110. - Remove a dead variable from the amd64 pmap_extract_and_hold(). - Fix grammar in the vm_page_wire man page. Reported by: alc Reviewed by: alc, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21639 Modified: head/share/man/man9/vm_page_wire.9 head/sys/amd64/amd64/pmap.c Modified: head/share/man/man9/vm_page_wire.9 ============================================================================== --- head/share/man/man9/vm_page_wire.9 Mon Sep 16 15:04:45 2019 (r352407) +++ head/share/man/man9/vm_page_wire.9 Mon Sep 16 15:06:19 2019 (r352408) @@ -51,7 +51,7 @@ The .Fn vm_page_wire and .Fn vm_page_wire_mapped -function wire the page, prevent it from being reclaimed by the page +functions wire the page, which prevents it from being reclaimed by the page daemon or when its containing object is destroyed. Both functions require that the page belong to an object. The Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 16 15:04:45 2019 (r352407) +++ head/sys/amd64/amd64/pmap.c Mon Sep 16 15:06:19 2019 (r352408) @@ -3064,10 +3064,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ { pd_entry_t pde, *pdep; pt_entry_t pte, PG_RW, PG_V; - vm_paddr_t pa; vm_page_t m; - pa = 0; m = NULL; PG_RW = pmap_rw_bit(pmap); PG_V = pmap_valid_bit(pmap); From owner-svn-src-head@freebsd.org Mon Sep 16 15:09:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6290612512B; Mon, 16 Sep 2019 15:09:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X8mD1SPYz3K6P; Mon, 16 Sep 2019 15:09:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 114FC22042; Mon, 16 Sep 2019 15:09:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GF9Vd0053329; Mon, 16 Sep 2019 15:09:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GF9VHl053328; Mon, 16 Sep 2019 15:09:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909161509.x8GF9VHl053328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 16 Sep 2019 15:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352409 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 352409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 15:09:32 -0000 Author: markj Date: Mon Sep 16 15:09:31 2019 New Revision: 352409 URL: https://svnweb.freebsd.org/changeset/base/352409 Log: Fix a page leak in vm_page_reclaim_run(). After r352110 the attempt to remove mappings of the page being replaced may fail if the page is wired. In this case we must free the replacement page. Reviewed by: alc, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21639 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Sep 16 15:06:19 2019 (r352408) +++ head/sys/vm/vm_page.c Mon Sep 16 15:09:31 2019 (r352409) @@ -2597,16 +2597,23 @@ retry: } /* - * Replace "m" with the new page. For - * vm_page_replace(), "m" must be busy - * and dequeued. Finally, change "m" - * as if vm_page_free() was called. + * Unmap the page and check for new + * wirings that may have been acquired + * through a pmap lookup. */ if (object->ref_count != 0 && !vm_page_try_remove_all(m)) { + vm_page_free(m_new); error = EBUSY; goto unlock; } + + /* + * Replace "m" with the new page. For + * vm_page_replace(), "m" must be busy + * and dequeued. Finally, change "m" + * as if vm_page_free() was called. + */ m_new->aflags = m->aflags & ~PGA_QUEUE_STATE_MASK; KASSERT(m_new->oflags == VPO_UNMANAGED, From owner-svn-src-head@freebsd.org Mon Sep 16 15:12:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1932D125388; Mon, 16 Sep 2019 15:12:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X8r16tQyz3KVb; Mon, 16 Sep 2019 15:12:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCD26221F0; Mon, 16 Sep 2019 15:12:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GFCnDm059215; Mon, 16 Sep 2019 15:12:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GFCn07059211; Mon, 16 Sep 2019 15:12:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909161512.x8GFCn07059211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 16 Sep 2019 15:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352410 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 352410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 15:12:50 -0000 Author: markj Date: Mon Sep 16 15:12:49 2019 New Revision: 352410 URL: https://svnweb.freebsd.org/changeset/base/352410 Log: Fix a race in vm_page_dequeue_deferred_free() after r352110. This function loaded the page's queue index before setting PGA_DEQUEUE. In this window the page daemon may have deactivated the page, updating its queue index. Make the operation atomic using vm_page_pqstate_cmpset(); the page daemon will not modify the page once it observes that PGA_DEQUEUE is set. Reported and tested by: pho Reviewed by: alc, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21639 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Sep 16 15:09:31 2019 (r352409) +++ head/sys/vm/vm_page.c Mon Sep 16 15:12:49 2019 (r352410) @@ -3315,13 +3315,18 @@ vm_page_dequeue_deferred_free(vm_page_t m) KASSERT(m->ref_count == 0, ("page %p has references", m)); - if ((m->aflags & PGA_DEQUEUE) != 0) - return; - atomic_thread_fence_acq(); - if ((queue = m->queue) == PQ_NONE) - return; - vm_page_aflag_set(m, PGA_DEQUEUE); - vm_page_pqbatch_submit(m, queue); + for (;;) { + if ((m->aflags & PGA_DEQUEUE) != 0) + return; + atomic_thread_fence_acq(); + if ((queue = atomic_load_8(&m->queue)) == PQ_NONE) + return; + if (vm_page_pqstate_cmpset(m, queue, queue, PGA_DEQUEUE, + PGA_DEQUEUE)) { + vm_page_pqbatch_submit(m, queue); + break; + } + } } /* Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Sep 16 15:09:31 2019 (r352409) +++ head/sys/vm/vm_page.h Mon Sep 16 15:12:49 2019 (r352410) @@ -783,8 +783,6 @@ vm_page_pqstate_cmpset(vm_page_t m, uint32_t oldq, uin { uint32_t *addr, nval, oval, qsmask; - vm_page_assert_locked(m); - fflags <<= VM_PAGE_AFLAG_SHIFT; nflags <<= VM_PAGE_AFLAG_SHIFT; newq <<= VM_PAGE_QUEUE_SHIFT; From owner-svn-src-head@freebsd.org Mon Sep 16 15:16:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E816C12548D; Mon, 16 Sep 2019 15:16:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X8wc5s8Cz3Kfk; Mon, 16 Sep 2019 15:16:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8204221F1; Mon, 16 Sep 2019 15:16:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GFGmFJ059901; Mon, 16 Sep 2019 15:16:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GFGm40059900; Mon, 16 Sep 2019 15:16:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909161516.x8GFGm40059900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 16 Sep 2019 15:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352411 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 352411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 15:16:49 -0000 Author: markj Date: Mon Sep 16 15:16:48 2019 New Revision: 352411 URL: https://svnweb.freebsd.org/changeset/base/352411 Log: Assert that the refcount value is not VPRC_BLOCKED in vm_page_drop(). VPRC_BLOCKED is a refcount flag used to indicate that a thread is tearing down mappings of a page. When set, it causes attempts to wire a page via a pmap lookup to fail. It should never represent the last reference to a page, so assert this. Suggested by: kib Reviewed by: alc, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21639 Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Sep 16 15:12:49 2019 (r352410) +++ head/sys/vm/vm_page.h Mon Sep 16 15:16:48 2019 (r352411) @@ -902,13 +902,17 @@ vm_page_in_laundry(vm_page_t m) static inline u_int vm_page_drop(vm_page_t m, u_int val) { + u_int old; /* * Synchronize with vm_page_free_prep(): ensure that all updates to the * page structure are visible before it is freed. */ atomic_thread_fence_rel(); - return (atomic_fetchadd_int(&m->ref_count, -val)); + old = atomic_fetchadd_int(&m->ref_count, -val); + KASSERT(old != VPRC_BLOCKED, + ("vm_page_drop: page %p has an invalid refcount value", m)); + return (old); } /* From owner-svn-src-head@freebsd.org Mon Sep 16 15:45:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01A66125E72; Mon, 16 Sep 2019 15:45:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X9Y868JTz3M5v; Mon, 16 Sep 2019 15:45:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5AC82271C; Mon, 16 Sep 2019 15:45:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GFj03i080388; Mon, 16 Sep 2019 15:45:00 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GFj09T080385; Mon, 16 Sep 2019 15:45:00 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909161545.x8GFj09T080385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 Sep 2019 15:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352413 - head/tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/fs/fusefs X-SVN-Commit-Revision: 352413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 15:45:01 -0000 Author: asomers Date: Mon Sep 16 15:44:59 2019 New Revision: 352413 URL: https://svnweb.freebsd.org/changeset/base/352413 Log: fusefs: fix some minor Coverity CIDs in the tests Where open(2) is expected to fail, the tests should assert or expect that its return value is -1. These tests all accepted too much but happened to pass anyway. Reported by: Coverity Coverity CID: 1404512, 1404378, 1404504, 1404483 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/fs/fusefs/create.cc head/tests/sys/fs/fusefs/default_permissions.cc head/tests/sys/fs/fusefs/opendir.cc Modified: head/tests/sys/fs/fusefs/create.cc ============================================================================== --- head/tests/sys/fs/fusefs/create.cc Mon Sep 16 15:21:37 2019 (r352412) +++ head/tests/sys/fs/fusefs/create.cc Mon Sep 16 15:44:59 2019 (r352413) @@ -204,7 +204,7 @@ TEST_F(Create, eexist) EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) .WillOnce(Invoke(ReturnErrno(ENOENT))); expect_create(RELPATH, mode, ReturnErrno(EEXIST)); - EXPECT_NE(0, open(FULLPATH, O_CREAT | O_EXCL, mode)); + EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); EXPECT_EQ(EEXIST, errno); } @@ -342,7 +342,7 @@ TEST_F(Create, eperm) .WillOnce(Invoke(ReturnErrno(ENOENT))); expect_create(RELPATH, mode, ReturnErrno(EPERM)); - EXPECT_NE(0, open(FULLPATH, O_CREAT | O_EXCL, mode)); + EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); EXPECT_EQ(EPERM, errno); } Modified: head/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- head/tests/sys/fs/fusefs/default_permissions.cc Mon Sep 16 15:21:37 2019 (r352412) +++ head/tests/sys/fs/fusefs/default_permissions.cc Mon Sep 16 15:44:59 2019 (r352413) @@ -749,7 +749,7 @@ TEST_F(Open, eacces) expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755, UINT64_MAX, 1); expect_lookup(RELPATH, ino, S_IFREG | 0644, UINT64_MAX); - EXPECT_NE(0, open(FULLPATH, O_RDWR)); + EXPECT_EQ(-1, open(FULLPATH, O_RDWR)); EXPECT_EQ(EACCES, errno); } Modified: head/tests/sys/fs/fusefs/opendir.cc ============================================================================== --- head/tests/sys/fs/fusefs/opendir.cc Mon Sep 16 15:21:37 2019 (r352412) +++ head/tests/sys/fs/fusefs/opendir.cc Mon Sep 16 15:44:59 2019 (r352413) @@ -103,7 +103,7 @@ TEST_F(Opendir, eperm) expect_lookup(RELPATH, ino); expect_opendir(ino, O_RDONLY, ReturnErrno(EPERM)); - EXPECT_NE(0, open(FULLPATH, O_DIRECTORY)); + EXPECT_EQ(-1, open(FULLPATH, O_DIRECTORY)); EXPECT_EQ(EPERM, errno); } From owner-svn-src-head@freebsd.org Mon Sep 16 15:56:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 414D712614A; Mon, 16 Sep 2019 15:56:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46X9pG0zjgz3MZ0; Mon, 16 Sep 2019 15:56:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 006EB228D6; Mon, 16 Sep 2019 15:56:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GFuLQh087539; Mon, 16 Sep 2019 15:56:21 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GFuL3u087536; Mon, 16 Sep 2019 15:56:21 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909161556.x8GFuL3u087536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 Sep 2019 15:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352414 - head/tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/fs/fusefs X-SVN-Commit-Revision: 352414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 15:56:22 -0000 Author: asomers Date: Mon Sep 16 15:56:21 2019 New Revision: 352414 URL: https://svnweb.freebsd.org/changeset/base/352414 Log: fusefs: initialize C++ classes the Coverity way Coverity complained that I wasn't initializing some class members until the SetUp method. Do it in the constructor instead. Reported by: Coverity Coverity CIDs: 1404352, 1404378 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/fs/fusefs/io.cc head/tests/sys/fs/fusefs/mknod.cc Modified: head/tests/sys/fs/fusefs/io.cc ============================================================================== --- head/tests/sys/fs/fusefs/io.cc Mon Sep 16 15:44:59 2019 (r352413) +++ head/tests/sys/fs/fusefs/io.cc Mon Sep 16 15:56:21 2019 (r352414) @@ -108,11 +108,11 @@ int m_backing_fd, m_control_fd, m_test_fd; off_t m_filesize; bool m_direct_io; -Io(): m_backing_fd(-1), m_control_fd(-1), m_test_fd(-1), m_direct_io(false) {}; +Io(): m_backing_fd(-1), m_control_fd(-1), m_test_fd(-1), m_filesize(0), + m_direct_io(false) {}; void SetUp() { - m_filesize = 0; m_backing_fd = open("backing_file", O_RDWR | O_CREAT | O_TRUNC, 0644); if (m_backing_fd < 0) FAIL() << strerror(errno); Modified: head/tests/sys/fs/fusefs/mknod.cc ============================================================================== --- head/tests/sys/fs/fusefs/mknod.cc Mon Sep 16 15:44:59 2019 (r352413) +++ head/tests/sys/fs/fusefs/mknod.cc Mon Sep 16 15:56:21 2019 (r352414) @@ -55,8 +55,11 @@ const static mode_t c_umask = 022; public: -virtual void SetUp() { +Mknod() { m_oldmask = umask(c_umask); +} + +virtual void SetUp() { if (geteuid() != 0) { GTEST_SKIP() << "Only root may use most mknod(2) variations"; } From owner-svn-src-head@freebsd.org Mon Sep 16 16:41:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8AB212705A; Mon, 16 Sep 2019 16:41:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XBnn4hN4z3PTb; Mon, 16 Sep 2019 16:41:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 856862302C; Mon, 16 Sep 2019 16:41:01 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GGf1D4017638; Mon, 16 Sep 2019 16:41:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GGf1p8017637; Mon, 16 Sep 2019 16:41:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201909161641.x8GGf1p8017637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 Sep 2019 16:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352417 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 352417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 16:41:01 -0000 Author: asomers Date: Mon Sep 16 16:41:01 2019 New Revision: 352417 URL: https://svnweb.freebsd.org/changeset/base/352417 Log: Fix an off-by-one error from r351961 That revision addressed a Coverity CID that could lead to a buffer overflow, but it had an off-by-one error in the buffer size check. Reported by: Coverity Coverity CID: 1405530 MFC after: 3 days MFC-With: 351961 Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/fuse/fuse_internal.c Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Mon Sep 16 16:17:29 2019 (r352416) +++ head/sys/fs/fuse/fuse_internal.c Mon Sep 16 16:41:01 2019 (r352417) @@ -390,7 +390,7 @@ fuse_internal_invalidate_entry(struct mount *mp, struc if ((err = uiomove(&fnieo, sizeof(fnieo), uio)) != 0) return (err); - if (fnieo.namelen > sizeof(name)) + if (fnieo.namelen >= sizeof(name)) return (EINVAL); if ((err = uiomove(name, fnieo.namelen, uio)) != 0) From owner-svn-src-head@freebsd.org Mon Sep 16 20:26:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECD73EB906; Mon, 16 Sep 2019 20:26:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XHpP5zGhz45s6; Mon, 16 Sep 2019 20:26:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC16C258E1; Mon, 16 Sep 2019 20:26:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GKQrqk063975; Mon, 16 Sep 2019 20:26:53 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GKQreB063974; Mon, 16 Sep 2019 20:26:53 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909162026.x8GKQreB063974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 16 Sep 2019 20:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352420 - head/stand/forth X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/forth X-SVN-Commit-Revision: 352420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 20:26:54 -0000 Author: tsoome Date: Mon Sep 16 20:26:53 2019 New Revision: 352420 URL: https://svnweb.freebsd.org/changeset/base/352420 Log: loader_4th: scan_buffer can leave empty string on stack When the file processing is done, we will have string with lenght 0 in stack and we will attempt to allocate 0 bytes. Modified: head/stand/forth/support.4th Modified: head/stand/forth/support.4th ============================================================================== --- head/stand/forth/support.4th Mon Sep 16 18:40:27 2019 (r352419) +++ head/stand/forth/support.4th Mon Sep 16 20:26:53 2019 (r352420) @@ -363,6 +363,7 @@ variable fd ; : line_buffer_resize ( len -- len ) + dup 0= if exit then >r line_buffer .len @ if line_buffer .addr @ @@ -376,6 +377,7 @@ variable fd ; : append_to_line_buffer ( addr len -- ) + dup 0= if 2drop exit then line_buffer strget 2swap strcat line_buffer .len ! From owner-svn-src-head@freebsd.org Mon Sep 16 20:28:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA728EB99C; Mon, 16 Sep 2019 20:28:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XHqs3LwCz461P; Mon, 16 Sep 2019 20:28:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56203258E2; Mon, 16 Sep 2019 20:28:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GKS9LC064080; Mon, 16 Sep 2019 20:28:09 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GKS9jK064079; Mon, 16 Sep 2019 20:28:09 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909162028.x8GKS9jK064079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 16 Sep 2019 20:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352421 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 352421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 20:28:09 -0000 Author: tsoome Date: Mon Sep 16 20:28:08 2019 New Revision: 352421 URL: https://svnweb.freebsd.org/changeset/base/352421 Log: loader: Malloc(0) should return NULL. We really should not allocate anything with size 0. Modified: head/stand/libsa/zalloc_malloc.c Modified: head/stand/libsa/zalloc_malloc.c ============================================================================== --- head/stand/libsa/zalloc_malloc.c Mon Sep 16 20:26:53 2019 (r352420) +++ head/stand/libsa/zalloc_malloc.c Mon Sep 16 20:28:08 2019 (r352421) @@ -55,6 +55,9 @@ Malloc(size_t bytes, const char *file, int line) { Guard *res; + if (bytes == 0) + return (NULL); + #ifdef USEENDGUARD bytes += MALLOCALIGN + 1; #else From owner-svn-src-head@freebsd.org Mon Sep 16 20:41:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E62F0EBE8E; Mon, 16 Sep 2019 20:41:37 +0000 (UTC) (envelope-from dmgk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XJ7P5vJkz471w; Mon, 16 Sep 2019 20:41:37 +0000 (UTC) (envelope-from dmgk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD96D25C03; Mon, 16 Sep 2019 20:41:37 +0000 (UTC) (envelope-from dmgk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GKfboh071793; Mon, 16 Sep 2019 20:41:37 GMT (envelope-from dmgk@FreeBSD.org) Received: (from dmgk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GKfbmT071792; Mon, 16 Sep 2019 20:41:37 GMT (envelope-from dmgk@FreeBSD.org) Message-Id: <201909162041.x8GKfbmT071792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dmgk set sender to dmgk@FreeBSD.org using -f From: Dmitri Goutnik Date: Mon, 16 Sep 2019 20:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352422 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: dmgk X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 352422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 20:41:38 -0000 Author: dmgk (ports committer) Date: Mon Sep 16 20:41:37 2019 New Revision: 352422 URL: https://svnweb.freebsd.org/changeset/base/352422 Log: Add myself (dmgk) as a ports committer Approved by: tz (mentor) Differential Revision: https://reviews.freebsd.org/D21672 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon Sep 16 20:28:08 2019 (r352421) +++ head/share/misc/committers-ports.dot Mon Sep 16 20:41:37 2019 (r352422) @@ -96,6 +96,7 @@ decke [label="Bernhard Froehlich\ndecke@FreeBSD.org\n2 delphij [label="Xin Li\ndelphij@FreeBSD.org\n2006/05/01"] demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"] +dmgk [label="Dmitri Goutnik\dmgk@FreeBSD.org\n2019/09/15"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"] dteske [label="Devin Teske\ndteske@FreeBSD.org\n2018/03/01"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2017/01/10"] @@ -304,6 +305,7 @@ amdmi3 -> arrowd antoine -> dumbbell +araujo -> dmgk araujo -> egypcio araujo -> jhixson araujo -> lippe @@ -736,6 +738,7 @@ timur -> kbowling tmclaugh -> itetcu tmclaugh -> xride +tz -> dmgk tz -> joneum tz -> fernape tz -> mfechner From owner-svn-src-head@freebsd.org Mon Sep 16 20:43:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64A14EBF51; Mon, 16 Sep 2019 20:43:21 +0000 (UTC) (envelope-from dmgk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XJ9P20qlz47Ch; Mon, 16 Sep 2019 20:43:21 +0000 (UTC) (envelope-from dmgk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 282B125C5D; Mon, 16 Sep 2019 20:43:21 +0000 (UTC) (envelope-from dmgk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GKhKkt075769; Mon, 16 Sep 2019 20:43:20 GMT (envelope-from dmgk@FreeBSD.org) Received: (from dmgk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GKhKQn075768; Mon, 16 Sep 2019 20:43:20 GMT (envelope-from dmgk@FreeBSD.org) Message-Id: <201909162043.x8GKhKQn075768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dmgk set sender to dmgk@FreeBSD.org using -f From: Dmitri Goutnik Date: Mon, 16 Sep 2019 20:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352423 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: dmgk X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 352423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 20:43:21 -0000 Author: dmgk (ports committer) Date: Mon Sep 16 20:43:20 2019 New Revision: 352423 URL: https://svnweb.freebsd.org/changeset/base/352423 Log: Add myself (dmgk) to calendar.freebsd Approved by: tz (mentor) Differential Revision: https://reviews.freebsd.org/D21675 Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Sep 16 20:41:37 2019 (r352422) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Sep 16 20:43:20 2019 (r352423) @@ -446,6 +446,7 @@ 11/28 Nik Clayton born in Peterborough, United Kingdom, 1973 11/28 Stanislav Sedov born in Chelyabinsk, USSR, 1985 11/29 Doug Moore born in Arlington, Texas, United States, 1960 +11/30 Dmitri Goutnik born in Minsk, USSR, 1969 12/01 Hajimu Umemoto born in Nara, Japan, 1961 12/01 Alexey Dokuchaev born in Magadan, USSR, 1980 12/02 Ermal Luçi born in Tirane, Albania, 1980 From owner-svn-src-head@freebsd.org Mon Sep 16 21:31:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA896ED10B; Mon, 16 Sep 2019 21:31:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XKDS4cClz49kp; Mon, 16 Sep 2019 21:31:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68FEE264C5; Mon, 16 Sep 2019 21:31:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GLV4bC001664; Mon, 16 Sep 2019 21:31:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GLV2bt001656; Mon, 16 Sep 2019 21:31:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909162131.x8GLV2bt001656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 16 Sep 2019 21:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352424 - in head/sys: cddl/compat/opensolaris/kern kern sys vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/compat/opensolaris/kern kern sys vm X-SVN-Commit-Revision: 352424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 21:31:04 -0000 Author: mjg Date: Mon Sep 16 21:31:02 2019 New Revision: 352424 URL: https://svnweb.freebsd.org/changeset/base/352424 Log: vfs: manage mnt_ref with atomics New primitive is introduced to denote sections can operate locklessly on aspects of struct mount, but which can also be disabled if necessary. This provides an opportunity to start scaling common case modifications while providing stable state of the struct when facing unmount, write suspendion or other events. mnt_ref is the first counter to start being managed in this manner with the intent to make it per-cpu. Reviewed by: kib, jeff Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21425 Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c head/sys/kern/subr_pcpu.c head/sys/kern/vfs_default.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_mountroot.c head/sys/kern/vfs_subr.c head/sys/sys/mount.h head/sys/vm/uma.h Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon Sep 16 20:43:20 2019 (r352423) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon Sep 16 21:31:02 2019 (r352424) @@ -242,6 +242,7 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const cha if (VFS_ROOT(mp, LK_EXCLUSIVE, &mvp)) panic("mount: lost mount"); VOP_UNLOCK(vp, 0); + vfs_op_exit(mp); vfs_unbusy(mp); *vpp = mvp; return (0); Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Mon Sep 16 20:43:20 2019 (r352423) +++ head/sys/kern/subr_pcpu.c Mon Sep 16 21:31:02 2019 (r352424) @@ -131,15 +131,19 @@ SYSINIT(dpcpu, SI_SUB_KLD, SI_ORDER_FIRST, dpcpu_start /* * UMA_PCPU_ZONE zones, that are available for all kernel - * consumers. Right now 64 bit zone is used for counter(9). + * consumers. Right now 64 bit zone is used for counter(9) + * and int zone is used for mount point counters. */ +uma_zone_t pcpu_zone_int; uma_zone_t pcpu_zone_64; static void pcpu_zones_startup(void) { + pcpu_zone_int = uma_zcreate("int pcpu", sizeof(int), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); pcpu_zone_64 = uma_zcreate("64 pcpu", sizeof(uint64_t), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Sep 16 20:43:20 2019 (r352423) +++ head/sys/kern/vfs_default.c Mon Sep 16 21:31:02 2019 (r352424) @@ -601,17 +601,24 @@ vop_stdgetwritemount(ap) */ vp = ap->a_vp; mp = vp->v_mount; - if (mp == NULL) - goto out; - MNT_ILOCK(mp); - if (mp != vp->v_mount) { + if (mp == NULL) { + *(ap->a_mpp) = NULL; + return (0); + } + if (vfs_op_thread_enter(mp)) { + if (mp == vp->v_mount) + MNT_REF_UNLOCKED(mp); + else + mp = NULL; + vfs_op_thread_exit(mp); + } else { + MNT_ILOCK(mp); + if (mp == vp->v_mount) + MNT_REF(mp); + else + mp = NULL; MNT_IUNLOCK(mp); - mp = NULL; - goto out; } - MNT_REF(mp); - MNT_IUNLOCK(mp); -out: *(ap->a_mpp) = mp; return (0); } Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Sep 16 20:43:20 2019 (r352423) +++ head/sys/kern/vfs_mount.c Mon Sep 16 21:31:02 2019 (r352424) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -123,6 +124,10 @@ mount_init(void *mem, int size, int flags) mtx_init(&mp->mnt_mtx, "struct mount mtx", NULL, MTX_DEF); mtx_init(&mp->mnt_listmtx, "struct mount vlist mtx", NULL, MTX_DEF); lockinit(&mp->mnt_explock, PVFS, "explock", 0, 0); + mp->mnt_thread_in_ops_pcpu = uma_zalloc_pcpu(pcpu_zone_int, + M_WAITOK | M_ZERO); + mp->mnt_ref = 0; + mp->mnt_vfs_ops = 1; return (0); } @@ -132,6 +137,7 @@ mount_fini(void *mem, int size) struct mount *mp; mp = (struct mount *)mem; + uma_zfree_pcpu(pcpu_zone_int, mp->mnt_thread_in_ops_pcpu); lockdestroy(&mp->mnt_explock); mtx_destroy(&mp->mnt_listmtx); mtx_destroy(&mp->mnt_mtx); @@ -445,6 +451,12 @@ vfs_ref(struct mount *mp) { CTR2(KTR_VFS, "%s: mp %p", __func__, mp); + if (vfs_op_thread_enter(mp)) { + MNT_REF_UNLOCKED(mp); + vfs_op_thread_exit(mp); + return; + } + MNT_ILOCK(mp); MNT_REF(mp); MNT_IUNLOCK(mp); @@ -455,6 +467,12 @@ vfs_rel(struct mount *mp) { CTR2(KTR_VFS, "%s: mp %p", __func__, mp); + if (vfs_op_thread_enter(mp)) { + MNT_REL_UNLOCKED(mp); + vfs_op_thread_exit(mp); + return; + } + MNT_ILOCK(mp); MNT_REL(mp); MNT_IUNLOCK(mp); @@ -478,7 +496,12 @@ vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp mp->mnt_activevnodelistsize = 0; TAILQ_INIT(&mp->mnt_tmpfreevnodelist); mp->mnt_tmpfreevnodelistsize = 0; - mp->mnt_ref = 0; + if (mp->mnt_ref != 0 || mp->mnt_lockref != 0 || + mp->mnt_writeopcount != 0) + panic("%s: non-zero counters on new mp %p\n", __func__, mp); + if (mp->mnt_vfs_ops != 1) + panic("%s: vfs_ops should be 1 but %d found\n", __func__, + mp->mnt_vfs_ops); (void) vfs_busy(mp, MBF_NOWAIT); atomic_add_acq_int(&vfsp->vfc_refcount, 1); mp->mnt_op = vfsp->vfc_vfsops; @@ -507,6 +530,9 @@ void vfs_mount_destroy(struct mount *mp) { + if (mp->mnt_vfs_ops == 0) + panic("%s: entered with zero vfs_ops\n", __func__); + MNT_ILOCK(mp); mp->mnt_kern_flag |= MNTK_REFEXPIRE; if (mp->mnt_kern_flag & MNTK_MWAIT) { @@ -540,6 +566,11 @@ vfs_mount_destroy(struct mount *mp) if (mp->mnt_lockref != 0) panic("vfs_mount_destroy: nonzero lock refcount"); MNT_IUNLOCK(mp); + + if (mp->mnt_vfs_ops != 1) + panic("%s: vfs_ops should be 1 but %d found\n", __func__, + mp->mnt_vfs_ops); + if (mp->mnt_vnodecovered != NULL) vrele(mp->mnt_vnodecovered); #ifdef MAC @@ -951,6 +982,7 @@ vfs_domount_first( vrele(newdp); if ((mp->mnt_flag & MNT_RDONLY) == 0) vfs_allocate_syncvnode(mp); + vfs_op_exit(mp); vfs_unbusy(mp); return (0); } @@ -1019,6 +1051,8 @@ vfs_domount_update( VI_UNLOCK(vp); VOP_UNLOCK(vp, 0); + vfs_op_enter(mp); + MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { MNT_IUNLOCK(mp); @@ -1100,6 +1134,7 @@ vfs_domount_update( else vfs_deallocate_syncvnode(mp); end: + vfs_op_exit(mp); vfs_unbusy(mp); VI_LOCK(vp); vp->v_iflag &= ~VI_MOUNT; @@ -1328,6 +1363,7 @@ dounmount_cleanup(struct mount *mp, struct vnode *cove mp->mnt_kern_flag &= ~MNTK_MWAIT; wakeup(mp); } + vfs_op_exit_locked(mp); MNT_IUNLOCK(mp); if (coveredvp != NULL) { VOP_UNLOCK(coveredvp, 0); @@ -1337,6 +1373,69 @@ dounmount_cleanup(struct mount *mp, struct vnode *cove } /* + * There are various reference counters associated with the mount point. + * Normally it is permitted to modify them without taking the mnt ilock, + * but this behavior can be temporarily disabled if stable value is needed + * or callers are expected to block (e.g. to not allow new users during + * forced unmount). + */ +void +vfs_op_enter(struct mount *mp) +{ + + MNT_ILOCK(mp); + mp->mnt_vfs_ops++; + if (mp->mnt_vfs_ops > 1) { + MNT_IUNLOCK(mp); + return; + } + /* + * Paired with a fence in vfs_op_thread_enter(). See the comment + * above it for details. + */ + atomic_thread_fence_seq_cst(); + vfs_op_barrier_wait(mp); + MNT_IUNLOCK(mp); +} + +void +vfs_op_exit_locked(struct mount *mp) +{ + + mtx_assert(MNT_MTX(mp), MA_OWNED); + + if (mp->mnt_vfs_ops <= 0) + panic("%s: invalid vfs_ops count %d for mp %p\n", + __func__, mp->mnt_vfs_ops, mp); + mp->mnt_vfs_ops--; +} + +void +vfs_op_exit(struct mount *mp) +{ + + MNT_ILOCK(mp); + vfs_op_exit_locked(mp); + MNT_IUNLOCK(mp); +} + +/* + * It is assumed the caller already posted at least an acquire barrier. + */ +void +vfs_op_barrier_wait(struct mount *mp) +{ + int *in_op; + int cpu; + + CPU_FOREACH(cpu) { + in_op = zpcpu_get_cpu(mp->mnt_thread_in_ops_pcpu, cpu); + while (atomic_load_int(in_op)) + cpu_spinwait(); + } +} + +/* * Do the actual filesystem unmount. */ int @@ -1379,6 +1478,8 @@ dounmount(struct mount *mp, int flags, struct thread * return (error); } + vfs_op_enter(mp); + vn_start_write(NULL, &mp, V_WAIT | V_MNTREF); MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0 || @@ -1469,6 +1570,7 @@ dounmount(struct mount *mp, int flags, struct thread * mp->mnt_kern_flag &= ~MNTK_MWAIT; wakeup(mp); } + vfs_op_exit_locked(mp); MNT_IUNLOCK(mp); if (coveredvp) VOP_UNLOCK(coveredvp, 0); Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Mon Sep 16 20:43:20 2019 (r352423) +++ head/sys/kern/vfs_mountroot.c Mon Sep 16 21:31:02 2019 (r352424) @@ -273,6 +273,7 @@ vfs_mountroot_devfs(struct thread *td, struct mount ** *mpp = mp; rootdevmp = mp; + vfs_op_exit(mp); } set_rootvnode(); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Sep 16 20:43:20 2019 (r352423) +++ head/sys/kern/vfs_subr.c Mon Sep 16 21:31:02 2019 (r352424) @@ -4032,6 +4032,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) mp->mnt_secondary_accwrites); db_printf(" mnt_gjprovider = %s\n", mp->mnt_gjprovider != NULL ? mp->mnt_gjprovider : "NULL"); + db_printf(" mnt_vfs_ops = %d\n", mp->mnt_vfs_ops); db_printf("\n\nList of active vnodes\n"); TAILQ_FOREACH(vp, &mp->mnt_activevnodelist, v_actfreelist) { Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Mon Sep 16 20:43:20 2019 (r352423) +++ head/sys/sys/mount.h Mon Sep 16 21:31:02 2019 (r352424) @@ -226,6 +226,8 @@ struct mount { struct lock mnt_explock; /* vfs_export walkers lock */ TAILQ_ENTRY(mount) mnt_upper_link; /* (m) we in the all uppers */ TAILQ_HEAD(, mount) mnt_uppers; /* (m) upper mounts over us*/ + int mnt_vfs_ops; /* (i) pending vfs ops */ + int *mnt_thread_in_ops_pcpu; }; /* @@ -265,15 +267,26 @@ void __mnt_vnode_markerfree_active(struct vno #define MNT_ITRYLOCK(mp) mtx_trylock(&(mp)->mnt_mtx) #define MNT_IUNLOCK(mp) mtx_unlock(&(mp)->mnt_mtx) #define MNT_MTX(mp) (&(mp)->mnt_mtx) + +#define MNT_REF_UNLOCKED(mp) do { \ + atomic_add_int(&(mp)->mnt_ref, 1); \ +} while (0) +#define MNT_REL_UNLOCKED(mp) do { \ + int _c; \ + _c = atomic_fetchadd_int(&(mp)->mnt_ref, -1) - 1; \ + KASSERT(_c >= 0, ("negative mnt_ref %d", _c)); \ +} while (0) + #define MNT_REF(mp) do { \ mtx_assert(MNT_MTX(mp), MA_OWNED); \ - (mp)->mnt_ref++; \ + atomic_add_int(&(mp)->mnt_ref, 1); \ } while (0) #define MNT_REL(mp) do { \ + int _c; \ mtx_assert(MNT_MTX(mp), MA_OWNED); \ - KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref")); \ - (mp)->mnt_ref--; \ - if ((mp)->mnt_ref == 0) \ + _c = atomic_fetchadd_int(&(mp)->mnt_ref, -1) - 1; \ + KASSERT(_c >= 0, ("negative mnt_ref %d", _c)); \ + if (_c == 0) \ wakeup((mp)); \ } while (0) @@ -940,6 +953,48 @@ vfs_sysctl_t vfs_stdsysctl; void syncer_suspend(void); void syncer_resume(void); + +void vfs_op_barrier_wait(struct mount *); +void vfs_op_enter(struct mount *); +void vfs_op_exit_locked(struct mount *); +void vfs_op_exit(struct mount *); + +/* + * We mark ourselves as entering the section and post a sequentially consistent + * fence, meaning the store is completed before we get into the section and + * mnt_vfs_ops is only read afterwards. + * + * Any thread transitioning the ops counter 0->1 does things in the opposite + * order - first bumps the count, posts a sequentially consistent fence and + * observes all CPUs not executing within the section. + * + * This provides an invariant that by the time the last CPU is observed not + * executing, everyone else entering will see the counter > 0 and exit. + * + * Note there is no barrier between vfs_ops and the rest of the code in the + * section. It is not necessary as the writer has to wait for everyone to drain + * before making any changes or only make changes safe while the section is + * executed. + */ + +#define vfs_op_thread_enter(mp) ({ \ + struct mount *_mp = (mp); \ + bool _retval = true; \ + critical_enter(); \ + *(int *)zpcpu_get(_mp->mnt_thread_in_ops_pcpu) = 1; \ + atomic_thread_fence_seq_cst(); \ + if (__predict_false(_mp->mnt_vfs_ops > 0)) { \ + vfs_op_thread_exit(_mp); \ + _retval = false; \ + } \ + _retval; \ +}) + +#define vfs_op_thread_exit(mp) do { \ + atomic_thread_fence_rel(); \ + *(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) = 0; \ + critical_exit(); \ +} while (0) #else /* !_KERNEL */ Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Mon Sep 16 20:43:20 2019 (r352423) +++ head/sys/vm/uma.h Mon Sep 16 21:31:02 2019 (r352424) @@ -650,6 +650,7 @@ int uma_zone_exhausted_nolock(uma_zone_t zone); /* * Common UMA_ZONE_PCPU zones. */ +extern uma_zone_t pcpu_zone_int; extern uma_zone_t pcpu_zone_64; /* From owner-svn-src-head@freebsd.org Mon Sep 16 21:32:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D758AED210; Mon, 16 Sep 2019 21:32:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XKFx5JRcz4BBf; Mon, 16 Sep 2019 21:32:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 993FE2653F; Mon, 16 Sep 2019 21:32:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GLWLuD003394; Mon, 16 Sep 2019 21:32:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GLWLRu003393; Mon, 16 Sep 2019 21:32:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909162132.x8GLWLRu003393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 16 Sep 2019 21:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352425 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 21:32:21 -0000 Author: mjg Date: Mon Sep 16 21:32:21 2019 New Revision: 352425 URL: https://svnweb.freebsd.org/changeset/base/352425 Log: vfs: manage mnt_lockref with atomics See r352424. Reviewed by: kib, jeff Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21574 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Sep 16 21:31:02 2019 (r352424) +++ head/sys/kern/vfs_subr.c Mon Sep 16 21:32:21 2019 (r352425) @@ -641,6 +641,18 @@ vfs_busy(struct mount *mp, int flags) MPASS((flags & ~MBF_MASK) == 0); CTR3(KTR_VFS, "%s: mp %p with flags %d", __func__, mp, flags); + if (vfs_op_thread_enter(mp)) { + MPASS((mp->mnt_kern_flag & MNTK_DRAINING) == 0); + MPASS((mp->mnt_kern_flag & MNTK_UNMOUNT) == 0); + MPASS((mp->mnt_kern_flag & MNTK_REFEXPIRE) == 0); + MNT_REF_UNLOCKED(mp); + atomic_add_int(&mp->mnt_lockref, 1); + vfs_op_thread_exit(mp); + if (flags & MBF_MNTLSTLOCK) + mtx_unlock(&mountlist_mtx); + return (0); + } + MNT_ILOCK(mp); MNT_REF(mp); /* @@ -673,7 +685,7 @@ vfs_busy(struct mount *mp, int flags) } if (flags & MBF_MNTLSTLOCK) mtx_unlock(&mountlist_mtx); - mp->mnt_lockref++; + atomic_add_int(&mp->mnt_lockref, 1); MNT_IUNLOCK(mp); return (0); } @@ -684,13 +696,24 @@ vfs_busy(struct mount *mp, int flags) void vfs_unbusy(struct mount *mp) { + int c; CTR2(KTR_VFS, "%s: mp %p", __func__, mp); + + if (vfs_op_thread_enter(mp)) { + MPASS((mp->mnt_kern_flag & MNTK_DRAINING) == 0); + c = atomic_fetchadd_int(&mp->mnt_lockref, -1) - 1; + KASSERT(c >= 0, ("%s: negative mnt_lockref %d\n", __func__, c)); + MNT_REL_UNLOCKED(mp); + vfs_op_thread_exit(mp); + return; + } + MNT_ILOCK(mp); MNT_REL(mp); - KASSERT(mp->mnt_lockref > 0, ("negative mnt_lockref")); - mp->mnt_lockref--; - if (mp->mnt_lockref == 0 && (mp->mnt_kern_flag & MNTK_DRAINING) != 0) { + c = atomic_fetchadd_int(&mp->mnt_lockref, -1) - 1; + KASSERT(c >= 0, ("%s: negative mnt_lockref %d\n", __func__, c)); + if (c == 0 && (mp->mnt_kern_flag & MNTK_DRAINING) != 0) { MPASS(mp->mnt_kern_flag & MNTK_UNMOUNT); CTR1(KTR_VFS, "%s: waking up waiters", __func__); mp->mnt_kern_flag &= ~MNTK_DRAINING; From owner-svn-src-head@freebsd.org Mon Sep 16 21:33:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21916ED40D; Mon, 16 Sep 2019 21:33:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XKH06tWRz4BLL; Mon, 16 Sep 2019 21:33:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF42126556; Mon, 16 Sep 2019 21:33:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GLXGe8006438; Mon, 16 Sep 2019 21:33:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GLXGrG006436; Mon, 16 Sep 2019 21:33:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909162133.x8GLXGrG006436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 16 Sep 2019 21:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352426 - in head/sys: kern ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern ufs/ffs X-SVN-Commit-Revision: 352426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 21:33:17 -0000 Author: mjg Date: Mon Sep 16 21:33:16 2019 New Revision: 352426 URL: https://svnweb.freebsd.org/changeset/base/352426 Log: vfs: manage mnt_writeopcount with atomics See r352424. Reviewed by: kib, jeff Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21575 Modified: head/sys/kern/vfs_vnops.c head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Sep 16 21:32:21 2019 (r352425) +++ head/sys/kern/vfs_vnops.c Mon Sep 16 21:33:16 2019 (r352426) @@ -1621,11 +1621,23 @@ vn_suspendable(struct mount *mp) * suspension is over, and then proceed. */ static int -vn_start_write_locked(struct mount *mp, int flags) +vn_start_write_refed(struct mount *mp, int flags, bool mplocked) { int error, mflags; - mtx_assert(MNT_MTX(mp), MA_OWNED); + if (__predict_true(!mplocked) && (flags & V_XSLEEP) == 0 && + vfs_op_thread_enter(mp)) { + MPASS((mp->mnt_kern_flag & MNTK_SUSPEND) == 0); + atomic_add_int(&mp->mnt_writeopcount, 1); + vfs_op_thread_exit(mp); + return (0); + } + + if (mplocked) + mtx_assert(MNT_MTX(mp), MA_OWNED); + else + MNT_ILOCK(mp); + error = 0; /* @@ -1648,7 +1660,7 @@ vn_start_write_locked(struct mount *mp, int flags) } if (flags & V_XSLEEP) goto unlock; - mp->mnt_writeopcount++; + atomic_add_int(&mp->mnt_writeopcount, 1); unlock: if (error != 0 || (flags & V_XSLEEP) != 0) MNT_REL(mp); @@ -1694,11 +1706,10 @@ vn_start_write(struct vnode *vp, struct mount **mpp, i * refcount for the provided mountpoint too, in order to * emulate a vfs_ref(). */ - MNT_ILOCK(mp); if (vp == NULL && (flags & V_MNTREF) == 0) - MNT_REF(mp); + vfs_ref(mp); - return (vn_start_write_locked(mp, flags)); + return (vn_start_write_refed(mp, flags, false)); } /* @@ -1780,15 +1791,26 @@ vn_start_secondary_write(struct vnode *vp, struct moun void vn_finished_write(struct mount *mp) { + int c; + if (mp == NULL || !vn_suspendable(mp)) return; + + if (vfs_op_thread_enter(mp)) { + c = atomic_fetchadd_int(&mp->mnt_writeopcount, -1) - 1; + if (c < 0) + panic("vn_finished_write: invalid writeopcount %d", c); + MNT_REL_UNLOCKED(mp); + vfs_op_thread_exit(mp); + return; + } + MNT_ILOCK(mp); MNT_REL(mp); - mp->mnt_writeopcount--; - if (mp->mnt_writeopcount < 0) - panic("vn_finished_write: neg cnt"); - if ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0 && - mp->mnt_writeopcount <= 0) + c = atomic_fetchadd_int(&mp->mnt_writeopcount, -1) - 1; + if (c < 0) + panic("vn_finished_write: invalid writeopcount %d", c); + if ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0 && c == 0) wakeup(&mp->mnt_writeopcount); MNT_IUNLOCK(mp); } @@ -1827,8 +1849,11 @@ vfs_write_suspend(struct mount *mp, int flags) MPASS(vn_suspendable(mp)); + vfs_op_enter(mp); + MNT_ILOCK(mp); if (mp->mnt_susp_owner == curthread) { + vfs_op_exit_locked(mp); MNT_IUNLOCK(mp); return (EALREADY); } @@ -1845,6 +1870,7 @@ vfs_write_suspend(struct mount *mp, int flags) */ if ((flags & VS_SKIP_UNMOUNT) != 0 && (mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { + vfs_op_exit_locked(mp); MNT_IUNLOCK(mp); return (EBUSY); } @@ -1856,8 +1882,10 @@ vfs_write_suspend(struct mount *mp, int flags) MNT_MTX(mp), (PUSER - 1)|PDROP, "suspwt", 0); else MNT_IUNLOCK(mp); - if ((error = VFS_SYNC(mp, MNT_SUSPEND)) != 0) + if ((error = VFS_SYNC(mp, MNT_SUSPEND)) != 0) { vfs_write_resume(mp, 0); + vfs_op_exit(mp); + } return (error); } @@ -1881,14 +1909,15 @@ vfs_write_resume(struct mount *mp, int flags) curthread->td_pflags &= ~TDP_IGNSUSP; if ((flags & VR_START_WRITE) != 0) { MNT_REF(mp); - mp->mnt_writeopcount++; + atomic_add_int(&mp->mnt_writeopcount, 1); } MNT_IUNLOCK(mp); if ((flags & VR_NO_SUSPCLR) == 0) VFS_SUSP_CLEAN(mp); + vfs_op_exit(mp); } else if ((flags & VR_START_WRITE) != 0) { MNT_REF(mp); - vn_start_write_locked(mp, 0); + vn_start_write_refed(mp, 0, true); } else { MNT_IUNLOCK(mp); } Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Sep 16 21:32:21 2019 (r352425) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Sep 16 21:33:16 2019 (r352426) @@ -2954,17 +2954,26 @@ journal_suspend(ump) { struct jblocks *jblocks; struct mount *mp; + bool set; mp = UFSTOVFS(ump); + if ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) + return; + jblocks = ump->softdep_jblocks; + vfs_op_enter(mp); + set = false; MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_SUSPEND) == 0) { stat_journal_min++; mp->mnt_kern_flag |= MNTK_SUSPEND; mp->mnt_susp_owner = ump->softdep_flushtd; + set = true; } jblocks->jb_suspended = 1; MNT_IUNLOCK(mp); + if (!set) + vfs_op_exit(mp); } static int From owner-svn-src-head@freebsd.org Mon Sep 16 21:37:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE270ED4DD; Mon, 16 Sep 2019 21:37:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XKNF6HFGz4BW8; Mon, 16 Sep 2019 21:37:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5D7D2655B; Mon, 16 Sep 2019 21:37:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GLbnVX006702; Mon, 16 Sep 2019 21:37:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GLbmqb006694; Mon, 16 Sep 2019 21:37:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909162137.x8GLbmqb006694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 16 Sep 2019 21:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352427 - in head/sys: fs/tmpfs kern sys ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/tmpfs kern sys ufs/ffs X-SVN-Commit-Revision: 352427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 21:37:49 -0000 Author: mjg Date: Mon Sep 16 21:37:47 2019 New Revision: 352427 URL: https://svnweb.freebsd.org/changeset/base/352427 Log: vfs: convert struct mount counters to per-cpu There are 3 counters modified all the time in this structure - one for keeping the structure alive, one for preventing unmount and one for tracking active writers. Exact values of these counters are very rarely needed, which makes them a prime candidate for conversion to a per-cpu scheme, resulting in much better performance. Sample benchmark performing fstatfs (modifying 2 out of 3 counters) on a 104-way 2 socket Skylake system: before: 852393 ops/s after: 76682077 ops/s Reviewed by: kib, jeff Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21637 Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/kern/vfs_default.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_vnops.c head/sys/sys/mount.h head/sys/sys/pcpu.h head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Mon Sep 16 21:33:16 2019 (r352426) +++ head/sys/fs/tmpfs/tmpfs_subr.c Mon Sep 16 21:37:47 2019 (r352427) @@ -190,8 +190,6 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount /* If the root directory of the 'tmp' file system is not yet * allocated, this must be the request to do it. */ MPASS(IMPLIES(tmp->tm_root == NULL, parent == NULL && type == VDIR)); - KASSERT(tmp->tm_root == NULL || mp->mnt_writeopcount > 0, - ("creating node not under vn_start_write")); MPASS(IFF(type == VLNK, target != NULL)); MPASS(IFF(type == VBLK || type == VCHR, rdev != VNOVAL)); Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Sep 16 21:33:16 2019 (r352426) +++ head/sys/kern/vfs_default.c Mon Sep 16 21:37:47 2019 (r352427) @@ -607,7 +607,7 @@ vop_stdgetwritemount(ap) } if (vfs_op_thread_enter(mp)) { if (mp == vp->v_mount) - MNT_REF_UNLOCKED(mp); + vfs_mp_count_add_pcpu(mp, ref, 1); else mp = NULL; vfs_op_thread_exit(mp); Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Sep 16 21:33:16 2019 (r352426) +++ head/sys/kern/vfs_mount.c Mon Sep 16 21:37:47 2019 (r352427) @@ -126,6 +126,12 @@ mount_init(void *mem, int size, int flags) lockinit(&mp->mnt_explock, PVFS, "explock", 0, 0); mp->mnt_thread_in_ops_pcpu = uma_zalloc_pcpu(pcpu_zone_int, M_WAITOK | M_ZERO); + mp->mnt_ref_pcpu = uma_zalloc_pcpu(pcpu_zone_int, + M_WAITOK | M_ZERO); + mp->mnt_lockref_pcpu = uma_zalloc_pcpu(pcpu_zone_int, + M_WAITOK | M_ZERO); + mp->mnt_writeopcount_pcpu = uma_zalloc_pcpu(pcpu_zone_int, + M_WAITOK | M_ZERO); mp->mnt_ref = 0; mp->mnt_vfs_ops = 1; return (0); @@ -137,6 +143,9 @@ mount_fini(void *mem, int size) struct mount *mp; mp = (struct mount *)mem; + uma_zfree_pcpu(pcpu_zone_int, mp->mnt_writeopcount_pcpu); + uma_zfree_pcpu(pcpu_zone_int, mp->mnt_lockref_pcpu); + uma_zfree_pcpu(pcpu_zone_int, mp->mnt_ref_pcpu); uma_zfree_pcpu(pcpu_zone_int, mp->mnt_thread_in_ops_pcpu); lockdestroy(&mp->mnt_explock); mtx_destroy(&mp->mnt_listmtx); @@ -452,7 +461,7 @@ vfs_ref(struct mount *mp) CTR2(KTR_VFS, "%s: mp %p", __func__, mp); if (vfs_op_thread_enter(mp)) { - MNT_REF_UNLOCKED(mp); + vfs_mp_count_add_pcpu(mp, ref, 1); vfs_op_thread_exit(mp); return; } @@ -468,7 +477,7 @@ vfs_rel(struct mount *mp) CTR2(KTR_VFS, "%s: mp %p", __func__, mp); if (vfs_op_thread_enter(mp)) { - MNT_REL_UNLOCKED(mp); + vfs_mp_count_sub_pcpu(mp, ref, 1); vfs_op_thread_exit(mp); return; } @@ -533,6 +542,8 @@ vfs_mount_destroy(struct mount *mp) if (mp->mnt_vfs_ops == 0) panic("%s: entered with zero vfs_ops\n", __func__); + vfs_assert_mount_counters(mp); + MNT_ILOCK(mp); mp->mnt_kern_flag |= MNTK_REFEXPIRE; if (mp->mnt_kern_flag & MNTK_MWAIT) { @@ -1382,6 +1393,7 @@ dounmount_cleanup(struct mount *mp, struct vnode *cove void vfs_op_enter(struct mount *mp) { + int cpu; MNT_ILOCK(mp); mp->mnt_vfs_ops++; @@ -1395,7 +1407,20 @@ vfs_op_enter(struct mount *mp) */ atomic_thread_fence_seq_cst(); vfs_op_barrier_wait(mp); + /* + * Paired with a fence in vfs_op_thread_exit(). + */ + atomic_thread_fence_acq(); + CPU_FOREACH(cpu) { + mp->mnt_ref += + zpcpu_replace_cpu(mp->mnt_ref_pcpu, 0, cpu); + mp->mnt_lockref += + zpcpu_replace_cpu(mp->mnt_lockref_pcpu, 0, cpu); + mp->mnt_writeopcount += + zpcpu_replace_cpu(mp->mnt_writeopcount_pcpu, 0, cpu); + } MNT_IUNLOCK(mp); + vfs_assert_mount_counters(mp); } void @@ -1433,6 +1458,93 @@ vfs_op_barrier_wait(struct mount *mp) while (atomic_load_int(in_op)) cpu_spinwait(); } +} + +#ifdef DIAGNOSTIC +void +vfs_assert_mount_counters(struct mount *mp) +{ + int cpu; + + if (mp->mnt_vfs_ops == 0) + return; + + CPU_FOREACH(cpu) { + if (*(int *)zpcpu_get_cpu(mp->mnt_ref_pcpu, cpu) != 0 || + *(int *)zpcpu_get_cpu(mp->mnt_lockref_pcpu, cpu) != 0 || + *(int *)zpcpu_get_cpu(mp->mnt_writeopcount_pcpu, cpu) != 0) + vfs_dump_mount_counters(mp); + } +} + +void +vfs_dump_mount_counters(struct mount *mp) +{ + int cpu, *count; + int ref, lockref, writeopcount; + + printf("%s: mp %p vfs_ops %d\n", __func__, mp, mp->mnt_vfs_ops); + + printf(" ref : "); + ref = mp->mnt_ref; + CPU_FOREACH(cpu) { + count = zpcpu_get_cpu(mp->mnt_ref_pcpu, cpu); + printf("%d ", *count); + ref += *count; + } + printf("\n"); + printf(" lockref : "); + lockref = mp->mnt_lockref; + CPU_FOREACH(cpu) { + count = zpcpu_get_cpu(mp->mnt_lockref_pcpu, cpu); + printf("%d ", *count); + lockref += *count; + } + printf("\n"); + printf("writeopcount: "); + writeopcount = mp->mnt_writeopcount; + CPU_FOREACH(cpu) { + count = zpcpu_get_cpu(mp->mnt_writeopcount_pcpu, cpu); + printf("%d ", *count); + writeopcount += *count; + } + printf("\n"); + + printf("counter struct total\n"); + printf("ref %-5d %-5d\n", mp->mnt_ref, ref); + printf("lockref %-5d %-5d\n", mp->mnt_lockref, lockref); + printf("writeopcount %-5d %-5d\n", mp->mnt_writeopcount, writeopcount); + + panic("invalid counts on struct mount"); +} +#endif + +int +vfs_mount_fetch_counter(struct mount *mp, enum mount_counter which) +{ + int *base, *pcpu; + int cpu, sum; + + switch (which) { + case MNT_COUNT_REF: + base = &mp->mnt_ref; + pcpu = mp->mnt_ref_pcpu; + break; + case MNT_COUNT_LOCKREF: + base = &mp->mnt_lockref; + pcpu = mp->mnt_lockref_pcpu; + break; + case MNT_COUNT_WRITEOPCOUNT: + base = &mp->mnt_writeopcount; + pcpu = mp->mnt_writeopcount_pcpu; + break; + } + + sum = *base; + CPU_FOREACH(cpu) { + sum += *(int *)zpcpu_get_cpu(pcpu, cpu); + } + return (sum); } /* Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Sep 16 21:33:16 2019 (r352426) +++ head/sys/kern/vfs_subr.c Mon Sep 16 21:37:47 2019 (r352427) @@ -645,8 +645,8 @@ vfs_busy(struct mount *mp, int flags) MPASS((mp->mnt_kern_flag & MNTK_DRAINING) == 0); MPASS((mp->mnt_kern_flag & MNTK_UNMOUNT) == 0); MPASS((mp->mnt_kern_flag & MNTK_REFEXPIRE) == 0); - MNT_REF_UNLOCKED(mp); - atomic_add_int(&mp->mnt_lockref, 1); + vfs_mp_count_add_pcpu(mp, ref, 1); + vfs_mp_count_add_pcpu(mp, lockref, 1); vfs_op_thread_exit(mp); if (flags & MBF_MNTLSTLOCK) mtx_unlock(&mountlist_mtx); @@ -654,6 +654,7 @@ vfs_busy(struct mount *mp, int flags) } MNT_ILOCK(mp); + vfs_assert_mount_counters(mp); MNT_REF(mp); /* * If mount point is currently being unmounted, sleep until the @@ -685,7 +686,7 @@ vfs_busy(struct mount *mp, int flags) } if (flags & MBF_MNTLSTLOCK) mtx_unlock(&mountlist_mtx); - atomic_add_int(&mp->mnt_lockref, 1); + mp->mnt_lockref++; MNT_IUNLOCK(mp); return (0); } @@ -702,17 +703,23 @@ vfs_unbusy(struct mount *mp) if (vfs_op_thread_enter(mp)) { MPASS((mp->mnt_kern_flag & MNTK_DRAINING) == 0); - c = atomic_fetchadd_int(&mp->mnt_lockref, -1) - 1; - KASSERT(c >= 0, ("%s: negative mnt_lockref %d\n", __func__, c)); - MNT_REL_UNLOCKED(mp); + vfs_mp_count_sub_pcpu(mp, lockref, 1); + vfs_mp_count_sub_pcpu(mp, ref, 1); vfs_op_thread_exit(mp); return; } MNT_ILOCK(mp); + vfs_assert_mount_counters(mp); MNT_REL(mp); - c = atomic_fetchadd_int(&mp->mnt_lockref, -1) - 1; - KASSERT(c >= 0, ("%s: negative mnt_lockref %d\n", __func__, c)); + c = --mp->mnt_lockref; + if (mp->mnt_vfs_ops == 0) { + MPASS((mp->mnt_kern_flag & MNTK_DRAINING) == 0); + MNT_IUNLOCK(mp); + return; + } + if (c < 0) + vfs_dump_mount_counters(mp); if (c == 0 && (mp->mnt_kern_flag & MNTK_DRAINING) != 0) { MPASS(mp->mnt_kern_flag & MNTK_UNMOUNT); CTR1(KTR_VFS, "%s: waking up waiters", __func__); @@ -4040,16 +4047,19 @@ DB_SHOW_COMMAND(mount, db_show_mount) if (jailed(mp->mnt_cred)) db_printf(", jail=%d", mp->mnt_cred->cr_prison->pr_id); db_printf(" }\n"); - db_printf(" mnt_ref = %d\n", mp->mnt_ref); + db_printf(" mnt_ref = %d (with %d in the struct)\n", + vfs_mount_fetch_counter(mp, MNT_COUNT_REF), mp->mnt_ref); db_printf(" mnt_gen = %d\n", mp->mnt_gen); db_printf(" mnt_nvnodelistsize = %d\n", mp->mnt_nvnodelistsize); db_printf(" mnt_activevnodelistsize = %d\n", mp->mnt_activevnodelistsize); - db_printf(" mnt_writeopcount = %d\n", mp->mnt_writeopcount); + db_printf(" mnt_writeopcount = %d (with %d in the struct)\n", + vfs_mount_fetch_counter(mp, MNT_COUNT_WRITEOPCOUNT), mp->mnt_writeopcount); db_printf(" mnt_maxsymlinklen = %d\n", mp->mnt_maxsymlinklen); db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max); db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed); - db_printf(" mnt_lockref = %d\n", mp->mnt_lockref); + db_printf(" mnt_lockref = %d (with %d in the struct)\n", + vfs_mount_fetch_counter(mp, MNT_COUNT_LOCKREF), mp->mnt_lockref); db_printf(" mnt_secondary_writes = %d\n", mp->mnt_secondary_writes); db_printf(" mnt_secondary_accwrites = %d\n", mp->mnt_secondary_accwrites); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Sep 16 21:33:16 2019 (r352426) +++ head/sys/kern/vfs_vnops.c Mon Sep 16 21:37:47 2019 (r352427) @@ -1628,7 +1628,7 @@ vn_start_write_refed(struct mount *mp, int flags, bool if (__predict_true(!mplocked) && (flags & V_XSLEEP) == 0 && vfs_op_thread_enter(mp)) { MPASS((mp->mnt_kern_flag & MNTK_SUSPEND) == 0); - atomic_add_int(&mp->mnt_writeopcount, 1); + vfs_mp_count_add_pcpu(mp, writeopcount, 1); vfs_op_thread_exit(mp); return (0); } @@ -1660,7 +1660,7 @@ vn_start_write_refed(struct mount *mp, int flags, bool } if (flags & V_XSLEEP) goto unlock; - atomic_add_int(&mp->mnt_writeopcount, 1); + mp->mnt_writeopcount++; unlock: if (error != 0 || (flags & V_XSLEEP) != 0) MNT_REL(mp); @@ -1797,19 +1797,23 @@ vn_finished_write(struct mount *mp) return; if (vfs_op_thread_enter(mp)) { - c = atomic_fetchadd_int(&mp->mnt_writeopcount, -1) - 1; - if (c < 0) - panic("vn_finished_write: invalid writeopcount %d", c); - MNT_REL_UNLOCKED(mp); + vfs_mp_count_sub_pcpu(mp, writeopcount, 1); + vfs_mp_count_sub_pcpu(mp, ref, 1); vfs_op_thread_exit(mp); return; } MNT_ILOCK(mp); + vfs_assert_mount_counters(mp); MNT_REL(mp); - c = atomic_fetchadd_int(&mp->mnt_writeopcount, -1) - 1; + c = --mp->mnt_writeopcount; + if (mp->mnt_vfs_ops == 0) { + MPASS((mp->mnt_kern_flag & MNTK_SUSPEND) == 0); + MNT_IUNLOCK(mp); + return; + } if (c < 0) - panic("vn_finished_write: invalid writeopcount %d", c); + vfs_dump_mount_counters(mp); if ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0 && c == 0) wakeup(&mp->mnt_writeopcount); MNT_IUNLOCK(mp); @@ -1852,6 +1856,7 @@ vfs_write_suspend(struct mount *mp, int flags) vfs_op_enter(mp); MNT_ILOCK(mp); + vfs_assert_mount_counters(mp); if (mp->mnt_susp_owner == curthread) { vfs_op_exit_locked(mp); MNT_IUNLOCK(mp); @@ -1909,7 +1914,7 @@ vfs_write_resume(struct mount *mp, int flags) curthread->td_pflags &= ~TDP_IGNSUSP; if ((flags & VR_START_WRITE) != 0) { MNT_REF(mp); - atomic_add_int(&mp->mnt_writeopcount, 1); + mp->mnt_writeopcount++; } MNT_IUNLOCK(mp); if ((flags & VR_NO_SUSPCLR) == 0) Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Mon Sep 16 21:33:16 2019 (r352426) +++ head/sys/sys/mount.h Mon Sep 16 21:37:47 2019 (r352427) @@ -228,6 +228,9 @@ struct mount { TAILQ_HEAD(, mount) mnt_uppers; /* (m) upper mounts over us*/ int mnt_vfs_ops; /* (i) pending vfs ops */ int *mnt_thread_in_ops_pcpu; + int *mnt_ref_pcpu; + int *mnt_lockref_pcpu; + int *mnt_writeopcount_pcpu; }; /* @@ -268,25 +271,16 @@ void __mnt_vnode_markerfree_active(struct vno #define MNT_IUNLOCK(mp) mtx_unlock(&(mp)->mnt_mtx) #define MNT_MTX(mp) (&(mp)->mnt_mtx) -#define MNT_REF_UNLOCKED(mp) do { \ - atomic_add_int(&(mp)->mnt_ref, 1); \ -} while (0) -#define MNT_REL_UNLOCKED(mp) do { \ - int _c; \ - _c = atomic_fetchadd_int(&(mp)->mnt_ref, -1) - 1; \ - KASSERT(_c >= 0, ("negative mnt_ref %d", _c)); \ -} while (0) - #define MNT_REF(mp) do { \ mtx_assert(MNT_MTX(mp), MA_OWNED); \ - atomic_add_int(&(mp)->mnt_ref, 1); \ + mp->mnt_ref++; \ } while (0) #define MNT_REL(mp) do { \ - int _c; \ mtx_assert(MNT_MTX(mp), MA_OWNED); \ - _c = atomic_fetchadd_int(&(mp)->mnt_ref, -1) - 1; \ - KASSERT(_c >= 0, ("negative mnt_ref %d", _c)); \ - if (_c == 0) \ + (mp)->mnt_ref--; \ + if ((mp)->mnt_vfs_ops && (mp)->mnt_ref < 0) \ + vfs_dump_mount_counters(mp); \ + if ((mp)->mnt_ref == 0 && (mp)->mnt_vfs_ops) \ wakeup((mp)); \ } while (0) @@ -959,6 +953,17 @@ void vfs_op_enter(struct mount *); void vfs_op_exit_locked(struct mount *); void vfs_op_exit(struct mount *); +#ifdef DIAGNOSTIC +void vfs_assert_mount_counters(struct mount *); +void vfs_dump_mount_counters(struct mount *); +#else +#define vfs_assert_mount_counters(mp) do { } while (0) +#define vfs_dump_mount_counters(mp) do { } while (0) +#endif + +enum mount_counter { MNT_COUNT_REF, MNT_COUNT_LOCKREF, MNT_COUNT_WRITEOPCOUNT }; +int vfs_mount_fetch_counter(struct mount *, enum mount_counter); + /* * We mark ourselves as entering the section and post a sequentially consistent * fence, meaning the store is completed before we get into the section and @@ -976,24 +981,39 @@ void vfs_op_exit(struct mount *); * before making any changes or only make changes safe while the section is * executed. */ +#define vfs_op_thread_entered(mp) ({ \ + MPASS(curthread->td_critnest > 0); \ + *(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) == 1; \ +}) #define vfs_op_thread_enter(mp) ({ \ - struct mount *_mp = (mp); \ bool _retval = true; \ critical_enter(); \ - *(int *)zpcpu_get(_mp->mnt_thread_in_ops_pcpu) = 1; \ + MPASS(!vfs_op_thread_entered(mp)); \ + *(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) = 1; \ atomic_thread_fence_seq_cst(); \ - if (__predict_false(_mp->mnt_vfs_ops > 0)) { \ - vfs_op_thread_exit(_mp); \ + if (__predict_false(mp->mnt_vfs_ops > 0)) { \ + vfs_op_thread_exit(mp); \ _retval = false; \ } \ _retval; \ }) #define vfs_op_thread_exit(mp) do { \ + MPASS(vfs_op_thread_entered(mp)); \ atomic_thread_fence_rel(); \ *(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) = 0; \ critical_exit(); \ +} while (0) + +#define vfs_mp_count_add_pcpu(mp, count, val) do { \ + MPASS(vfs_op_thread_entered(mp)); \ + (*(int *)zpcpu_get(mp->mnt_##count##_pcpu)) += val; \ +} while (0) + +#define vfs_mp_count_sub_pcpu(mp, count, val) do { \ + MPASS(vfs_op_thread_entered(mp)); \ + (*(int *)zpcpu_get(mp->mnt_##count##_pcpu)) -= val; \ } while (0) #else /* !_KERNEL */ Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Mon Sep 16 21:33:16 2019 (r352426) +++ head/sys/sys/pcpu.h Mon Sep 16 21:37:47 2019 (r352427) @@ -243,6 +243,18 @@ zpcpu_get_cpu(void *base, int cpu) } /* + * This operation is NOT atomic and does not post any barriers. + * If you use this the assumption is that the target CPU will not + * be modifying this variable. + * If you need atomicity use xchg. + * */ +#define zpcpu_replace_cpu(base, val, cpu) ({ \ + __typeof(val) _old = *(__typeof(val) *)zpcpu_get_cpu(base, cpu);\ + *(__typeof(val) *)zpcpu_get_cpu(base, cpu) = val; \ + _old; \ +}) + +/* * Machine dependent callouts. cpu_pcpu_init() is responsible for * initializing machine dependent fields of struct pcpu, and * db_show_mdpcpu() is responsible for handling machine dependent Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Sep 16 21:33:16 2019 (r352426) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Sep 16 21:37:47 2019 (r352427) @@ -13403,10 +13403,11 @@ softdep_request_cleanup(fs, vp, cred, resource) * (fs_minfree). */ if (resource == FLUSH_INODES_WAIT) { - needed = vp->v_mount->mnt_writeopcount + 2; + needed = vfs_mount_fetch_counter(vp->v_mount, + MNT_COUNT_WRITEOPCOUNT) + 2; } else if (resource == FLUSH_BLOCKS_WAIT) { - needed = (vp->v_mount->mnt_writeopcount + 2) * - fs->fs_contigsumsize; + needed = (vfs_mount_fetch_counter(vp->v_mount, + MNT_COUNT_WRITEOPCOUNT) + 2) * fs->fs_contigsumsize; if (priv_check_cred(cred, PRIV_VFS_BLOCKRESERVE)) needed += fragstoblks(fs, roundup((fs->fs_dsize * fs->fs_minfree / 100) - From owner-svn-src-head@freebsd.org Mon Sep 16 22:17:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 184C5EE18B; Mon, 16 Sep 2019 22:17:18 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XLFn6qdGz4D9l; Mon, 16 Sep 2019 22:17:17 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C997F26C65; Mon, 16 Sep 2019 22:17:17 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GMHHdf030199; Mon, 16 Sep 2019 22:17:17 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GMHHat030196; Mon, 16 Sep 2019 22:17:17 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201909162217.x8GMHHat030196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Mon, 16 Sep 2019 22:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352430 - in head/sys/riscv: conf riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys/riscv: conf riscv X-SVN-Commit-Revision: 352430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 22:17:18 -0000 Author: mhorne Date: Mon Sep 16 22:17:16 2019 New Revision: 352430 URL: https://svnweb.freebsd.org/changeset/base/352430 Log: RISC-V: Support EARLY_AP_STARTUP The EARLY_AP_STARTUP option initializes non-boot processors much sooner during startup. This adds support for this option on RISC-V and enables it by default for GENERIC. Reviewed by: jhb, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21661 Modified: head/sys/riscv/conf/GENERIC head/sys/riscv/riscv/clock.c head/sys/riscv/riscv/mp_machdep.c Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Mon Sep 16 22:02:14 2019 (r352429) +++ head/sys/riscv/conf/GENERIC Mon Sep 16 22:17:16 2019 (r352430) @@ -71,6 +71,7 @@ options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options RCTL # Resource limits options SMP +options EARLY_AP_STARTUP options INTRNG # RISC-V SBI console Modified: head/sys/riscv/riscv/clock.c ============================================================================== --- head/sys/riscv/riscv/clock.c Mon Sep 16 22:02:14 2019 (r352429) +++ head/sys/riscv/riscv/clock.c Mon Sep 16 22:17:16 2019 (r352430) @@ -37,10 +37,34 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include +#include void cpu_initclocks(void) { +#ifdef EARLY_AP_STARTUP + struct thread *td; + int i; + td = curthread; cpu_initclocks_bsp(); + CPU_FOREACH(i) { + if (i == 0) + continue; + thread_lock(td); + sched_bind(td, i); + thread_unlock(td); + cpu_initclocks_ap(); + } + thread_lock(td); + if (sched_is_bound(td)) + sched_unbind(td); + thread_unlock(td); +#else + cpu_initclocks_bsp(); +#endif } Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Mon Sep 16 22:02:14 2019 (r352429) +++ head/sys/riscv/riscv/mp_machdep.c Mon Sep 16 22:17:16 2019 (r352430) @@ -257,8 +257,10 @@ init_secondary(uint64_t hart) /* Enable software interrupts */ riscv_unmask_ipi(); +#ifndef EARLY_AP_STARTUP /* Start per-CPU event timers. */ cpu_initclocks_ap(); +#endif /* Enable external (PLIC) interrupts */ csr_set(sie, SIE_SEIE); From owner-svn-src-head@freebsd.org Mon Sep 16 22:48:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DD13EE9AA; Mon, 16 Sep 2019 22:48:41 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XLy108bHz4FPt; Mon, 16 Sep 2019 22:48:41 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC366271BC; Mon, 16 Sep 2019 22:48:40 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8GMmeVg047831; Mon, 16 Sep 2019 22:48:40 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8GMme2M047830; Mon, 16 Sep 2019 22:48:40 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201909162248.x8GMme2M047830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 16 Sep 2019 22:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352431 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 352431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Sep 2019 22:48:41 -0000 Author: jmg Date: Mon Sep 16 22:48:40 2019 New Revision: 352431 URL: https://svnweb.freebsd.org/changeset/base/352431 Log: fix the article to be correct... Modified: head/libexec/rc/rc.d/growfs Modified: head/libexec/rc/rc.d/growfs ============================================================================== --- head/libexec/rc/rc.d/growfs Mon Sep 16 22:17:16 2019 (r352430) +++ head/libexec/rc/rc.d/growfs Mon Sep 16 22:48:40 2019 (r352431) @@ -31,7 +31,7 @@ # BEFORE: sysctl # KEYWORD: firstboot -# This allows us to distribute a image +# This allows us to distribute an image # and have it work on essentially any size drive. # # TODO: Figure out where this should really be ordered. From owner-svn-src-head@freebsd.org Tue Sep 17 00:22:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B0ECF0AB0; Tue, 17 Sep 2019 00:22:21 +0000 (UTC) (envelope-from dmgk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XP250Qggz4K0g; Tue, 17 Sep 2019 00:22:21 +0000 (UTC) (envelope-from dmgk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E76B83AB; Tue, 17 Sep 2019 00:22:20 +0000 (UTC) (envelope-from dmgk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8H0MK23005313; Tue, 17 Sep 2019 00:22:20 GMT (envelope-from dmgk@FreeBSD.org) Received: (from dmgk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8H0MKf3005312; Tue, 17 Sep 2019 00:22:20 GMT (envelope-from dmgk@FreeBSD.org) Message-Id: <201909170022.x8H0MKf3005312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dmgk set sender to dmgk@FreeBSD.org using -f From: Dmitri Goutnik Date: Tue, 17 Sep 2019 00:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352432 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: dmgk X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 352432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 00:22:21 -0000 Author: dmgk (ports committer) Date: Tue Sep 17 00:22:20 2019 New Revision: 352432 URL: https://svnweb.freebsd.org/changeset/base/352432 Log: Amend r352422, add missing 'n' Reported by: yuripv Approved by: araujo (mentor) Differential Revision: https://reviews.freebsd.org/D21679 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon Sep 16 22:48:40 2019 (r352431) +++ head/share/misc/committers-ports.dot Tue Sep 17 00:22:20 2019 (r352432) @@ -96,7 +96,7 @@ decke [label="Bernhard Froehlich\ndecke@FreeBSD.org\n2 delphij [label="Xin Li\ndelphij@FreeBSD.org\n2006/05/01"] demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"] -dmgk [label="Dmitri Goutnik\dmgk@FreeBSD.org\n2019/09/15"] +dmgk [label="Dmitri Goutnik\ndmgk@FreeBSD.org\n2019/09/15"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"] dteske [label="Devin Teske\ndteske@FreeBSD.org\n2018/03/01"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2017/01/10"] From owner-svn-src-head@freebsd.org Tue Sep 17 02:54:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0CDFF4A74; Tue, 17 Sep 2019 02:54:00 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XSP43X9zz4Qy7; Tue, 17 Sep 2019 02:54:00 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D8DF1EAF; Tue, 17 Sep 2019 02:54:00 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8H2s0pA094732; Tue, 17 Sep 2019 02:54:00 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8H2s02p094731; Tue, 17 Sep 2019 02:54:00 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201909170254.x8H2s02p094731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Tue, 17 Sep 2019 02:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352433 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 352433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 02:54:00 -0000 Author: dougm Date: Tue Sep 17 02:53:59 2019 New Revision: 352433 URL: https://svnweb.freebsd.org/changeset/base/352433 Log: Remove dead code from vm_map_unlink_entry made dead by r351476, and also a no-longer-used enumerant. Reviewed by: alc Approved by: markj (mentor, implicit) Tested by: pho (as part of a larger change) Differential Revision: https://reviews.freebsd.org/D21668 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Sep 17 00:22:20 2019 (r352432) +++ head/sys/vm/vm_map.c Tue Sep 17 02:53:59 2019 (r352433) @@ -1250,7 +1250,6 @@ vm_map_entry_link(vm_map_t map, vm_map_entry_t entry) } enum unlink_merge_type { - UNLINK_MERGE_PREV, UNLINK_MERGE_NONE, UNLINK_MERGE_NEXT }; @@ -1266,17 +1265,9 @@ vm_map_entry_unlink(vm_map_t map, vm_map_entry_t entry KASSERT(root != NULL, ("vm_map_entry_unlink: unlink object not mapped")); + vm_map_splay_findnext(root, &rlist); switch (op) { - case UNLINK_MERGE_PREV: - vm_map_splay_findprev(root, &llist); - llist->end = root->end; - y = root->right; - root = llist; - llist = root->right; - root->right = y; - break; case UNLINK_MERGE_NEXT: - vm_map_splay_findnext(root, &rlist); rlist->start = root->start; rlist->offset = root->offset; y = root->left; @@ -1286,7 +1277,6 @@ vm_map_entry_unlink(vm_map_t map, vm_map_entry_t entry break; case UNLINK_MERGE_NONE: vm_map_splay_findprev(root, &llist); - vm_map_splay_findnext(root, &rlist); if (llist != &map->header) { root = llist; llist = root->right; From owner-svn-src-head@freebsd.org Tue Sep 17 03:39:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 320F8F59FC; Tue, 17 Sep 2019 03:39:32 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XTPc0Nkqz4Swm; Tue, 17 Sep 2019 03:39:32 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E482126B2; Tue, 17 Sep 2019 03:39:31 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8H3dVBh020033; Tue, 17 Sep 2019 03:39:31 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8H3dVnI020032; Tue, 17 Sep 2019 03:39:31 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201909170339.x8H3dVnI020032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Tue, 17 Sep 2019 03:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352434 - in head/sys/mips: include mips X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: in head/sys/mips: include mips X-SVN-Commit-Revision: 352434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 03:39:32 -0000 Author: jah Date: Tue Sep 17 03:39:31 2019 New Revision: 352434 URL: https://svnweb.freebsd.org/changeset/base/352434 Log: mips: move support for temporary mappings above KSEG0 to per-CPU data This is derived from similar work done in r310481 for i386 and r312610 for armv6/armv7. Additionally, use a critical section to keep the thread pinned for per-CPU operations instead of completely disabling local interrupts. No objections from: adrian, jmallett, imp Differential Revision: https://reviews.freebsd.org/D18593 Modified: head/sys/mips/include/pcpu.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pcpu.h ============================================================================== --- head/sys/mips/include/pcpu.h Tue Sep 17 02:53:59 2019 (r352433) +++ head/sys/mips/include/pcpu.h Tue Sep 17 03:39:31 2019 (r352434) @@ -51,7 +51,13 @@ #else #define PCPU_MD_MIPS32_FIELDS \ PCPU_MD_COMMON_FIELDS \ - char __pad[125] + pt_entry_t *pc_cmap1_ptep; /* PTE for copy window 1 KVA */ \ + pt_entry_t *pc_cmap2_ptep; /* PTE for copy window 2 KVA */ \ + vm_offset_t pc_cmap1_addr; /* KVA page for copy window 1 */ \ + vm_offset_t pc_cmap2_addr; /* KVA page for copy window 2 */ \ + vm_offset_t pc_qmap_addr; /* KVA page for temporary mappings */ \ + pt_entry_t *pc_qmap_ptep; /* PTE for temporary mapping KVA */ \ + char __pad[101] #endif #ifdef __mips_n64 Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Tue Sep 17 02:53:59 2019 (r352433) +++ head/sys/mips/mips/pmap.c Tue Sep 17 03:39:31 2019 (r352434) @@ -138,6 +138,8 @@ pd_entry_t *kernel_segmap; vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ +static int need_local_mappings; + static int nkpt; unsigned pmap_max_asid; /* max ASID supported by the system */ @@ -187,104 +189,96 @@ static void pmap_invalidate_range_action(void *arg); static void pmap_update_page_action(void *arg); #ifndef __mips_n64 + +static vm_offset_t crashdumpva; + /* - * This structure is for high memory (memory above 512Meg in 32 bit) support. + * These functions are for high memory (memory above 512Meg in 32 bit) support. * The highmem area does not have a KSEG0 mapping, and we need a mechanism to * do temporary per-CPU mappings for pmap_zero_page, pmap_copy_page etc. * * At bootup, we reserve 2 virtual pages per CPU for mapping highmem pages. To * access a highmem physical address on a CPU, we map the physical address to - * the reserved virtual address for the CPU in the kernel pagetable. This is - * done with interrupts disabled(although a spinlock and sched_pin would be - * sufficient). + * the reserved virtual address for the CPU in the kernel pagetable. */ -struct local_sysmaps { - vm_offset_t base; - uint32_t saved_intr; - uint16_t valid1, valid2; -}; -static struct local_sysmaps sysmap_lmem[MAXCPU]; +static void +pmap_init_reserved_pages(void) +{ + struct pcpu *pc; + vm_offset_t pages; + int i; + + if (need_local_mappings == 0) + return; + + CPU_FOREACH(i) { + pc = pcpu_find(i); + /* + * Skip if the mapping has already been initialized, + * i.e. this is the BSP. + */ + if (pc->pc_cmap1_addr != 0) + continue; + pages = kva_alloc(PAGE_SIZE * 3); + if (pages == 0) + panic("%s: unable to allocate KVA", __func__); + pc->pc_cmap1_ptep = pmap_pte(kernel_pmap, pages); + pc->pc_cmap2_ptep = pmap_pte(kernel_pmap, pages + PAGE_SIZE); + pc->pc_qmap_ptep = + pmap_pte(kernel_pmap, pages + (PAGE_SIZE * 2)); + pc->pc_cmap1_addr = pages; + pc->pc_cmap2_addr = pages + PAGE_SIZE; + pc->pc_qmap_addr = pages + (PAGE_SIZE * 2); + } +} +SYSINIT(rpages_init, SI_SUB_CPU, SI_ORDER_ANY, pmap_init_reserved_pages, NULL); + static __inline void pmap_alloc_lmem_map(void) { - int i; - - for (i = 0; i < MAXCPU; i++) { - sysmap_lmem[i].base = virtual_avail; - virtual_avail += PAGE_SIZE * 2; - sysmap_lmem[i].valid1 = sysmap_lmem[i].valid2 = 0; - } + PCPU_SET(cmap1_addr, virtual_avail); + PCPU_SET(cmap2_addr, virtual_avail + PAGE_SIZE); + PCPU_SET(cmap1_ptep, pmap_pte(kernel_pmap, virtual_avail)); + PCPU_SET(cmap2_ptep, pmap_pte(kernel_pmap, virtual_avail + PAGE_SIZE)); + PCPU_SET(qmap_addr, virtual_avail + (2 * PAGE_SIZE)); + PCPU_SET(qmap_ptep, pmap_pte(kernel_pmap, virtual_avail + (2 * PAGE_SIZE))); + crashdumpva = virtual_avail + (3 * PAGE_SIZE); + virtual_avail += PAGE_SIZE * 4; } static __inline vm_offset_t pmap_lmem_map1(vm_paddr_t phys) { - struct local_sysmaps *sysm; - pt_entry_t *pte, npte; - vm_offset_t va; - uint32_t intr; - int cpu; - - intr = intr_disable(); - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; - sysm->saved_intr = intr; - va = sysm->base; - npte = TLBLO_PA_TO_PFN(phys) | PTE_C_CACHE | PTE_D | PTE_V | PTE_G; - pte = pmap_pte(kernel_pmap, va); - *pte = npte; - sysm->valid1 = 1; - return (va); + critical_enter(); + *PCPU_GET(cmap1_ptep) = + TLBLO_PA_TO_PFN(phys) | PTE_C_CACHE | PTE_D | PTE_V | PTE_G; + return (PCPU_GET(cmap1_addr)); } static __inline vm_offset_t pmap_lmem_map2(vm_paddr_t phys1, vm_paddr_t phys2) { - struct local_sysmaps *sysm; - pt_entry_t *pte, npte; - vm_offset_t va1, va2; - uint32_t intr; - int cpu; - - intr = intr_disable(); - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; - sysm->saved_intr = intr; - va1 = sysm->base; - va2 = sysm->base + PAGE_SIZE; - npte = TLBLO_PA_TO_PFN(phys1) | PTE_C_CACHE | PTE_D | PTE_V | PTE_G; - pte = pmap_pte(kernel_pmap, va1); - *pte = npte; - npte = TLBLO_PA_TO_PFN(phys2) | PTE_C_CACHE | PTE_D | PTE_V | PTE_G; - pte = pmap_pte(kernel_pmap, va2); - *pte = npte; - sysm->valid1 = 1; - sysm->valid2 = 1; - return (va1); + critical_enter(); + *PCPU_GET(cmap1_ptep) = + TLBLO_PA_TO_PFN(phys1) | PTE_C_CACHE | PTE_D | PTE_V | PTE_G; + *PCPU_GET(cmap2_ptep) = + TLBLO_PA_TO_PFN(phys2) | PTE_C_CACHE | PTE_D | PTE_V | PTE_G; + return (PCPU_GET(cmap1_addr)); } static __inline void pmap_lmem_unmap(void) { - struct local_sysmaps *sysm; - pt_entry_t *pte; - int cpu; - - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; - pte = pmap_pte(kernel_pmap, sysm->base); - *pte = PTE_G; - tlb_invalidate_address(kernel_pmap, sysm->base); - sysm->valid1 = 0; - if (sysm->valid2) { - pte = pmap_pte(kernel_pmap, sysm->base + PAGE_SIZE); - *pte = PTE_G; - tlb_invalidate_address(kernel_pmap, sysm->base + PAGE_SIZE); - sysm->valid2 = 0; - } - intr_restore(sysm->saved_intr); + *PCPU_GET(cmap1_ptep) = PTE_G; + tlb_invalidate_address(kernel_pmap, PCPU_GET(cmap1_addr)); + if (*PCPU_GET(cmap2_ptep) != PTE_G) { + *PCPU_GET(cmap2_ptep) = PTE_G; + tlb_invalidate_address(kernel_pmap, PCPU_GET(cmap2_addr)); + } + critical_exit(); } + #else /* __mips_n64 */ static __inline void @@ -495,7 +489,6 @@ void pmap_bootstrap(void) { int i; - int need_local_mappings = 0; /* Sort. */ again: @@ -588,9 +581,9 @@ again: printf("pcpu is available at virtual address %p.\n", pcpup); #endif + pmap_create_kernel_pagetable(); if (need_local_mappings) pmap_alloc_lmem_map(); - pmap_create_kernel_pagetable(); pmap_max_asid = VMNUM_PIDS; mips_wr_entryhi(0); mips_wr_pagemask(0); @@ -2381,28 +2374,16 @@ pmap_kenter_temporary(vm_paddr_t pa, int i) va = MIPS_PHYS_TO_DIRECT(pa); } else { #ifndef __mips_n64 /* XXX : to be converted to new style */ - int cpu; - register_t intr; - struct local_sysmaps *sysm; pt_entry_t *pte, npte; - /* If this is used other than for dumps, we may need to leave - * interrupts disasbled on return. If crash dumps don't work when - * we get to this point, we might want to consider this (leaving things - * disabled as a starting point ;-) - */ - intr = intr_disable(); - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; + pte = pmap_pte(kernel_pmap, crashdumpva); + /* Since this is for the debugger, no locks or any other fun */ npte = TLBLO_PA_TO_PFN(pa) | PTE_C_CACHE | PTE_D | PTE_V | PTE_G; - pte = pmap_pte(kernel_pmap, sysm->base); *pte = npte; - sysm->valid1 = 1; - pmap_update_page(kernel_pmap, sysm->base, npte); - va = sysm->base; - intr_restore(intr); + pmap_update_page(kernel_pmap, crashdumpva, npte); + va = crashdumpva; #endif } return ((void *)va); @@ -2411,29 +2392,17 @@ pmap_kenter_temporary(vm_paddr_t pa, int i) void pmap_kenter_temporary_free(vm_paddr_t pa) { -#ifndef __mips_n64 /* XXX : to be converted to new style */ - int cpu; - register_t intr; - struct local_sysmaps *sysm; -#endif - + #ifndef __mips_n64 /* XXX : to be converted to new style */ + pt_entry_t *pte; + #endif if (MIPS_DIRECT_MAPPABLE(pa)) { /* nothing to do for this case */ return; } #ifndef __mips_n64 /* XXX : to be converted to new style */ - cpu = PCPU_GET(cpuid); - sysm = &sysmap_lmem[cpu]; - if (sysm->valid1) { - pt_entry_t *pte; - - intr = intr_disable(); - pte = pmap_pte(kernel_pmap, sysm->base); - *pte = PTE_G; - pmap_invalidate_page(kernel_pmap, sysm->base); - intr_restore(intr); - sysm->valid1 = 0; - } + pte = pmap_pte(kernel_pmap, crashdumpva); + *pte = PTE_G; + pmap_invalidate_page(kernel_pmap, crashdumpva); #endif } @@ -2687,8 +2656,8 @@ pmap_quick_enter_page(vm_page_t m) #if defined(__mips_n64) return MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m)); #else + vm_offset_t qaddr; vm_paddr_t pa; - struct local_sysmaps *sysm; pt_entry_t *pte, npte; pa = VM_PAGE_TO_PHYS(m); @@ -2700,17 +2669,16 @@ pmap_quick_enter_page(vm_page_t m) return (MIPS_PHYS_TO_DIRECT(pa)); } critical_enter(); - sysm = &sysmap_lmem[PCPU_GET(cpuid)]; + qaddr = PCPU_GET(qmap_addr); + pte = PCPU_GET(qmap_ptep); - KASSERT(sysm->valid1 == 0, ("pmap_quick_enter_page: PTE busy")); + KASSERT(*pte == PTE_G, ("pmap_quick_enter_page: PTE busy")); - pte = pmap_pte(kernel_pmap, sysm->base); npte = TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G; PMAP_PTE_SET_CACHE_BITS(npte, pa, m); *pte = npte; - sysm->valid1 = 1; - return (sysm->base); + return (qaddr); #endif } @@ -2720,23 +2688,20 @@ pmap_quick_remove_page(vm_offset_t addr) mips_dcache_wbinv_range(addr, PAGE_SIZE); #if !defined(__mips_n64) - struct local_sysmaps *sysm; pt_entry_t *pte; if (addr >= MIPS_KSEG0_START && addr < MIPS_KSEG0_END) return; - sysm = &sysmap_lmem[PCPU_GET(cpuid)]; + pte = PCPU_GET(qmap_ptep); - KASSERT(sysm->valid1 != 0, + KASSERT(*pte != PTE_G, ("pmap_quick_remove_page: PTE not in use")); - KASSERT(sysm->base == addr, + KASSERT(PCPU_GET(qmap_addr) == addr, ("pmap_quick_remove_page: invalid address")); - pte = pmap_pte(kernel_pmap, addr); *pte = PTE_G; tlb_invalidate_address(kernel_pmap, addr); - sysm->valid1 = 0; critical_exit(); #endif } From owner-svn-src-head@freebsd.org Tue Sep 17 08:09:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDACDFB69A; Tue, 17 Sep 2019 08:09:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XbPH62kNz3C40; Tue, 17 Sep 2019 08:09:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE56C586A; Tue, 17 Sep 2019 08:09:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8H89dJM079227; Tue, 17 Sep 2019 08:09:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8H89ddk079226; Tue, 17 Sep 2019 08:09:39 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909170809.x8H89ddk079226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 17 Sep 2019 08:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352437 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 08:09:40 -0000 Author: mjg Date: Tue Sep 17 08:09:39 2019 New Revision: 352437 URL: https://svnweb.freebsd.org/changeset/base/352437 Log: vfs: fix braino resulting in NULL pointer deref in r352424 The breakage was added after all the testing and the testing which followed was not sufficient to find it. Reported by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Tue Sep 17 06:08:15 2019 (r352436) +++ head/sys/kern/vfs_default.c Tue Sep 17 08:09:39 2019 (r352437) @@ -613,11 +613,13 @@ vop_stdgetwritemount(ap) vfs_op_thread_exit(mp); } else { MNT_ILOCK(mp); - if (mp == vp->v_mount) + if (mp == vp->v_mount) { MNT_REF(mp); - else + MNT_IUNLOCK(mp); + } else { + MNT_IUNLOCK(mp); mp = NULL; - MNT_IUNLOCK(mp); + } } *(ap->a_mpp) = mp; return (0); From owner-svn-src-head@freebsd.org Tue Sep 17 08:56:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1171EFC206; Tue, 17 Sep 2019 08:56:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46XcRh5qp9z3F6N; Tue, 17 Sep 2019 08:56:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x8H8ufiJ095262 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 17 Sep 2019 11:56:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x8H8ufiJ095262 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x8H8uf9w095261; Tue, 17 Sep 2019 11:56:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 17 Sep 2019 11:56:41 +0300 From: Konstantin Belousov To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352421 - head/stand/libsa Message-ID: <20190917085641.GY2559@kib.kiev.ua> References: <201909162028.x8GKS9jK064079@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909162028.x8GKS9jK064079@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46XcRh5qp9z3F6N X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 08:56:49 -0000 On Mon, Sep 16, 2019 at 08:28:09PM +0000, Toomas Soome wrote: > Author: tsoome > Date: Mon Sep 16 20:28:08 2019 > New Revision: 352421 > URL: https://svnweb.freebsd.org/changeset/base/352421 > > Log: > loader: Malloc(0) should return NULL. > > We really should not allocate anything with size 0. Why ? This is quite unexpected from other environments, where malloc(0) returns unique object. > > Modified: > head/stand/libsa/zalloc_malloc.c > > Modified: head/stand/libsa/zalloc_malloc.c > ============================================================================== > --- head/stand/libsa/zalloc_malloc.c Mon Sep 16 20:26:53 2019 (r352420) > +++ head/stand/libsa/zalloc_malloc.c Mon Sep 16 20:28:08 2019 (r352421) > @@ -55,6 +55,9 @@ Malloc(size_t bytes, const char *file, int line) > { > Guard *res; > > + if (bytes == 0) > + return (NULL); > + > #ifdef USEENDGUARD > bytes += MALLOCALIGN + 1; > #else From owner-svn-src-head@freebsd.org Tue Sep 17 09:05:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8979FC671 for ; Tue, 17 Sep 2019 09:05:36 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-hyfv10011601.me.com (pv50p00im-hyfv10011601.me.com [17.58.6.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xcdr18Z5z3FZl for ; Tue, 17 Sep 2019 09:05:36 +0000 (UTC) (envelope-from tsoome@me.com) Received: from [192.168.150.41] (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-hyfv10011601.me.com (Postfix) with ESMTPSA id 6319F380397; Tue, 17 Sep 2019 09:05:31 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r352421 - head/stand/libsa From: Toomas Soome In-Reply-To: <20190917085641.GY2559@kib.kiev.ua> Date: Tue, 17 Sep 2019 12:05:26 +0300 Cc: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6762A429-F17F-46D1-A55B-BD9C627D6903@me.com> References: <201909162028.x8GKS9jK064079@repo.freebsd.org> <20190917085641.GY2559@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.104.11) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-09-17_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=476 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909170097 X-Rspamd-Queue-Id: 46Xcdr18Z5z3FZl X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.20 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[me.com]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; MV_CASE(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_IN_DNSWL_MED(-0.20)[43.6.58.17.list.dnswl.org : 127.0.5.2]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-5.74), ipnet: 17.58.0.0/20(-3.33), asn: 714(-2.91), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[me.com]; ASN(0.00)[asn:714, ipnet:17.58.0.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[me.com.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 09:05:37 -0000 > On 17 Sep 2019, at 11:56, Konstantin Belousov = wrote: >=20 > On Mon, Sep 16, 2019 at 08:28:09PM +0000, Toomas Soome wrote: >> Author: tsoome >> Date: Mon Sep 16 20:28:08 2019 >> New Revision: 352421 >> URL: https://svnweb.freebsd.org/changeset/base/352421 >>=20 >> Log: >> loader: Malloc(0) should return NULL. >>=20 >> We really should not allocate anything with size 0. > Why ? This is quite unexpected from other environments, where > malloc(0) returns unique object. >=20 Hiding bugs. And, we are not getting unique object, we are getting chunk = of memory with payload length of 0 and the memory content depends on if = head and tail guards are used - the chunk is with size at least = MALLOCALIGN (16 or 64 bytes) and the chunk is from random location of = heap. rgds, toomas= From owner-svn-src-head@freebsd.org Tue Sep 17 09:46:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B54C5FD22C; Tue, 17 Sep 2019 09:46:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XdYH4HDhz3HXJ; Tue, 17 Sep 2019 09:46:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 726096A03; Tue, 17 Sep 2019 09:46:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8H9khRM037961; Tue, 17 Sep 2019 09:46:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8H9khmT037960; Tue, 17 Sep 2019 09:46:43 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909170946.x8H9khmT037960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 17 Sep 2019 09:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352438 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 09:46:43 -0000 Author: tuexen Date: Tue Sep 17 09:46:42 2019 New Revision: 352438 URL: https://svnweb.freebsd.org/changeset/base/352438 Log: Only allow a SCTP-AUTH shared key to be updated by the application if it is not deactivated and not used. This avoids a use-after-free problem. Reported by: da_cheng_shao@yeah.net MFC after: 3 days Modified: head/sys/netinet/sctp_auth.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Tue Sep 17 08:09:39 2019 (r352437) +++ head/sys/netinet/sctp_auth.c Tue Sep 17 09:46:42 2019 (r352438) @@ -523,7 +523,7 @@ sctp_insert_sharedkey(struct sctp_keyhead *shared_keys } else if (new_skey->keyid == skey->keyid) { /* replace the existing key */ /* verify this key *can* be replaced */ - if ((skey->deactivated) && (skey->refcount > 1)) { + if ((skey->deactivated) || (skey->refcount > 1)) { SCTPDBG(SCTP_DEBUG_AUTH1, "can't replace shared key id %u\n", new_skey->keyid); From owner-svn-src-head@freebsd.org Tue Sep 17 09:47:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1252FD2A6; Tue, 17 Sep 2019 09:47:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XdZH4DvQz3HgH; Tue, 17 Sep 2019 09:47:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75B956A04; Tue, 17 Sep 2019 09:47:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8H9lZ3r038046; Tue, 17 Sep 2019 09:47:35 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8H9lZe6038045; Tue, 17 Sep 2019 09:47:35 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909170947.x8H9lZe6038045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 17 Sep 2019 09:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352439 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 352439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 09:47:35 -0000 Author: tsoome Date: Tue Sep 17 09:47:35 2019 New Revision: 352439 URL: https://svnweb.freebsd.org/changeset/base/352439 Log: loader: factor out guard location setup from Realloc To simplify and make it easier to read, use ga_Bytes field from guard structure. Modified: head/stand/libsa/zalloc_malloc.c Modified: head/stand/libsa/zalloc_malloc.c ============================================================================== --- head/stand/libsa/zalloc_malloc.c Tue Sep 17 09:46:42 2019 (r352438) +++ head/stand/libsa/zalloc_malloc.c Tue Sep 17 09:47:35 2019 (r352439) @@ -156,7 +156,9 @@ Realloc(void *ptr, size_t size, const char *file, int if ((res = Malloc(size, file, line)) != NULL) { if (ptr) { - old = *(size_t *)((char *)ptr - MALLOCALIGN) - MALLOCALIGN; + Guard *g = (Guard *)((char *)ptr - MALLOCALIGN); + + old = g->ga_Bytes - MALLOCALIGN; if (old < size) bcopy(ptr, res, old); else From owner-svn-src-head@freebsd.org Tue Sep 17 11:35:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1B2812121A; Tue, 17 Sep 2019 11:35:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XgzG6tsQz3Pxm; Tue, 17 Sep 2019 11:35:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCA2C7D2F; Tue, 17 Sep 2019 11:35:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HBZst4002707; Tue, 17 Sep 2019 11:35:54 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HBZrKt002702; Tue, 17 Sep 2019 11:35:54 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909171135.x8HBZrKt002702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 17 Sep 2019 11:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352443 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 352443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 11:35:55 -0000 Author: tsoome Date: Tue Sep 17 11:35:53 2019 New Revision: 352443 URL: https://svnweb.freebsd.org/changeset/base/352443 Log: loader: cstyle cleanup libsa zalloc sources Clean up libstand zalloc* sources. Note that it is not 100% whitespace cleanup. I also reduced block in znalloc and zfree as those were obvious simplifications and did help to save one level of indent. Modified: head/stand/libsa/zalloc.c head/stand/libsa/zalloc_defs.h head/stand/libsa/zalloc_malloc.c head/stand/libsa/zalloc_mem.h head/stand/libsa/zalloc_protos.h Modified: head/stand/libsa/zalloc.c ============================================================================== --- head/stand/libsa/zalloc.c Tue Sep 17 11:20:53 2019 (r352442) +++ head/stand/libsa/zalloc.c Tue Sep 17 11:35:53 2019 (r352443) @@ -1,5 +1,5 @@ /* - * This module derived from code donated to the FreeBSD Project by + * This module derived from code donated to the FreeBSD Project by * Matthew Dillon * * Copyright (c) 1998 The FreeBSD Project @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); /* - * LIB/MEMORY/ZALLOC.C - self contained low-overhead memory pool/allocation + * LIB/MEMORY/ZALLOC.C - self contained low-overhead memory pool/allocation * subsystem * - * This subsystem implements memory pools and memory allocation + * This subsystem implements memory pools and memory allocation * routines. * * Pools are managed via a linked list of 'free' areas. Allocating @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); * to allocate the entire pool without incuring any structural overhead. * * The system works best when allocating similarly-sized chunks of - * memory. Care must be taken to avoid fragmentation when + * memory. Care must be taken to avoid fragmentation when * allocating/deallocating dissimilar chunks. * * When a memory pool is first allocated, the entire pool is marked as @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); * available. * * z[n]xalloc() works like z[n]alloc() but the allocation is made from - * within the specified address range. If the segment could not be + * within the specified address range. If the segment could not be * allocated, NULL is returned. WARNING! The address range will be * aligned to an 8 or 16 byte boundry depending on the cpu so if you * give an unaligned address range, unexpected results may occur. @@ -88,56 +88,54 @@ typedef char assert_align[(sizeof(struct MemNode) <= M void * znalloc(MemPool *mp, uintptr_t bytes) { - /* - * align according to pool object size (can be 0). This is - * inclusive of the MEMNODE_SIZE_MASK minimum alignment. - * - */ - bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; - - if (bytes == 0) - return((void *)-1); - - /* - * locate freelist entry big enough to hold the object. If all objects - * are the same size, this is a constant-time function. - */ - - if (bytes <= mp->mp_Size - mp->mp_Used) { MemNode **pmn; MemNode *mn; - for (pmn = &mp->mp_First; (mn=*pmn) != NULL; pmn = &mn->mr_Next) { - if (bytes > mn->mr_Bytes) - continue; + /* + * align according to pool object size (can be 0). This is + * inclusive of the MEMNODE_SIZE_MASK minimum alignment. + * + */ + bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; - /* - * Cut a chunk of memory out of the beginning of this - * block and fixup the link appropriately. - */ + if (bytes == 0) + return ((void *)-1); - { + /* + * locate freelist entry big enough to hold the object. If all objects + * are the same size, this is a constant-time function. + */ + + if (bytes > mp->mp_Size - mp->mp_Used) + return (NULL); + + for (pmn = &mp->mp_First; (mn = *pmn) != NULL; pmn = &mn->mr_Next) { char *ptr = (char *)mn; + if (bytes > mn->mr_Bytes) + continue; + + /* + * Cut a chunk of memory out of the beginning of this + * block and fixup the link appropriately. + */ if (mn->mr_Bytes == bytes) { - *pmn = mn->mr_Next; + *pmn = mn->mr_Next; } else { - mn = (MemNode *)((char *)mn + bytes); - mn->mr_Next = ((MemNode *)ptr)->mr_Next; - mn->mr_Bytes = ((MemNode *)ptr)->mr_Bytes - bytes; - *pmn = mn; + mn = (MemNode *)((char *)mn + bytes); + mn->mr_Next = ((MemNode *)ptr)->mr_Next; + mn->mr_Bytes = ((MemNode *)ptr)->mr_Bytes - bytes; + *pmn = mn; } mp->mp_Used += bytes; return(ptr); - } } - } - /* - * Memory pool is full, return NULL. - */ + /* + * Memory pool is full, return NULL. + */ - return(NULL); + return (NULL); } /* @@ -147,99 +145,97 @@ znalloc(MemPool *mp, uintptr_t bytes) void zfree(MemPool *mp, void *ptr, uintptr_t bytes) { - /* - * align according to pool object size (can be 0). This is - * inclusive of the MEMNODE_SIZE_MASK minimum alignment. - */ - bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; + MemNode **pmn; + MemNode *mn; - if (bytes == 0) - return; + /* + * align according to pool object size (can be 0). This is + * inclusive of the MEMNODE_SIZE_MASK minimum alignment. + */ + bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; - /* - * panic if illegal pointer - */ + if (bytes == 0) + return; - if ((char *)ptr < (char *)mp->mp_Base || - (char *)ptr + bytes > (char *)mp->mp_End || - ((uintptr_t)ptr & MEMNODE_SIZE_MASK) != 0) - panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes); + /* + * panic if illegal pointer + */ - /* - * free the segment - */ + if ((char *)ptr < (char *)mp->mp_Base || + (char *)ptr + bytes > (char *)mp->mp_End || + ((uintptr_t)ptr & MEMNODE_SIZE_MASK) != 0) + panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes); - { - MemNode **pmn; - MemNode *mn; - + /* + * free the segment + */ mp->mp_Used -= bytes; for (pmn = &mp->mp_First; (mn = *pmn) != NULL; pmn = &mn->mr_Next) { - /* - * If area between last node and current node - * - check range - * - check merge with next area - * - check merge with previous area - */ - if ((char *)ptr <= (char *)mn) { /* - * range check + * If area between last node and current node + * - check range + * - check merge with next area + * - check merge with previous area */ - if ((char *)ptr + bytes > (char *)mn) { - panic("zfree(%p,%ju): corrupt memlist1", ptr, - (uintmax_t)bytes); - } + if ((char *)ptr <= (char *)mn) { + /* + * range check + */ + if ((char *)ptr + bytes > (char *)mn) { + panic("zfree(%p,%ju): corrupt memlist1", ptr, + (uintmax_t)bytes); + } - /* - * merge against next area or create independant area - */ + /* + * merge against next area or create independant area + */ - if ((char *)ptr + bytes == (char *)mn) { - ((MemNode *)ptr)->mr_Next = mn->mr_Next; - ((MemNode *)ptr)->mr_Bytes= bytes + mn->mr_Bytes; - } else { - ((MemNode *)ptr)->mr_Next = mn; - ((MemNode *)ptr)->mr_Bytes= bytes; - } - *pmn = mn = (MemNode *)ptr; + if ((char *)ptr + bytes == (char *)mn) { + ((MemNode *)ptr)->mr_Next = mn->mr_Next; + ((MemNode *)ptr)->mr_Bytes = + bytes + mn->mr_Bytes; + } else { + ((MemNode *)ptr)->mr_Next = mn; + ((MemNode *)ptr)->mr_Bytes = bytes; + } + *pmn = mn = (MemNode *)ptr; - /* - * merge against previous area (if there is a previous - * area). - */ + /* + * merge against previous area (if there is a previous + * area). + */ - if (pmn != &mp->mp_First) { - if ((char*)pmn + ((MemNode*)pmn)->mr_Bytes == (char*)ptr) { - ((MemNode *)pmn)->mr_Next = mn->mr_Next; - ((MemNode *)pmn)->mr_Bytes += mn->mr_Bytes; - mn = (MemNode *)pmn; - } + if (pmn != &mp->mp_First) { + if ((char *)pmn + ((MemNode*)pmn)->mr_Bytes == + (char *)ptr) { + ((MemNode *)pmn)->mr_Next = mn->mr_Next; + ((MemNode *)pmn)->mr_Bytes += + mn->mr_Bytes; + mn = (MemNode *)pmn; + } + } + return; } - return; - /* NOT REACHED */ - } - if ((char *)ptr < (char *)mn + mn->mr_Bytes) { - panic("zfree(%p,%ju): corrupt memlist2", ptr, - (uintmax_t)bytes); - } + if ((char *)ptr < (char *)mn + mn->mr_Bytes) { + panic("zfree(%p,%ju): corrupt memlist2", ptr, + (uintmax_t)bytes); + } } /* * We are beyond the last MemNode, append new MemNode. Merge against * previous area if possible. */ - if (pmn == &mp->mp_First || - (char *)pmn + ((MemNode *)pmn)->mr_Bytes != (char *)ptr - ) { - ((MemNode *)ptr)->mr_Next = NULL; - ((MemNode *)ptr)->mr_Bytes = bytes; - *pmn = (MemNode *)ptr; - mn = (MemNode *)ptr; + if (pmn == &mp->mp_First || + (char *)pmn + ((MemNode *)pmn)->mr_Bytes != (char *)ptr) { + ((MemNode *)ptr)->mr_Next = NULL; + ((MemNode *)ptr)->mr_Bytes = bytes; + *pmn = (MemNode *)ptr; + mn = (MemNode *)ptr; } else { - ((MemNode *)pmn)->mr_Bytes += bytes; - mn = (MemNode *)pmn; + ((MemNode *)pmn)->mr_Bytes += bytes; + mn = (MemNode *)pmn; } - } } /* @@ -256,26 +252,26 @@ zfree(MemPool *mp, void *ptr, uintptr_t bytes) void zextendPool(MemPool *mp, void *base, uintptr_t bytes) { - if (mp->mp_Size == 0) { - mp->mp_Base = base; - mp->mp_Used = bytes; - mp->mp_End = (char *)base + bytes; - mp->mp_Size = bytes; - } else { - void *pend = (char *)mp->mp_Base + mp->mp_Size; + if (mp->mp_Size == 0) { + mp->mp_Base = base; + mp->mp_Used = bytes; + mp->mp_End = (char *)base + bytes; + mp->mp_Size = bytes; + } else { + void *pend = (char *)mp->mp_Base + mp->mp_Size; - if (base < mp->mp_Base) { - mp->mp_Size += (char *)mp->mp_Base - (char *)base; - mp->mp_Used += (char *)mp->mp_Base - (char *)base; - mp->mp_Base = base; + if (base < mp->mp_Base) { + mp->mp_Size += (char *)mp->mp_Base - (char *)base; + mp->mp_Used += (char *)mp->mp_Base - (char *)base; + mp->mp_Base = base; + } + base = (char *)base + bytes; + if (base > pend) { + mp->mp_Size += (char *)base - (char *)pend; + mp->mp_Used += (char *)base - (char *)pend; + mp->mp_End = (char *)base; + } } - base = (char *)base + bytes; - if (base > pend) { - mp->mp_Size += (char *)base - (char *)pend; - mp->mp_Used += (char *)base - (char *)pend; - mp->mp_End = (char *)base; - } - } } #ifdef ZALLOCDEBUG @@ -283,34 +279,32 @@ zextendPool(MemPool *mp, void *base, uintptr_t bytes) void zallocstats(MemPool *mp) { - int abytes = 0; - int hbytes = 0; - int fcount = 0; - MemNode *mn; + int abytes = 0; + int hbytes = 0; + int fcount = 0; + MemNode *mn; - printf("%d bytes reserved", (int) mp->mp_Size); + printf("%d bytes reserved", (int)mp->mp_Size); - mn = mp->mp_First; + mn = mp->mp_First; - if ((void *)mn != (void *)mp->mp_Base) { - abytes += (char *)mn - (char *)mp->mp_Base; - } + if ((void *)mn != (void *)mp->mp_Base) { + abytes += (char *)mn - (char *)mp->mp_Base; + } - while (mn) { - if ((char *)mn + mn->mr_Bytes != mp->mp_End) { - hbytes += mn->mr_Bytes; - ++fcount; + while (mn != NULL) { + if ((char *)mn + mn->mr_Bytes != mp->mp_End) { + hbytes += mn->mr_Bytes; + ++fcount; + } + if (mn->mr_Next != NULL) { + abytes += (char *)mn->mr_Next - + ((char *)mn + mn->mr_Bytes); + } + mn = mn->mr_Next; } - if (mn->mr_Next) - abytes += (char *)mn->mr_Next - ((char *)mn + mn->mr_Bytes); - mn = mn->mr_Next; - } - printf(" %d bytes allocated\n%d fragments (%d bytes fragmented)\n", - abytes, - fcount, - hbytes - ); + printf(" %d bytes allocated\n%d fragments (%d bytes fragmented)\n", + abytes, fcount, hbytes); } #endif - Modified: head/stand/libsa/zalloc_defs.h ============================================================================== --- head/stand/libsa/zalloc_defs.h Tue Sep 17 11:20:53 2019 (r352442) +++ head/stand/libsa/zalloc_defs.h Tue Sep 17 11:35:53 2019 (r352443) @@ -1,5 +1,5 @@ /* - * This module derived from code donated to the FreeBSD Project by + * This module derived from code donated to the FreeBSD Project by * Matthew Dillon * * Copyright (c) 1998 The FreeBSD Project @@ -33,23 +33,26 @@ * DEFS.H */ -#define USEGUARD /* use stard/end guard bytes */ -#define USEENDGUARD -#define DMALLOCDEBUG /* add debugging code to gather stats */ -#define ZALLOCDEBUG +#ifndef _ZALLOC_DEFS_H +#define _ZALLOC_DEFS_H +#define USEGUARD /* use stard/end guard bytes */ +#define USEENDGUARD +#define DMALLOCDEBUG /* add debugging code to gather stats */ +#define ZALLOCDEBUG + #include #include "stand.h" #include "zalloc_mem.h" -#define Library extern +#define Library extern /* * block extension for sbrk() */ -#define BLKEXTEND (4 * 1024) -#define BLKEXTENDMASK (BLKEXTEND - 1) +#define BLKEXTEND (4 * 1024) +#define BLKEXTENDMASK (BLKEXTEND - 1) /* * Required malloc alignment. @@ -68,11 +71,13 @@ #define MALLOCALIGN_MASK (MALLOCALIGN - 1) typedef struct Guard { - size_t ga_Bytes; - size_t ga_Magic; /* must be at least 32 bits */ + size_t ga_Bytes; + size_t ga_Magic; /* must be at least 32 bits */ } Guard; -#define GAMAGIC 0x55FF44FD -#define GAFREE 0x5F54F4DF +#define GAMAGIC 0x55FF44FD +#define GAFREE 0x5F54F4DF #include "zalloc_protos.h" + +#endif /* _ZALLOC_DEFS_H */ Modified: head/stand/libsa/zalloc_malloc.c ============================================================================== --- head/stand/libsa/zalloc_malloc.c Tue Sep 17 11:20:53 2019 (r352442) +++ head/stand/libsa/zalloc_malloc.c Tue Sep 17 11:35:53 2019 (r352443) @@ -1,5 +1,5 @@ /* - * This module derived from code donated to the FreeBSD Project by + * This module derived from code donated to the FreeBSD Project by * Matthew Dillon * * Copyright (c) 1998 The FreeBSD Project @@ -53,141 +53,145 @@ void mallocstats(void); void * Malloc(size_t bytes, const char *file, int line) { - Guard *res; + Guard *res; - if (bytes == 0) - return (NULL); + if (bytes == 0) + return (NULL); #ifdef USEENDGUARD - bytes += MALLOCALIGN + 1; + bytes += MALLOCALIGN + 1; #else - bytes += MALLOCALIGN; + bytes += MALLOCALIGN; #endif - while ((res = znalloc(&MallocPool, bytes)) == NULL) { - int incr = (bytes + BLKEXTENDMASK) & ~BLKEXTENDMASK; - char *base; + while ((res = znalloc(&MallocPool, bytes)) == NULL) { + int incr = (bytes + BLKEXTENDMASK) & ~BLKEXTENDMASK; + char *base; - if ((base = sbrk(incr)) == (char *)-1) - return(NULL); - zextendPool(&MallocPool, base, incr); - zfree(&MallocPool, base, incr); - } + if ((base = sbrk(incr)) == (char *)-1) + return (NULL); + zextendPool(&MallocPool, base, incr); + zfree(&MallocPool, base, incr); + } #ifdef DMALLOCDEBUG - if (++MallocCount > MallocMax) - MallocMax = MallocCount; + if (++MallocCount > MallocMax) + MallocMax = MallocCount; #endif #ifdef USEGUARD - res->ga_Magic = GAMAGIC; + res->ga_Magic = GAMAGIC; #endif - res->ga_Bytes = bytes; + res->ga_Bytes = bytes; #ifdef USEENDGUARD - *((signed char *)res + bytes - 1) = -2; + *((signed char *)res + bytes - 1) = -2; #endif - return((char *)res + MALLOCALIGN); + return ((char *)res + MALLOCALIGN); } void Free(void *ptr, const char *file, int line) { - size_t bytes; + size_t bytes; - if (ptr != NULL) { - Guard *res = (void *)((char *)ptr - MALLOCALIGN); + if (ptr != NULL) { + Guard *res = (void *)((char *)ptr - MALLOCALIGN); - if (file == NULL) - file = "unknown"; + if (file == NULL) + file = "unknown"; #ifdef USEGUARD - if (res->ga_Magic == GAFREE) { - printf("free: duplicate free @ %p from %s:%d\n", ptr, file, line); - return; - } - if (res->ga_Magic != GAMAGIC) - panic("free: guard1 fail @ %p from %s:%d", ptr, file, line); - res->ga_Magic = GAFREE; + if (res->ga_Magic == GAFREE) { + printf("free: duplicate free @ %p from %s:%d\n", + ptr, file, line); + return; + } + if (res->ga_Magic != GAMAGIC) + panic("free: guard1 fail @ %p from %s:%d", + ptr, file, line); + res->ga_Magic = GAFREE; #endif #ifdef USEENDGUARD - if (*((signed char *)res + res->ga_Bytes - 1) == -1) { - printf("free: duplicate2 free @ %p from %s:%d\n", ptr, file, line); - return; - } - if (*((signed char *)res + res->ga_Bytes - 1) != -2) - panic("free: guard2 fail @ %p + %zu from %s:%d", ptr, res->ga_Bytes - MALLOCALIGN, file, line); - *((signed char *)res + res->ga_Bytes - 1) = -1; + if (*((signed char *)res + res->ga_Bytes - 1) == -1) { + printf("free: duplicate2 free @ %p from %s:%d\n", + ptr, file, line); + return; + } + if (*((signed char *)res + res->ga_Bytes - 1) != -2) + panic("free: guard2 fail @ %p + %zu from %s:%d", + ptr, res->ga_Bytes - MALLOCALIGN, file, line); + *((signed char *)res + res->ga_Bytes - 1) = -1; #endif - bytes = res->ga_Bytes; - zfree(&MallocPool, res, bytes); + bytes = res->ga_Bytes; + zfree(&MallocPool, res, bytes); #ifdef DMALLOCDEBUG - --MallocCount; + --MallocCount; #endif - } + } } void * Calloc(size_t n1, size_t n2, const char *file, int line) { - uintptr_t bytes = (uintptr_t)n1 * (uintptr_t)n2; - void *res; + uintptr_t bytes = (uintptr_t)n1 * (uintptr_t)n2; + void *res; - if ((res = Malloc(bytes, file, line)) != NULL) { - bzero(res, bytes); + if ((res = Malloc(bytes, file, line)) != NULL) { + bzero(res, bytes); #ifdef DMALLOCDEBUG - if (++MallocCount > MallocMax) - MallocMax = MallocCount; + if (++MallocCount > MallocMax) + MallocMax = MallocCount; #endif - } - return(res); + } + return (res); } /* * realloc() - I could be fancier here and free the old buffer before - * allocating the new one (saving potential fragmentation + * allocating the new one (saving potential fragmentation * and potential buffer copies). But I don't bother. */ void * Realloc(void *ptr, size_t size, const char *file, int line) { - void *res; - size_t old; + void *res; + size_t old; - if ((res = Malloc(size, file, line)) != NULL) { - if (ptr) { - Guard *g = (Guard *)((char *)ptr - MALLOCALIGN); + if ((res = Malloc(size, file, line)) != NULL) { + if (ptr != NULL) { + Guard *g = (Guard *)((char *)ptr - MALLOCALIGN); - old = g->ga_Bytes - MALLOCALIGN; - if (old < size) - bcopy(ptr, res, old); - else - bcopy(ptr, res, size); - Free(ptr, file, line); - } else { + old = g->ga_Bytes - MALLOCALIGN; + if (old < size) + bcopy(ptr, res, old); + else + bcopy(ptr, res, size); + Free(ptr, file, line); + } else { #ifdef DMALLOCDEBUG - if (++MallocCount > MallocMax) - MallocMax = MallocCount; + if (++MallocCount > MallocMax) + MallocMax = MallocCount; #ifdef EXITSTATS - if (DidAtExit == 0) { - DidAtExit = 1; - atexit(mallocstats); - } + if (DidAtExit == 0) { + DidAtExit = 1; + atexit(mallocstats); + } #endif #endif + } } - } - return(res); + return (res); } void * Reallocf(void *ptr, size_t size, const char *file, int line) { - void *res; + void *res; - if ((res = Realloc(ptr, size, file, line)) == NULL) - Free(ptr, file, line); - return(res); + if ((res = Realloc(ptr, size, file, line)) == NULL) + Free(ptr, file, line); + return (res); } #ifdef DMALLOCDEBUG @@ -195,11 +199,10 @@ Reallocf(void *ptr, size_t size, const char *file, int void mallocstats(void) { - printf("Active Allocations: %d/%d\n", MallocCount, MallocMax); + printf("Active Allocations: %d/%d\n", MallocCount, MallocMax); #ifdef ZALLOCDEBUG - zallocstats(&MallocPool); + zallocstats(&MallocPool); #endif } #endif - Modified: head/stand/libsa/zalloc_mem.h ============================================================================== --- head/stand/libsa/zalloc_mem.h Tue Sep 17 11:20:53 2019 (r352442) +++ head/stand/libsa/zalloc_mem.h Tue Sep 17 11:35:53 2019 (r352443) @@ -1,5 +1,5 @@ /* - * This module derived from code donated to the FreeBSD Project by + * This module derived from code donated to the FreeBSD Project by * Matthew Dillon * * Copyright (c) 1998 The FreeBSD Project @@ -34,20 +34,23 @@ * * Basic memory pool / memory node structures. */ +#ifndef _ZALLOC_MEM_H +#define _ZALLOC_MEM_H typedef struct MemNode { - struct MemNode *mr_Next; - uintptr_t mr_Bytes; + struct MemNode *mr_Next; + uintptr_t mr_Bytes; } MemNode; typedef struct MemPool { - void *mp_Base; - void *mp_End; - MemNode *mp_First; - uintptr_t mp_Size; - uintptr_t mp_Used; + void *mp_Base; + void *mp_End; + MemNode *mp_First; + uintptr_t mp_Size; + uintptr_t mp_Used; } MemPool; -#define ZNOTE_FREE 0 -#define ZNOTE_REUSE 1 +#define ZNOTE_FREE 0 +#define ZNOTE_REUSE 1 +#endif /* _ZALLOC_MEM_H */ Modified: head/stand/libsa/zalloc_protos.h ============================================================================== --- head/stand/libsa/zalloc_protos.h Tue Sep 17 11:20:53 2019 (r352442) +++ head/stand/libsa/zalloc_protos.h Tue Sep 17 11:35:53 2019 (r352443) @@ -1,5 +1,5 @@ /* - * This module derived from code donated to the FreeBSD Project by + * This module derived from code donated to the FreeBSD Project by * Matthew Dillon * * Copyright (c) 1998 The FreeBSD Project @@ -29,7 +29,12 @@ * $FreeBSD$ */ +#ifndef _ZALLOC_PROTOS_H +#define _ZALLOC_PROTOS_H + Library void *znalloc(struct MemPool *mpool, uintptr_t bytes); Library void zfree(struct MemPool *mpool, void *ptr, uintptr_t bytes); Library void zextendPool(MemPool *mp, void *base, uintptr_t bytes); Library void zallocstats(struct MemPool *mp); + +#endif /* _ZALLOC_PROTOS_H */ From owner-svn-src-head@freebsd.org Tue Sep 17 13:07:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F1B31239F9; Tue, 17 Sep 2019 13:07:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xk0R3JzRz40Zv; Tue, 17 Sep 2019 13:07:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55FCE8D50; Tue, 17 Sep 2019 13:07:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HD73Z6055211; Tue, 17 Sep 2019 13:07:03 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HD73Pd055210; Tue, 17 Sep 2019 13:07:03 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909171307.x8HD73Pd055210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 17 Sep 2019 13:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352444 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 352444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 13:07:03 -0000 Author: tsoome Date: Tue Sep 17 13:07:02 2019 New Revision: 352444 URL: https://svnweb.freebsd.org/changeset/base/352444 Log: loader: stand.h should define reallocf as Reallocf Use the same approach as other zalloc functions. Modified: head/stand/libsa/stand.h Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Tue Sep 17 11:35:53 2019 (r352443) +++ head/stand/libsa/stand.h Tue Sep 17 13:07:02 2019 (r352444) @@ -264,9 +264,6 @@ static __inline int tolower(int c) extern void setheap(void *base, void *top); extern char *sbrk(int incr); -extern void *reallocf(void *ptr, size_t size); -extern void mallocstats(void); - extern int printf(const char *fmt, ...) __printflike(1, 2); extern int asprintf(char **buf, const char *cfmt, ...) __printflike(2, 3); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); @@ -433,17 +430,20 @@ void *Malloc(size_t, const char *, int); void *Calloc(size_t, size_t, const char *, int); void *Realloc(void *, size_t, const char *, int); void Free(void *, const char *, int); +extern void mallocstats(void); #ifdef DEBUG_MALLOC #define malloc(x) Malloc(x, __FILE__, __LINE__) #define calloc(x, y) Calloc(x, y, __FILE__, __LINE__) #define free(x) Free(x, __FILE__, __LINE__) #define realloc(x, y) Realloc(x, y, __FILE__, __LINE__) +#define reallocf(x, y) Reallocf(x, y, __FILE__, __LINE__) #else #define malloc(x) Malloc(x, NULL, 0) #define calloc(x, y) Calloc(x, y, NULL, 0) #define free(x) Free(x, NULL, 0) #define realloc(x, y) Realloc(x, y, NULL, 0) +#define reallocf(x, y) Reallocf(x, y, NULL, 0) #endif #endif /* STAND_H */ From owner-svn-src-head@freebsd.org Tue Sep 17 13:15:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C915C123D73; Tue, 17 Sep 2019 13:15:28 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XkB84w7sz418S; Tue, 17 Sep 2019 13:15:28 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88F9A8F2F; Tue, 17 Sep 2019 13:15:28 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HDFS0h061174; Tue, 17 Sep 2019 13:15:28 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HDFRo1061168; Tue, 17 Sep 2019 13:15:27 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909171315.x8HDFRo1061168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 17 Sep 2019 13:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352445 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 352445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 13:15:28 -0000 Author: tsoome Date: Tue Sep 17 13:15:27 2019 New Revision: 352445 URL: https://svnweb.freebsd.org/changeset/base/352445 Log: loader: add memalign() to libsa Implement memalign(size_t alignment, size_t size) to allocate aligned memory. Modified: head/stand/libsa/stand.h head/stand/libsa/zalloc.c head/stand/libsa/zalloc_malloc.c head/stand/libsa/zalloc_protos.h Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Tue Sep 17 13:07:02 2019 (r352444) +++ head/stand/libsa/stand.h Tue Sep 17 13:15:27 2019 (r352445) @@ -427,19 +427,23 @@ extern uint16_t ntohs(uint16_t); #endif void *Malloc(size_t, const char *, int); +void *Memalign(size_t, size_t, const char *, int); void *Calloc(size_t, size_t, const char *, int); void *Realloc(void *, size_t, const char *, int); +void *Reallocf(void *, size_t, const char *, int); void Free(void *, const char *, int); extern void mallocstats(void); #ifdef DEBUG_MALLOC #define malloc(x) Malloc(x, __FILE__, __LINE__) +#define memalign(x, y) Memalign(x, y, __FILE__, __LINE__) #define calloc(x, y) Calloc(x, y, __FILE__, __LINE__) #define free(x) Free(x, __FILE__, __LINE__) #define realloc(x, y) Realloc(x, y, __FILE__, __LINE__) #define reallocf(x, y) Reallocf(x, y, __FILE__, __LINE__) #else #define malloc(x) Malloc(x, NULL, 0) +#define memalign(x, y) Memalign(x, y, NULL, 0) #define calloc(x, y) Calloc(x, y, NULL, 0) #define free(x) Free(x, NULL, 0) #define realloc(x, y) Realloc(x, y, NULL, 0) Modified: head/stand/libsa/zalloc.c ============================================================================== --- head/stand/libsa/zalloc.c Tue Sep 17 13:07:02 2019 (r352444) +++ head/stand/libsa/zalloc.c Tue Sep 17 13:15:27 2019 (r352445) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include + /* * LIB/MEMORY/ZALLOC.C - self contained low-overhead memory pool/allocation * subsystem @@ -86,7 +88,7 @@ typedef char assert_align[(sizeof(struct MemNode) <= M */ void * -znalloc(MemPool *mp, uintptr_t bytes) +znalloc(MemPool *mp, uintptr_t bytes, size_t align) { MemNode **pmn; MemNode *mn; @@ -111,14 +113,40 @@ znalloc(MemPool *mp, uintptr_t bytes) for (pmn = &mp->mp_First; (mn = *pmn) != NULL; pmn = &mn->mr_Next) { char *ptr = (char *)mn; + uintptr_t dptr; + char *aligned; + size_t extra; - if (bytes > mn->mr_Bytes) + dptr = (uintptr_t)(ptr + MALLOCALIGN); /* pointer to data */ + aligned = (char *)(roundup2(dptr, align) - MALLOCALIGN); + extra = aligned - ptr; + + if (bytes + extra > mn->mr_Bytes) continue; /* + * Cut extra from head and create new memory node from reminder. + */ + + if (extra != 0) { + MemNode *new; + + new = (MemNode *)aligned; + new->mr_Next = mn->mr_Next; + new->mr_Bytes = mn->mr_Bytes - extra; + + /* And update current memory node */ + mn->mr_Bytes = extra; + mn->mr_Next = new; + /* In next iteration, we will get our aligned address */ + continue; + } + + /* * Cut a chunk of memory out of the beginning of this * block and fixup the link appropriately. */ + if (mn->mr_Bytes == bytes) { *pmn = mn->mr_Next; } else { Modified: head/stand/libsa/zalloc_malloc.c ============================================================================== --- head/stand/libsa/zalloc_malloc.c Tue Sep 17 13:07:02 2019 (r352444) +++ head/stand/libsa/zalloc_malloc.c Tue Sep 17 13:15:27 2019 (r352445) @@ -50,9 +50,27 @@ void mallocstats(void); #undef free #endif +static void *Malloc_align(size_t, size_t); + void * -Malloc(size_t bytes, const char *file, int line) +Malloc(size_t bytes, const char *file __unused, int line __unused) { + return (Malloc_align(bytes, 1)); +} + +void * +Memalign(size_t alignment, size_t bytes, const char *file __unused, + int line __unused) +{ + if (alignment == 0) + alignment = 1; + + return (Malloc_align(bytes, alignment)); +} + +static void * +Malloc_align(size_t bytes, size_t alignment) +{ Guard *res; if (bytes == 0) @@ -64,7 +82,7 @@ Malloc(size_t bytes, const char *file, int line) bytes += MALLOCALIGN; #endif - while ((res = znalloc(&MallocPool, bytes)) == NULL) { + while ((res = znalloc(&MallocPool, bytes, alignment)) == NULL) { int incr = (bytes + BLKEXTENDMASK) & ~BLKEXTENDMASK; char *base; Modified: head/stand/libsa/zalloc_protos.h ============================================================================== --- head/stand/libsa/zalloc_protos.h Tue Sep 17 13:07:02 2019 (r352444) +++ head/stand/libsa/zalloc_protos.h Tue Sep 17 13:15:27 2019 (r352445) @@ -32,7 +32,7 @@ #ifndef _ZALLOC_PROTOS_H #define _ZALLOC_PROTOS_H -Library void *znalloc(struct MemPool *mpool, uintptr_t bytes); +Library void *znalloc(struct MemPool *mpool, uintptr_t bytes, size_t align); Library void zfree(struct MemPool *mpool, void *ptr, uintptr_t bytes); Library void zextendPool(MemPool *mp, void *base, uintptr_t bytes); Library void zallocstats(struct MemPool *mp); From owner-svn-src-head@freebsd.org Tue Sep 17 13:50:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCF5E124702; Tue, 17 Sep 2019 13:50:25 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XkyT5621z42NM; Tue, 17 Sep 2019 13:50:25 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EEC49454; Tue, 17 Sep 2019 13:50:25 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HDoP2S078666; Tue, 17 Sep 2019 13:50:25 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HDoPJB078665; Tue, 17 Sep 2019 13:50:25 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909171350.x8HDoPJB078665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 17 Sep 2019 13:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352446 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 352446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 13:50:25 -0000 Author: tsoome Date: Tue Sep 17 13:50:25 2019 New Revision: 352446 URL: https://svnweb.freebsd.org/changeset/base/352446 Log: loader.efi: efipart needs to use ioalign UEFI specification 2.7A, EFI_BLOCK_IO_PROTOCOL, page 566. The ioalign property does define the alignment of data buffer. If the alignment is required and our buffer is not aligned, or if the data buffer is not multiple of Blocksize, we need to use bounce buffer to perform the block IO. This is much like with BIOS version, except there the INT13 needs buffer to be located in low memory. Additionally, we need to handle disk writes properly. Modified: head/stand/efi/libefi/efipart.c Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Tue Sep 17 13:15:27 2019 (r352445) +++ head/stand/efi/libefi/efipart.c Tue Sep 17 13:50:25 2019 (r352446) @@ -64,6 +64,9 @@ static int efipart_printhd(int); #define PNP0700 0x700 #define PNP0701 0x701 +/* Bounce buffer max size */ +#define BIO_BUFFER_SIZE 0x4000 + struct devsw efipart_fddev = { .dv_name = "fd", .dv_type = DEVT_FD, @@ -266,6 +269,12 @@ efipart_inithandles(void) continue; } + /* Allowed values are 0, 1 and power of 2. */ + if (blkio->Media->IoAlign > 1 && + !powerof2(blkio->Media->IoAlign)) { + continue; + } + /* This is bad. */ if ((pd = calloc(1, sizeof(*pd))) == NULL) { printf("efipart_inithandles: Out of memory.\n"); @@ -979,8 +988,10 @@ efipart_realstrategy(void *devdata, int rw, daddr_t bl EFI_BLOCK_IO *blkio; uint64_t off, disk_blocks, d_offset = 0; char *blkbuf; - size_t blkoff, blksz; - int error; + size_t blkoff, blksz, bio_size; + unsigned ioalign; + bool need_buf; + int rc; uint64_t diskend, readstart; if (dev == NULL || blk < 0) @@ -1028,40 +1039,118 @@ efipart_realstrategy(void *devdata, int rw, daddr_t bl size = size * blkio->Media->BlockSize; } - if (rsize != NULL) - *rsize = size; - + need_buf = true; + /* Do we need bounce buffer? */ if ((size % blkio->Media->BlockSize == 0) && (off % blkio->Media->BlockSize == 0)) - return (efipart_readwrite(blkio, rw, - off / blkio->Media->BlockSize, - size / blkio->Media->BlockSize, buf)); + need_buf = false; - /* - * The buffer size is not a multiple of the media block size. - */ - blkbuf = malloc(blkio->Media->BlockSize); + /* Do we have IO alignment requirement? */ + ioalign = blkio->Media->IoAlign; + if (ioalign == 0) + ioalign++; + + if (ioalign > 1 && (uintptr_t)buf != roundup2((uintptr_t)buf, ioalign)) + need_buf = true; + + if (need_buf) { + for (bio_size = BIO_BUFFER_SIZE; bio_size > 0; + bio_size -= blkio->Media->BlockSize) { + blkbuf = memalign(ioalign, bio_size); + if (blkbuf != NULL) + break; + } + } else { + blkbuf = buf; + bio_size = size; + } + if (blkbuf == NULL) return (ENOMEM); - error = 0; + if (rsize != NULL) + *rsize = size; + + rc = 0; blk = off / blkio->Media->BlockSize; blkoff = off % blkio->Media->BlockSize; - blksz = blkio->Media->BlockSize - blkoff; + while (size > 0) { - error = efipart_readwrite(blkio, rw, blk, 1, blkbuf); - if (error) + size_t x = min(size, bio_size); + + if (x < blkio->Media->BlockSize) + x = 1; + else + x /= blkio->Media->BlockSize; + + switch (rw & F_MASK) { + case F_READ: + blksz = blkio->Media->BlockSize * x - blkoff; + if (size < blksz) + blksz = size; + + rc = efipart_readwrite(blkio, rw, blk, x, blkbuf); + if (rc != 0) + goto error; + + if (need_buf) + bcopy(blkbuf + blkoff, buf, blksz); break; - if (size < blksz) - blksz = size; - bcopy(blkbuf + blkoff, buf, blksz); + case F_WRITE: + rc = 0; + if (blkoff != 0) { + /* + * We got offset to sector, read 1 sector to + * blkbuf. + */ + x = 1; + blksz = blkio->Media->BlockSize - blkoff; + blksz = min(blksz, size); + rc = efipart_readwrite(blkio, F_READ, blk, x, + blkbuf); + } else if (size < blkio->Media->BlockSize) { + /* + * The remaining block is not full + * sector. Read 1 sector to blkbuf. + */ + x = 1; + blksz = size; + rc = efipart_readwrite(blkio, F_READ, blk, x, + blkbuf); + } else { + /* We can write full sector(s). */ + blksz = blkio->Media->BlockSize * x; + } + + if (rc != 0) + goto error; + /* + * Put your Data In, Put your Data out, + * Put your Data In, and shake it all about + */ + if (need_buf) + bcopy(buf, blkbuf + blkoff, blksz); + rc = efipart_readwrite(blkio, F_WRITE, blk, x, blkbuf); + if (rc != 0) + goto error; + break; + default: + /* DO NOTHING */ + rc = EROFS; + goto error; + } + + blkoff = 0; buf += blksz; size -= blksz; - blk++; - blkoff = 0; - blksz = blkio->Media->BlockSize; + blk += x; } - free(blkbuf); - return (error); +error: + if (rsize != NULL) + *rsize -= size; + + if (need_buf) + free(blkbuf); + return (rc); } From owner-svn-src-head@freebsd.org Tue Sep 17 13:58:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AAC5124BEF; Tue, 17 Sep 2019 13:58:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xl7X2vzyz42tp; Tue, 17 Sep 2019 13:58:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 477C7960C; Tue, 17 Sep 2019 13:58:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HDwGj1084493; Tue, 17 Sep 2019 13:58:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HDwFI9084489; Tue, 17 Sep 2019 13:58:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909171358.x8HDwFI9084489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 Sep 2019 13:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352447 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Commit-Revision: 352447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 13:58:16 -0000 Author: avg Date: Tue Sep 17 13:58:15 2019 New Revision: 352447 URL: https://svnweb.freebsd.org/changeset/base/352447 Log: MFZoL: Add -vnP support to 'zfs send' for bookmarks zfsonlinux/zfs@835db58592d7d947e5818eb7281882e2a46073e0 We have long supported estimating a size of an incremental stream from a snapshot. We should do the same for bookmarks as well. Obtained from: ZoL Author: loli10K MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Sep 17 13:50:25 2019 (r352446) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Sep 17 13:58:15 2019 (r352447) @@ -190,8 +190,8 @@ .Ar snapshot .Nm .Cm send -.Op Fl Lce -.Op Fl i Ar snapshot Ns | Ns bookmark +.Op Fl LPcenv +.Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm send @@ -2766,7 +2766,7 @@ on future versions of .It Xo .Nm .Cm send -.Op Fl Lce +.Op Fl LPcenv .Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc @@ -2780,7 +2780,7 @@ stream generated from a filesystem or volume is receiv name will be .Pq --head-- . .Bl -tag -width indent -.It Fl i Ar snapshot Ns | Ns bookmark +.It Fl i Ar snapshot Ns | Ns Ar bookmark Generate an incremental send stream. The incremental source must be an earlier snapshot in the destination's history. @@ -2792,6 +2792,23 @@ specified as the last component of the name If the incremental target is a clone, the incremental source can be the origin snapshot, or an earlier snapshot in the origin's filesystem, or the origin's origin, etc. +.It Fl n, -dryrun +Do a dry-run +.Pq Qq No-op +send. +Do not generate any actual send data. +This is useful in conjunction with the +.Fl v +or +.Fl P +flags to determine what data will be sent. +In this case, the verbose output will be written to standard output +.Po contrast with a non-dry-run, where the stream is written to standard output +and the verbose output goes to standard error +.Pc . +.It Fl v, -verbose +Print verbose information about the stream package generated. +This information includes a per-second report of how much data has been sent. .It Fl L, -large-block Generate a stream which may contain blocks larger than 128KB. This flag @@ -2808,6 +2825,8 @@ See for details on ZFS feature flags and the .Sy large_blocks feature. +.It Fl P, -parsable +Print machine-parsable verbose information about the stream package generated. .It Fl c, -compressed Generate a more compact stream by using compressed WRITE records for blocks which are compressed on disk and in memory (see the Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Sep 17 13:50:25 2019 (r352446) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Sep 17 13:58:15 2019 (r352447) @@ -3928,13 +3928,11 @@ zfs_do_send(int argc, char **argv) if (strchr(argv[0], '@') == NULL || (fromname && strchr(fromname, '#') != NULL)) { char frombuf[ZFS_MAX_DATASET_NAME_LEN]; - enum lzc_send_flags lzc_flags = 0; if (flags.replicate || flags.doall || flags.props || - flags.dedup || flags.dryrun || flags.verbose || - flags.progress) { - (void) fprintf(stderr, - gettext("Error: " + flags.dedup || (strchr(argv[0], '@') == NULL && + (flags.dryrun || flags.verbose || flags.progress))) { + (void) fprintf(stderr, gettext("Error: " "Unsupported flag with filesystem or bookmark.\n")); return (1); } @@ -3943,13 +3941,6 @@ zfs_do_send(int argc, char **argv) if (zhp == NULL) return (1); - if (flags.largeblock) - lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; - if (flags.embed_data) - lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; - if (flags.compress) - lzc_flags |= LZC_SEND_FLAG_COMPRESS; - if (fromname != NULL && (fromname[0] == '#' || fromname[0] == '@')) { /* @@ -3963,7 +3954,7 @@ zfs_do_send(int argc, char **argv) (void) strlcat(frombuf, fromname, sizeof (frombuf)); fromname = frombuf; } - err = zfs_send_one(zhp, fromname, STDOUT_FILENO, lzc_flags); + err = zfs_send_one(zhp, fromname, STDOUT_FILENO, flags); zfs_close(zhp); return (err != 0); } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Sep 17 13:50:25 2019 (r352446) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Sep 17 13:58:15 2019 (r352447) @@ -660,7 +660,7 @@ typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, vo extern int zfs_send(zfs_handle_t *, const char *, const char *, sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **); -extern int zfs_send_one(zfs_handle_t *, const char *, int, enum lzc_send_flags); +extern int zfs_send_one(zfs_handle_t *, const char *, int, sendflags_t flags); extern int zfs_send_resume(libzfs_handle_t *, sendflags_t *, int outfd, const char *); extern nvlist_t *zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl, Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Sep 17 13:50:25 2019 (r352446) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Sep 17 13:58:15 2019 (r352447) @@ -1190,16 +1190,14 @@ send_print_verbose(FILE *fout, const char *tosnap, con } } - if (size != 0) { - if (parsable) { - (void) fprintf(fout, "\t%llu", - (longlong_t)size); - } else { - char buf[16]; - zfs_nicenum(size, buf, sizeof (buf)); - (void) fprintf(fout, dgettext(TEXT_DOMAIN, - " estimated size is %s"), buf); - } + if (parsable) { + (void) fprintf(fout, "\t%llu", + (longlong_t)size); + } else if (size != 0) { + char buf[16]; + zfs_nicenum(size, buf, sizeof (buf)); + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + " estimated size is %s"), buf); } (void) fprintf(fout, "\n"); } @@ -2037,17 +2035,40 @@ err_out: } int -zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, - enum lzc_send_flags flags) +zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, sendflags_t flags) { - int err; + int err = 0; libzfs_handle_t *hdl = zhp->zfs_hdl; - + enum lzc_send_flags lzc_flags = 0; + FILE *fout = (flags.verbose && flags.dryrun) ? stdout : stderr; char errbuf[1024]; + + if (flags.largeblock) + lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; + if (flags.embed_data) + lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; + if (flags.compress) + lzc_flags |= LZC_SEND_FLAG_COMPRESS; + + if (flags.verbose) { + uint64_t size = 0; + err = lzc_send_space(zhp->zfs_name, from, lzc_flags, &size); + if (err == 0) { + send_print_verbose(fout, zhp->zfs_name, from, size, + flags.parsable); + } else { + (void) fprintf(stderr, "Cannot estimate send size: " + "%s\n", strerror(errno)); + } + } + + if (flags.dryrun) + return (err); + (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "warning: cannot send '%s'"), zhp->zfs_name); - err = lzc_send(zhp->zfs_name, from, fd, flags); + err = lzc_send(zhp->zfs_name, from, fd, lzc_flags); if (err != 0) { switch (errno) { case EXDEV: From owner-svn-src-head@freebsd.org Tue Sep 17 14:08:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04572125078; Tue, 17 Sep 2019 14:08:10 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XlLx5d4Qz43WB; Tue, 17 Sep 2019 14:08:09 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A45AE97CD; Tue, 17 Sep 2019 14:08:09 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HE899p090325; Tue, 17 Sep 2019 14:08:09 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HE89OK090324; Tue, 17 Sep 2019 14:08:09 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909171408.x8HE89OK090324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 17 Sep 2019 14:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352448 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/sys X-SVN-Commit-Revision: 352448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 14:08:10 -0000 Author: lwhsu Date: Tue Sep 17 14:08:09 2019 New Revision: 352448 URL: https://svnweb.freebsd.org/changeset/base/352448 Log: Temporarily skip flakey test case lib.libc.sys.stat_test.stat_socket PR: 240621 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/lib/libc/sys/t_stat.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_stat.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_stat.c Tue Sep 17 13:58:15 2019 (r352447) +++ head/contrib/netbsd-tests/lib/libc/sys/t_stat.c Tue Sep 17 14:08:09 2019 (r352448) @@ -332,6 +332,9 @@ ATF_TC_BODY(stat_socket, tc) uint32_t iaddr; int fd, flags; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/240621"); + (void)memset(&st, 0, sizeof(struct stat)); (void)memset(&addr, 0, sizeof(struct sockaddr_in)); From owner-svn-src-head@freebsd.org Tue Sep 17 14:15:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55898125544; Tue, 17 Sep 2019 14:15:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XlWn1bsVz44Ql; Tue, 17 Sep 2019 14:15:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AC1999A2; Tue, 17 Sep 2019 14:15:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HEFmQD096366; Tue, 17 Sep 2019 14:15:48 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HEFmTk096365; Tue, 17 Sep 2019 14:15:48 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909171415.x8HEFmTk096365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 Sep 2019 14:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352449 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 352449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 14:15:49 -0000 Author: avg Date: Tue Sep 17 14:15:48 2019 New Revision: 352449 URL: https://svnweb.freebsd.org/changeset/base/352449 Log: fixup up fallout from r352447 in libbe I totally forgot that we now have another in-tree consumer of libzfs. MFC after: 3 days X-MFC with: r352447 Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Tue Sep 17 14:08:09 2019 (r352448) +++ head/lib/libbe/be.c Tue Sep 17 14:15:48 2019 (r352449) @@ -775,6 +775,7 @@ be_export(libbe_handle_t *lbh, const char *bootenv, in char snap_name[BE_MAXPATHLEN]; char buf[BE_MAXPATHLEN]; zfs_handle_t *zfs; + sendflags_t flags = { 0 }; int err; if ((err = be_snapshot(lbh, bootenv, NULL, true, snap_name)) != 0) @@ -786,7 +787,7 @@ be_export(libbe_handle_t *lbh, const char *bootenv, in if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) return (set_error(lbh, BE_ERR_ZFSOPEN)); - err = zfs_send_one(zfs, NULL, fd, 0); + err = zfs_send_one(zfs, NULL, fd, flags); zfs_close(zfs); return (err); From owner-svn-src-head@freebsd.org Tue Sep 17 14:27:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2076125863; Tue, 17 Sep 2019 14:27:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xlnp6tVKz44w8; Tue, 17 Sep 2019 14:27:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x8HERnIR071898 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 17 Sep 2019 17:27:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x8HERnIR071898 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x8HERni2071897; Tue, 17 Sep 2019 17:27:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 17 Sep 2019 17:27:49 +0300 From: Konstantin Belousov To: Toomas Soome Cc: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352421 - head/stand/libsa Message-ID: <20190917142749.GB2559@kib.kiev.ua> References: <201909162028.x8GKS9jK064079@repo.freebsd.org> <20190917085641.GY2559@kib.kiev.ua> <6762A429-F17F-46D1-A55B-BD9C627D6903@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6762A429-F17F-46D1-A55B-BD9C627D6903@me.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46Xlnp6tVKz44w8 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-2.66), ipnet: 2001:470::/32(-4.46), asn: 6939(-3.22), country: US(-0.05)]; FREEMAIL_TO(0.00)[me.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 14:27:59 -0000 On Tue, Sep 17, 2019 at 12:05:26PM +0300, Toomas Soome wrote: > > > > On 17 Sep 2019, at 11:56, Konstantin Belousov wrote: > > > > On Mon, Sep 16, 2019 at 08:28:09PM +0000, Toomas Soome wrote: > >> Author: tsoome > >> Date: Mon Sep 16 20:28:08 2019 > >> New Revision: 352421 > >> URL: https://svnweb.freebsd.org/changeset/base/352421 > >> > >> Log: > >> loader: Malloc(0) should return NULL. > >> > >> We really should not allocate anything with size 0. > > Why ? This is quite unexpected from other environments, where > > malloc(0) returns unique object. > > > > Hiding bugs. And, we are not getting unique object, we are getting chunk of memory with payload length of 0 and the memory content depends on if head and tail guards are used - the chunk is with size at least MALLOCALIGN (16 or 64 bytes) and the chunk is from random location of heap. > Yes, exactly, this is how all other mallocs behave. From owner-svn-src-head@freebsd.org Tue Sep 17 15:53:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BDEB127E9E; Tue, 17 Sep 2019 15:53:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xnhj0rpbz4BJ3; Tue, 17 Sep 2019 15:53:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 008F9ABBA; Tue, 17 Sep 2019 15:53:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HFre2c054198; Tue, 17 Sep 2019 15:53:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HFre1x054197; Tue, 17 Sep 2019 15:53:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909171553.x8HFre1x054197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 17 Sep 2019 15:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352450 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 15:53:41 -0000 Author: mjg Date: Tue Sep 17 15:53:40 2019 New Revision: 352450 URL: https://svnweb.freebsd.org/changeset/base/352450 Log: vfs: apply r352437 to the fast path as well This one is very hard to run into. If the filesystem is being unmounted or the mount point is freed the vfs_op_thread_enter will fail. For it to succeed the mount point itself would have to be reallocated in the time window between the initial read and the attempt to enter. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Tue Sep 17 14:15:48 2019 (r352449) +++ head/sys/kern/vfs_default.c Tue Sep 17 15:53:40 2019 (r352450) @@ -606,11 +606,13 @@ vop_stdgetwritemount(ap) return (0); } if (vfs_op_thread_enter(mp)) { - if (mp == vp->v_mount) + if (mp == vp->v_mount) { vfs_mp_count_add_pcpu(mp, ref, 1); - else + vfs_op_thread_exit(mp); + } else { + vfs_op_thread_exit(mp); mp = NULL; - vfs_op_thread_exit(mp); + } } else { MNT_ILOCK(mp); if (mp == vp->v_mount) { From owner-svn-src-head@freebsd.org Tue Sep 17 16:16:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 744411287E9; Tue, 17 Sep 2019 16:16:47 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XpCM2W2mz4CSn; Tue, 17 Sep 2019 16:16:47 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AB06AF32; Tue, 17 Sep 2019 16:16:47 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HGGlAr066219; Tue, 17 Sep 2019 16:16:47 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HGGlkb066218; Tue, 17 Sep 2019 16:16:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909171616.x8HGGlkb066218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 17 Sep 2019 16:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352451 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 352451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 16:16:47 -0000 Author: tsoome Date: Tue Sep 17 16:16:46 2019 New Revision: 352451 URL: https://svnweb.freebsd.org/changeset/base/352451 Log: loader: revert r352421 As insisted by kib, malloc(0) is quite legal. Modified: head/stand/libsa/zalloc_malloc.c Modified: head/stand/libsa/zalloc_malloc.c ============================================================================== --- head/stand/libsa/zalloc_malloc.c Tue Sep 17 15:53:40 2019 (r352450) +++ head/stand/libsa/zalloc_malloc.c Tue Sep 17 16:16:46 2019 (r352451) @@ -73,9 +73,6 @@ Malloc_align(size_t bytes, size_t alignment) { Guard *res; - if (bytes == 0) - return (NULL); - #ifdef USEENDGUARD bytes += MALLOCALIGN + 1; #else From owner-svn-src-head@freebsd.org Tue Sep 17 16:21:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4DFF1289F5 for ; Tue, 17 Sep 2019 16:21:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46XpJH20Vdz4Cfw for ; Tue, 17 Sep 2019 16:21:03 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568737261; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Gc2RuZZRH7J5CLsbO+oyMax7PNHVYAa0se0Cj4RnqP/6tpjcSfrqZZFImRfhwKzpa2PetPPPAx6nt P5WD1af4u6mDpj77XgnJC4rihhLqwM4pjI2YD5DQqPGu5UmslkPBJqacjcKw4JgdxUs1pCThlUIJkK peZ3XyrjPpIdQzu7wmH7+NWJq38b8un6lyUCBJ0akFR8nF19+Eg2PnaoepsGo5mY/CiCBFoa9OjsfH ZwVCrwgPrKjhncD+noSQzB2nUKHsnurHiPLhiyicdhfLgyEHtV59oZK/V68fFY0sA3r4bnZarD8QRu sS6A6nGbNDdtgiQ1vv/+aSn5osDJPNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=RidBFvt1egsvG4iczwVRR+rQwzBd4Y2CJVwPGpoZJeI=; b=lGWDzEI4RjAy7TW0TpIM0AxDLmcsdoZdEz31sCzJtvPvIjlxitKohm1yA7CTfRSYezlgcEbJb0SlX MOXPhaPWGOPG3Fl5c+YyOTklodT7EwHCVRv1zzyhNebc+rX9kVLG8RPfvS4kBo8+VjmttDNH0upjbq UCXtSjH+eFrmE3TrObvKZ8irJi/15930p+FFI2N/nOuhHWvv5mNeshg6NukuysbaJPS2u4ziU2i1Ck hlxNrCAT+kEWpUT1Dio5LwX0qaDjlTtV29glNfI/ZchFG/8hlYhkwu5lzcQN0JlVwiwhjNPauKC1/T z6KPvp/9+4Lj6fNq6zaYTF689uftE4w== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=RidBFvt1egsvG4iczwVRR+rQwzBd4Y2CJVwPGpoZJeI=; b=VNzvE1ZVvvLo8RSwAR2ZFAFmWx+Qr88uAOG9pKYN7ZkxCIxOOQ2vZARvkU0kZP8s8Ab5veWzC4BQz jlHOL9hCxk35giTjZEis7LpL7bX8E1SS7LYsSbszcJNqveAym2FTE3rI/+Q2HtmWDMaduPJZPAqTvK xaJtNvz1bMhULpBgcFGvx4wvml+zirYGJq9exCq/fT+YWbtcxLI91MkV1gy23mmo67A9n89XCDIU8Y 028qtyY7D+ZYoUZ2T717zMMqW//GD32I50lIAoAgNu6BPQYBMH1bcLDqm2YEOF9R0zxhGIGNeg5yw7 jleiB/ixxhWD9LMG96Z8WRh+4uZkXjg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 222a285a-d967-11e9-85ed-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 222a285a-d967-11e9-85ed-13b9aae3a1d2; Tue, 17 Sep 2019 16:21:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8HGKwS2099761; Tue, 17 Sep 2019 10:20:58 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r352451 - head/stand/libsa From: Ian Lepore To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 17 Sep 2019 10:20:58 -0600 In-Reply-To: <201909171616.x8HGGlkb066218@repo.freebsd.org> References: <201909171616.x8HGGlkb066218@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46XpJH20Vdz4Cfw X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 16:21:03 -0000 On Tue, 2019-09-17 at 16:16 +0000, Toomas Soome wrote: > Author: tsoome > Date: Tue Sep 17 16:16:46 2019 > New Revision: 352451 > URL: https://svnweb.freebsd.org/changeset/base/352451 > > Log: > loader: revert r352421 > > As insisted by kib, malloc(0) is quite legal. > > Modified: > head/stand/libsa/zalloc_malloc.c > > Modified: head/stand/libsa/zalloc_malloc.c > ============================================================================== > --- head/stand/libsa/zalloc_malloc.c Tue Sep 17 15:53:40 2019 (r352450) > +++ head/stand/libsa/zalloc_malloc.c Tue Sep 17 16:16:46 2019 (r352451) > @@ -73,9 +73,6 @@ Malloc_align(size_t bytes, size_t alignment) > { > Guard *res; > > - if (bytes == 0) > - return (NULL); > - > #ifdef USEENDGUARD > bytes += MALLOCALIGN + 1; > #else For the record, you're both right. In both the C and posix standards for malloc(), an implementation is allowed to return either NULL or a unique pointer which cannot be used to access any memory but must be passed to free(). -- Ian From owner-svn-src-head@freebsd.org Tue Sep 17 16:53:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF963129419; Tue, 17 Sep 2019 16:53:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xq2D4FP4z4FTH; Tue, 17 Sep 2019 16:53:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x8HGrlbD017005 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 17 Sep 2019 19:53:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x8HGrlbD017005 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x8HGrlEP017004; Tue, 17 Sep 2019 19:53:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 17 Sep 2019 19:53:47 +0300 From: Konstantin Belousov To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352451 - head/stand/libsa Message-ID: <20190917165347.GD2559@kib.kiev.ua> References: <201909171616.x8HGGlkb066218@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909171616.x8HGGlkb066218@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46Xq2D4FP4z4FTH X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 16:53:56 -0000 On Tue, Sep 17, 2019 at 04:16:47PM +0000, Toomas Soome wrote: > Author: tsoome > Date: Tue Sep 17 16:16:46 2019 > New Revision: 352451 > URL: https://svnweb.freebsd.org/changeset/base/352451 > > Log: > loader: revert r352421 > > As insisted by kib, malloc(0) is quite legal. Thank you. > > Modified: > head/stand/libsa/zalloc_malloc.c > > Modified: head/stand/libsa/zalloc_malloc.c > ============================================================================== > --- head/stand/libsa/zalloc_malloc.c Tue Sep 17 15:53:40 2019 (r352450) > +++ head/stand/libsa/zalloc_malloc.c Tue Sep 17 16:16:46 2019 (r352451) > @@ -73,9 +73,6 @@ Malloc_align(size_t bytes, size_t alignment) > { > Guard *res; > > - if (bytes == 0) > - return (NULL); > - > #ifdef USEENDGUARD > bytes += MALLOCALIGN + 1; > #else From owner-svn-src-head@freebsd.org Tue Sep 17 17:44:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 928E012A56C; Tue, 17 Sep 2019 17:44:51 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xr8z3KZ9z4HtD; Tue, 17 Sep 2019 17:44:51 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37665C096; Tue, 17 Sep 2019 17:44:51 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HHipLd019777; Tue, 17 Sep 2019 17:44:51 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HHipJ4019776; Tue, 17 Sep 2019 17:44:51 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201909171744.x8HHipJ4019776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 17 Sep 2019 17:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352453 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 17:44:51 -0000 Author: mckusick Date: Tue Sep 17 17:44:50 2019 New Revision: 352453 URL: https://svnweb.freebsd.org/changeset/base/352453 Log: The VFS-level clustering code collects together sequential blocks by issuing delayed-writes (bdwrite()) until a non-sequential block is written or the maximum cluster size is reached. At that point it collects the delayed buffers together (using bread()) to write them in a single operation. The assumption was that since we just looked at them they will still be in memory so there is no need to check for a read error from bread(). Very occationally (apparently every 10-hours or so when being pounded by Peter Holm's tests) this assumption is wrong. The fix is to check for errors from bread() and fail the cluster write thus falling back to the default individual flushing of any still dirty buffers. Reported by: Peter Holm and Chuck Silvers Reviewed by: kib MFC after: 3 days Modified: head/sys/kern/vfs_cluster.c Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Tue Sep 17 17:28:44 2019 (r352452) +++ head/sys/kern/vfs_cluster.c Tue Sep 17 17:44:50 2019 (r352453) @@ -718,6 +718,14 @@ cluster_write(struct vnode *vp, struct buf *bp, u_quad struct cluster_save *buflist; buflist = cluster_collectbufs(vp, bp, gbflags); + if (buflist == NULL) { + /* + * Cluster build failed so just write + * it now. + */ + bawrite(bp); + return; + } endbp = &buflist->bs_children [buflist->bs_nchildren - 1]; if (VOP_REALLOCBLKS(vp, buflist)) { @@ -1056,7 +1064,7 @@ cluster_collectbufs(struct vnode *vp, struct buf *last struct cluster_save *buflist; struct buf *bp; daddr_t lbn; - int i, len; + int i, j, len, error; len = vp->v_lastw - vp->v_cstart + 1; buflist = malloc(sizeof(struct buf *) * (len + 1) + sizeof(*buflist), @@ -1064,8 +1072,18 @@ cluster_collectbufs(struct vnode *vp, struct buf *last buflist->bs_nchildren = 0; buflist->bs_children = (struct buf **) (buflist + 1); for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) { - (void)bread_gb(vp, lbn, last_bp->b_bcount, NOCRED, + error = bread_gb(vp, lbn, last_bp->b_bcount, NOCRED, gbflags, &bp); + if (error != 0) { + /* + * If read fails, release collected buffers + * and return failure. + */ + for (j = 0; j < i; j++) + brelse(buflist->bs_children[j]); + free(buflist, M_SEGMENT); + return (NULL); + } buflist->bs_children[i] = bp; if (bp->b_blkno == bp->b_lblkno) VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, From owner-svn-src-head@freebsd.org Tue Sep 17 18:05:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05F5912AB98; Tue, 17 Sep 2019 18:05:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xrcs6PHMz4K5Y; Tue, 17 Sep 2019 18:05:33 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBD73C421; Tue, 17 Sep 2019 18:05:33 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HI5X0R031567; Tue, 17 Sep 2019 18:05:33 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HI5XRM031566; Tue, 17 Sep 2019 18:05:33 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909171805.x8HI5XRM031566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 17 Sep 2019 18:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352454 - head/stand/forth X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/forth X-SVN-Commit-Revision: 352454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 18:05:34 -0000 Author: tsoome Date: Tue Sep 17 18:05:33 2019 New Revision: 352454 URL: https://svnweb.freebsd.org/changeset/base/352454 Log: loader: provide u> and xemit words if needed We have external interpreter (userboot.so) which may be lagging behind with updates and may be missing u> xemit words. Modified: head/stand/forth/loader.4th Modified: head/stand/forth/loader.4th ============================================================================== --- head/stand/forth/loader.4th Tue Sep 17 17:44:50 2019 (r352453) +++ head/stand/forth/loader.4th Tue Sep 17 18:05:33 2019 (r352454) @@ -27,6 +27,29 @@ only forth definitions +\ provide u> if needed +s" u>" sfind [if] drop [else] + drop +: u> + 2dup u< if 2drop 0 exit then + swap u< if -1 exit then + 0 +; +[then] + +\ provide xemit if needed +s" xemit" sfind [if] drop [else] + drop +: xemit + dup 0x80 u< if emit exit then + 0 swap 0x3F + begin 2dup u> while + 2/ >r dup 0x3F and 0x80 or swap 6 rshift r> + repeat 0x7F xor 2* or + begin dup 0x80 u< 0= while emit repeat drop +; +[then] + s" arch-i386" environment? [if] [if] s" loader_version" environment? [if] 11 < [if] From owner-svn-src-head@freebsd.org Tue Sep 17 18:32:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 035E712B64B; Tue, 17 Sep 2019 18:32:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XsCl6NXFz4Whl; Tue, 17 Sep 2019 18:32:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE66718E4A; Tue, 17 Sep 2019 18:32:19 +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 x8HIWJgJ049619; Tue, 17 Sep 2019 18:32:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HIWJeY049304; Tue, 17 Sep 2019 18:32:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909171832.x8HIWJeY049304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 Sep 2019 18:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352455 - in head: lib/libc/sys sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern X-SVN-Commit-Revision: 352455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 18:32:20 -0000 Author: kib Date: Tue Sep 17 18:32:18 2019 New Revision: 352455 URL: https://svnweb.freebsd.org/changeset/base/352455 Log: Return EISDIR when directory is opened with O_CREAT without O_DIRECTORY. Reviewed by: bcr (man page), emaste (previous version) PR: 240452 Sponsored by: The FreeBSD Foundation MFC after: 1 week DIfferential revision: https://reviews.freebsd.org/D21634 Modified: head/lib/libc/sys/open.2 head/sys/kern/vfs_vnops.c Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Tue Sep 17 18:05:33 2019 (r352454) +++ head/lib/libc/sys/open.2 Tue Sep 17 18:32:18 2019 (r352455) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd June 14, 2019 +.Dd September 17, 2019 .Dt OPEN 2 .Os .Sh NAME @@ -419,6 +419,11 @@ Too many symbolic links were encountered in translatin .It Bq Er EISDIR The named file is a directory, and the arguments specify it is to be modified. +.It Bq Er EISDIR +The named file is a directory, and the flags specified +.Dv O_CREAT +without +.Dv O_DIRECTORY . .It Bq Er EROFS The named file resides on a read-only file system, and the file is to be modified. Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Sep 17 18:05:33 2019 (r352454) +++ head/sys/kern/vfs_vnops.c Tue Sep 17 18:32:18 2019 (r352455) @@ -264,6 +264,10 @@ restart: error = EEXIST; goto bad; } + if (vp->v_type == VDIR) { + error = EISDIR; + goto bad; + } fmode &= ~O_CREAT; } } else { From owner-svn-src-head@freebsd.org Tue Sep 17 18:36:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A902212B7DC; Tue, 17 Sep 2019 18:36:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XsJZ2Wpsz4X7N; Tue, 17 Sep 2019 18:36:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B46018E76; Tue, 17 Sep 2019 18:36:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HIaUGK050111; Tue, 17 Sep 2019 18:36:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HIaUhL050110; Tue, 17 Sep 2019 18:36:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909171836.x8HIaUhL050110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 Sep 2019 18:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352456 - head/contrib/jemalloc/src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/contrib/jemalloc/src X-SVN-Commit-Revision: 352456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 18:36:30 -0000 Author: kib Date: Tue Sep 17 18:36:29 2019 New Revision: 352456 URL: https://svnweb.freebsd.org/changeset/base/352456 Log: realloc(x, 0) should not return NULL. See http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm#dr_400. Upstream jemalloc issue is opened by emaste at https://github.com/jemalloc/jemalloc/issues/1629. Reviewed by: emaste PR: 240456 Sponsored by: The FreeBSD Foundation MFC after: 1 week DIfferential revision: https://reviews.freebsd.org/D21632 Modified: head/contrib/jemalloc/src/jemalloc.c Modified: head/contrib/jemalloc/src/jemalloc.c ============================================================================== --- head/contrib/jemalloc/src/jemalloc.c Tue Sep 17 18:32:18 2019 (r352455) +++ head/contrib/jemalloc/src/jemalloc.c Tue Sep 17 18:36:29 2019 (r352456) @@ -2299,21 +2299,6 @@ je_realloc(void *ptr, size_t size) { LOG("core.realloc.entry", "ptr: %p, size: %zu\n", ptr, size); if (unlikely(size == 0)) { - if (ptr != NULL) { - /* realloc(ptr, 0) is equivalent to free(ptr). */ - UTRACE(ptr, 0, 0); - tcache_t *tcache; - tsd_t *tsd = tsd_fetch(); - if (tsd_reentrancy_level_get(tsd) == 0) { - tcache = tcache_get(tsd); - } else { - tcache = NULL; - } - ifree(tsd, ptr, tcache, true); - - LOG("core.realloc.exit", "result: %p", NULL); - return NULL; - } size = 1; } From owner-svn-src-head@freebsd.org Tue Sep 17 18:41:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAED912BB07; Tue, 17 Sep 2019 18:41:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XsQX46xQz4XW6; Tue, 17 Sep 2019 18:41:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 576A018EF8; Tue, 17 Sep 2019 18:41:40 +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 x8HIfejf054293; Tue, 17 Sep 2019 18:41:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HIfeUj054292; Tue, 17 Sep 2019 18:41:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909171841.x8HIfeUj054292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 Sep 2019 18:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352457 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 352457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 18:41:40 -0000 Author: kib Date: Tue Sep 17 18:41:39 2019 New Revision: 352457 URL: https://svnweb.freebsd.org/changeset/base/352457 Log: Further refine r352393, only call vnode_pager_setsize() outside the node lock when shrinking. This is similar to r252528, applied to the above commit. Apparently there is a race which makes necessary at least to keep the n_size and pager size consistent when extending. Current suspect is that iod threads perform vnode_pager_setsize() without taking the vnode lock, which corrupts the file content. Reported and tested by: Masachika ISHIZUKA Discussed with: rmacklem (related issues) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue Sep 17 18:36:29 2019 (r352456) +++ head/sys/fs/nfsclient/nfs_clport.c Tue Sep 17 18:41:39 2019 (r352457) @@ -414,12 +414,12 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt struct nfsnode *np; struct nfsmount *nmp; struct timespec mtime_save; + vm_object_t object; u_quad_t nsize; - int setnsize, error, force_fid_err; + int error, force_fid_err; + bool setnsize; error = 0; - setnsize = 0; - nsize = 0; /* * If v_type == VNON it is a new node, so fill in the v_type, @@ -511,8 +511,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt * zero np->n_attrstamp to indicate that * the attributes are stale. */ - nsize = vap->va_size = np->n_size; - setnsize = 1; + vap->va_size = np->n_size; np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); } else if (np->n_flag & NMODIFIED) { @@ -526,22 +525,9 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - nsize = np->n_size; - setnsize = 1; - } else if (vap->va_size < np->n_size) { - /* - * When shrinking the size, the call to - * vnode_pager_setsize() cannot be done - * with the mutex held, so delay it until - * after the mtx_unlock call. - */ - nsize = np->n_size = vap->va_size; - np->n_flag |= NSIZECHANGED; - setnsize = 1; } else { - nsize = np->n_size = vap->va_size; + np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; - setnsize = 1; } } else { np->n_size = vap->va_size; @@ -579,6 +565,23 @@ out: if (np->n_attrstamp != 0) KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, error); #endif + nsize = vap->va_size; + object = vp->v_object; + setnsize = false; + if (object != NULL) { + if (OFF_TO_IDX(nsize + PAGE_MASK) < object->size) { + /* + * When shrinking the size, the call to + * vnode_pager_setsize() cannot be done with + * the mutex held, because we might need to + * wait for a busy page. Delay it until after + * the node is unlocked. + */ + setnsize = true; + } else { + vnode_pager_setsize(vp, nsize); + } + } NFSUNLOCKNODE(np); if (setnsize) vnode_pager_setsize(vp, nsize); From owner-svn-src-head@freebsd.org Tue Sep 17 18:49:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D80912BD07; Tue, 17 Sep 2019 18:49:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XsbG0PnVz4Y1X; Tue, 17 Sep 2019 18:49:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0C6A1905F; Tue, 17 Sep 2019 18:49:13 +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 x8HInDDT056281; Tue, 17 Sep 2019 18:49:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HInDBn056278; Tue, 17 Sep 2019 18:49:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909171849.x8HInDBn056278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 Sep 2019 18:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352458 - in head/sys: net sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: net sys X-SVN-Commit-Revision: 352458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 18:49:14 -0000 Author: kib Date: Tue Sep 17 18:49:13 2019 New Revision: 352458 URL: https://svnweb.freebsd.org/changeset/base/352458 Log: Add SIOCGIFDOWNREASON. The ioctl(2) is intended to provide more details about the cause of the down for the link. Eventually we might define a comprehensive list of codes for the situations. But interface also allows the driver to provide free-form null-terminated ASCII string to provide arbitrary non-formalized information. Sample implementation exists for mlx5(4), where the string is fetched from firmware controlling the port. Reviewed by: hselasky, rrs Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21527 Modified: head/sys/net/if.c head/sys/net/if.h head/sys/sys/sockio.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Sep 17 18:41:39 2019 (r352457) +++ head/sys/net/if.c Tue Sep 17 18:49:13 2019 (r352458) @@ -2891,6 +2891,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, case SIOCGIFGENERIC: case SIOCGIFRSSKEY: case SIOCGIFRSSHASH: + case SIOCGIFDOWNREASON: if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); error = (*ifp->if_ioctl)(ifp, cmd, data); Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Sep 17 18:41:39 2019 (r352457) +++ head/sys/net/if.h Tue Sep 17 18:49:13 2019 (r352458) @@ -585,6 +585,16 @@ struct ifrsshash { #define IFNET_PCP_NONE 0xff /* PCP disabled */ +#define IFDR_MSG_SIZE 64 +#define IFDR_REASON_MSG 1 +#define IFDR_REASON_VENDOR 2 +struct ifdownreason { + char ifdr_name[IFNAMSIZ]; + uint32_t ifdr_reason; + uint32_t ifdr_vendor; + char ifdr_msg[IFDR_MSG_SIZE]; +}; + #endif /* __BSD_VISIBLE */ #ifdef _KERNEL Modified: head/sys/sys/sockio.h ============================================================================== --- head/sys/sys/sockio.h Tue Sep 17 18:41:39 2019 (r352457) +++ head/sys/sys/sockio.h Tue Sep 17 18:49:13 2019 (r352458) @@ -143,4 +143,6 @@ #define SIOCGLANPCP _IOWR('i', 152, struct ifreq) /* Get (V)LAN PCP */ #define SIOCSLANPCP _IOW('i', 153, struct ifreq) /* Set (V)LAN PCP */ +#define SIOCGIFDOWNREASON _IOWR('i', 154, struct ifdownreason) + #endif /* !_SYS_SOCKIO_H_ */ From owner-svn-src-head@freebsd.org Tue Sep 17 18:51:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A00212BEBD; Tue, 17 Sep 2019 18:51:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XsdV6D7Cz4YCt; Tue, 17 Sep 2019 18:51:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EF6E190C9; Tue, 17 Sep 2019 18:51: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 x8HIpArD057247; Tue, 17 Sep 2019 18:51:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HIpA2X057246; Tue, 17 Sep 2019 18:51:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909171851.x8HIpA2X057246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 Sep 2019 18:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352459 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 352459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 18:51:11 -0000 Author: kib Date: Tue Sep 17 18:51:10 2019 New Revision: 352459 URL: https://svnweb.freebsd.org/changeset/base/352459 Log: ifconfig: add report of the string from SIOCGIFDOWNREASON. Sample output: # ifconfig mce0 mce0: flags=8802 metric 0 mtu 1500 options=3ed07bb ether e4:1d:2d:e7:10:0a media: Ethernet autoselect status: no carrier (Negotiation failure) nd6 options=21 Reviewed by: hselasky, rrs Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21527 Modified: head/sbin/ifconfig/ifmedia.c Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Tue Sep 17 18:49:13 2019 (r352458) +++ head/sbin/ifconfig/ifmedia.c Tue Sep 17 18:51:10 2019 (r352459) @@ -80,6 +80,7 @@ #include #include #include +#include #include #include #include @@ -110,18 +111,20 @@ static void media_status(int s) { struct ifmediareq ifmr; + struct ifdownreason ifdr; int *media_list, i; - int xmedia = 1; + bool no_carrier, xmedia; (void) memset(&ifmr, 0, sizeof(ifmr)); (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + xmedia = true; /* * Check if interface supports extended media types. */ if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0) - xmedia = 0; - if (xmedia == 0 && ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { + xmedia = false; + if (!xmedia && ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { /* * Interface doesn't support SIOC{G,S}IFMEDIA. */ @@ -158,6 +161,7 @@ media_status(int s) putchar('\n'); if (ifmr.ifm_status & IFM_AVALID) { + no_carrier = false; printf("\tstatus: "); switch (IFM_TYPE(ifmr.ifm_active)) { case IFM_ETHER: @@ -165,7 +169,7 @@ media_status(int s) if (ifmr.ifm_status & IFM_ACTIVE) printf("active"); else - printf("no carrier"); + no_carrier = true; break; case IFM_IEEE80211: @@ -176,8 +180,26 @@ media_status(int s) else printf("running"); } else - printf("no carrier"); + no_carrier = true; break; + } + if (no_carrier) { + printf("no carrier"); + memset(&ifdr, 0, sizeof(ifdr)); + strlcpy(ifdr.ifdr_name, name, sizeof(ifdr.ifdr_name)); + if (ioctl(s, SIOCGIFDOWNREASON, (caddr_t)&ifdr) == 0) { + switch (ifdr.ifdr_reason) { + case IFDR_REASON_MSG: + printf(" (%s)", ifdr.ifdr_msg); + break; + case IFDR_REASON_VENDOR: + printf(" (vendor code %d)", + ifdr.ifdr_vendor); + break; + default: + break; + } + } } putchar('\n'); } From owner-svn-src-head@freebsd.org Tue Sep 17 20:03:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B9D012D805; Tue, 17 Sep 2019 20:03:21 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XvDn0qBWz4dJB; Tue, 17 Sep 2019 20:03:21 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F41EA19F3F; Tue, 17 Sep 2019 20:03:20 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HK3KxN005911; Tue, 17 Sep 2019 20:03:20 GMT (envelope-from swills@FreeBSD.org) Received: (from swills@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HK3K4P005909; Tue, 17 Sep 2019 20:03:20 GMT (envelope-from swills@FreeBSD.org) Message-Id: <201909172003.x8HK3K4P005909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: swills set sender to swills@FreeBSD.org using -f From: Steve Wills Date: Tue, 17 Sep 2019 20:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352460 - in head/usr.sbin: newsyslog syslogd X-SVN-Group: head X-SVN-Commit-Author: swills X-SVN-Commit-Paths: in head/usr.sbin: newsyslog syslogd X-SVN-Commit-Revision: 352460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 20:03:21 -0000 Author: swills (ports committer) Date: Tue Sep 17 20:03:20 2019 New Revision: 352460 URL: https://svnweb.freebsd.org/changeset/base/352460 Log: log daemon.info to /var/log/daemon.log by default log daemon facility now that daemon(8) has syslog support which defaults to daemon facility, info priority Reviewed by: bapt Approved by: bapt Differential Revision: https://reviews.freebsd.org/D21561 Modified: head/usr.sbin/newsyslog/newsyslog.conf head/usr.sbin/syslogd/syslog.conf Modified: head/usr.sbin/newsyslog/newsyslog.conf ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.conf Tue Sep 17 18:51:10 2019 (r352459) +++ head/usr.sbin/newsyslog/newsyslog.conf Tue Sep 17 20:03:20 2019 (r352460) @@ -30,6 +30,7 @@ /var/log/security 600 10 1000 * JC /var/log/utx.log 644 3 * @01T05 B /var/log/weekly.log 640 5 * $W6D0 JN +/var/log/daemon 644 5 1000 @0101T JC /etc/newsyslog.conf.d/[!.]*.conf /usr/local/etc/newsyslog.conf.d/[!.]*.conf Modified: head/usr.sbin/syslogd/syslog.conf ============================================================================== --- head/usr.sbin/syslogd/syslog.conf Tue Sep 17 18:51:10 2019 (r352459) +++ head/usr.sbin/syslogd/syslog.conf Tue Sep 17 20:03:20 2019 (r352460) @@ -14,6 +14,7 @@ cron.* /var/log/cron !-devd *.=debug /var/log/debug.log *.emerg * +daemon.info /var/log/daemon.log # uncomment this to log all writes to /dev/console to /var/log/console.log # touch /var/log/console.log and chmod it to mode 600 before it will work #console.info /var/log/console.log From owner-svn-src-head@freebsd.org Tue Sep 17 20:05:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FE6312D899; Tue, 17 Sep 2019 20:05:07 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XvGq1vm9z4dRM; Tue, 17 Sep 2019 20:05:07 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24F9719F42; Tue, 17 Sep 2019 20:05:07 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HK574e006044; Tue, 17 Sep 2019 20:05:07 GMT (envelope-from swills@FreeBSD.org) Received: (from swills@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HK57Di006043; Tue, 17 Sep 2019 20:05:07 GMT (envelope-from swills@FreeBSD.org) Message-Id: <201909172005.x8HK57Di006043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: swills set sender to swills@FreeBSD.org using -f From: Steve Wills Date: Tue, 17 Sep 2019 20:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352461 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: swills X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 352461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 20:05:07 -0000 Author: swills (ports committer) Date: Tue Sep 17 20:05:06 2019 New Revision: 352461 URL: https://svnweb.freebsd.org/changeset/base/352461 Log: Use correct filename in newsyslog.conf Approved by: bapt (implicit) Differential Revision: https://reviews.freebsd.org/D21561 Modified: head/usr.sbin/newsyslog/newsyslog.conf Modified: head/usr.sbin/newsyslog/newsyslog.conf ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.conf Tue Sep 17 20:03:20 2019 (r352460) +++ head/usr.sbin/newsyslog/newsyslog.conf Tue Sep 17 20:05:06 2019 (r352461) @@ -30,7 +30,7 @@ /var/log/security 600 10 1000 * JC /var/log/utx.log 644 3 * @01T05 B /var/log/weekly.log 640 5 * $W6D0 JN -/var/log/daemon 644 5 1000 @0101T JC +/var/log/daemon.log 644 5 1000 @0101T JC /etc/newsyslog.conf.d/[!.]*.conf /usr/local/etc/newsyslog.conf.d/[!.]*.conf From owner-svn-src-head@freebsd.org Tue Sep 17 22:08:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3578EE8576; Tue, 17 Sep 2019 22:08:17 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xy0x0gk8z4l3C; Tue, 17 Sep 2019 22:08:17 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFE2D1B5CA; Tue, 17 Sep 2019 22:08:16 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HM8GGD076393; Tue, 17 Sep 2019 22:08:16 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HM8Gnr076392; Tue, 17 Sep 2019 22:08:16 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909172208.x8HM8Gnr076392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 17 Sep 2019 22:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352462 - head/tests/sys/netpfil/common X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netpfil/common X-SVN-Commit-Revision: 352462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 22:08:17 -0000 Author: lwhsu Date: Tue Sep 17 22:08:16 2019 New Revision: 352462 URL: https://svnweb.freebsd.org/changeset/base/352462 Log: Temporarily skip sys.netpfil.common.forward.pf_v4 on i386 CI as it always fails PR: 240085 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netpfil/common/forward.sh Modified: head/tests/sys/netpfil/common/forward.sh ============================================================================== --- head/tests/sys/netpfil/common/forward.sh Tue Sep 17 20:05:06 2019 (r352461) +++ head/tests/sys/netpfil/common/forward.sh Tue Sep 17 22:08:16 2019 (r352462) @@ -40,6 +40,10 @@ v4_head() v4_body() { firewall=$1 + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "i386" ] && [ "${firewall}" = "pf" ]; then + atf_skip "https://bugs.freebsd.org/240085" + fi firewall_init $firewall epair_send=$(vnet_mkepair) From owner-svn-src-head@freebsd.org Tue Sep 17 22:09:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00622E8636; Tue, 17 Sep 2019 22:09:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xy226CrPz4lBk; Tue, 17 Sep 2019 22:09:14 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B885F1B5D0; Tue, 17 Sep 2019 22:09:14 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8HM9ELa076494; Tue, 17 Sep 2019 22:09:14 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8HM9ELi076493; Tue, 17 Sep 2019 22:09:14 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909172209.x8HM9ELi076493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 17 Sep 2019 22:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352463 - head/tests/sys/netpfil/common X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netpfil/common X-SVN-Commit-Revision: 352463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 22:09:15 -0000 Author: lwhsu Date: Tue Sep 17 22:09:14 2019 New Revision: 352463 URL: https://svnweb.freebsd.org/changeset/base/352463 Log: Temporarily skip sys.netpfil.common.tos.pf_tos on i386 CI as it always fails PR: 240086 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netpfil/common/tos.sh Modified: head/tests/sys/netpfil/common/tos.sh ============================================================================== --- head/tests/sys/netpfil/common/tos.sh Tue Sep 17 22:08:16 2019 (r352462) +++ head/tests/sys/netpfil/common/tos.sh Tue Sep 17 22:09:14 2019 (r352463) @@ -40,6 +40,10 @@ tos_head() tos_body() { firewall=$1 + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "i386" ] && [ "${firewall}" = "pf" ]; then + atf_skip "https://bugs.freebsd.org/240086" + fi firewall_init $firewall epair_send=$(vnet_mkepair) From owner-svn-src-head@freebsd.org Tue Sep 17 23:18:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E81DCEA08B; Tue, 17 Sep 2019 23:18:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XzYq5rLlz4pB9; Tue, 17 Sep 2019 23:18:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f41.google.com with SMTP id q10so11798777iop.2; Tue, 17 Sep 2019 16:18:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=510hRvj20U2t/iOIkqm++Rn80Ilexx8vJrOB+SdJdCs=; b=De/7+lQAgeTD0ynkebGaN4L3mU1wKna+p7UKwlJqycybxIRDK99S6v8vY7YHm+fkpN XUj0wQ799SnRpG7iPGOvMJ6NhSCNJfBVpCeF3+zcOmrUbC6ZWysKR4+Kqdik/uE9PXR5 Lr6B0fWTP/BxkvOfDy0PLFWMgF41kkbgYjO/QUdOfAeUM9psH3PHcONXMIkIj7wsWCsq nKraPFGSN3yoNHP6TvdkYjDHAViDuZEY3AFCAtkUSpbotgyFruCznvZziH4YjEQcNVms VgVXrrHang6mZI/evlm0j4rD6X5S+PpAkf08lpwOGhoDTOdTG/5hHtwmEtqdrDWn/nh3 AvTQ== X-Gm-Message-State: APjAAAXJiRH/THqStrVvOjJj8K3omMl47u3P0TpdRCVZGSU48483S/vh 8QO95gwbRFy31CG5MY6hdU3wnXfD X-Google-Smtp-Source: APXvYqwZF7VI2ncr0Cl4BzYd2bj/9rh+C007Nsj+MNp5dQE/Pu67aXqPlBt+8nI6kP2Ug6JM5XFHDQ== X-Received: by 2002:a5d:964f:: with SMTP id d15mr1743204ios.230.1568762302394; Tue, 17 Sep 2019 16:18:22 -0700 (PDT) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com. [209.85.166.48]) by smtp.gmail.com with ESMTPSA id w22sm3563475ior.79.2019.09.17.16.18.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Sep 2019 16:18:21 -0700 (PDT) Received: by mail-io1-f48.google.com with SMTP id j4so11629024iog.11; Tue, 17 Sep 2019 16:18:21 -0700 (PDT) X-Received: by 2002:a6b:5b0a:: with SMTP id v10mr1789018ioh.80.1568762301761; Tue, 17 Sep 2019 16:18:21 -0700 (PDT) MIME-Version: 1.0 References: <201909171616.x8HGGlkb066218@repo.freebsd.org> In-Reply-To: <201909171616.x8HGGlkb066218@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 17 Sep 2019 16:18:10 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352451 - head/stand/libsa To: Toomas Soome Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46XzYq5rLlz4pB9 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 23:18:24 -0000 Well, hang on; it's also perfectly legal for a malloc implementation to return NULL for requests of zero bytes. You can access exactly the number of bytes requested in the allocation; and free(NULL) works as expected. NULL (0) is also aligned to any size you could want. Best, Conrad On Tue, Sep 17, 2019 at 9:16 AM Toomas Soome wrote: > > Author: tsoome > Date: Tue Sep 17 16:16:46 2019 > New Revision: 352451 > URL: https://svnweb.freebsd.org/changeset/base/352451 > > Log: > loader: revert r352421 > > As insisted by kib, malloc(0) is quite legal. > > Modified: > head/stand/libsa/zalloc_malloc.c > > Modified: head/stand/libsa/zalloc_malloc.c > ============================================================================== > --- head/stand/libsa/zalloc_malloc.c Tue Sep 17 15:53:40 2019 (r352450) > +++ head/stand/libsa/zalloc_malloc.c Tue Sep 17 16:16:46 2019 (r352451) > @@ -73,9 +73,6 @@ Malloc_align(size_t bytes, size_t alignment) > { > Guard *res; > > - if (bytes == 0) > - return (NULL); > - > #ifdef USEENDGUARD > bytes += MALLOCALIGN + 1; > #else From owner-svn-src-head@freebsd.org Wed Sep 18 01:33:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89F65ED4C2; Wed, 18 Sep 2019 01:33:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Y2YV33SSz4vQy; Wed, 18 Sep 2019 01:33:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C59C1DB03; Wed, 18 Sep 2019 01:33:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8I1XIA8098807; Wed, 18 Sep 2019 01:33:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8I1XI63098806; Wed, 18 Sep 2019 01:33:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909180133.x8I1XI63098806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 18 Sep 2019 01:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352464 - head/stand/mips/uboot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/mips/uboot X-SVN-Commit-Revision: 352464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 01:33:18 -0000 Author: kevans Date: Wed Sep 18 01:33:17 2019 New Revision: 352464 URL: https://svnweb.freebsd.org/changeset/base/352464 Log: mips: ubldr: use truncated load address for mips32 BFD appears to silently truncate 0xffffffff80800000 when it processes the ldscript for 32-bit mips, but LLD chokes on it as the linker script tries to place elements above 32-bit range. It's unclear to me if silent truncation is kosher or not and whether this patch is really what we want to do, but it is one approach at least. Reviewed by: imp, mizhka Differential Revision: https://reviews.freebsd.org/D21487 Modified: head/stand/mips/uboot/Makefile Modified: head/stand/mips/uboot/Makefile ============================================================================== --- head/stand/mips/uboot/Makefile Tue Sep 17 22:09:14 2019 (r352463) +++ head/stand/mips/uboot/Makefile Wed Sep 18 01:33:17 2019 (r352464) @@ -19,7 +19,11 @@ INSTALLFLAGS= -b WARNS?= 1 # Address at which ubldr will be loaded. # This varies for different boards and SOCs. +.if ${MACHINE_ARCH:Mmips64*} UBLDR_LOADADDR?= 0xffffffff80800000 +.else +UBLDR_LOADADDR?= 0x80800000 +.endif # Architecture-specific loader code SRCS= start.S conf.c vers.c From owner-svn-src-head@freebsd.org Wed Sep 18 01:58:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62C45EDA7F; Wed, 18 Sep 2019 01:58:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Y3751zk1z3Bxn; Wed, 18 Sep 2019 01:58:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2300D1DE85; Wed, 18 Sep 2019 01:58:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8I1wuPY011259; Wed, 18 Sep 2019 01:58:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8I1wuZu011258; Wed, 18 Sep 2019 01:58:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909180158.x8I1wuZu011258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 18 Sep 2019 01:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352465 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 352465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 01:58:57 -0000 Author: kevans Date: Wed Sep 18 01:58:56 2019 New Revision: 352465 URL: https://svnweb.freebsd.org/changeset/base/352465 Log: googletest: default-disable on all of MIPS for now Parts of the fusefs tests trigger a bug in current versions of llvm: IR representation of some routine for the MIPS targets is a function with a large number of arguments. This then leads the compiler on an hour+ long goose chase, which is OK if you build the current tree but less-so if you're trying external toolchain or doing a universe build involving mips when it eventually gets switched over to LLVM. Better, accurate details can be found in LLVM PR43263. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Sep 18 01:33:17 2019 (r352464) +++ head/share/mk/src.opts.mk Wed Sep 18 01:58:56 2019 (r352465) @@ -108,7 +108,6 @@ __DEFAULT_YES_OPTIONS = \ GDB \ GNU_DIFF \ GNU_GREP \ - GOOGLETEST \ GPIO \ HAST \ HTML \ @@ -258,6 +257,15 @@ __T=${MACHINE_ARCH} __TT=${TARGET} .else __TT=${MACHINE} +.endif + +# Default GOOGLETEST to off for MIPS while LLVM PR 43263 is active. Part +# of the fusefs tests trigger excessively long compile times. It does +# eventually succeed, but this shouldn't be forced on those building by default. +.if ${__TT} == "mips" +__DEFAULT_NO_OPTIONS+= GOOGLETEST +.else +__DEFAULT_YES_OPTIONS+= GOOGLETEST .endif # All supported backends for LLVM_TARGET_XXX From owner-svn-src-head@freebsd.org Wed Sep 18 02:03:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7349EDD2F; Wed, 18 Sep 2019 02:03:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Y3DX3xYZz3CMf; Wed, 18 Sep 2019 02:03:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BD471E03C; Wed, 18 Sep 2019 02:03:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8I23eeI016637; Wed, 18 Sep 2019 02:03:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8I23eew016636; Wed, 18 Sep 2019 02:03:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909180203.x8I23eew016636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 18 Sep 2019 02:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352466 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 352466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 02:03:40 -0000 Author: kevans Date: Wed Sep 18 02:03:39 2019 New Revision: 352466 URL: https://svnweb.freebsd.org/changeset/base/352466 Log: Add description for WITH_GOOGLETEST This is the logical negation of WITHOUT_GOOGLETEST, and helpful to have as we now have different per-arch defaults for this option. Added: head/tools/build/options/WITH_GOOGLETEST (contents, props changed) Added: head/tools/build/options/WITH_GOOGLETEST ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GOOGLETEST Wed Sep 18 02:03:39 2019 (r352466) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build and install +.Lb libgmock , +.Lb libgtest , +and dependent tests. From owner-svn-src-head@freebsd.org Wed Sep 18 02:04:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 712FAEDDB8; Wed, 18 Sep 2019 02:04:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Y3Fk2H4zz3CVG; Wed, 18 Sep 2019 02:04:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 317831E03D; Wed, 18 Sep 2019 02:04:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8I24giJ016732; Wed, 18 Sep 2019 02:04:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8I24gIV016731; Wed, 18 Sep 2019 02:04:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909180204.x8I24gIV016731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 18 Sep 2019 02:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352467 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 352467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 02:04:42 -0000 Author: kevans Date: Wed Sep 18 02:04:41 2019 New Revision: 352467 URL: https://svnweb.freebsd.org/changeset/base/352467 Log: src.conf(5): regenerate after r352465, r352466 These changed the defaults for the GOOGLETEST knob and added a description for WITH_GOOGLETEST. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Sep 18 02:03:39 2019 (r352466) +++ head/share/man/man5/src.conf.5 Wed Sep 18 02:04:41 2019 (r352467) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd August 16, 2019 +.Dd September 17, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -831,6 +831,17 @@ Set to neither build nor install .Lb libgmock , .Lb libgtest , and dependent tests. +.Pp +This is a default setting on +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +.It Va WITH_GOOGLETEST +Set to build and install +.Lb libgmock , +.Lb libgtest , +and dependent tests. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GPIO Set to not build .Xr gpioctl 8 From owner-svn-src-head@freebsd.org Wed Sep 18 07:57:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 965EAF5C83; Wed, 18 Sep 2019 07:57:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YC5K3W4Yz41gh; Wed, 18 Sep 2019 07:57:57 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BC1721EE4; Wed, 18 Sep 2019 07:57:57 +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 x8I7vvoJ024623; Wed, 18 Sep 2019 07:57:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8I7vuYW024620; Wed, 18 Sep 2019 07:57:56 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909180757.x8I7vuYW024620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 18 Sep 2019 07:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352482 - in head: . lib lib/libarchive X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: . lib lib/libarchive X-SVN-Commit-Revision: 352482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 07:57:57 -0000 Author: bapt Date: Wed Sep 18 07:57:56 2019 New Revision: 352482 URL: https://svnweb.freebsd.org/changeset/base/352482 Log: Add native support for zstd to libarchive Note that old pkg will failed to build after this. A recent ports tree (one providing pkg 1.12+) is required to build. Older already built pkg, should continue working as expected PR: 238797 Exp run by: antoine Reviewed by: cem Approved by: cem Differential Revision: https://reviews.freebsd.org/D20752 Modified: head/Makefile.inc1 head/lib/Makefile head/lib/libarchive/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Sep 18 07:32:15 2019 (r352481) +++ head/Makefile.inc1 Wed Sep 18 07:57:56 2019 (r352482) @@ -2770,6 +2770,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libfigpar \ ${_lib_libgssapi} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ + lib/libzstd \ ${_lib_casper} \ lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam/libpam ${_lib_libthr} \ Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Sep 18 07:32:15 2019 (r352481) +++ head/lib/Makefile Wed Sep 18 07:57:56 2019 (r352482) @@ -102,7 +102,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ # libraries, those libraries should be listed as build order dependencies here. SUBDIR_DEPEND_geom= libufs -SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd +SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} SUBDIR_DEPEND_libc++:= libcxxrt Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Wed Sep 18 07:32:15 2019 (r352481) +++ head/lib/libarchive/Makefile Wed Sep 18 07:57:56 2019 (r352482) @@ -6,8 +6,8 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive LIB= archive -LIBADD= z bz2 lzma bsdxml -CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 +LIBADD= z bz2 lzma bsdxml zstd +CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -DHAVE_ZSTD_H=1 -DHAVE_LIBZSTD=1 # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system. # It has no real relation to the libarchive version number. @@ -15,6 +15,7 @@ SHLIB_MAJOR= 7 CFLAGS+= -DPLATFORM_CONFIG_H=\"${.CURDIR}/config_freebsd.h\" CFLAGS+= -I${.OBJDIR} +CFLAGS+= -I${SRCTOP}/sys/contrib/zstd/lib .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_OPENSSL From owner-svn-src-head@freebsd.org Wed Sep 18 08:02:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 338D3F69D4; Wed, 18 Sep 2019 08:02:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YCB40fWKz428X; Wed, 18 Sep 2019 08:02:04 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB2E22077; Wed, 18 Sep 2019 08:02:03 +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 x8I823tW026566; Wed, 18 Sep 2019 08:02:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8I823Iu026565; Wed, 18 Sep 2019 08:02:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909180802.x8I823Iu026565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 18 Sep 2019 08:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352483 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 352483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 08:02:04 -0000 Author: bapt Date: Wed Sep 18 08:02:03 2019 New Revision: 352483 URL: https://svnweb.freebsd.org/changeset/base/352483 Log: Add the missing bits for LIBADD to properly function now that libarchive is linked to libzstd Pointy hat: bapt Reported by: antoine Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Wed Sep 18 07:57:56 2019 (r352482) +++ head/share/mk/src.libnames.mk Wed Sep 18 08:02:03 2019 (r352483) @@ -230,7 +230,7 @@ LIBVERIEXEC?= ${LIBVERIEXECDIR}/libveriexec${PIE_SUFFI # Each library's LIBADD needs to be duplicated here for static linkage of # 2nd+ order consumers. Auto-generating this would be better. _DP_80211= sbuf bsdxml -_DP_archive= z bz2 lzma bsdxml +_DP_archive= z bz2 lzma bsdxml zstd _DP_zstd= pthread .if ${MK_BLACKLIST} != "no" _DP_blacklist+= pthread From owner-svn-src-head@freebsd.org Wed Sep 18 08:37:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14CE1F7779 for ; Wed, 18 Sep 2019 08:37:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YCyy2fJCz43jB for ; Wed, 18 Sep 2019 08:37:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72d.google.com with SMTP id i78so7100324qke.11 for ; Wed, 18 Sep 2019 01:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6FYq9RJi/7MgmXDJn8UxswwKOI0zTBhKb78CwHGTUck=; b=o9xUD/YZRQjI/fopRmb3s4TJT7p30L8xmRYd+sc3T2O5qEskKZoWvmL+YtDWfeEQMx Wzgu6c686/OZ0SnI9r8ve/YTPpUOXiQMHFnHoPLomPvcEURf30ceNhzHzpDwHhNuhy7L Jt/AyksfL4FJteqjxx5m+wODB/k6GMhNtUyyXirK62LEgl3+kZDBS6vcM4+ghMcaIwcI DpxNY2khaylU5ESY4wJsYn3u/6VbFHSdNCqcuzk58Kq7JsAv2PDpolnYZRMQhyQUfey0 J0fDSrFzRIjmVnfRPB01ZirW6/+bR0fh4Ud7Kvzpj2YMYB8b4RuEho3RhSP6qnMdmwEr 5Uow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6FYq9RJi/7MgmXDJn8UxswwKOI0zTBhKb78CwHGTUck=; b=asqC9gJPI/KDrNYQhSIUgypijALKCSM2LQdZb1UZqfpvIpb2vKe84QPvlReiX2qNMD MXJN3VcLs/35tUbt4fbM4uBIwp/X2J2GVYgPsFcw0csdEdQtXIaCmn3aRiaGSK5hck8i n/mKQpWJl4WcV/LZRAb6j7XgJrWzWVCsw544zkS3nqbMw0WGLCPP49N8BiuAAdbnjJIf rJztKBpPmAggAkA9/3wThvG+d4my2Fs17d898eucZJQyeFvS/Y3pYRkYu5m8vELdSK4O HazM/LzRqiqHqjUyjQWE7jp1rvM69J3c6zjlNub8LqLY/z9KlNWFSAYGA1L/EmjaoGuL 5Kww== X-Gm-Message-State: APjAAAXMc6DcoEyGzvkg3CQEXeHUWbyTEK4ccRykLG/lb6NIhBwACWQb keYUTsHDc1o1LS8QOwPFtWZGSj8AwjWqUKaKunw6Aw== X-Google-Smtp-Source: APXvYqwYSHKVKaryplEKnx3iTb6hPz102prEOk5j7hRIhLlPuO2pMYjCParu9FijQcXpvak6B4Sei4/5O2tufS/XAZ0= X-Received: by 2002:a37:30f:: with SMTP id 15mr2537199qkd.240.1568795849315; Wed, 18 Sep 2019 01:37:29 -0700 (PDT) MIME-Version: 1.0 References: <201909171616.x8HGGlkb066218@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 18 Sep 2019 09:37:17 +0100 Message-ID: Subject: Re: svn commit: r352451 - head/stand/libsa To: "Conrad E. Meyer" Cc: Toomas Soome , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46YCyy2fJCz43jB X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=o9xUD/YZ; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72d) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.87 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[d.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.87)[ip: (-9.38), ipnet: 2607:f8b0::/32(-2.68), asn: 15169(-2.23), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 08:37:31 -0000 On Wed, Sep 18, 2019, 12:18 AM Conrad Meyer wrote: > Well, hang on; it's also perfectly legal for a malloc implementation > to return NULL for requests of zero bytes. You can access exactly the > number of bytes requested in the allocation; and free(NULL) works as > expected. NULL (0) is also aligned to any size you could want. > Legal, yes. But it is different than all the other FreeBSD environments, so the loader becomes the odd man out. This restores the consistency. Warner Best, > Conrad > > On Tue, Sep 17, 2019 at 9:16 AM Toomas Soome wrote: > > > > Author: tsoome > > Date: Tue Sep 17 16:16:46 2019 > > New Revision: 352451 > > URL: https://svnweb.freebsd.org/changeset/base/352451 > > > > Log: > > loader: revert r352421 > > > > As insisted by kib, malloc(0) is quite legal. > > > > Modified: > > head/stand/libsa/zalloc_malloc.c > > > > Modified: head/stand/libsa/zalloc_malloc.c > > > ============================================================================== > > --- head/stand/libsa/zalloc_malloc.c Tue Sep 17 15:53:40 2019 > (r352450) > > +++ head/stand/libsa/zalloc_malloc.c Tue Sep 17 16:16:46 2019 > (r352451) > > @@ -73,9 +73,6 @@ Malloc_align(size_t bytes, size_t alignment) > > { > > Guard *res; > > > > - if (bytes == 0) > > - return (NULL); > > - > > #ifdef USEENDGUARD > > bytes += MALLOCALIGN + 1; > > #else > From owner-svn-src-head@freebsd.org Wed Sep 18 08:44:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E637DF79C7; Wed, 18 Sep 2019 08:44:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46YD6g3n0lz446f; Wed, 18 Sep 2019 08:44:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E54B7260408; Wed, 18 Sep 2019 10:44:02 +0200 (CEST) Subject: Re: svn commit: r352451 - head/stand/libsa To: Warner Losh , "Conrad E. Meyer" Cc: Toomas Soome , src-committers , svn-src-all , svn-src-head References: <201909171616.x8HGGlkb066218@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <347a71f4-bbad-0d39-9e75-0564d06d7a1e@selasky.org> Date: Wed, 18 Sep 2019 10:43:16 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46YD6g3n0lz446f X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.48 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; IP_SCORE(-3.18)[ip: (-9.36), ipnet: 88.99.0.0/16(-4.75), asn: 24940(-1.78), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 08:44:13 -0000 On 2019-09-18 10:37, Warner Losh wrote: > On Wed, Sep 18, 2019, 12:18 AM Conrad Meyer wrote: > >> Well, hang on; it's also perfectly legal for a malloc implementation >> to return NULL for requests of zero bytes. You can access exactly the >> number of bytes requested in the allocation; and free(NULL) works as >> expected. NULL (0) is also aligned to any size you could want. >> > > Legal, yes. But it is different than all the other FreeBSD environments, > so the loader becomes the odd man out. This restores the consistency. > Hi, The problem is the code that use malloc() that take NULL as a failure, even if the size is zero :-) array = malloc(n * sizeof(q)); if (array == NULL) goto failure; --HPS From owner-svn-src-head@freebsd.org Wed Sep 18 11:59:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8C18FB374 for ; Wed, 18 Sep 2019 11:59:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YJRW5tHtz4DW6 for ; Wed, 18 Sep 2019 11:59:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x834.google.com with SMTP id c21so8448807qtj.12 for ; Wed, 18 Sep 2019 04:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XL9ELMHmimsD/QqzRRaugiKqyv4hryLcwg9DlRwDPbA=; b=1y4GU9sKFcWxiSEyRLy+p6zftzcOYHIUHdN0dHW69qCNLtcm/iH5/PPQjSFLXacj3w yOr2IT2jexhEcuAHyZOrotja2Anyma+QPgFUuSicbkedNBpzkLFkKXX7Tj/goPAZ7QQJ UaxfOTmuRkx3zJTRXPs7p2S7cuRwUbdsx0fofI/M/8QkEEKQN8/mkh0078VojHdM8g9b VEho30/UGBB/83zerkuUaTj2W8v9OkNE9SDrisE2fR5XHQ0EaD+0gCLtiCtfAG6bJObU J/LmSDYvSm2qn8DBezLS4zUDOByciuHG6xBNze81ceRfGHkqg7pYjkas8qMyU3Afrx8p AWpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XL9ELMHmimsD/QqzRRaugiKqyv4hryLcwg9DlRwDPbA=; b=o8IRKMg1kWYP/lanf9+9HyzIk2R/8w9EL2T1K5StOCR8VuW6eKmiLtB/BKX1S0noEw Wk/9Zp1hJWKWa/n4KBmgFyTQTPehWsmRQ1hUlBcSQMhIW7xuzDg0xMnTxN1v8U/hTN88 xVmCN8Fk2qzX5YPOj8PCrTfRmtmI4CrHoo0KL6U/LwpGJt8rV4qyu+T8MF7GpWGCD1mO mLE/B/L7k9IfuydP/LQdFYPoFh/ox+xYBTslDtCK2ePFroOacwLcgW+zVNLT1t4hEifW zgwBsclpf2YK/+A0ieBp+z/JxMOh/fytNv2PRyuPsRtxFPbMDFTalRL0nU/BTu/yf0UB Z5kg== X-Gm-Message-State: APjAAAWdHuhq04FKpWeNuqvKgMRy5GD/j8+8hhSWMVIsVBRvm1ByGuu3 YQ3sMWDc9ayMCAZMkgnboAJEU0aHoI+G1dNdNpd3188Uq7U= X-Google-Smtp-Source: APXvYqzH5tnewJr2ckSfKkBGjxxZrRHF4lQzTDu867ShZE11DyL/+PVBFZHCoKWViSUVQT+kOeI98uRHquAo1DdH+48= X-Received: by 2002:ac8:44c9:: with SMTP id b9mr3620893qto.175.1568807942530; Wed, 18 Sep 2019 04:59:02 -0700 (PDT) MIME-Version: 1.0 References: <201909171616.x8HGGlkb066218@repo.freebsd.org> <347a71f4-bbad-0d39-9e75-0564d06d7a1e@selasky.org> In-Reply-To: <347a71f4-bbad-0d39-9e75-0564d06d7a1e@selasky.org> From: Warner Losh Date: Wed, 18 Sep 2019 12:58:33 +0100 Message-ID: Subject: Re: svn commit: r352451 - head/stand/libsa To: Hans Petter Selasky Cc: "Conrad E. Meyer" , Toomas Soome , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46YJRW5tHtz4DW6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=1y4GU9sK; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::834) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.88 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.88)[ip: (-9.42), ipnet: 2607:f8b0::/32(-2.68), asn: 15169(-2.23), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 11:59:04 -0000 On Wed, Sep 18, 2019, 9:44 AM Hans Petter Selasky wrote: > On 2019-09-18 10:37, Warner Losh wrote: > > On Wed, Sep 18, 2019, 12:18 AM Conrad Meyer wrote: > > > >> Well, hang on; it's also perfectly legal for a malloc implementation > >> to return NULL for requests of zero bytes. You can access exactly the > >> number of bytes requested in the allocation; and free(NULL) works as > >> expected. NULL (0) is also aligned to any size you could want. > >> > > > > Legal, yes. But it is different than all the other FreeBSD environments, > > so the loader becomes the odd man out. This restores the consistency. > > > > Hi, > > The problem is the code that use malloc() that take NULL as a failure, > even if the size is zero :-) > > array = malloc(n * sizeof(q)); > if (array == NULL) > goto failure; > Such code isn't portable... Warner --HPS > > From owner-svn-src-head@freebsd.org Wed Sep 18 12:34:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D4BCFC706; Wed, 18 Sep 2019 12:34:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YKDR2FKbz4GHV; Wed, 18 Sep 2019 12:34:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x62f.google.com with SMTP id 4so3089131pld.10; Wed, 18 Sep 2019 05:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=aD9pixccf+aGWsrIGJSgW81goM9b0U0pX7AmH96tl0w=; b=WY1jgBN9bGrhZFzy0rcdUF+L5yQuq11vMkoiiZnz1o/xBwUH7PKBsoHMvDusBtNi3I RLw7+lEctALDs+ZYMMm9oxk09/LEnaF22kr7/BlVYehL//KpA9nvOAiLF12MFfvwS6yd D9cgUWtnYvR1vu15n1deVGzxA8vlRuSeL6iX75ZFML73WuvQ7VnBrBBN8chwKhiSNI2a w2QnFWsj8TCYhZsI0iEXLHJGUXtopEBbBJG0yOIhVRZ7Jq7JjIcecA0lbuy7m9hcKnxK 5SghyjhPNuG7ZTl0Qzh+pSg4wJA0yIv/Cm24zwwSxDDwtagelVu2zMqyZocGnY1dKpeZ KOlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=aD9pixccf+aGWsrIGJSgW81goM9b0U0pX7AmH96tl0w=; b=L9OL8xTb1eBy212p0B2Xa+4K0SrraxBsBJDC0gf3lwk0ALjmrhrJvdOZ0gu9ShzzE4 rZr9/jkkPtTCbpPJ2QyNTVaGAWzwhZg+o1kHfcz8z2LtFrPL82Nf20LiIwpBnqJmb2cZ dChoo/Y+bqhp/ISfAFxaRbGPR9x1IK27AD23vaICIYVN7Ym1yCwBS8nrgNSNAqwKKNJJ zwlV/tAY1Ak0bhPDw5482EUubc16pwc1x1TvBwcQ1Kn5wYjbonAs0RC3QkfzdgIx2uqv LU4xhu3J6QtQiMvTqJYvGpUKxDeN3TRV8qljSkqLvuJum7hFvWsr5tNrbOBTpWO1zSqh eCXg== X-Gm-Message-State: APjAAAXSQ0Tp6KNBfs6YPjL5ARqHrbeIpCUdtdJndD2skE9Q+rArNMxR A5V+4ud54KHq9JJ4RokCjVE8+6xOtaE= X-Google-Smtp-Source: APXvYqyvuVzrku0P0D5jf2Fc5zG3dTm7OdRza7khx9Z/DAoC80Xqt53FlOUpLKBAbkXiXBAujAjSEA== X-Received: by 2002:a17:902:aa43:: with SMTP id c3mr3773454plr.11.1568810068843; Wed, 18 Sep 2019 05:34:28 -0700 (PDT) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c9sm1393968pfd.100.2019.09.18.05.34.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Sep 2019 05:34:27 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r352465 - head/share/mk From: Enji Cooper X-Mailer: iPhone Mail (16G102) In-Reply-To: <201909180158.x8I1wuZu011258@repo.freebsd.org> Date: Wed, 18 Sep 2019 05:34:27 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> References: <201909180158.x8I1wuZu011258@repo.freebsd.org> To: Kyle Evans X-Rspamd-Queue-Id: 46YKDR2FKbz4GHV X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 12:34:31 -0000 > On Sep 17, 2019, at 18:58, Kyle Evans wrote: >=20 > Author: kevans > Date: Wed Sep 18 01:58:56 2019 > New Revision: 352465 > URL: https://svnweb.freebsd.org/changeset/base/352465 >=20 > Log: > googletest: default-disable on all of MIPS for now >=20 > Parts of the fusefs tests trigger a bug in current versions of llvm: IR > representation of some routine for the MIPS targets is a function with a > large number of arguments. This then leads the compiler on an hour+ long > goose chase, which is OK if you build the current tree but less-so if you= 're > trying external toolchain or doing a universe build involving mips when i= t > eventually gets switched over to LLVM. >=20 > Better, accurate details can be found in LLVM PR43263. Uhhhhh... why not do this in tests/sys/... instead? -Enji= From owner-svn-src-head@freebsd.org Wed Sep 18 12:41:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0018FC894; Wed, 18 Sep 2019 12:41:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YKN65CNSz4GWK; Wed, 18 Sep 2019 12:41:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 86CCDB35; Wed, 18 Sep 2019 12:41:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f179.google.com with SMTP id z67so7780681qkb.12; Wed, 18 Sep 2019 05:41:10 -0700 (PDT) X-Gm-Message-State: APjAAAUUZgb3HwME7Lr8199XMEoQ7yWJodpI6dp8LQkPOl/0YGwiYNhE akZywzljalb7DSYNU80XmgdW6/JBX0cYNsGly84= X-Google-Smtp-Source: APXvYqwM4aMIPsImbYq2hcrZmskdd+GqvjN5vJB4rgwck3Voahpxhe3OoBKHq+ZZG6eBNyCbmfA9HSmbJSPjxcx8458= X-Received: by 2002:ae9:dd81:: with SMTP id r123mr3685582qkf.103.1568810469982; Wed, 18 Sep 2019 05:41:09 -0700 (PDT) MIME-Version: 1.0 References: <201909180158.x8I1wuZu011258@repo.freebsd.org> <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> In-Reply-To: <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> From: Kyle Evans Date: Wed, 18 Sep 2019 07:40:58 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352465 - head/share/mk To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 12:41:10 -0000 On Wed, Sep 18, 2019 at 7:34 AM Enji Cooper wrote: > > > > On Sep 17, 2019, at 18:58, Kyle Evans wrote: > > > > Author: kevans > > Date: Wed Sep 18 01:58:56 2019 > > New Revision: 352465 > > URL: https://svnweb.freebsd.org/changeset/base/352465 > > > > Log: > > googletest: default-disable on all of MIPS for now > > > > Parts of the fusefs tests trigger a bug in current versions of llvm: IR > > representation of some routine for the MIPS targets is a function with a > > large number of arguments. This then leads the compiler on an hour+ long > > goose chase, which is OK if you build the current tree but less-so if you're > > trying external toolchain or doing a universe build involving mips when it > > eventually gets switched over to LLVM. > > > > Better, accurate details can be found in LLVM PR43263. > > Uhhhhh... why not do this in tests/sys/... instead? Because there's still value in being able to easily enable these for building/running the complete set of tests through standard build infrastructure, but it's not worth adding a knob specifically for the fusefs tests. I also prefer the communication of it being an off-by-default option and easily deduced from src.conf(5) that this part of the build is default-disabled on mips/mips. From owner-svn-src-head@freebsd.org Wed Sep 18 13:54:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DCDBFE178 for ; Wed, 18 Sep 2019 13:54:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YM0F2C2Rz4LVD for ; Wed, 18 Sep 2019 13:54:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72f.google.com with SMTP id p10so8089525qkg.8 for ; Wed, 18 Sep 2019 06:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XRwikxn5g6EWbzXQ61TZKQtamW1pm5X3cmdP9+6sIPc=; b=Q/dp0/4nJg5sdqe46wGn1uMCllIoUpd/VWZD0PQ4eKTQUP3LBTCxV5heflulT838+v b4FZuVh6JqUCRRiNAjUQBCADBq8WKmdH7kgfB5gdnrKmqYfOW09tK4/OP8nOXmP9RfqN OoS7kaskAtBEDQlctufYDSqV9FDRU8H7oYMshQMc34kBqcd+gsBL14A/CtwB1XVe/KfD cG8ykfSwhFy2IVZa6s82RyrteLowcTSOOeGtB2g8OoJqKIvWm1CMVFdmXBAZF6HIteOW UjRMlrRTrYH5LhdZS6xYHuVEcSRydmQy5Z7l72H3MzE80cQXYCTYKosO9cZ0f3bTMUzw Ap8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XRwikxn5g6EWbzXQ61TZKQtamW1pm5X3cmdP9+6sIPc=; b=bAdj3i9L2DCj5TSz00np/svvjKDxMtlvPI2meCeeFEoVe+mhE1V8MFremviYQOjtwK oUDZzW9YmfM6HlBuoi+NxRWMhoRLf3LJ/29hb671TuIvsZ6nKy68+iGmpzIrWrRgu8n7 SeLpmceaQtF89E5afA20x+IIaNagN9EhClvTPFuiwMPwBEAJkyhkhYfrIRgFbVQ/4hAv uKCWw8AUKFAhcPKqOMa6rE/Su14f7Z6qGpZ+hNpSfdn+U/4Mgw8n593TfOvIhDkH6W8J OHNc9bAQarWNQZHztbbVuLhNL4k0azKVxgqb7gI/0vxCDRXrjfSns3QSkivtpezfTraL iJzQ== X-Gm-Message-State: APjAAAW80Ki+Qspat6OJDIXipYjFCMRggFs0lukj3iSrjvDiz0TZhN51 GO/kt9J33537XZ2xWVWwlalae3Bzd6bB/7ucAJckQg== X-Google-Smtp-Source: APXvYqzapiM7f4Qn+WdIepd/VJUDO4hSWsPdsk4CY5Q31sgS2kB8DylUMnUrAZ9YHfe44XdfqylZBRZNxlrhd20vssM= X-Received: by 2002:a37:30f:: with SMTP id 15mr3705071qkd.240.1568814844116; Wed, 18 Sep 2019 06:54:04 -0700 (PDT) MIME-Version: 1.0 References: <201909180158.x8I1wuZu011258@repo.freebsd.org> <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> In-Reply-To: From: Warner Losh Date: Wed, 18 Sep 2019 14:53:49 +0100 Message-ID: Subject: Re: svn commit: r352465 - head/share/mk To: Kyle Evans Cc: Garrett Cooper , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46YM0F2C2Rz4LVD X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=Q/dp0/4n; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72f) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.88 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[f.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.89)[ip: (-9.46), ipnet: 2607:f8b0::/32(-2.68), asn: 15169(-2.23), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_CC(0.00)[gmail.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 13:54:06 -0000 On Wed, Sep 18, 2019, 1:41 PM Kyle Evans wrote: > On Wed, Sep 18, 2019 at 7:34 AM Enji Cooper wrote: > > > > > > > On Sep 17, 2019, at 18:58, Kyle Evans wrote: > > > > > > Author: kevans > > > Date: Wed Sep 18 01:58:56 2019 > > > New Revision: 352465 > > > URL: https://svnweb.freebsd.org/changeset/base/352465 > > > > > > Log: > > > googletest: default-disable on all of MIPS for now > > > > > > Parts of the fusefs tests trigger a bug in current versions of llvm: > IR > > > representation of some routine for the MIPS targets is a function > with a > > > large number of arguments. This then leads the compiler on an hour+ > long > > > goose chase, which is OK if you build the current tree but less-so if > you're > > > trying external toolchain or doing a universe build involving mips > when it > > > eventually gets switched over to LLVM. > > > > > > Better, accurate details can be found in LLVM PR43263. > > > > Uhhhhh... why not do this in tests/sys/... instead? > > Because there's still value in being able to easily enable these for > building/running the complete set of tests through standard build > infrastructure, but it's not worth adding a knob specifically for the > fusefs tests. I also prefer the communication of it being an > off-by-default option and easily deduced from src.conf(5) that this > part of the build is default-disabled on mips/mips. > This is the right way to do this, imho... Warner > From owner-svn-src-head@freebsd.org Wed Sep 18 14:33:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05A57FEFBF; Wed, 18 Sep 2019 14:33:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YMt84ZS0z4P62; Wed, 18 Sep 2019 14:33:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x434.google.com with SMTP id q7so73473pfh.8; Wed, 18 Sep 2019 07:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7zG9fsIp5ZWG8t/NVo2n3trzTl/SuNuBBWDv25aQNJU=; b=Son4I8Ztc/iYdP14OFA9Ri7/b8qFfV8lt3hcVwMK3CWPJYS2KtE2oENR+S0V1/WJJu oFpecRmMJpgUkdHJr3M0EFznVVU5aAgWAWJYKOCwZAnRvJeyxhZFhHbts4SDMTIPjGkV sSksOrCTo8q5bbyYfZ56qBCnQsg/fIVhJp8j/Lmv0a+C9mCYVJK5fOYznZJpB4iHmm6x cxGS1kjHcSGivYxa5Almb4VYwU2VIZRxyvPevDCoq1xnuze1EyEYzPXxJTvfNpHJB581 neD6t/a0GSf8jA5VtcEQOt9ULa7U4TF3/yR6pKCKPJKwNCilitPlWPR6VY9bNFWilMYT 4jZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7zG9fsIp5ZWG8t/NVo2n3trzTl/SuNuBBWDv25aQNJU=; b=kQUb85JsNdM90RDXpgK5HVn6j7ErKiQfISSTicuSNgbs27sYRxfq1iKAN9adF+iQG1 DOsYKoVxR1XijGaz/kz6oZEeHnJl5Odfg61lmRRCXLss4UXiLcgppseCZCkj4h2iSmLW 8bh+XJJ2TIZHCM1vH361Mt07VfHfZ1FpAxFNLu8pIY05AxDEanp/k32e+iZ4c/yh7ruf gMcpKBPoLTueTVufQQNWKELkjanr7xm2Snj+WlLrQSSK1i47ypfk2Gr0T1CAgi1FyuzV SLYNxu+IzLwXnqLJGZCjo2RVX/XoYvNMn35yY76kCbAPkAxtu2Ominxw7Mc8UwBfIFx/ mKTw== X-Gm-Message-State: APjAAAVkbzPXit4XHXsBLld1KJZMM/G1XIeCuE9oM4KBOdyIefjlVmol IkasUIiiXOu8H3anNyleBd5DZhBAVo0= X-Google-Smtp-Source: APXvYqzAhUpWsDG/JXfkfSkPqj16Vk4KoabLoX9tUhE6YLDGehG8NCr/ZGjxB5mJ4tFIUDhiIKjoXQ== X-Received: by 2002:a65:5186:: with SMTP id h6mr4246007pgq.304.1568817230370; Wed, 18 Sep 2019 07:33:50 -0700 (PDT) Received: from ?IPv6:2607:fb90:8361:37e4:e838:8e5e:c58b:1a9d? ([2607:fb90:8361:37e4:e838:8e5e:c58b:1a9d]) by smtp.gmail.com with ESMTPSA id q204sm5304344pfc.11.2019.09.18.07.33.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Sep 2019 07:33:49 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r352465 - head/share/mk From: Enji Cooper X-Mailer: iPhone Mail (16G102) In-Reply-To: Date: Wed, 18 Sep 2019 07:33:48 -0700 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <201909180158.x8I1wuZu011258@repo.freebsd.org> <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> To: Kyle Evans X-Rspamd-Queue-Id: 46YMt84ZS0z4P62 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Son4I8Zt; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::434 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-8.95), ipnet: 2607:f8b0::/32(-2.68), asn: 15169(-2.23), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE_FREEMAIL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[4.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 14:33:54 -0000 > On Sep 18, 2019, at 05:40, Kyle Evans wrote: >=20 >> On Wed, Sep 18, 2019 at 7:34 AM Enji Cooper wrote= : >>=20 >>=20 >>> On Sep 17, 2019, at 18:58, Kyle Evans wrote: >>>=20 >>> Author: kevans >>> Date: Wed Sep 18 01:58:56 2019 >>> New Revision: 352465 >>> URL: https://svnweb.freebsd.org/changeset/base/352465 >>>=20 >>> Log: >>> googletest: default-disable on all of MIPS for now >>>=20 >>> Parts of the fusefs tests trigger a bug in current versions of llvm: IR >>> representation of some routine for the MIPS targets is a function with a= >>> large number of arguments. This then leads the compiler on an hour+ long= >>> goose chase, which is OK if you build the current tree but less-so if yo= u're >>> trying external toolchain or doing a universe build involving mips when i= t >>> eventually gets switched over to LLVM. >>>=20 >>> Better, accurate details can be found in LLVM PR43263. >>=20 >> Uhhhhh... why not do this in tests/sys/... instead? >=20 > Because there's still value in being able to easily enable these for > building/running the complete set of tests through standard build > infrastructure, but it's not worth adding a knob specifically for the > fusefs tests. I also prefer the communication of it being an > off-by-default option and easily deduced from src.conf(5) that this > part of the build is default-disabled on mips/mips. Let me rephrase things a bit: is googlemock broken for all of mips, or is it= just the tests? If the latter, the tests should be blacklisted for mips wit= h a justification. If the former, I agree your method of dealing with the si= tuation is ok, but more investigation needs to be done to see whether or not= the port (in general) is broken and mark it broken if need be. The problem with src.opts.mk=E2=80=99s per-architecture options, is that it c= an be very heavy handed enabling/disabling features. I=E2=80=99m not sure th= at everything in there warrants disabling at that level. Thanks, -Enji= From owner-svn-src-head@freebsd.org Wed Sep 18 14:46:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C32BFF5CA; Wed, 18 Sep 2019 14:46:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YN8R37pMz4Pqn; Wed, 18 Sep 2019 14:46:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x642.google.com with SMTP id d22so52249pll.7; Wed, 18 Sep 2019 07:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=fjbIe09aU41TCx2p3bq3Iq5woBQ0Tz1ppj2LdvS6GPw=; b=u61tERG9jFwxUaQtdyWDd/ikpMrOYz4pQUOp/bZGMzOwQtdjPSjeqUiTr74pORW/Co t8zEYrqPfqDqDbz6+jlCNDrlimBKwCjP+cC8suVFPoNlDtZx+17psuJ/cwgG7Oyyb/G7 ZpYVSVDGQTKnMfy/yRF/d3EHGNEzKQUJuS7spvlN9HDTKihIi5/MoBOGkXgCZxUIcvhz CQBXxDc+DfkEL8v4adfGwOZHPoCHEnKv/IPdieWIDqcKS9IgD1uz4vPvpPwR5kLf5DHw vcgwvw25dray0PHFBJo6f5PaRNW0vxhF02YppwakL3y92E1m7SrYJlIRN2Pk50ESRwBS rHZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=fjbIe09aU41TCx2p3bq3Iq5woBQ0Tz1ppj2LdvS6GPw=; b=srS1Y9OEqnrnBL1EXc3FrESjBGkGcZRNb+Y6SpU7PfgDHBxceZWORStDV01ci6erbC V5XpNhHoNsRb+doZdUhHe+RokeBCqieQSVK9DFR6ckseDGhrKImcipAM5xwOhIOdyAso qGqUmm6WcXMkwS2lx6WLo800/x+csMYZ1qzzwVmyKX/KSAE61NKp3VbKZ/XKxaCfXsCb /aVRJZDsJsfBcsBImwDoqC39TcV/zE3mie4Pg07w5Lw1rg72vBP0qwvPSqoegv2VsOMz K+0Jyri5htaj8sl9alvrO2PCIIu/kemRg+t8s5ggugMhhb2gZ/vvkMjgvkXwOMsnlbPQ JO8A== X-Gm-Message-State: APjAAAU8AmHhEhdWrAvoasuWlLd+UIdBJgmNh69NuuJgo/RJ05HdlBhn SMqN+MJHRHKyq9Wbo2yGebp0Oh6FrP4= X-Google-Smtp-Source: APXvYqxxMxqMpAIH5lZVv6tuaHv8ZFY5f2VItOVQEu+kA6VV3rzA/4EI6/agU6eN6nemoPFWKao8uQ== X-Received: by 2002:a17:902:9a81:: with SMTP id w1mr4634094plp.124.1568817973395; Wed, 18 Sep 2019 07:46:13 -0700 (PDT) Received: from ?IPv6:2607:fb90:8361:37e4:e838:8e5e:c58b:1a9d? ([2607:fb90:8361:37e4:e838:8e5e:c58b:1a9d]) by smtp.gmail.com with ESMTPSA id g19sm6418874pgm.63.2019.09.18.07.46.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Sep 2019 07:46:12 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r352465 - head/share/mk From: Enji Cooper X-Mailer: iPhone Mail (16G102) In-Reply-To: Date: Wed, 18 Sep 2019 07:46:11 -0700 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <81382CF5-A928-48EF-93A9-BBBBA174F4BD@gmail.com> References: <201909180158.x8I1wuZu011258@repo.freebsd.org> <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> To: Kyle Evans X-Rspamd-Queue-Id: 46YN8R37pMz4Pqn X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=u61tERG9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::642 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-0.32), ipnet: 2607:f8b0::/32(-2.68), asn: 15169(-2.23), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE_FREEMAIL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2.4.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 14:46:16 -0000 > On Sep 18, 2019, at 07:33, Enji Cooper wrote: >=20 >=20 >>> On Sep 18, 2019, at 05:40, Kyle Evans wrote: >>>=20 >>> On Wed, Sep 18, 2019 at 7:34 AM Enji Cooper wrot= e: >>>=20 >>>=20 >>>> On Sep 17, 2019, at 18:58, Kyle Evans wrote: >>>>=20 >>>> Author: kevans >>>> Date: Wed Sep 18 01:58:56 2019 >>>> New Revision: 352465 >>>> URL: https://svnweb.freebsd.org/changeset/base/352465 >>>>=20 >>>> Log: >>>> googletest: default-disable on all of MIPS for now >>>>=20 >>>> Parts of the fusefs tests trigger a bug in current versions of llvm: IR= >>>> representation of some routine for the MIPS targets is a function with a= >>>> large number of arguments. This then leads the compiler on an hour+ lon= g >>>> goose chase, which is OK if you build the current tree but less-so if y= ou're >>>> trying external toolchain or doing a universe build involving mips when= it >>>> eventually gets switched over to LLVM. >>>>=20 >>>> Better, accurate details can be found in LLVM PR43263. >>>=20 >>> Uhhhhh... why not do this in tests/sys/... instead? >>=20 >> Because there's still value in being able to easily enable these for >> building/running the complete set of tests through standard build >> infrastructure, but it's not worth adding a knob specifically for the >> fusefs tests. I also prefer the communication of it being an >> off-by-default option and easily deduced from src.conf(5) that this >> part of the build is default-disabled on mips/mips. >=20 > Let me rephrase things a bit: is googlemock broken for all of mips, or is i= t just the tests? If the latter, the tests should be blacklisted for mips wi= th a justification. If the former, I agree your method of dealing with the s= ituation is ok, but more investigation needs to be done to see whether or no= t the port (in general) is broken and mark it broken if need be. It looks like the latter case, based on the PR, and it=E2=80=99s a build per= formance issue... Is this impacting CI pipelines? > The problem with src.opts.mk=E2=80=99s per-architecture options, is that i= t can be very heavy handed enabling/disabling features. I=E2=80=99m not sure= that everything in there warrants disabling at that level. My investigation suggests that the course of action was overly heavy handed.= While I=E2=80=99m not asking for a revert, it would be really nice if whole= features weren=E2=80=99t disabled, unless there=E2=80=99s an issue with the= feature. Thank you, -Enji= From owner-svn-src-head@freebsd.org Wed Sep 18 14:58:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB9F1FF92F; Wed, 18 Sep 2019 14:58:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YNQf555hz4QMH; Wed, 18 Sep 2019 14:58:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x532.google.com with SMTP id a3so4251984pgm.13; Wed, 18 Sep 2019 07:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oZmj3sDnUKRP7unsUf2M8sYTzWergU3a3/7hSqSxa6U=; b=S17ThCIvC/pnA0B4GAQuJVvdyVAHshxdn75SipwhJKD/xsiOiWRGzG1qkWoyfmmWIx j91ai+uREH0hs44k0/t42ppj46IvaQgS7SQ/uFbvxjA/iCHHrs7WUo9irz7X5hSNcWPg eIksoej63l1U7ovdxLuYXP8gabRpuDufwzqmgAuK0y8bJVhtRzSPp07yxEAtnmlbnJSa pFdYem6uKd7HmdOJJoei4d7pfS1L0eHuHcS0cB5eTY7XMMIJAgP6GNt8RjHrkRThE9Ph 9L51LiB2SN1l/hHoaeYssBpdKn7Gj/OF4ye2WzSqYk2j5rzSG1J/H2sXNh0kWE8iNeMl AAuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oZmj3sDnUKRP7unsUf2M8sYTzWergU3a3/7hSqSxa6U=; b=j2n5Rm2YzDGAJ01WjhLfwVgANCv7hGmJdeY4LIqX/zF0TXR8iyySLTTyY4UzJAYTbo /v7HBYFBfRjhpU51t/cRcSZN9g+F0WaCDf1oLy/HGcFDQRH1XN3y38wg6h8GT0z2HFED CWBENNtQ/nSN2EMsIwwQbHAzW0Cx4IaL08xIx+5MUciXD6559sOJH/tLD+60M5AOTSwG JcNWypyzwm2RnwEwAE504a5Hs7+kRNCA/5tieYrHNefc/la6rAbwyACJbBGVTBmuHx24 KojyUydqp7j3lPstVX3rTlhq/D3INA/Wp8A8sNcnPgPfZXNahwkA0Fio1aMPAIpAaLbI GsHg== X-Gm-Message-State: APjAAAW8IrVnb9m+s8/ggSh41Z+3Ub8atwgqgspQ/c/HdTTjm7Jd5X69 qzcgtaX5AhBwHmY9/ZaJYz23iuiY0RY= X-Google-Smtp-Source: APXvYqyXJVXJBPtN8ndexMipG/kyAlS57UwfI0U1+IQPoaeJGRSQBsopBocM4lm5IDB9q8BgmUFf9w== X-Received: by 2002:a62:e416:: with SMTP id r22mr4629623pfh.145.1568818712856; Wed, 18 Sep 2019 07:58:32 -0700 (PDT) Received: from ?IPv6:2607:fb90:8361:37e4:e838:8e5e:c58b:1a9d? ([2607:fb90:8361:37e4:e838:8e5e:c58b:1a9d]) by smtp.gmail.com with ESMTPSA id f6sm5335867pgk.65.2019.09.18.07.58.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Sep 2019 07:58:32 -0700 (PDT) Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r352465 - head/share/mk From: Enji Cooper X-Mailer: iPhone Mail (16G102) In-Reply-To: Date: Wed, 18 Sep 2019 07:58:30 -0700 Cc: Kyle Evans , src-committers , svn-src-all , svn-src-head Message-Id: <775F2D15-84C0-4347-863A-6C35095F39FF@gmail.com> References: <201909180158.x8I1wuZu011258@repo.freebsd.org> <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> To: Warner Losh X-Rspamd-Queue-Id: 46YNQf555hz4QMH X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=S17ThCIv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-1.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-9.07), ipnet: 2607:f8b0::/32(-2.68), asn: 15169(-2.23), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 14:58:35 -0000 > On Sep 18, 2019, at 06:53, Warner Losh wrote: >=20 >=20 >=20 >> On Wed, Sep 18, 2019, 1:41 PM Kyle Evans wrote: >> On Wed, Sep 18, 2019 at 7:34 AM Enji Cooper wrote= : >> > >> > >> > > On Sep 17, 2019, at 18:58, Kyle Evans wrote: >> > > >> > > Author: kevans >> > > Date: Wed Sep 18 01:58:56 2019 >> > > New Revision: 352465 >> > > URL: https://svnweb.freebsd.org/changeset/base/352465 >> > > >> > > Log: >> > > googletest: default-disable on all of MIPS for now >> > > >> > > Parts of the fusefs tests trigger a bug in current versions of llvm:= IR >> > > representation of some routine for the MIPS targets is a function wi= th a >> > > large number of arguments. This then leads the compiler on an hour+ l= ong >> > > goose chase, which is OK if you build the current tree but less-so i= f you're >> > > trying external toolchain or doing a universe build involving mips w= hen it >> > > eventually gets switched over to LLVM. >> > > >> > > Better, accurate details can be found in LLVM PR43263. >> > >> > Uhhhhh... why not do this in tests/sys/... instead? >>=20 >> Because there's still value in being able to easily enable these for >> building/running the complete set of tests through standard build >> infrastructure, but it's not worth adding a knob specifically for the >> fusefs tests. I also prefer the communication of it being an >> off-by-default option and easily deduced from src.conf(5) that this >> part of the build is default-disabled on mips/mips. >=20 >=20 > This is the right way to do this, imho... I disagree: disabling a framework and all tests dependent on it because of c= ompile times for a single test suite is the wrong approach. I would complain= more loudly (for instance), if MK_TESTS were disabled on mips, just because= of a build or test issue with a single test. This change throws the baby out with the bath water. The only reason why I=E2= =80=99m not asking for a revert is that mips is a tier 2 arch which I haven=E2= =80=99t verified, and the bath tub that=E2=80=99s being emptied is small, as= many folks haven=E2=80=99t written GoogleTest tests yet in the src tree. -Enji= From owner-svn-src-head@freebsd.org Wed Sep 18 14:58:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8BBBFF97A; Wed, 18 Sep 2019 14:58:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YNQz4YZpz4QTf; Wed, 18 Sep 2019 14:58:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 702791AF7; Wed, 18 Sep 2019 14:58:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f175.google.com with SMTP id g16so66895qto.9; Wed, 18 Sep 2019 07:58:51 -0700 (PDT) X-Gm-Message-State: APjAAAWPmmIAP5ERNW/Hb6pjWVeK0T/8UAvuwCv+7GgkwH5sEhufEhLT XZAfT1AHZxL+UMH2jjlQd/MmLQSP//G7Si1kff4= X-Google-Smtp-Source: APXvYqzamkyxn8O+Es7SzdKVmCuZIrjqK26ws4sXws03vZyVRQhQo0clFxjeasqgu9FjjIVDhJPvSsaNewf0eZzZkuc= X-Received: by 2002:a0c:9276:: with SMTP id 51mr3487907qvz.35.1568818730707; Wed, 18 Sep 2019 07:58:50 -0700 (PDT) MIME-Version: 1.0 References: <201909180158.x8I1wuZu011258@repo.freebsd.org> <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> <81382CF5-A928-48EF-93A9-BBBBA174F4BD@gmail.com> In-Reply-To: <81382CF5-A928-48EF-93A9-BBBBA174F4BD@gmail.com> From: Kyle Evans Date: Wed, 18 Sep 2019 09:58:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352465 - head/share/mk To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 14:58:51 -0000 On Wed, Sep 18, 2019 at 9:46 AM Enji Cooper wrote: > > > > On Sep 18, 2019, at 07:33, Enji Cooper wrote: > > > > > >>> On Sep 18, 2019, at 05:40, Kyle Evans wrote: > >>> > >>> On Wed, Sep 18, 2019 at 7:34 AM Enji Cooper w= rote: > >>> > >>> > >>>> On Sep 17, 2019, at 18:58, Kyle Evans wrote: > >>>> > >>>> Author: kevans > >>>> Date: Wed Sep 18 01:58:56 2019 > >>>> New Revision: 352465 > >>>> URL: https://svnweb.freebsd.org/changeset/base/352465 > >>>> > >>>> Log: > >>>> googletest: default-disable on all of MIPS for now > >>>> > >>>> Parts of the fusefs tests trigger a bug in current versions of llvm:= IR > >>>> representation of some routine for the MIPS targets is a function wi= th a > >>>> large number of arguments. This then leads the compiler on an hour+ = long > >>>> goose chase, which is OK if you build the current tree but less-so i= f you're > >>>> trying external toolchain or doing a universe build involving mips w= hen it > >>>> eventually gets switched over to LLVM. > >>>> > >>>> Better, accurate details can be found in LLVM PR43263. > >>> > >>> Uhhhhh... why not do this in tests/sys/... instead? > >> > >> Because there's still value in being able to easily enable these for > >> building/running the complete set of tests through standard build > >> infrastructure, but it's not worth adding a knob specifically for the > >> fusefs tests. I also prefer the communication of it being an > >> off-by-default option and easily deduced from src.conf(5) that this > >> part of the build is default-disabled on mips/mips. > > > > Let me rephrase things a bit: is googlemock broken for all of mips, or = is it just the tests? If the latter, the tests should be blacklisted for mi= ps with a justification. If the former, I agree your method of dealing with= the situation is ok, but more investigation needs to be done to see whethe= r or not the port (in general) is broken and mark it broken if need be. > > It looks like the latter case, based on the PR, and it=E2=80=99s a build = performance issue... Is this impacting CI pipelines? > It is the latter, and I do not want to *blacklist* them because as far as I can tell, the tests aren't necessarily broken. I want to workaround them for default by now. > > The problem with src.opts.mk=E2=80=99s per-architecture options, is tha= t it can be very heavy handed enabling/disabling features. I=E2=80=99m not = sure that everything in there warrants disabling at that level. > > My investigation suggests that the course of action was overly heavy hand= ed. While I=E2=80=99m not asking for a revert, it would be really nice if w= hole features weren=E2=80=99t disabled, unless there=E2=80=99s an issue wit= h the feature. > We do not have a lighter method for dealing with this that I can tell, because as I said above: I do not want to blacklist them or completely kill them off. I still want the option to build and test them, but as I aim to switch mips over to llvm I do not want to subject CI and the rest of the world to an extra 1.5+ hour build time for this during tinderbox runs. Given that it's mips, so already tier-high, and I'm one of few people that care about it (and I only care about it for the time being), I intend to leave it as-is since it's still a default in the rest of the world. From owner-svn-src-head@freebsd.org Wed Sep 18 15:04:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9681FFCAA; Wed, 18 Sep 2019 15:04:12 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YNY80tppz4R5J; Wed, 18 Sep 2019 15:04:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x643.google.com with SMTP id 4so68969pld.10; Wed, 18 Sep 2019 08:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=MfbK6b4YtIVwe8D8fbxZ4jQBGB/OBUeNzbVqgVBEBFg=; b=ieaScacJuXxCgvMCi8rJ3t8qXjyV6and2P2bYEojiblX3IQxS6RE6zZCznqxZ/lN/1 q98etIidJgS9jX2aJeyEcqejgjmLQo6h0iiAMtrlVSU73nwcTNVsezqNvrOlX/SAYHi+ rhDrqG1sQ+UUI+Zuf6cQSTpJMXd26wUpypuotAVnNQSGm0w7hFreYvDV6q2LWE9v8B5U IIG2/BzAA/vqK0pQk4DwtGRiKfcmu9hyrsEzFYpe+kks7Ofk3qgep/rMONGjhsX3R8lM OGQ0GGlJEW5bBuTSKTAB9UEMOgI1AzMXlw+d/FS2MXrXdA9I/lnUvTKU5jajgQteDgo5 BFWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=MfbK6b4YtIVwe8D8fbxZ4jQBGB/OBUeNzbVqgVBEBFg=; b=EgM7PxDNEl5HxuyvrUw0hYL8dhU508gxlkiSRAw/e0zpl3rf66T/1efeWcq5P/Jhgm 3kFXdiUDf48AGIP7sX4eG9zUY3NHwOkepzgi1I6ed00gyRxa4KioAqhACv5aOhKCtaCE 5ao0Ackb57khvibMLe44h7pvF9oAThOdVXDfOT8iCY3JNZuXD4Gmmee9Cz0/R87eS7uU QLNs9qRkjfAtwNh7xTRqJE9bxZ2eDp2EL35YTwfGwyQxHq7mM7w/GXltb0dkefT58gM2 wjD1JBUdyZFqHxHiYt97RI/Tkg4ON1bS2xcGzwF4DNcKIKymEADgSgVrdtNcqVDzXObU X/Ag== X-Gm-Message-State: APjAAAWh550yF9uljZTvWEGNkt6GQFrXrt8dxUGHnZ8oXmcKtaxJkxTO HrGxdSj3FUja+dfDLjxuFw5AA/WLb8c= X-Google-Smtp-Source: APXvYqwlE0BD3sQvXNyH93tJMZJQZ1Q/VZhPnUvy+kVW0FtbhPy6pg3kKZcTVSxPMMaK/oiwdF/4rQ== X-Received: by 2002:a17:902:a411:: with SMTP id p17mr4654999plq.108.1568819049098; Wed, 18 Sep 2019 08:04:09 -0700 (PDT) Received: from ?IPv6:2607:fb90:8361:37e4:e838:8e5e:c58b:1a9d? ([2607:fb90:8361:37e4:e838:8e5e:c58b:1a9d]) by smtp.gmail.com with ESMTPSA id a8sm9174421pfa.182.2019.09.18.08.04.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Sep 2019 08:04:08 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r352465 - head/share/mk From: Enji Cooper X-Mailer: iPhone Mail (16G102) In-Reply-To: Date: Wed, 18 Sep 2019 08:04:07 -0700 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <201909180158.x8I1wuZu011258@repo.freebsd.org> <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> <81382CF5-A928-48EF-93A9-BBBBA174F4BD@gmail.com> To: Kyle Evans X-Rspamd-Queue-Id: 46YNY80tppz4R5J X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ieaScacJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::643 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-0.56), ipnet: 2607:f8b0::/32(-2.68), asn: 15169(-2.23), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE_FREEMAIL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 15:04:13 -0000 > On Sep 18, 2019, at 07:58, Kyle Evans wrote: >=20 >> On Wed, Sep 18, 2019 at 9:46 AM Enji Cooper wrote= : >>=20 >>=20 >>> On Sep 18, 2019, at 07:33, Enji Cooper wrote: >>>=20 >>>=20 >>>>> On Sep 18, 2019, at 05:40, Kyle Evans wrote: >>>>>=20 >>>>> On Wed, Sep 18, 2019 at 7:34 AM Enji Cooper wr= ote: >>>>>=20 >>>>>=20 >>>>>> On Sep 17, 2019, at 18:58, Kyle Evans wrote: >>>>>>=20 >>>>>> Author: kevans >>>>>> Date: Wed Sep 18 01:58:56 2019 >>>>>> New Revision: 352465 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/352465 >>>>>>=20 >>>>>> Log: >>>>>> googletest: default-disable on all of MIPS for now >>>>>>=20 >>>>>> Parts of the fusefs tests trigger a bug in current versions of llvm: I= R >>>>>> representation of some routine for the MIPS targets is a function wit= h a >>>>>> large number of arguments. This then leads the compiler on an hour+ l= ong >>>>>> goose chase, which is OK if you build the current tree but less-so if= you're >>>>>> trying external toolchain or doing a universe build involving mips wh= en it >>>>>> eventually gets switched over to LLVM. >>>>>>=20 >>>>>> Better, accurate details can be found in LLVM PR43263. >>>>>=20 >>>>> Uhhhhh... why not do this in tests/sys/... instead? >>>>=20 >>>> Because there's still value in being able to easily enable these for >>>> building/running the complete set of tests through standard build >>>> infrastructure, but it's not worth adding a knob specifically for the >>>> fusefs tests. I also prefer the communication of it being an >>>> off-by-default option and easily deduced from src.conf(5) that this >>>> part of the build is default-disabled on mips/mips. >>>=20 >>> Let me rephrase things a bit: is googlemock broken for all of mips, or i= s it just the tests? If the latter, the tests should be blacklisted for mips= with a justification. If the former, I agree your method of dealing with th= e situation is ok, but more investigation needs to be done to see whether or= not the port (in general) is broken and mark it broken if need be. >>=20 >> It looks like the latter case, based on the PR, and it=E2=80=99s a build p= erformance issue... Is this impacting CI pipelines? >>=20 >=20 > It is the latter, and I do not want to *blacklist* them because as far > as I can tell, the tests aren't necessarily broken. I want to > workaround them for default by now. >=20 >>> The problem with src.opts.mk=E2=80=99s per-architecture options, is that= it can be very heavy handed enabling/disabling features. I=E2=80=99m not su= re that everything in there warrants disabling at that level. >>=20 >> My investigation suggests that the course of action was overly heavy hand= ed. While I=E2=80=99m not asking for a revert, it would be really nice if wh= ole features weren=E2=80=99t disabled, unless there=E2=80=99s an issue with t= he feature. >>=20 >=20 > We do not have a lighter method for dealing with this that I can tell, > because as I said above: I do not want to blacklist them or completely > kill them off. I still want the option to build and test them, but as > I aim to switch mips over to llvm I do not want to subject CI and the > rest of the world to an extra 1.5+ hour build time for this during > tinderbox runs. >=20 > Given that it's mips, so already tier-high, and I'm one of few people > that care about it (and I only care about it for the time being), I > intend to leave it as-is since it's still a default in the rest of the > world. Ok, valid straw man argument: in this particular case, should llvm / c++ sup= port be disabled instead, since it=E2=80=99s the real underlying issue? I=E2= =80=99m guessing (non-ancient) g++ doesn=E2=80=99t have this issue. Again, disabling a framework because of a single issue in the tests doesn=E2= =80=99t make sense. Unless you have proof that the build times for all of go= ogletest/googlemock with llvm is an issue, this seems like the wrong remedia= tion to perform. -Enji PS A heads up to asomers and myself would have been nice. I don=E2=80=99t li= ke post-commit nitpicking, since the issue could have been discussed/reviewe= d before commit.= From owner-svn-src-head@freebsd.org Wed Sep 18 15:14:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05DCEFFF44; Wed, 18 Sep 2019 15:14:08 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YNmb6BQlz4Rb8; Wed, 18 Sep 2019 15:14:07 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id AC06C1D2B; Wed, 18 Sep 2019 15:14:07 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f182.google.com with SMTP id f16so8382423qkl.9; Wed, 18 Sep 2019 08:14:07 -0700 (PDT) X-Gm-Message-State: APjAAAUcYIKRBW11CJoX1AuE93jiBc0w7bgJ+ARa4TOYpr2Twhz3W+Cn XxKghNQLPbWX9ReAkS5BSPyCxNeXiJLrHuL+RU4= X-Google-Smtp-Source: APXvYqwpkQSWSL4spsEZQoIkdy1F0Y+zacGj/wFL1UdNIX8lQ+CwG2Mx9fS0MuEY6rCdkIB/0K+Kc5AuX00v5SFXff0= X-Received: by 2002:ae9:dd81:: with SMTP id r123mr4548667qkf.103.1568819647168; Wed, 18 Sep 2019 08:14:07 -0700 (PDT) MIME-Version: 1.0 References: <201909180158.x8I1wuZu011258@repo.freebsd.org> <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> <81382CF5-A928-48EF-93A9-BBBBA174F4BD@gmail.com> In-Reply-To: From: Kyle Evans Date: Wed, 18 Sep 2019 10:13:55 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352465 - head/share/mk To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 15:14:08 -0000 On Wed, Sep 18, 2019 at 10:04 AM Enji Cooper wrote: > > > > On Sep 18, 2019, at 07:58, Kyle Evans wrote: > > > >> On Wed, Sep 18, 2019 at 9:46 AM Enji Cooper wr= ote: > >> > >> > >>> On Sep 18, 2019, at 07:33, Enji Cooper wrote: > >>> > >>> > >>>>> On Sep 18, 2019, at 05:40, Kyle Evans wrote: > >>>>> > >>>>> On Wed, Sep 18, 2019 at 7:34 AM Enji Cooper = wrote: > >>>>> > >>>>> > >>>>>> On Sep 17, 2019, at 18:58, Kyle Evans wrote: > >>>>>> > >>>>>> Author: kevans > >>>>>> Date: Wed Sep 18 01:58:56 2019 > >>>>>> New Revision: 352465 > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/352465 > >>>>>> > >>>>>> Log: > >>>>>> googletest: default-disable on all of MIPS for now > >>>>>> > >>>>>> Parts of the fusefs tests trigger a bug in current versions of llv= m: IR > >>>>>> representation of some routine for the MIPS targets is a function = with a > >>>>>> large number of arguments. This then leads the compiler on an hour= + long > >>>>>> goose chase, which is OK if you build the current tree but less-so= if you're > >>>>>> trying external toolchain or doing a universe build involving mips= when it > >>>>>> eventually gets switched over to LLVM. > >>>>>> > >>>>>> Better, accurate details can be found in LLVM PR43263. > >>>>> > >>>>> Uhhhhh... why not do this in tests/sys/... instead? > >>>> > >>>> Because there's still value in being able to easily enable these for > >>>> building/running the complete set of tests through standard build > >>>> infrastructure, but it's not worth adding a knob specifically for th= e > >>>> fusefs tests. I also prefer the communication of it being an > >>>> off-by-default option and easily deduced from src.conf(5) that this > >>>> part of the build is default-disabled on mips/mips. > >>> > >>> Let me rephrase things a bit: is googlemock broken for all of mips, o= r is it just the tests? If the latter, the tests should be blacklisted for = mips with a justification. If the former, I agree your method of dealing wi= th the situation is ok, but more investigation needs to be done to see whet= her or not the port (in general) is broken and mark it broken if need be. > >> > >> It looks like the latter case, based on the PR, and it=E2=80=99s a bui= ld performance issue... Is this impacting CI pipelines? > >> > > > > It is the latter, and I do not want to *blacklist* them because as far > > as I can tell, the tests aren't necessarily broken. I want to > > workaround them for default by now. > > > >>> The problem with src.opts.mk=E2=80=99s per-architecture options, is t= hat it can be very heavy handed enabling/disabling features. I=E2=80=99m no= t sure that everything in there warrants disabling at that level. > >> > >> My investigation suggests that the course of action was overly heavy h= anded. While I=E2=80=99m not asking for a revert, it would be really nice i= f whole features weren=E2=80=99t disabled, unless there=E2=80=99s an issue = with the feature. > >> > > > > We do not have a lighter method for dealing with this that I can tell, > > because as I said above: I do not want to blacklist them or completely > > kill them off. I still want the option to build and test them, but as > > I aim to switch mips over to llvm I do not want to subject CI and the > > rest of the world to an extra 1.5+ hour build time for this during > > tinderbox runs. > > > > Given that it's mips, so already tier-high, and I'm one of few people > > that care about it (and I only care about it for the time being), I > > intend to leave it as-is since it's still a default in the rest of the > > world. > > Ok, valid straw man argument: in this particular case, should llvm / c++ = support be disabled instead, since it=E2=80=99s the real underlying issue? = I=E2=80=99m guessing (non-ancient) g++ doesn=E2=80=99t have this issue. > > Again, disabling a framework because of a single issue in the tests doesn= =E2=80=99t make sense. Unless you have proof that the build times for all o= f googletest/googlemock with llvm is an issue, this seems like the wrong re= mediation to perform. > > -Enji > > PS A heads up to asomers and myself would have been nice. I don=E2=80=99t= like post-commit nitpicking, since the issue could have been discussed/rev= iewed before commit. If this was any less than a temporary workaround that will get reverted in due time, I would sympathize with your argument completely. I had no intention of wasting your time or asomers' time with this tier-2 problem that had already been diagnosed as an LLVM/mips bug. The unfortunate reality is that no one (including CI) is running tests on FreeBSD/mips, and no one will feel the fallout of this decision. From owner-svn-src-head@freebsd.org Wed Sep 18 15:26:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCBBF121208 for ; Wed, 18 Sep 2019 15:26:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YP2k5cG3z4S8H for ; Wed, 18 Sep 2019 15:26:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 91F651E60 for ; Wed, 18 Sep 2019 15:26:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f180.google.com with SMTP id c3so177881qtv.10 for ; Wed, 18 Sep 2019 08:26:22 -0700 (PDT) X-Gm-Message-State: APjAAAW5ha0XJF0lhDg5BzPoC5iU39ZtynxSD1Oz5o7QkzEvgYUEVsPc qu6S/urlq9BLGX8TUjjbKUcn/XWQLvRbPE41O9U= X-Received: by 2002:ac8:2bca:: with SMTP id n10mt4641633qtn.242.1568820382118; Wed, 18 Sep 2019 08:26:22 -0700 (PDT) MIME-Version: 1.0 References: <201909180158.x8I1wuZu011258@repo.freebsd.org> <0FBC9A62-AE3B-4F27-AABC-06FF45F415F1@gmail.com> <81382CF5-A928-48EF-93A9-BBBBA174F4BD@gmail.com> In-Reply-To: From: Kyle Evans Date: Wed, 18 Sep 2019 10:26:10 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352465 - head/share/mk Cc: Enji Cooper , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 15:26:22 -0000 On Wed, Sep 18, 2019 at 10:13 AM Kyle Evans wrote: > > On Wed, Sep 18, 2019 at 10:04 AM Enji Cooper wrot= e: > > > > > > > On Sep 18, 2019, at 07:58, Kyle Evans wrote: > > > > > >> On Wed, Sep 18, 2019 at 9:46 AM Enji Cooper = wrote: > > >> > > >> > > >>> On Sep 18, 2019, at 07:33, Enji Cooper wrot= e: > > >>> > > >>> > > >>>>> On Sep 18, 2019, at 05:40, Kyle Evans wrote: > > >>>>> > > >>>>> On Wed, Sep 18, 2019 at 7:34 AM Enji Cooper wrote: > > >>>>> > > >>>>> > > >>>>>> On Sep 17, 2019, at 18:58, Kyle Evans wrote= : > > >>>>>> > > >>>>>> Author: kevans > > >>>>>> Date: Wed Sep 18 01:58:56 2019 > > >>>>>> New Revision: 352465 > > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/352465 > > >>>>>> > > >>>>>> Log: > > >>>>>> googletest: default-disable on all of MIPS for now > > >>>>>> > > >>>>>> Parts of the fusefs tests trigger a bug in current versions of l= lvm: IR > > >>>>>> representation of some routine for the MIPS targets is a functio= n with a > > >>>>>> large number of arguments. This then leads the compiler on an ho= ur+ long > > >>>>>> goose chase, which is OK if you build the current tree but less-= so if you're > > >>>>>> trying external toolchain or doing a universe build involving mi= ps when it > > >>>>>> eventually gets switched over to LLVM. > > >>>>>> > > >>>>>> Better, accurate details can be found in LLVM PR43263. > > >>>>> > > >>>>> Uhhhhh... why not do this in tests/sys/... instead? > > >>>> > > >>>> Because there's still value in being able to easily enable these f= or > > >>>> building/running the complete set of tests through standard build > > >>>> infrastructure, but it's not worth adding a knob specifically for = the > > >>>> fusefs tests. I also prefer the communication of it being an > > >>>> off-by-default option and easily deduced from src.conf(5) that thi= s > > >>>> part of the build is default-disabled on mips/mips. > > >>> > > >>> Let me rephrase things a bit: is googlemock broken for all of mips,= or is it just the tests? If the latter, the tests should be blacklisted fo= r mips with a justification. If the former, I agree your method of dealing = with the situation is ok, but more investigation needs to be done to see wh= ether or not the port (in general) is broken and mark it broken if need be. > > >> > > >> It looks like the latter case, based on the PR, and it=E2=80=99s a b= uild performance issue... Is this impacting CI pipelines? > > >> > > > > > > It is the latter, and I do not want to *blacklist* them because as fa= r > > > as I can tell, the tests aren't necessarily broken. I want to > > > workaround them for default by now. > > > > > >>> The problem with src.opts.mk=E2=80=99s per-architecture options, is= that it can be very heavy handed enabling/disabling features. I=E2=80=99m = not sure that everything in there warrants disabling at that level. > > >> > > >> My investigation suggests that the course of action was overly heavy= handed. While I=E2=80=99m not asking for a revert, it would be really nice= if whole features weren=E2=80=99t disabled, unless there=E2=80=99s an issu= e with the feature. > > >> > > > > > > We do not have a lighter method for dealing with this that I can tell= , > > > because as I said above: I do not want to blacklist them or completel= y > > > kill them off. I still want the option to build and test them, but as > > > I aim to switch mips over to llvm I do not want to subject CI and the > > > rest of the world to an extra 1.5+ hour build time for this during > > > tinderbox runs. > > > > > > Given that it's mips, so already tier-high, and I'm one of few people > > > that care about it (and I only care about it for the time being), I > > > intend to leave it as-is since it's still a default in the rest of th= e > > > world. > > > > Ok, valid straw man argument: in this particular case, should llvm / c+= + support be disabled instead, since it=E2=80=99s the real underlying issue= ? I=E2=80=99m guessing (non-ancient) g++ doesn=E2=80=99t have this issue. > > > > Again, disabling a framework because of a single issue in the tests doe= sn=E2=80=99t make sense. Unless you have proof that the build times for all= of googletest/googlemock with llvm is an issue, this seems like the wrong = remediation to perform. > > > > -Enji > > > > PS A heads up to asomers and myself would have been nice. I don=E2=80= =99t like post-commit nitpicking, since the issue could have been discussed= /reviewed before commit. > > If this was any less than a temporary workaround that will get > reverted in due time, I would sympathize with your argument > completely. I had no intention of wasting your time or asomers' time > with this tier-2 problem that had already been diagnosed as an > LLVM/mips bug. > > The unfortunate reality is that no one (including CI) is running tests > on FreeBSD/mips, and no one will feel the fallout of this decision. Sorry, this was supposed to read: "this decision, and anyone else will simply flip it back on for MIPS in the meantime." From owner-svn-src-head@freebsd.org Wed Sep 18 16:13:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94B4B122504; Wed, 18 Sep 2019 16:13:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YQ4l3RrMz4Vdj; Wed, 18 Sep 2019 16:13: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC55277B6; Wed, 18 Sep 2019 16:13:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8IGDB7D019182; Wed, 18 Sep 2019 16:13:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8IGDAFn019180; Wed, 18 Sep 2019 16:13:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909181613.x8IGDAFn019180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 Sep 2019 16:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352486 - in head: lib/libc/gen sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/gen sys/kern sys/sys X-SVN-Commit-Revision: 352486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 16:13:11 -0000 Author: kib Date: Wed Sep 18 16:13:10 2019 New Revision: 352486 URL: https://svnweb.freebsd.org/changeset/base/352486 Log: sysctl: use names instead of magic numbers. Replace magic numbers with symbols for internal sysctl operations. Convert in-kernel and libc consumers. Submitted by: Pawel Biernacki MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21693 Modified: head/lib/libc/gen/sysctlnametomib.c head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Modified: head/lib/libc/gen/sysctlnametomib.c ============================================================================== --- head/lib/libc/gen/sysctlnametomib.c Wed Sep 18 14:38:42 2019 (r352485) +++ head/lib/libc/gen/sysctlnametomib.c Wed Sep 18 16:13:10 2019 (r352486) @@ -47,8 +47,8 @@ sysctlnametomib(const char *name, int *mibp, size_t *s int oid[2]; int error; - oid[0] = 0; - oid[1] = 3; + oid[0] = CTL_SYSCTL; + oid[1] = CTL_SYSCTL_NAME2OID; *sizep *= sizeof(int); error = sysctl(oid, 2, mibp, sizep, name, strlen(name)); Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Wed Sep 18 14:38:42 2019 (r352485) +++ head/sys/kern/kern_sysctl.c Wed Sep 18 16:13:10 2019 (r352486) @@ -935,13 +935,18 @@ SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_re * (be aware though, that the proper interface isn't as obvious as it * may seem, there are various conflicting requirements. * - * {0,0} printf the entire MIB-tree. - * {0,1,...} return the name of the "..." OID. - * {0,2,...} return the next OID. - * {0,3} return the OID of the name in "new" - * {0,4,...} return the kind & format info for the "..." OID. - * {0,5,...} return the description of the "..." OID. - * {0,6,...} return the aggregation label of the "..." OID. + * {CTL_SYSCTL, CTL_SYSCTL_DEBUG} printf the entire MIB-tree. + * {CTL_SYSCTL, CTL_SYSCTL_NAME, ...} return the name of the "..." + * OID. + * {CTL_SYSCTL, CTL_SYSCTL_NEXT, ...} return the next OID. + * {CTL_SYSCTL, CTL_SYSCTL_NAME2OID} return the OID of the name in + * "new" + * {CTL_SYSCTL, CTL_SYSCTL_OIDFMT, ...} return the kind & format info + * for the "..." OID. + * {CTL_SYSCTL, CTL_SYSCTL_OIDDESCR, ...} return the description of the + * "..." OID. + * {CTL_SYSCTL, CTL_SYSCTL_OIDLABEL, ...} return the aggregation label of + * the "..." OID. */ #ifdef SYSCTL_DEBUG @@ -1009,8 +1014,8 @@ sysctl_sysctl_debug(SYSCTL_HANDLER_ARGS) return (ENOENT); } -SYSCTL_PROC(_sysctl, 0, debug, CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, - 0, 0, sysctl_sysctl_debug, "-", ""); +SYSCTL_PROC(_sysctl, CTL_SYSCTL_DEBUG, debug, CTLTYPE_STRING | CTLFLAG_RD | + CTLFLAG_MPSAFE, 0, 0, sysctl_sysctl_debug, "-", ""); #endif static int @@ -1075,8 +1080,8 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) * XXXRW/JA: Shouldn't return name data for nodes that we don't permit in * capability mode. */ -static SYSCTL_NODE(_sysctl, 1, name, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, - sysctl_sysctl_name, ""); +static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NAME, name, CTLFLAG_RD | + CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_name, ""); static int sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen, @@ -1162,8 +1167,8 @@ sysctl_sysctl_next(SYSCTL_HANDLER_ARGS) * XXXRW/JA: Shouldn't return next data for nodes that we don't permit in * capability mode. */ -static SYSCTL_NODE(_sysctl, 2, next, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, - sysctl_sysctl_next, ""); +static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NEXT, next, CTLFLAG_RD | + CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_next, ""); static int name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) @@ -1249,9 +1254,9 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS) * XXXRW/JA: Shouldn't return name2oid data for nodes that we don't permit in * capability mode. */ -SYSCTL_PROC(_sysctl, 3, name2oid, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE - | CTLFLAG_CAPRW, 0, 0, sysctl_sysctl_name2oid, "I", ""); +SYSCTL_PROC(_sysctl, CTL_SYSCTL_NAME2OID, name2oid, CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_ANYBODY | CTLFLAG_MPSAFE | CTLFLAG_CAPRW, 0, 0, + sysctl_sysctl_name2oid, "I", ""); static int sysctl_sysctl_oidfmt(SYSCTL_HANDLER_ARGS) @@ -1279,8 +1284,8 @@ sysctl_sysctl_oidfmt(SYSCTL_HANDLER_ARGS) } -static SYSCTL_NODE(_sysctl, 4, oidfmt, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD, - sysctl_sysctl_oidfmt, ""); +static SYSCTL_NODE(_sysctl, CTL_SYSCTL_OIDFMT, oidfmt, CTLFLAG_RD | + CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_oidfmt, ""); static int sysctl_sysctl_oiddescr(SYSCTL_HANDLER_ARGS) @@ -1304,8 +1309,8 @@ sysctl_sysctl_oiddescr(SYSCTL_HANDLER_ARGS) return (error); } -static SYSCTL_NODE(_sysctl, 5, oiddescr, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD, - sysctl_sysctl_oiddescr, ""); +static SYSCTL_NODE(_sysctl, CTL_SYSCTL_OIDDESCR, oiddescr, CTLFLAG_RD | + CTLFLAG_MPSAFE|CTLFLAG_CAPRD, sysctl_sysctl_oiddescr, ""); static int sysctl_sysctl_oidlabel(SYSCTL_HANDLER_ARGS) @@ -1329,8 +1334,8 @@ sysctl_sysctl_oidlabel(SYSCTL_HANDLER_ARGS) return (error); } -static SYSCTL_NODE(_sysctl, 6, oidlabel, - CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_oidlabel, ""); +static SYSCTL_NODE(_sysctl, CTL_SYSCTL_OIDLABEL, oidlabel, CTLFLAG_RD | + CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_oidlabel, ""); /* * Default "handler" functions. @@ -1857,8 +1862,8 @@ kernel_sysctlbyname(struct thread *td, char *name, voi size_t oidlen, plen; int error; - oid[0] = 0; /* sysctl internal magic */ - oid[1] = 3; /* name2oid */ + oid[0] = CTL_SYSCTL; + oid[1] = CTL_SYSCTL_NAME2OID; oidlen = sizeof(oid); error = kernel_sysctl(td, oid, 2, oid, &oidlen, @@ -2165,8 +2170,8 @@ kern___sysctlbyname(struct thread *td, const char *ona if (error != 0) goto out; - oid[0] = 0; - oid[1] = 3; + oid[0] = CTL_SYSCTL; + oid[1] = CTL_SYSCTL_NAME2OID; oidlen = sizeof(oid); error = kernel_sysctl(td, oid, 2, oid, &oidlen, (void *)name, namelen, retval, flags); @@ -2667,8 +2672,8 @@ db_show_sysctl_all(int *oid, size_t len, int flags) int name1[CTL_MAXNAME + 2], name2[CTL_MAXNAME + 2]; size_t l1, l2; - name1[0] = 0; - name1[1] = 2; + name1[0] = CTL_SYSCTL; + name1[1] = CTL_SYSCTL_NEXT; l1 = 2; if (len) { memcpy(name1+2, oid, len * sizeof(int)); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Wed Sep 18 14:38:42 2019 (r352485) +++ head/sys/sys/sysctl.h Wed Sep 18 16:13:10 2019 (r352486) @@ -889,7 +889,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); /* * Top-level identifiers */ -#define CTL_UNSPEC 0 /* unused */ +#define CTL_SYSCTL 0 /* "magic" numbers */ #define CTL_KERN 1 /* "high kernel": proc, limits */ #define CTL_VM 2 /* virtual memory */ #define CTL_VFS 3 /* filesystem, mount type is next */ @@ -899,6 +899,17 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define CTL_MACHDEP 7 /* machine dependent */ #define CTL_USER 8 /* user-level */ #define CTL_P1003_1B 9 /* POSIX 1003.1B */ + +/* + * CTL_SYSCTL identifiers + */ +#define CTL_SYSCTL_DEBUG 0 /* printf all nodes */ +#define CTL_SYSCTL_NAME 1 /* string name of OID */ +#define CTL_SYSCTL_NEXT 2 /* next OID */ +#define CTL_SYSCTL_NAME2OID 3 /* int array of name */ +#define CTL_SYSCTL_OIDFMT 4 /* OID's kind and format */ +#define CTL_SYSCTL_OIDDESCR 5 /* OID's description */ +#define CTL_SYSCTL_OIDLABEL 6 /* aggregation label */ /* * CTL_KERN identifiers From owner-svn-src-head@freebsd.org Wed Sep 18 16:13:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F348E122571; Wed, 18 Sep 2019 16:13:51 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YQ5W6xQkz4VmT; Wed, 18 Sep 2019 16:13:51 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7040277BB; Wed, 18 Sep 2019 16:13:51 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8IGDp1I019262; Wed, 18 Sep 2019 16:13:51 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8IGDodZ019256; Wed, 18 Sep 2019 16:13:50 GMT (envelope-from br@FreeBSD.org) Message-Id: <201909181613.x8IGDodZ019256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 18 Sep 2019 16:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352487 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/sys X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head: lib/libpmc sys/conf sys/dev/hwpmc sys/sys X-SVN-Commit-Revision: 352487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 16:13:52 -0000 Author: br Date: Wed Sep 18 16:13:50 2019 New Revision: 352487 URL: https://svnweb.freebsd.org/changeset/base/352487 Log: Add support for BERI statcounters. BERI stands for Bluespec Extensible RISC Implementation, based on MIPS. BERI has not implemented standard MIPS perfomance monitoring counters, instead it provides statistical counters. BERI statcounters have a several limitations: - They can't be written - They don't support start/stop operation - None of hardware interrupt is provided on a counter overflow. So make it separate to hwpmc_mips module and support process/system counting mode only. Sponsored by: DARPA, AFRL Added: head/sys/dev/hwpmc/hwpmc_beri.c (contents, props changed) head/sys/dev/hwpmc/hwpmc_beri.h (contents, props changed) Modified: head/lib/libpmc/libpmc.c head/sys/conf/files.mips head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Wed Sep 18 16:13:10 2019 (r352486) +++ head/lib/libpmc/libpmc.c Wed Sep 18 16:13:50 2019 (r352487) @@ -143,6 +143,7 @@ PMC_CLASSDEP_TABLE(k8, K8); PMC_CLASSDEP_TABLE(xscale, XSCALE); PMC_CLASSDEP_TABLE(armv7, ARMV7); PMC_CLASSDEP_TABLE(armv8, ARMV8); +PMC_CLASSDEP_TABLE(beri, BERI); PMC_CLASSDEP_TABLE(mips24k, MIPS24K); PMC_CLASSDEP_TABLE(mips74k, MIPS74K); PMC_CLASSDEP_TABLE(octeon, OCTEON); @@ -187,6 +188,7 @@ static const struct pmc_event_descr cortex_a57_event_t PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_SOFT, PMC_CLASS_XSCALE); +PMC_MDEP_TABLE(beri, BERI, PMC_CLASS_SOFT, PMC_CLASS_BERI); PMC_MDEP_TABLE(cortex_a8, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7); PMC_MDEP_TABLE(cortex_a9, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7); PMC_MDEP_TABLE(cortex_a53, ARMV8, PMC_CLASS_SOFT, PMC_CLASS_ARMV8); @@ -235,6 +237,7 @@ PMC_CLASS_TABLE_DESC(cortex_a53, ARMV8, cortex_a53, ar PMC_CLASS_TABLE_DESC(cortex_a57, ARMV8, cortex_a57, arm64); #endif #if defined(__mips__) +PMC_CLASS_TABLE_DESC(beri, BERI, beri, mips); PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips); PMC_CLASS_TABLE_DESC(mips74k, MIPS74K, mips74k, mips); PMC_CLASS_TABLE_DESC(octeon, OCTEON, octeon, mips); @@ -829,6 +832,11 @@ arm64_allocate_pmc(enum pmc_event pe, char *ctrspec __ #if defined(__mips__) +static struct pmc_event_alias beri_aliases[] = { + EV_ALIAS("instructions", "INST"), + EV_ALIAS(NULL, NULL) +}; + static struct pmc_event_alias mips24k_aliases[] = { EV_ALIAS("instructions", "INSTR_EXECUTED"), EV_ALIAS("branches", "BRANCH_COMPLETED"), @@ -1267,6 +1275,10 @@ pmc_event_names_of_class(enum pmc_class cl, const char break; } break; + case PMC_CLASS_BERI: + ev = beri_event_table; + count = PMC_EVENT_TABLE_SIZE(beri); + break; case PMC_CLASS_MIPS24K: ev = mips24k_event_table; count = PMC_EVENT_TABLE_SIZE(mips24k); @@ -1508,6 +1520,10 @@ pmc_init(void) break; #endif #if defined(__mips__) + case PMC_CPU_MIPS_BERI: + PMC_MDEP_INIT(beri); + pmc_class_table[n] = &beri_class_table_descr; + break; case PMC_CPU_MIPS_24K: PMC_MDEP_INIT(mips24k); pmc_class_table[n] = &mips24k_class_table_descr; @@ -1645,6 +1661,9 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype default: /* Unknown CPU type. */ break; } + } else if (pe >= PMC_EV_BERI_FIRST && pe <= PMC_EV_BERI_LAST) { + ev = beri_event_table; + evfence = beri_event_table + PMC_EVENT_TABLE_SIZE(beri); } else if (pe >= PMC_EV_MIPS24K_FIRST && pe <= PMC_EV_MIPS24K_LAST) { ev = mips24k_event_table; evfence = mips24k_event_table + PMC_EVENT_TABLE_SIZE(mips24k); Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Wed Sep 18 16:13:10 2019 (r352486) +++ head/sys/conf/files.mips Wed Sep 18 16:13:50 2019 (r352487) @@ -91,7 +91,9 @@ dev/nvram2env/nvram2env_mips.c optional nvram2env dev/nvram2env/nvram2env.c optional nvram2env # hwpmc support -dev/hwpmc/hwpmc_mips.c optional hwpmc +dev/hwpmc/hwpmc_beri.c optional hwpmc_beri +dev/hwpmc/hwpmc_mips.c optional hwpmc_mips24k | \ + hwpmc_mips74k dev/hwpmc/hwpmc_mips24k.c optional hwpmc_mips24k dev/hwpmc/hwpmc_mips74k.c optional hwpmc_mips74k Added: head/sys/dev/hwpmc/hwpmc_beri.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hwpmc/hwpmc_beri.c Wed Sep 18 16:13:50 2019 (r352487) @@ -0,0 +1,540 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_hwpmc_hooks.h" + +#include +#include + +#include + +#define BERI_NCOUNTERS 56 +#define BERI_PMC_CAPS (PMC_CAP_USER | PMC_CAP_SYSTEM | \ + PMC_CAP_READ | PMC_CAP_WRITE ) + +struct beri_event_code_map { + uint32_t pe_ev; /* enum value */ + uint64_t (*get_func)(void); +}; + +const struct beri_event_code_map beri_event_codes[BERI_NCOUNTERS] = { + { PMC_EV_BERI_CYCLE, + statcounters_get_cycle_count }, + { PMC_EV_BERI_INST, + statcounters_get_inst_count }, + { PMC_EV_BERI_INST_USER, + statcounters_get_inst_user_count }, + { PMC_EV_BERI_INST_KERNEL, + statcounters_get_inst_kernel_count }, + { PMC_EV_BERI_IMPRECISE_SETBOUNDS, + statcounters_get_imprecise_setbounds_count }, + { PMC_EV_BERI_UNREPRESENTABLE_CAPS, + statcounters_get_unrepresentable_caps_count }, + { PMC_EV_BERI_ITLB_MISS, + statcounters_get_itlb_miss_count }, + { PMC_EV_BERI_DTLB_MISS, + statcounters_get_dtlb_miss_count }, + { PMC_EV_BERI_ICACHE_WRITE_HIT, + statcounters_get_icache_write_hit_count }, + { PMC_EV_BERI_ICACHE_WRITE_MISS, + statcounters_get_icache_write_miss_count }, + { PMC_EV_BERI_ICACHE_READ_HIT, + statcounters_get_icache_read_hit_count }, + { PMC_EV_BERI_ICACHE_READ_MISS, + statcounters_get_icache_read_miss_count }, + { PMC_EV_BERI_ICACHE_EVICT, + statcounters_get_icache_evict_count }, + { PMC_EV_BERI_DCACHE_WRITE_HIT, + statcounters_get_dcache_write_hit_count }, + { PMC_EV_BERI_DCACHE_WRITE_MISS, + statcounters_get_dcache_write_miss_count }, + { PMC_EV_BERI_DCACHE_READ_HIT, + statcounters_get_dcache_read_hit_count }, + { PMC_EV_BERI_DCACHE_READ_MISS, + statcounters_get_dcache_read_miss_count }, + { PMC_EV_BERI_DCACHE_EVICT, + statcounters_get_dcache_evict_count }, + { PMC_EV_BERI_DCACHE_SET_TAG_WRITE, + statcounters_get_dcache_set_tag_write_count }, + { PMC_EV_BERI_DCACHE_SET_TAG_READ, + statcounters_get_dcache_set_tag_read_count }, + { PMC_EV_BERI_L2CACHE_WRITE_HIT, + statcounters_get_l2cache_write_hit_count }, + { PMC_EV_BERI_L2CACHE_WRITE_MISS, + statcounters_get_l2cache_write_miss_count }, + { PMC_EV_BERI_L2CACHE_READ_HIT, + statcounters_get_l2cache_read_hit_count }, + { PMC_EV_BERI_L2CACHE_READ_MISS, + statcounters_get_l2cache_read_miss_count }, + { PMC_EV_BERI_L2CACHE_EVICT, + statcounters_get_l2cache_evict_count }, + { PMC_EV_BERI_L2CACHE_SET_TAG_WRITE, + statcounters_get_l2cache_set_tag_write_count }, + { PMC_EV_BERI_L2CACHE_SET_TAG_READ, + statcounters_get_l2cache_set_tag_read_count }, + { PMC_EV_BERI_MEM_BYTE_READ, + statcounters_get_mem_byte_read_count }, + { PMC_EV_BERI_MEM_BYTE_WRITE, + statcounters_get_mem_byte_write_count }, + { PMC_EV_BERI_MEM_HWORD_READ, + statcounters_get_mem_hword_read_count }, + { PMC_EV_BERI_MEM_HWORD_WRITE, + statcounters_get_mem_hword_write_count }, + { PMC_EV_BERI_MEM_WORD_READ, + statcounters_get_mem_word_read_count }, + { PMC_EV_BERI_MEM_WORD_WRITE, + statcounters_get_mem_word_write_count }, + { PMC_EV_BERI_MEM_DWORD_READ, + statcounters_get_mem_dword_read_count }, + { PMC_EV_BERI_MEM_DWORD_WRITE, + statcounters_get_mem_dword_write_count }, + { PMC_EV_BERI_MEM_CAP_READ, + statcounters_get_mem_cap_read_count }, + { PMC_EV_BERI_MEM_CAP_WRITE, + statcounters_get_mem_cap_write_count }, + { PMC_EV_BERI_MEM_CAP_READ_TAG_SET, + statcounters_get_mem_cap_read_tag_set_count }, + { PMC_EV_BERI_MEM_CAP_WRITE_TAG_SET, + statcounters_get_mem_cap_write_tag_set_count }, + { PMC_EV_BERI_TAGCACHE_WRITE_HIT, + statcounters_get_tagcache_write_hit_count }, + { PMC_EV_BERI_TAGCACHE_WRITE_MISS, + statcounters_get_tagcache_write_miss_count }, + { PMC_EV_BERI_TAGCACHE_READ_HIT, + statcounters_get_tagcache_read_hit_count }, + { PMC_EV_BERI_TAGCACHE_READ_MISS, + statcounters_get_tagcache_read_miss_count }, + { PMC_EV_BERI_TAGCACHE_EVICT, + statcounters_get_tagcache_evict_count }, + { PMC_EV_BERI_L2CACHEMASTER_READ_REQ, + statcounters_get_l2cachemaster_read_req_count }, + { PMC_EV_BERI_L2CACHEMASTER_WRITE_REQ, + statcounters_get_l2cachemaster_write_req_count }, + { PMC_EV_BERI_L2CACHEMASTER_WRITE_REQ_FLIT, + statcounters_get_l2cachemaster_write_req_flit_count }, + { PMC_EV_BERI_L2CACHEMASTER_READ_RSP, + statcounters_get_l2cachemaster_read_rsp_count }, + { PMC_EV_BERI_L2CACHEMASTER_READ_RSP_FLIT, + statcounters_get_l2cachemaster_read_rsp_flit_count }, + { PMC_EV_BERI_L2CACHEMASTER_WRITE_RSP, + statcounters_get_l2cachemaster_write_rsp_count }, + { PMC_EV_BERI_TAGCACHEMASTER_READ_REQ, + statcounters_get_tagcachemaster_read_req_count }, + { PMC_EV_BERI_TAGCACHEMASTER_WRITE_REQ, + statcounters_get_tagcachemaster_write_req_count }, + { PMC_EV_BERI_TAGCACHEMASTER_WRITE_REQ_FLIT, + statcounters_get_tagcachemaster_write_req_flit_count }, + { PMC_EV_BERI_TAGCACHEMASTER_READ_RSP, + statcounters_get_tagcachemaster_read_rsp_count }, + { PMC_EV_BERI_TAGCACHEMASTER_READ_RSP_FLIT, + statcounters_get_tagcachemaster_read_rsp_flit_count }, + { PMC_EV_BERI_TAGCACHEMASTER_WRITE_RSP, + statcounters_get_tagcachemaster_write_rsp_count }, +}; + +struct mips_pmc_spec beri_pmc_spec = { + .ps_cpuclass = PMC_CLASS_BERI, + .ps_cputype = PMC_CPU_MIPS_BERI, + .ps_capabilities = BERI_PMC_CAPS, + .ps_counter_width = 64 +}; + +/* + * Per-processor information. + */ +struct beri_cpu { + struct pmc_hw *pc_beripmcs; + uint64_t start_values[BERI_NCOUNTERS]; + uint64_t stop_values[BERI_NCOUNTERS]; + uint64_t saved_values[BERI_NCOUNTERS]; +}; + +int beri_npmcs; +static struct beri_cpu **beri_pcpu; + +static int +beri_allocate_pmc(int cpu, int ri, struct pmc *pm, + const struct pmc_op_pmcallocate *a) +{ + uint32_t config; + int i; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[beri,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < beri_npmcs, + ("[beri,%d] illegal row index %d", __LINE__, ri)); + + if (a->pm_class != beri_pmc_spec.ps_cpuclass) + return (EINVAL); + + for (i = 0; i < BERI_NCOUNTERS; i++) { + if (beri_event_codes[i].pe_ev == a->pm_ev) { + config = i; + break; + } + } + + if (i == BERI_NCOUNTERS) + return (EINVAL); + + pm->pm_md.pm_mips_evsel = config; + + PMCDBG2(MDP,ALL,2,"beri-allocate ri=%d -> config=0x%x", ri, config); + + return (0); +} + +static int +beri_read_pmc(int cpu, int ri, pmc_value_t *v) +{ + uint32_t config; + struct pmc *pm; + pmc_value_t new; + pmc_value_t start_val; + pmc_value_t stop_val; + pmc_value_t saved_val; + pmc_value_t result; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[beri,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < beri_npmcs, + ("[beri,%d] illegal row index %d", __LINE__, ri)); + + pm = beri_pcpu[cpu]->pc_beripmcs[ri].phw_pmc; + config = pm->pm_md.pm_mips_evsel; + + start_val = beri_pcpu[cpu]->start_values[config]; + if (PMC_IS_SYSTEM_MODE(PMC_TO_MODE(pm))) { + stop_val = beri_event_codes[config].get_func(); + } else + stop_val = beri_pcpu[cpu]->stop_values[config]; + + if (start_val <= stop_val) + result = stop_val - start_val; + else { + if (config == 0) /* CYCLE counter is 48 bit */ + result = 0x00ffffffffffffffUL; + else + result = 0xffffffffffffffffUL; + result -= start_val; + result += stop_val; + } + + saved_val = beri_pcpu[cpu]->saved_values[config]; + + *v = result + saved_val; + + return (0); +} + +static int +beri_write_pmc(int cpu, int ri, pmc_value_t v) +{ + struct pmc *pm; + uint32_t config; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[beri,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < beri_npmcs, + ("[beri,%d] illegal row-index %d", __LINE__, ri)); + + pm = beri_pcpu[cpu]->pc_beripmcs[ri].phw_pmc; + config = pm->pm_md.pm_mips_evsel; + + if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + v = (1UL << (beri_pmc_spec.ps_counter_width - 1)) - v; + + PMCDBG3(MDP,WRI,1,"beri-write cpu=%d ri=%d v=%jx", cpu, ri, v); + + if (PMC_IS_SYSTEM_MODE(PMC_TO_MODE(pm))) + beri_pcpu[cpu]->saved_values[config] = 0; + else + beri_pcpu[cpu]->saved_values[config] = v; + + return (0); +} + +static int +beri_config_pmc(int cpu, int ri, struct pmc *pm) +{ + struct pmc_hw *phw; + + PMCDBG3(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[beri,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < beri_npmcs, + ("[beri,%d] illegal row-index %d", __LINE__, ri)); + + phw = &beri_pcpu[cpu]->pc_beripmcs[ri]; + + KASSERT(pm == NULL || phw->phw_pmc == NULL, + ("[beri,%d] pm=%p phw->pm=%p hwpmc not unconfigured", + __LINE__, pm, phw->phw_pmc)); + + phw->phw_pmc = pm; + + return (0); +} + +static int +beri_start_pmc(int cpu, int ri) +{ + uint32_t config; + struct pmc *pm; + struct pmc_hw *phw; + pmc_value_t v; + + phw = &beri_pcpu[cpu]->pc_beripmcs[ri]; + pm = phw->phw_pmc; + config = pm->pm_md.pm_mips_evsel; + + v = beri_event_codes[config].get_func(); + beri_pcpu[cpu]->start_values[config] = v; + + return (0); +} + +static int +beri_stop_pmc(int cpu, int ri) +{ + uint32_t config; + struct pmc *pm; + struct pmc_hw *phw; + pmc_value_t v; + + phw = &beri_pcpu[cpu]->pc_beripmcs[ri]; + pm = phw->phw_pmc; + config = pm->pm_md.pm_mips_evsel; + + v = beri_event_codes[config].get_func(); + beri_pcpu[cpu]->stop_values[config] = v; + + return (0); +} + +static int +beri_release_pmc(int cpu, int ri, struct pmc *pmc) +{ + struct pmc_hw *phw; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[beri,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < beri_npmcs, + ("[beri,%d] illegal row-index %d", __LINE__, ri)); + + phw = &beri_pcpu[cpu]->pc_beripmcs[ri]; + KASSERT(phw->phw_pmc == NULL, + ("[beri,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); + + return (0); +} + +static int +beri_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) +{ + struct pmc_hw *phw; + char beri_name[PMC_NAME_MAX]; + int error; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[beri,%d], illegal CPU %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < beri_npmcs, + ("[beri,%d] row-index %d out of range", __LINE__, ri)); + + phw = &beri_pcpu[cpu]->pc_beripmcs[ri]; + snprintf(beri_name, sizeof(beri_name), "MIPS-%d", ri); + if ((error = copystr(beri_name, pi->pm_name, PMC_NAME_MAX, + NULL)) != 0) + return error; + pi->pm_class = beri_pmc_spec.ps_cpuclass; + if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { + pi->pm_enabled = TRUE; + *ppmc = phw->phw_pmc; + } else { + pi->pm_enabled = FALSE; + *ppmc = NULL; + } + + return (0); +} + +static int +beri_get_config(int cpu, int ri, struct pmc **ppm) +{ + + *ppm = beri_pcpu[cpu]->pc_beripmcs[ri].phw_pmc; + + return (0); +} + +static int +beri_pmc_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) +{ + + return (0); +} + +static int +beri_pmc_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) +{ + + return (0); +} + +static int +beri_pcpu_init(struct pmc_mdep *md, int cpu) +{ + int first_ri, i; + struct pmc_cpu *pc; + struct beri_cpu *pac; + struct pmc_hw *phw; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[beri,%d] wrong cpu number %d", __LINE__, cpu)); + PMCDBG1(MDP,INI,1,"beri-init cpu=%d", cpu); + + beri_pcpu[cpu] = pac = malloc(sizeof(struct beri_cpu), M_PMC, + M_WAITOK|M_ZERO); + pac->pc_beripmcs = malloc(sizeof(struct pmc_hw) * beri_npmcs, + M_PMC, M_WAITOK|M_ZERO); + pc = pmc_pcpu[cpu]; + first_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_MIPS].pcd_ri; + KASSERT(pc != NULL, ("[beri,%d] NULL per-cpu pointer", __LINE__)); + + for (i = 0, phw = pac->pc_beripmcs; i < beri_npmcs; i++, phw++) { + phw->phw_state = PMC_PHW_FLAG_IS_ENABLED | + PMC_PHW_CPU_TO_STATE(cpu) | PMC_PHW_INDEX_TO_STATE(i); + phw->phw_pmc = NULL; + pc->pc_hwpmcs[i + first_ri] = phw; + } + + return (0); +} + +static int +beri_pcpu_fini(struct pmc_mdep *md, int cpu) +{ + + return (0); +} + +struct pmc_mdep * +pmc_beri_initialize() +{ + struct pmc_mdep *pmc_mdep; + struct pmc_classdep *pcd; + + snprintf(pmc_cpuid, sizeof(pmc_cpuid), "beri"); + + beri_npmcs = 2; + + PMCDBG1(MDP,INI,1,"beri-init npmcs=%d", beri_npmcs); + + /* + * Allocate space for pointers to PMC HW descriptors and for + * the MDEP structure used by MI code. + */ + beri_pcpu = malloc(sizeof(struct beri_cpu *) * pmc_cpu_max(), M_PMC, + M_WAITOK|M_ZERO); + + /* Just one class */ + pmc_mdep = pmc_mdep_alloc(1); + + pmc_mdep->pmd_cputype = beri_pmc_spec.ps_cputype; + + pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_MIPS]; + pcd->pcd_caps = beri_pmc_spec.ps_capabilities; + pcd->pcd_class = beri_pmc_spec.ps_cpuclass; + pcd->pcd_num = beri_npmcs; + pcd->pcd_ri = pmc_mdep->pmd_npmc; + pcd->pcd_width = beri_pmc_spec.ps_counter_width; + + pcd->pcd_allocate_pmc = beri_allocate_pmc; + pcd->pcd_config_pmc = beri_config_pmc; + pcd->pcd_pcpu_fini = beri_pcpu_fini; + pcd->pcd_pcpu_init = beri_pcpu_init; + pcd->pcd_describe = beri_describe; + pcd->pcd_get_config = beri_get_config; + pcd->pcd_read_pmc = beri_read_pmc; + pcd->pcd_release_pmc = beri_release_pmc; + pcd->pcd_start_pmc = beri_start_pmc; + pcd->pcd_stop_pmc = beri_stop_pmc; + pcd->pcd_write_pmc = beri_write_pmc; + + pmc_mdep->pmd_intr = NULL; + pmc_mdep->pmd_switch_in = beri_pmc_switch_in; + pmc_mdep->pmd_switch_out = beri_pmc_switch_out; + + pmc_mdep->pmd_npmc += beri_npmcs; + + return (pmc_mdep); +} + +void +pmc_beri_finalize(struct pmc_mdep *md) +{ + +} + +struct pmc_mdep * +pmc_md_initialize() +{ + + return (pmc_beri_initialize()); +} + +void +pmc_md_finalize(struct pmc_mdep *md) +{ + + return (pmc_beri_finalize(md)); +} + +int +pmc_save_kernel_callchain(uintptr_t *cc, int nframes, + struct trapframe *tf) +{ + + return (0); +} + +int +pmc_save_user_callchain(uintptr_t *cc, int nframes, + struct trapframe *tf) +{ + + return (0); +} Added: head/sys/dev/hwpmc/hwpmc_beri.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hwpmc/hwpmc_beri.h Wed Sep 18 16:13:50 2019 (r352487) @@ -0,0 +1,107 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_HWPMC_HWPMC_BERI_H_ +#define _DEV_HWPMC_HWPMC_BERI_H_ + +#define STATCOUNTER_ITEM(name, X, Y) \ +static inline uint64_t statcounters_get_##name##_count(void) \ +{ \ + uint64_t ret; \ + __asm __volatile( \ + ".word (0x1f << 26) | (0x0 << 21) | \ + (12 << 16) | ("#X" << 11) | \ + ( "#Y" << 6) | 0x3b\n\t" \ + "move %0,$12" : "=r" (ret) :: "$12"); \ + return (ret); \ +} + +STATCOUNTER_ITEM(cycle,2,0) +STATCOUNTER_ITEM(inst,4,0) +STATCOUNTER_ITEM(inst_user,4,1) +STATCOUNTER_ITEM(inst_kernel,4,2) +STATCOUNTER_ITEM(imprecise_setbounds,4,3) +STATCOUNTER_ITEM(unrepresentable_caps,4,4) +STATCOUNTER_ITEM(itlb_miss,5,0) +STATCOUNTER_ITEM(dtlb_miss,6,0) +STATCOUNTER_ITEM(icache_write_hit,8,0) +STATCOUNTER_ITEM(icache_write_miss,8,1) +STATCOUNTER_ITEM(icache_read_hit,8,2) +STATCOUNTER_ITEM(icache_read_miss,8,3) +STATCOUNTER_ITEM(icache_evict,8,6) +STATCOUNTER_ITEM(dcache_write_hit,9,0) +STATCOUNTER_ITEM(dcache_write_miss,9,1) +STATCOUNTER_ITEM(dcache_read_hit,9,2) +STATCOUNTER_ITEM(dcache_read_miss,9,3) +STATCOUNTER_ITEM(dcache_evict,9,6) +STATCOUNTER_ITEM(dcache_set_tag_write,9,8) +STATCOUNTER_ITEM(dcache_set_tag_read,9,9) +STATCOUNTER_ITEM(l2cache_write_hit,10,0) +STATCOUNTER_ITEM(l2cache_write_miss,10,1) +STATCOUNTER_ITEM(l2cache_read_hit,10,2) +STATCOUNTER_ITEM(l2cache_read_miss,10,3) +STATCOUNTER_ITEM(l2cache_evict,10,6) +STATCOUNTER_ITEM(l2cache_set_tag_write,10,8) +STATCOUNTER_ITEM(l2cache_set_tag_read,10,9) +STATCOUNTER_ITEM(mem_byte_read,11,0) +STATCOUNTER_ITEM(mem_byte_write,11,1) +STATCOUNTER_ITEM(mem_hword_read,11,2) +STATCOUNTER_ITEM(mem_hword_write,11,3) +STATCOUNTER_ITEM(mem_word_read,11,4) +STATCOUNTER_ITEM(mem_word_write,11,5) +STATCOUNTER_ITEM(mem_dword_read,11,6) +STATCOUNTER_ITEM(mem_dword_write,11,7) +STATCOUNTER_ITEM(mem_cap_read,11,8) +STATCOUNTER_ITEM(mem_cap_write,11,9) +STATCOUNTER_ITEM(mem_cap_read_tag_set,11,10) +STATCOUNTER_ITEM(mem_cap_write_tag_set,11,11) +STATCOUNTER_ITEM(tagcache_write_hit,12,0) +STATCOUNTER_ITEM(tagcache_write_miss,12,1) +STATCOUNTER_ITEM(tagcache_read_hit,12,2) +STATCOUNTER_ITEM(tagcache_read_miss,12,3) +STATCOUNTER_ITEM(tagcache_evict,12,6) +STATCOUNTER_ITEM(l2cachemaster_read_req,13,0) +STATCOUNTER_ITEM(l2cachemaster_write_req,13,1) +STATCOUNTER_ITEM(l2cachemaster_write_req_flit,13,2) +STATCOUNTER_ITEM(l2cachemaster_read_rsp,13,3) +STATCOUNTER_ITEM(l2cachemaster_read_rsp_flit,13,4) +STATCOUNTER_ITEM(l2cachemaster_write_rsp,13,5) +STATCOUNTER_ITEM(tagcachemaster_read_req,14,0) +STATCOUNTER_ITEM(tagcachemaster_write_req,14,1) +STATCOUNTER_ITEM(tagcachemaster_write_req_flit,14,2) +STATCOUNTER_ITEM(tagcachemaster_read_rsp,14,3) +STATCOUNTER_ITEM(tagcachemaster_read_rsp_flit,14,4) +STATCOUNTER_ITEM(tagcachemaster_write_rsp,14,5) + +#endif /* !_DEV_HWPMC_HWPMC_BERI_H_ */ Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Wed Sep 18 16:13:10 2019 (r352486) +++ head/sys/dev/hwpmc/pmc_events.h Wed Sep 18 16:13:50 2019 (r352487) @@ -1246,6 +1246,67 @@ __PMC_EV_ALIAS("unhalted-core-cycles", IAP_ARCH_UNH_C #define PMC_EV_MIPS74K_FIRST PMC_EV_MIPS74K_CYCLES #define PMC_EV_MIPS74K_LAST PMC_EV_MIPS74K_WBB_25_50_FULL +#define __PMC_EV_BERI() \ + __PMC_EV(BERI, CYCLE) \ + __PMC_EV(BERI, INST) \ + __PMC_EV(BERI, INST_USER) \ + __PMC_EV(BERI, INST_KERNEL) \ + __PMC_EV(BERI, IMPRECISE_SETBOUNDS) \ + __PMC_EV(BERI, UNREPRESENTABLE_CAPS) \ + __PMC_EV(BERI, ITLB_MISS) \ + __PMC_EV(BERI, DTLB_MISS) \ + __PMC_EV(BERI, ICACHE_WRITE_HIT) \ + __PMC_EV(BERI, ICACHE_WRITE_MISS) \ + __PMC_EV(BERI, ICACHE_READ_HIT) \ + __PMC_EV(BERI, ICACHE_READ_MISS) \ + __PMC_EV(BERI, ICACHE_EVICT) \ + __PMC_EV(BERI, DCACHE_WRITE_HIT) \ + __PMC_EV(BERI, DCACHE_WRITE_MISS) \ + __PMC_EV(BERI, DCACHE_READ_HIT) \ + __PMC_EV(BERI, DCACHE_READ_MISS) \ + __PMC_EV(BERI, DCACHE_EVICT) \ + __PMC_EV(BERI, DCACHE_SET_TAG_WRITE) \ + __PMC_EV(BERI, DCACHE_SET_TAG_READ) \ + __PMC_EV(BERI, L2CACHE_WRITE_HIT) \ + __PMC_EV(BERI, L2CACHE_WRITE_MISS) \ + __PMC_EV(BERI, L2CACHE_READ_HIT) \ + __PMC_EV(BERI, L2CACHE_READ_MISS) \ + __PMC_EV(BERI, L2CACHE_EVICT) \ + __PMC_EV(BERI, L2CACHE_SET_TAG_WRITE) \ + __PMC_EV(BERI, L2CACHE_SET_TAG_READ) \ + __PMC_EV(BERI, MEM_BYTE_READ) \ + __PMC_EV(BERI, MEM_BYTE_WRITE) \ + __PMC_EV(BERI, MEM_HWORD_READ) \ + __PMC_EV(BERI, MEM_HWORD_WRITE) \ + __PMC_EV(BERI, MEM_WORD_READ) \ + __PMC_EV(BERI, MEM_WORD_WRITE) \ + __PMC_EV(BERI, MEM_DWORD_READ) \ + __PMC_EV(BERI, MEM_DWORD_WRITE) \ + __PMC_EV(BERI, MEM_CAP_READ) \ + __PMC_EV(BERI, MEM_CAP_WRITE) \ + __PMC_EV(BERI, MEM_CAP_READ_TAG_SET) \ + __PMC_EV(BERI, MEM_CAP_WRITE_TAG_SET) \ + __PMC_EV(BERI, TAGCACHE_WRITE_HIT) \ + __PMC_EV(BERI, TAGCACHE_WRITE_MISS) \ + __PMC_EV(BERI, TAGCACHE_READ_HIT) \ + __PMC_EV(BERI, TAGCACHE_READ_MISS) \ + __PMC_EV(BERI, TAGCACHE_EVICT) \ + __PMC_EV(BERI, L2CACHEMASTER_READ_REQ) \ + __PMC_EV(BERI, L2CACHEMASTER_WRITE_REQ) \ + __PMC_EV(BERI, L2CACHEMASTER_WRITE_REQ_FLIT) \ + __PMC_EV(BERI, L2CACHEMASTER_READ_RSP) \ + __PMC_EV(BERI, L2CACHEMASTER_READ_RSP_FLIT) \ + __PMC_EV(BERI, L2CACHEMASTER_WRITE_RSP) \ + __PMC_EV(BERI, TAGCACHEMASTER_READ_REQ) \ + __PMC_EV(BERI, TAGCACHEMASTER_WRITE_REQ) \ + __PMC_EV(BERI, TAGCACHEMASTER_WRITE_REQ_FLIT) \ + __PMC_EV(BERI, TAGCACHEMASTER_READ_RSP) \ + __PMC_EV(BERI, TAGCACHEMASTER_READ_RSP_FLIT) \ + __PMC_EV(BERI, TAGCACHEMASTER_WRITE_RSP) + +#define PMC_EV_BERI_FIRST PMC_EV_BERI_CYCLE +#define PMC_EV_BERI_LAST PMC_EV_BERI_TAGCACHEMASTER_WRITE_RSP + /* * Cavium Octeon counters. Obtained from cvmx-core.h */ @@ -1774,6 +1835,7 @@ __PMC_EV_ALIAS("unhalted-core-cycles", IAP_ARCH_UNH_C * 0x11300 0x00FF MIPS 24K events * 0x11400 0x00FF Octeon events * 0x11500 0x00FF MIPS 74K events + * 0x11600 0x00FF BERI statcounters * 0x13000 0x00FF MPC7450 events * 0x13100 0x00FF IBM PPC970 events * 0x13300 0x00FF Freescale e500 events @@ -1798,6 +1860,8 @@ __PMC_EV_ALIAS("unhalted-core-cycles", IAP_ARCH_UNH_C __PMC_EV_OCTEON() \ __PMC_EV_BLOCK(MIPS74K, 0x11500) \ __PMC_EV_MIPS74K() \ + __PMC_EV_BLOCK(BERI, 0x11600) \ + __PMC_EV_BERI() \ __PMC_EV_BLOCK(UCP, 0x12080) \ __PMC_EV_UCP() \ __PMC_EV_BLOCK(PPC7450, 0x13000) \ Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Wed Sep 18 16:13:10 2019 (r352486) +++ head/sys/sys/pmc.h Wed Sep 18 16:13:50 2019 (r352487) @@ -114,6 +114,7 @@ extern char pmc_cpuid[PMC_CPUID_LEN]; __PMC_CPU(MIPS_24K, 0x200, "MIPS 24K") \ __PMC_CPU(MIPS_OCTEON, 0x201, "Cavium Octeon") \ __PMC_CPU(MIPS_74K, 0x202, "MIPS 74K") \ + __PMC_CPU(MIPS_BERI, 0x203, "BERI") \ __PMC_CPU(PPC_7450, 0x300, "PowerPC MPC7450") \ __PMC_CPU(PPC_E500, 0x340, "PowerPC e500 Core") \ __PMC_CPU(PPC_970, 0x380, "IBM PowerPC 970") \ @@ -160,7 +161,8 @@ enum pmc_cputype { __PMC_CLASS(ARMV7, 0x10, "ARMv7") \ __PMC_CLASS(ARMV8, 0x11, "ARMv8") \ __PMC_CLASS(MIPS74K, 0x12, "MIPS 74K") \ - __PMC_CLASS(E500, 0x13, "Freescale e500 class") + __PMC_CLASS(E500, 0x13, "Freescale e500 class") \ + __PMC_CLASS(BERI, 0x14, "MIPS BERI") enum pmc_class { #undef __PMC_CLASS From owner-svn-src-head@freebsd.org Wed Sep 18 16:15:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1420712260F; Wed, 18 Sep 2019 16:15:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YQ6x6r8pz4Vvh; Wed, 18 Sep 2019 16:15:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE09B277BC; Wed, 18 Sep 2019 16:15:05 +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 x8IGF5UN019376; Wed, 18 Sep 2019 16:15:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8IGF5lk019374; Wed, 18 Sep 2019 16:15:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909181615.x8IGF5lk019374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 Sep 2019 16:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352488 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 352488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 16:15:06 -0000 Author: kib Date: Wed Sep 18 16:15:05 2019 New Revision: 352488 URL: https://svnweb.freebsd.org/changeset/base/352488 Log: truss: decode sysctl names. Submitted by: Pawel Biernacki MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21688 Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Wed Sep 18 16:13:50 2019 (r352487) +++ head/usr.bin/truss/syscall.h Wed Sep 18 16:15:05 2019 (r352488) @@ -131,6 +131,7 @@ enum Argtype { Sockprotocol, Socktype, Sysarch, + Sysctl, Umtxop, Waitoptions, Whence, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Wed Sep 18 16:13:50 2019 (r352487) +++ head/usr.bin/truss/syscalls.c Wed Sep 18 16:15:05 2019 (r352488) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #define _WANT_FREEBSD11_STAT #include +#include #include #include #include @@ -506,6 +507,12 @@ static struct syscall decoded_syscalls[] = { .args = { { Name, 0 }, { Atfd, 1 }, { Name, 2 } } }, { .name = "sysarch", .ret_type = 1, .nargs = 2, .args = { { Sysarch, 0 }, { Ptr, 1 } } }, + { .name = "__sysctl", .ret_type = 1, .nargs = 6, + .args = { { Sysctl, 0 }, { Sizet, 1 }, { Ptr, 2 }, { Ptr, 3 }, + { Ptr, 4 }, { Sizet, 5 } } }, + { .name = "__sysctlbyname", .ret_type = 1, .nargs = 6, + .args = { { Name, 0 }, { Sizet, 1 }, { Ptr, 2 }, { Ptr, 3 }, + { Ptr, 4}, { Sizet, 5 } } }, { .name = "thr_kill", .ret_type = 1, .nargs = 2, .args = { { Long, 0 }, { Signal, 1 } } }, { .name = "thr_self", .ret_type = 1, .nargs = 1, @@ -1551,6 +1558,15 @@ print_cmsgs(FILE *fp, pid_t pid, bool receive, struct free(cmsgbuf); } +static void +print_sysctl_oid(FILE *fp, int *oid, int len) +{ + int i; + + for (i = 0; i < len; i++) + fprintf(fp, ".%d", oid[i]); +} + /* * Converts a syscall argument into a string. Said string is * allocated via malloc(), so needs to be free()'d. sc is @@ -2267,6 +2283,62 @@ print_arg(struct syscall_args *sc, unsigned long *args print_integer_arg(sysdecode_sysarch_number, fp, args[sc->offset]); break; + case Sysctl: { + char name[BUFSIZ]; + int oid[CTL_MAXNAME + 2], qoid[CTL_MAXNAME + 2]; + size_t i; + int len; + + memset(name, 0, sizeof(name)); + len = args[sc->offset + 1]; + if (get_struct(pid, (void *)args[sc->offset], oid, + len * sizeof(oid[0])) != -1) { + fprintf(fp, "\""); + if (oid[0] == CTL_SYSCTL) { + fprintf(fp, "sysctl."); + switch (oid[1]) { + case CTL_SYSCTL_DEBUG: + fprintf(fp, "debug"); + break; + case CTL_SYSCTL_NAME: + fprintf(fp, "name"); + print_sysctl_oid(fp, oid + 2, len - 2); + break; + case CTL_SYSCTL_NEXT: + fprintf(fp, "next"); + break; + case CTL_SYSCTL_NAME2OID: + fprintf(fp, "name2oid"); + break; + case CTL_SYSCTL_OIDFMT: + fprintf(fp, "oidfmt"); + print_sysctl_oid(fp, oid + 2, len - 2); + break; + case CTL_SYSCTL_OIDDESCR: + fprintf(fp, "oiddescr"); + print_sysctl_oid(fp, oid + 2, len - 2); + break; + case CTL_SYSCTL_OIDLABEL: + fprintf(fp, "oidlabel"); + print_sysctl_oid(fp, oid + 2, len - 2); + break; + default: + print_sysctl_oid(fp, oid + 1, len - 1); + } + } else { + qoid[0] = CTL_SYSCTL; + qoid[1] = CTL_SYSCTL_NAME; + memcpy(qoid + 2, oid, len * sizeof(int)); + i = sizeof(name); + if (sysctl(qoid, len + 2, name, &i, 0, 0) == -1) + print_sysctl_oid(fp, qoid + 2, len); + else + fprintf(fp, "%s", name); + } + fprintf(fp, "\""); + } + break; + } case PipeFds: /* * The pipe() system call in the kernel returns its From owner-svn-src-head@freebsd.org Wed Sep 18 19:33:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C220E125728; Wed, 18 Sep 2019 19:33:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YVWS4kggz4gGw; Wed, 18 Sep 2019 19:33:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85DAE1AB7; Wed, 18 Sep 2019 19:33:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8IJX8RR035302; Wed, 18 Sep 2019 19:33:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8IJX8Bo035301; Wed, 18 Sep 2019 19:33:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909181933.x8IJX8Bo035301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 18 Sep 2019 19:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352493 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 352493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 19:33:08 -0000 Author: mav Date: Wed Sep 18 19:33:08 2019 New Revision: 352493 URL: https://svnweb.freebsd.org/changeset/base/352493 Log: Fix typo, setting hidden flag instead of reparse. Submitted by: Ryan Moeller MFC after: 3 days Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 18 19:28:17 2019 (r352492) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 18 19:33:08 2019 (r352493) @@ -5202,7 +5202,7 @@ zfs_freebsd_setattr(ap) FLAG_CHANGE(UF_HIDDEN, ZFS_HIDDEN, XAT_HIDDEN, xvap.xva_xoptattrs.xoa_hidden); FLAG_CHANGE(UF_REPARSE, ZFS_REPARSE, XAT_REPARSE, - xvap.xva_xoptattrs.xoa_hidden); + xvap.xva_xoptattrs.xoa_reparse); FLAG_CHANGE(UF_OFFLINE, ZFS_OFFLINE, XAT_OFFLINE, xvap.xva_xoptattrs.xoa_offline); FLAG_CHANGE(UF_SPARSE, ZFS_SPARSE, XAT_SPARSE, From owner-svn-src-head@freebsd.org Wed Sep 18 21:00:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AE0C126B16; Wed, 18 Sep 2019 21:00:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YXSK0Jw4z3Gb8; Wed, 18 Sep 2019 21:00:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E259E2904; Wed, 18 Sep 2019 21:00:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8IL0W7U083146; Wed, 18 Sep 2019 21:00:32 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8IL0WwD083145; Wed, 18 Sep 2019 21:00:32 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201909182100.x8IL0WwD083145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 18 Sep 2019 21:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352495 - head/tests/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/tests/sys/vm X-SVN-Commit-Revision: 352495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 21:00:33 -0000 Author: jilles Date: Wed Sep 18 21:00:32 2019 New Revision: 352495 URL: https://svnweb.freebsd.org/changeset/base/352495 Log: Add some tests for page fault signals and codes It is useful to have some tests for page fault signals. More tests would be useful but creating the conditions (such as various kinds of running out of memory and I/O errors) is more complicated. The tests page_fault_signal__bus_objerr_1 and page_fault_signal__bus_objerr_2 depend on https://reviews.freebsd.org/D21566 before they can pass. PR: 211924 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D21624 Added: head/tests/sys/vm/page_fault_signal.c (contents, props changed) Modified: head/tests/sys/vm/Makefile Modified: head/tests/sys/vm/Makefile ============================================================================== --- head/tests/sys/vm/Makefile Wed Sep 18 19:53:58 2019 (r352494) +++ head/tests/sys/vm/Makefile Wed Sep 18 21:00:32 2019 (r352495) @@ -5,6 +5,7 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/vm ATF_TESTS_C+= mlock_test \ - mmap_test + mmap_test \ + page_fault_signal .include Added: head/tests/sys/vm/page_fault_signal.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/vm/page_fault_signal.c Wed Sep 18 21:00:32 2019 (r352495) @@ -0,0 +1,184 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Jilles Tjoelker + * + * 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$ + */ + +#include + +#include +#include +#include +#include +#include + +static sigjmp_buf sig_env; +static volatile int last_sig, last_code; + +static void +sighandler(int sig, siginfo_t *info, void *context __unused) +{ + + last_sig = sig; + last_code = info->si_code; + siglongjmp(sig_env, 1); +} + +static void +setup_signals(void) +{ + struct sigaction sa; + int r; + + sa.sa_sigaction = sighandler; + sa.sa_flags = SA_RESTART | SA_RESETHAND | SA_SIGINFO; + r = sigfillset(&sa.sa_mask); + ATF_REQUIRE(r != -1); + r = sigaction(SIGILL, &sa, NULL); + ATF_REQUIRE(r != -1); + r = sigaction(SIGBUS, &sa, NULL); + ATF_REQUIRE(r != -1); + r = sigaction(SIGSEGV, &sa, NULL); + ATF_REQUIRE(r != -1); +} + +ATF_TC_WITHOUT_HEAD(page_fault_signal__segv_maperr_1); +ATF_TC_BODY(page_fault_signal__segv_maperr_1, tc) +{ + int *p; + int r; + int sz; + + sz = getpagesize(); + p = mmap(NULL, sz, PROT_READ, MAP_ANON, -1, 0); + ATF_REQUIRE(p != MAP_FAILED); + r = munmap(p, sz); + ATF_REQUIRE(r != -1); + if (sigsetjmp(sig_env, 1) == 0) { + setup_signals(); + *(volatile int *)p = 1; + } + ATF_CHECK_EQ(SIGSEGV, last_sig); + ATF_CHECK_EQ(SEGV_MAPERR, last_code); +} + +ATF_TC_WITHOUT_HEAD(page_fault_signal__segv_accerr_1); +ATF_TC_BODY(page_fault_signal__segv_accerr_1, tc) +{ + int *p; + int sz; + + sz = getpagesize(); + p = mmap(NULL, sz, PROT_READ, MAP_ANON, -1, 0); + ATF_REQUIRE(p != MAP_FAILED); + if (sigsetjmp(sig_env, 1) == 0) { + setup_signals(); + *(volatile int *)p = 1; + } + (void)munmap(p, sz); + ATF_CHECK_EQ(SIGSEGV, last_sig); + ATF_CHECK_EQ(SEGV_ACCERR, last_code); +} + +ATF_TC_WITHOUT_HEAD(page_fault_signal__segv_accerr_2); +ATF_TC_BODY(page_fault_signal__segv_accerr_2, tc) +{ + int *p; + volatile int dummy; + int sz; + + sz = getpagesize(); + p = mmap(NULL, sz, PROT_NONE, MAP_ANON, -1, 0); + ATF_REQUIRE(p != MAP_FAILED); + if (sigsetjmp(sig_env, 1) == 0) { + setup_signals(); + dummy = *p; + } + (void)munmap(p, sz); + ATF_CHECK_EQ(SIGSEGV, last_sig); + ATF_CHECK_EQ(SEGV_ACCERR, last_code); +} + +ATF_TC_WITHOUT_HEAD(page_fault_signal__bus_objerr_1); +ATF_TC_BODY(page_fault_signal__bus_objerr_1, tc) +{ + int *p; + int fd; + int sz; + + atf_tc_expect_fail("bug 211924"); + sz = getpagesize(); + fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600); + ATF_REQUIRE(fd != -1); + p = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(p != MAP_FAILED); + if (sigsetjmp(sig_env, 1) == 0) { + setup_signals(); + *(volatile int *)p = 1; + } + (void)munmap(p, sz); + (void)close(fd); + ATF_CHECK_EQ(SIGBUS, last_sig); + ATF_CHECK_EQ(BUS_OBJERR, last_code); +} + +ATF_TC_WITHOUT_HEAD(page_fault_signal__bus_objerr_2); +ATF_TC_BODY(page_fault_signal__bus_objerr_2, tc) +{ + int *p; + int fd; + int r; + int sz; + + atf_tc_expect_fail("bug 211924"); + sz = getpagesize(); + fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600); + ATF_REQUIRE(fd != -1); + r = ftruncate(fd, sz); + ATF_REQUIRE(r != -1); + p = mmap(NULL, sz * 2, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(p != MAP_FAILED); + if (sigsetjmp(sig_env, 1) == 0) { + setup_signals(); + ((volatile int *)p)[sz / sizeof(int)] = 1; + } + (void)munmap(p, sz * 2); + (void)close(fd); + ATF_CHECK_EQ(SIGBUS, last_sig); + ATF_CHECK_EQ(BUS_OBJERR, last_code); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, page_fault_signal__segv_maperr_1); + ATF_TP_ADD_TC(tp, page_fault_signal__segv_accerr_1); + ATF_TP_ADD_TC(tp, page_fault_signal__segv_accerr_2); + ATF_TP_ADD_TC(tp, page_fault_signal__bus_objerr_1); + ATF_TP_ADD_TC(tp, page_fault_signal__bus_objerr_2); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Thu Sep 19 07:28:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C76AF9141; Thu, 19 Sep 2019 07:28:25 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YpNn2rfHz4MPJ; Thu, 19 Sep 2019 07:28:25 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44EBA9EA0; Thu, 19 Sep 2019 07:28:25 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8J7SPwh056285; Thu, 19 Sep 2019 07:28:25 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8J7SPDr056284; Thu, 19 Sep 2019 07:28:25 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201909190728.x8J7SPDr056284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 19 Sep 2019 07:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352504 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 352504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 07:28:25 -0000 Author: allanjude Date: Thu Sep 19 07:28:24 2019 New Revision: 352504 URL: https://svnweb.freebsd.org/changeset/base/352504 Log: sys/vm/vm_glue.c: Incorrect function name in panic string Use __func__ to avoid this issue in the future. Submitted by: Wuyang Chung Reviewed by: markj, emaste Obtained from: https://github.com/freebsd/freebsd/pull/410 Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Wed Sep 18 23:33:38 2019 (r352503) +++ head/sys/vm/vm_glue.c Thu Sep 19 07:28:24 2019 (r352504) @@ -320,7 +320,7 @@ vm_thread_stack_create(struct domainset *ds, vm_object ks = kva_alloc((pages + KSTACK_GUARD_PAGES) * PAGE_SIZE); #endif if (ks == 0) { - printf("vm_thread_new: kstack allocation failed\n"); + printf("%s: kstack allocation failed\n", __func__); vm_object_deallocate(ksobj); return (0); } @@ -362,7 +362,7 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t for (i = 0; i < pages; i++) { m = vm_page_lookup(ksobj, i); if (m == NULL) - panic("vm_thread_dispose: kstack already missing?"); + panic("%s: kstack already missing?", __func__); vm_page_unwire_noq(m); vm_page_free(m); } From owner-svn-src-head@freebsd.org Thu Sep 19 09:22:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88C97FC299; Thu, 19 Sep 2019 09:22:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Yrwk34Ktz4SdY; Thu, 19 Sep 2019 09:22:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C997B44C; Thu, 19 Sep 2019 09:22:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8J9MksG026968; Thu, 19 Sep 2019 09:22:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8J9Mk3Q026967; Thu, 19 Sep 2019 09:22:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909190922.x8J9Mk3Q026967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 19 Sep 2019 09:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352505 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 352505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 09:22:46 -0000 Author: avg Date: Thu Sep 19 09:22:45 2019 New Revision: 352505 URL: https://svnweb.freebsd.org/changeset/base/352505 Log: vt: fix problems with trying to switch to a closed VT If there is an attempt to switch from a process-owned VT to a closed VT, then vt(4) first requests the process to release its VT and only then realizes that the target VT is closed and, so, the switch is not possible. So, the driver does not actually do any switch, but at the same time the owning process is not notified about that and it does not re-acquire the VT. This change adds an early check for the target VT state, so that the switch can be refused before the process coordination dance. On top of that, the code now checks for a failure of vt_window_switch() and calls vt_window_postswitch() for the current VT if it is in the process mode. Test Plan: - configure VT1 - VT8 (ttyv0 - ttyv7) to be text consoles (run getty) - configure VT9 (ttyv8) to rn X server - make sure that the X server configuration allows VT switching - leave VT10 - VT12 unconfigured - while in the X server press Ctrl+Alt+F10 - without the patch, observe strange screen content and problems with keyboard input - with the patch, observe that nothing happens The problem has been observed and the fix has been tested with an nVidia graphics card and the proprietary nvidia driver. Not sure if that matters. Reviewed by: ray MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21704 Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Sep 19 07:28:24 2019 (r352504) +++ head/sys/dev/vt/vt_core.c Thu Sep 19 09:22:45 2019 (r352505) @@ -335,7 +335,7 @@ static void vt_switch_timer(void *arg) { - vt_late_window_switch((struct vt_window *)arg); + (void)vt_late_window_switch((struct vt_window *)arg); } static int @@ -457,13 +457,22 @@ vt_window_postswitch(struct vt_window *vw) static int vt_late_window_switch(struct vt_window *vw) { + struct vt_window *curvw; int ret; callout_stop(&vw->vw_proc_dead_timer); ret = vt_window_switch(vw); - if (ret) + if (ret != 0) { + /* + * If the switch hasn't happened, then return the VT + * to the current owner, if any. + */ + curvw = vw->vw_device->vd_curwindow; + if (curvw->vw_smode.mode == VT_PROCESS) + (void)vt_window_postswitch(curvw); return (ret); + } /* Notify owner process about terminal availability. */ if (vw->vw_smode.mode == VT_PROCESS) { @@ -509,6 +518,19 @@ vt_proc_window_switch(struct vt_window *vw) return (0); /* success */ } + /* + * Early check for an attempt to switch to a non-functional VT. + * The same check is done in vt_window_switch(), but it's better + * to fail as early as possible to avoid needless pre-switch + * actions. + */ + VT_LOCK(vd); + if ((vw->vw_flags & (VWF_OPENED|VWF_CONSOLE)) == 0) { + VT_UNLOCK(vd); + return (EINVAL); + } + VT_UNLOCK(vd); + /* Ask current process permission to switch away. */ if (curvw->vw_smode.mode == VT_PROCESS) { DPRINTF(30, "%s: VT_PROCESS ", __func__); @@ -1792,7 +1814,7 @@ finish_vt_rel(struct vt_window *vw, int release, int * vw->vw_flags &= ~VWF_SWWAIT_REL; if (release) { callout_drain(&vw->vw_proc_dead_timer); - vt_late_window_switch(vw->vw_switch_to); + (void)vt_late_window_switch(vw->vw_switch_to); } return (0); } From owner-svn-src-head@freebsd.org Thu Sep 19 09:35:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA97CFC71B; Thu, 19 Sep 2019 09:35:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (springbank.echomania.com [IPv6:2a01:7c8:aab2:81::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "springbank.echomania.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YsCq40WTz4TD6; Thu, 19 Sep 2019 09:35:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [IPv6:2001:470:7a58:0:7545:d8b0:a999:1ee] (unknown [IPv6:2001:470:7a58:0:7545:d8b0:a999:1ee]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id 136F8580190; Thu, 19 Sep 2019 11:30:13 +0200 (CEST) Subject: Re: svn commit: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909132020.x8DKK62j025066@repo.freebsd.org> From: Dimitry Andric Message-ID: <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org> Date: Thu, 19 Sep 2019 11:30:12 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <201909132020.x8DKK62j025066@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46YsCq40WTz4TD6 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:20857, ipnet:2a01:7c8::/32, country:NL] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 09:35:51 -0000 On 2019-09-13 22:20, Cy Schubert wrote: > Author: cy > Date: Fri Sep 13 20:20:05 2019 > New Revision: 352304 > URL: https://svnweb.freebsd.org/changeset/base/352304 > > Log: > No longer mlock() ntpd pages by default in memory thus allowing its > pages to page as necessary. > > To restore historic BSD behaviour add the following to ntp.conf: > rlimit memlock 32 Apparently this does not completely work, as I still see: ntpd[824]: ntpd 4.2.8p12-a (1): Starting ntpd[825]: Cannot set RLIMIT_MEMLOCK: Operation not permitted even while my ntp.conf is almost entirely vanilla (it only has a different "server" line). Even explicitly adding: rlimit memlock -1 does not work, it results in the same error. -Dimitry From owner-svn-src-head@freebsd.org Thu Sep 19 09:43:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0D22FCAEE; Thu, 19 Sep 2019 09:43:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YsP84BQtz4TvM; Thu, 19 Sep 2019 09:43:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73170B7FE; Thu, 19 Sep 2019 09:43:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8J9huFE039369; Thu, 19 Sep 2019 09:43:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8J9huLb039368; Thu, 19 Sep 2019 09:43:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909190943.x8J9huLb039368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 19 Sep 2019 09:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352506 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 352506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 09:43:56 -0000 Author: avg Date: Thu Sep 19 09:43:56 2019 New Revision: 352506 URL: https://svnweb.freebsd.org/changeset/base/352506 Log: fix dsl_scan_ds_clone_swapped logic It was incorrect with respect to swapping dataset IDs both in the on-disk ZAP object and the in-memory queue. In both cases, if only ds1 was already present, then it would be first replaced with ds2 and then ds2 would be replaced back with ds1. Also, both cases did not properly handle a situation where both ds1 and ds2 are already queued. A duplicate insertion would be attempted and its failure would result in a panic. This change has also been submitted to ZoL as zfsonlinux/zfs@dd262c9 PR: 239566 Reported by: pascal.guitierrez@gmail.com MFC after: 4 days Sponsored by: CyberSecure Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Thu Sep 19 09:22:45 2019 (r352505) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Thu Sep 19 09:43:56 2019 (r352506) @@ -2014,16 +2014,17 @@ ds_clone_swapped_bookmark(dsl_dataset_t *ds1, dsl_data } /* - * Called when a parent dataset and its clone are swapped. If we were + * Called when an origin dataset and its clone are swapped. If we were * currently traversing the dataset, we need to switch to traversing the - * newly promoted parent. + * newly promoted clone. */ void dsl_scan_ds_clone_swapped(dsl_dataset_t *ds1, dsl_dataset_t *ds2, dmu_tx_t *tx) { dsl_pool_t *dp = ds1->ds_dir->dd_pool; dsl_scan_t *scn = dp->dp_scan; - uint64_t mintxg; + uint64_t mintxg1, mintxg2; + boolean_t ds1_queued, ds2_queued; if (!dsl_scan_is_running(scn)) return; @@ -2031,44 +2032,81 @@ dsl_scan_ds_clone_swapped(dsl_dataset_t *ds1, dsl_data ds_clone_swapped_bookmark(ds1, ds2, &scn->scn_phys.scn_bookmark); ds_clone_swapped_bookmark(ds1, ds2, &scn->scn_phys_cached.scn_bookmark); - if (scan_ds_queue_contains(scn, ds1->ds_object, &mintxg)) { - scan_ds_queue_remove(scn, ds1->ds_object); - scan_ds_queue_insert(scn, ds2->ds_object, mintxg); + /* + * Handle the in-memory scan queue. + */ + ds1_queued = scan_ds_queue_contains(scn, ds1->ds_object, &mintxg1); + ds2_queued = scan_ds_queue_contains(scn, ds2->ds_object, &mintxg2); + + /* Sanity checking. */ + if (ds1_queued) { + ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); + ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); } - if (scan_ds_queue_contains(scn, ds2->ds_object, &mintxg)) { + if (ds2_queued) { + ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); + ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); + } + + if (ds1_queued && ds2_queued) { + /* + * If both are queued, we don't need to do anything. + * The swapping code below would not handle this case correctly, + * since we can't insert ds2 if it is already there. That's + * because scan_ds_queue_insert() prohibits a duplicate insert + * and panics. + */ + } else if (ds1_queued) { + scan_ds_queue_remove(scn, ds1->ds_object); + scan_ds_queue_insert(scn, ds2->ds_object, mintxg1); + } else if (ds2_queued) { scan_ds_queue_remove(scn, ds2->ds_object); - scan_ds_queue_insert(scn, ds1->ds_object, mintxg); + scan_ds_queue_insert(scn, ds1->ds_object, mintxg2); } - if (zap_lookup_int_key(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, - ds1->ds_object, &mintxg) == 0) { - int err; - ASSERT3U(mintxg, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); - ASSERT3U(mintxg, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); - VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset, + /* + * Handle the on-disk scan queue. + * The on-disk state is an out-of-date version of the in-memory state, + * so the in-memory and on-disk values for ds1_queued and ds2_queued may + * be different. Therefore we need to apply the swap logic to the + * on-disk state independently of the in-memory state. + */ + ds1_queued = zap_lookup_int_key(dp->dp_meta_objset, + scn->scn_phys.scn_queue_obj, ds1->ds_object, &mintxg1) == 0; + ds2_queued = zap_lookup_int_key(dp->dp_meta_objset, + scn->scn_phys.scn_queue_obj, ds2->ds_object, &mintxg2) == 0; + + /* Sanity checking. */ + if (ds1_queued) { + ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); + ASSERT3U(mintxg1, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); + } + if (ds2_queued) { + ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); + ASSERT3U(mintxg2, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); + } + + if (ds1_queued && ds2_queued) { + /* + * If both are queued, we don't need to do anything. + * Alternatively, we could check for EEXIST from + * zap_add_int_key() and back out to the original state, but + * that would be more work than checking for this case upfront. + */ + } else if (ds1_queued) { + VERIFY3S(0, ==, zap_remove_int(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, ds1->ds_object, tx)); - err = zap_add_int_key(dp->dp_meta_objset, - scn->scn_phys.scn_queue_obj, ds2->ds_object, mintxg, tx); - VERIFY(err == 0 || err == EEXIST); - if (err == EEXIST) { - /* Both were there to begin with */ - VERIFY(0 == zap_add_int_key(dp->dp_meta_objset, - scn->scn_phys.scn_queue_obj, - ds1->ds_object, mintxg, tx)); - } + VERIFY3S(0, ==, zap_add_int_key(dp->dp_meta_objset, + scn->scn_phys.scn_queue_obj, ds2->ds_object, mintxg1, tx)); zfs_dbgmsg("clone_swap ds %llu; in queue; " "replacing with %llu", (u_longlong_t)ds1->ds_object, (u_longlong_t)ds2->ds_object); - } - if (zap_lookup_int_key(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, - ds2->ds_object, &mintxg) == 0) { - ASSERT3U(mintxg, ==, dsl_dataset_phys(ds1)->ds_prev_snap_txg); - ASSERT3U(mintxg, ==, dsl_dataset_phys(ds2)->ds_prev_snap_txg); - VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset, + } else if (ds2_queued) { + VERIFY3S(0, ==, zap_remove_int(dp->dp_meta_objset, scn->scn_phys.scn_queue_obj, ds2->ds_object, tx)); - VERIFY(0 == zap_add_int_key(dp->dp_meta_objset, - scn->scn_phys.scn_queue_obj, ds1->ds_object, mintxg, tx)); + VERIFY3S(0, ==, zap_add_int_key(dp->dp_meta_objset, + scn->scn_phys.scn_queue_obj, ds1->ds_object, mintxg2, tx)); zfs_dbgmsg("clone_swap ds %llu; in queue; " "replacing with %llu", (u_longlong_t)ds2->ds_object, From owner-svn-src-head@freebsd.org Thu Sep 19 09:48:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 164E6FCD1C; Thu, 19 Sep 2019 09:48:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YsTs6pf1z4V8G; Thu, 19 Sep 2019 09:48:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD228B806; Thu, 19 Sep 2019 09:48:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8J9m1JT039678; Thu, 19 Sep 2019 09:48:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8J9m1ue039677; Thu, 19 Sep 2019 09:48:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909190948.x8J9m1ue039677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 19 Sep 2019 09:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352507 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 352507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 09:48:02 -0000 Author: avg Date: Thu Sep 19 09:48:01 2019 New Revision: 352507 URL: https://svnweb.freebsd.org/changeset/base/352507 Log: update zfs send usage help with r352447 MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 19 09:43:56 2019 (r352506) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 19 09:48:01 2019 (r352507) @@ -290,7 +290,7 @@ get_usage(zfs_help_t idx) case HELP_SEND: return (gettext("\tsend [-DnPpRvLec] [-[iI] snapshot] " "\n" - "\tsend [-Le] [-i snapshot|bookmark] " + "\tsend [-LPcenv] [-i snapshot|bookmark] " "\n" "\tsend [-nvPe] -t \n")); case HELP_SET: From owner-svn-src-head@freebsd.org Thu Sep 19 10:22:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE86CFD8A8; Thu, 19 Sep 2019 10:22:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YtFd5YmKz4X8x; Thu, 19 Sep 2019 10:22:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2222C0CB; Thu, 19 Sep 2019 10:22:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JAMTEF063443; Thu, 19 Sep 2019 10:22:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JAMTIp063442; Thu, 19 Sep 2019 10:22:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909191022.x8JAMTIp063442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 19 Sep 2019 10:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352511 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 352511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 10:22:29 -0000 Author: tuexen Date: Thu Sep 19 10:22:29 2019 New Revision: 352511 URL: https://svnweb.freebsd.org/changeset/base/352511 Log: When processing an incoming IPv6 packet over the loopback interface which contains Hop-by-Hop options, the mbuf chain is potentially changed in ip6_hopopts_input(), called by ip6_input_hbh(). This can happen, because of the the use of IP6_EXTHDR_CHECK, which might call m_pullup(). So provide the updated pointer back to the called of ip6_input_hbh() to avoid using a freed mbuf chain in`ip6_input()`. Reviewed by: markj@ MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21664 Modified: head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Thu Sep 19 10:06:18 2019 (r352510) +++ head/sys/netinet6/ip6_input.c Thu Sep 19 10:22:29 2019 (r352511) @@ -403,20 +403,22 @@ VNET_SYSUNINIT(inet6, SI_SUB_PROTO_DOMAIN, SI_ORDER_TH #endif static int -ip6_input_hbh(struct mbuf *m, uint32_t *plen, uint32_t *rtalert, int *off, +ip6_input_hbh(struct mbuf **mp, uint32_t *plen, uint32_t *rtalert, int *off, int *nxt, int *ours) { + struct mbuf *m; struct ip6_hdr *ip6; struct ip6_hbh *hbh; - if (ip6_hopopts_input(plen, rtalert, &m, off)) { + if (ip6_hopopts_input(plen, rtalert, mp, off)) { #if 0 /*touches NULL pointer*/ - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); + in6_ifstat_inc((*mp)->m_pkthdr.rcvif, ifs6_in_discard); #endif goto out; /* m have already been freed */ } /* adjust pointer */ + m = *mp; ip6 = mtod(m, struct ip6_hdr *); /* @@ -854,7 +856,7 @@ passin: */ plen = (u_int32_t)ntohs(ip6->ip6_plen); if (ip6->ip6_nxt == IPPROTO_HOPOPTS) { - if (ip6_input_hbh(m, &plen, &rtalert, &off, &nxt, &ours) != 0) + if (ip6_input_hbh(&m, &plen, &rtalert, &off, &nxt, &ours) != 0) return; } else nxt = ip6->ip6_nxt; From owner-svn-src-head@freebsd.org Thu Sep 19 10:27:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E53EFDA77; Thu, 19 Sep 2019 10:27:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YtMm2pk0z4XSZ; Thu, 19 Sep 2019 10:27:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A28FC0E4; Thu, 19 Sep 2019 10:27:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JARl7G063854; Thu, 19 Sep 2019 10:27:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JARljp063853; Thu, 19 Sep 2019 10:27:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909191027.x8JARljp063853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 19 Sep 2019 10:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352512 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 352512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 10:27:48 -0000 Author: tuexen Date: Thu Sep 19 10:27:47 2019 New Revision: 352512 URL: https://svnweb.freebsd.org/changeset/base/352512 Log: When the RACK stack computes the space for user data in a TCP segment, it wasn't taking the IP level options into account. This patch fixes this. In addition, it also corrects a KASSERT and adds protection code to assure that the IP header chain and the TCP head fit in the first fragment as required by RFC 7112. Reviewed by: rrs@ MFC after: 3 days Sponsored by: Nertflix, Inc. Differential Revision: https://reviews.freebsd.org/D21666 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Sep 19 10:22:29 2019 (r352511) +++ head/sys/netinet/tcp_stacks/rack.c Thu Sep 19 10:27:47 2019 (r352512) @@ -7840,7 +7840,16 @@ send: hdrlen += sizeof(struct udphdr); } #endif - ipoptlen = 0; +#ifdef INET6 + if (isipv6) + ipoptlen = ip6_optlen(tp->t_inpcb); + else +#endif + if (tp->t_inpcb->inp_options) + ipoptlen = tp->t_inpcb->inp_options->m_len - + offsetof(struct ipoption, ipopt_list); + else + ipoptlen = 0; #if defined(IPSEC) || defined(IPSEC_SUPPORT) ipoptlen += ipsec_optlen; #endif @@ -7913,6 +7922,18 @@ send: sendalot = 1; } else { + if (optlen + ipoptlen > tp->t_maxseg) { + /* + * Since we don't have enough space to put + * the IP header chain and the TCP header in + * one packet as required by RFC 7112, don't + * send it. + */ + SOCKBUF_UNLOCK(&so->so_snd); + error = EMSGSIZE; + sack_rxmit = 0; + goto out; + } len = tp->t_maxseg - optlen - ipoptlen; sendalot = 1; } @@ -8414,15 +8435,9 @@ send: m->m_pkthdr.csum_flags |= CSUM_TSO; m->m_pkthdr.tso_segsz = tp->t_maxseg - optlen; } -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected: %d + %u + %u - %u != %u", - __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL))); -#else - KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected: %d + %u + %u != %u", - __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); -#endif + KASSERT(len + hdrlen == m_length(m, NULL), + ("%s: mbuf chain different than expected: %d + %u != %u", + __func__, len, hdrlen, m_length(m, NULL))); #ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */ From owner-svn-src-head@freebsd.org Thu Sep 19 11:34:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF2A5FEE49; Thu, 19 Sep 2019 11:34:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Yvrq64b7z4b85; Thu, 19 Sep 2019 11:34:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B115ACD73; Thu, 19 Sep 2019 11:34:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JBYZ6L004855; Thu, 19 Sep 2019 11:34:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JBYZMv004854; Thu, 19 Sep 2019 11:34:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909191134.x8JBYZMv004854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 Sep 2019 11:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352513 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 352513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 11:34:36 -0000 Author: emaste Date: Thu Sep 19 11:34:35 2019 New Revision: 352513 URL: https://svnweb.freebsd.org/changeset/base/352513 Log: freebsd-update.8: appease igor igor follows American style guides in the belief that abbreviations i.e. and e.g. are always followed by a comma. Make that change now so that future updates to freebsd-update.8 do not complain about this. Submitted by: grembo Event: EuroBSDCon Norway FreeBSD DevSummit Modified: head/usr.sbin/freebsd-update/freebsd-update.8 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Thu Sep 19 10:27:47 2019 (r352512) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Thu Sep 19 11:34:35 2019 (r352513) @@ -95,7 +95,7 @@ Trust an RSA key with SHA256 of .Ar KEY . (default: read value from configuration file.) .It Fl r Ar newrelease -Specify the new release (e.g. 11.2-RELEASE) to which +Specify the new release (e.g., 11.2-RELEASE) to which .Nm should upgrade (upgrade command only). .It Fl s Ar server From owner-svn-src-head@freebsd.org Thu Sep 19 11:46:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D9B5FF2D8; Thu, 19 Sep 2019 11:46:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Yw6r0T10z4bp1; Thu, 19 Sep 2019 11:46:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8691CF5E; Thu, 19 Sep 2019 11:46:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JBkhB1010565; Thu, 19 Sep 2019 11:46:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JBkhgL010564; Thu, 19 Sep 2019 11:46:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909191146.x8JBkhgL010564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 Sep 2019 11:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352514 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 352514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 11:46:44 -0000 Author: emaste Date: Thu Sep 19 11:46:43 2019 New Revision: 352514 URL: https://svnweb.freebsd.org/changeset/base/352514 Log: freebsd-update: make usage output consistent Drop trailing . which appeared only on description of IDS. Submitted by: grembo Event: EuroBSDCon Norway FreeBSD DevSummit Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 19 11:34:35 2019 (r352513) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 19 11:46:43 2019 (r352514) @@ -64,7 +64,7 @@ Commands: upgrade -- Fetch upgrades to FreeBSD version specified via -r option install -- Install downloaded updates or upgrades rollback -- Uninstall most recently installed updates - IDS -- Compare the system against an index of "known good" files. + IDS -- Compare the system against an index of "known good" files EOF exit 0 } From owner-svn-src-head@freebsd.org Thu Sep 19 12:46:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D160A122428; Thu, 19 Sep 2019 12:46:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YxS53M34z3CC7; Thu, 19 Sep 2019 12:46:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id AvpYil7hDUIS2Avpaiznxv; Thu, 19 Sep 2019 06:46:43 -0600 X-Authority-Analysis: v=2.3 cv=N41X6F1B c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=J70Eh1EUuV4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=M9TVV_1QxNmupA89uy4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 88B4DFA; Thu, 19 Sep 2019 05:46:40 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x8JCke0o003919; Thu, 19 Sep 2019 05:46:40 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x8JCke4Y003916; Thu, 19 Sep 2019 05:46:40 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201909191246.x8JCke4Y003916@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Dimitry Andric cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd In-reply-to: <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org> References: <201909132020.x8DKK62j025066@repo.freebsd.org> <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org> Comments: In-reply-to Dimitry Andric message dated "Thu, 19 Sep 2019 11:30:12 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 19 Sep 2019 05:46:40 -0700 X-CMAE-Envelope: MS4wfLhdgsmdiNKbT0mddolIEthE+HI9pWYlc9No05zpzFnvtU7dSpI+o9oxiFA/xd0LXWmjIB0vsAcfThmi/IFeRWNeLyGvzwi2YGrUcDBXdQhqDmDWUzvO 41gkbrpWRkYk+ipO4UKOKgCGOXHVCuaGq1VpNOy+9LUTgi06ZjdacK29LGsd99miaJn6XsX7dqkJo3J1FtFESDi+RVwQOBEzyH0+He4+1S7qc/3OWVso5Jd8 BWBJBGpWMckFyl9inBQoslJUGRFMIkaULCKL5G4FelLBArHFgxyr/N/zUfITuMUMLyqivURgw7VU26u679+7AA== X-Rspamd-Queue-Id: 46YxS53M34z3CC7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.13) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.03 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.43)[ip: (-6.59), ipnet: 64.59.128.0/20(-3.08), asn: 6327(-2.39), country: CA(-0.09)]; RCVD_IN_DNSWL_NONE(0.00)[13.134.59.64.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 12:46:46 -0000 In message <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org>, Dimitry Andric w rites: > On 2019-09-13 22:20, Cy Schubert wrote: > > Author: cy > > Date: Fri Sep 13 20:20:05 2019 > > New Revision: 352304 > > URL: https://svnweb.freebsd.org/changeset/base/352304 > > > > Log: > > No longer mlock() ntpd pages by default in memory thus allowing its > > pages to page as necessary. > > > > To restore historic BSD behaviour add the following to ntp.conf: > > rlimit memlock 32 > > Apparently this does not completely work, as I still see: > > ntpd[824]: ntpd 4.2.8p12-a (1): Starting > ntpd[825]: Cannot set RLIMIT_MEMLOCK: Operation not permitted > > even while my ntp.conf is almost entirely vanilla (it only has a > different "server" line). > > Even explicitly adding: > > rlimit memlock -1 > > does not work, it results in the same error. > > -Dimitry Can you try this please? diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c index 2b14431dc7b..bcfca27a535 100644 --- a/contrib/ntp/ntpd/ntpd.c +++ b/contrib/ntp/ntpd/ntpd.c @@ -999,7 +999,7 @@ ntpdmain( # if defined(HAVE_MLOCKALL) # ifdef HAVE_SETRLIMIT ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); -# ifdef RLIMIT_MEMLOCK +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 /* * The default RLIMIT_MEMLOCK is very low on Linux systems. * Unless we increase this limit malloc calls are likely to -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Sep 19 13:23:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B632123731; Thu, 19 Sep 2019 13:23:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YyGQ0qtpz3FG1; Thu, 19 Sep 2019 13:23:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0103CE159; Thu, 19 Sep 2019 13:23:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JDNPVb070218; Thu, 19 Sep 2019 13:23:25 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JDNP43070217; Thu, 19 Sep 2019 13:23:25 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909191323.x8JDNP43070217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 19 Sep 2019 13:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352515 - head/lib/libarchive/tests X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/lib/libarchive/tests X-SVN-Commit-Revision: 352515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 13:23:26 -0000 Author: lwhsu Date: Thu Sep 19 13:23:25 2019 New Revision: 352515 URL: https://svnweb.freebsd.org/changeset/base/352515 Log: Temporarily add test_write_filter_zstd BROKEN_TESTS as it always fails in CI There is no trivial way to mark single libarchive test skip currently so just add it to BROKEN_TESTS for now. PR: 240683 Sponsored by: The FreeBSD Foundation Modified: head/lib/libarchive/tests/Makefile Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Thu Sep 19 11:46:43 2019 (r352514) +++ head/lib/libarchive/tests/Makefile Thu Sep 19 13:23:25 2019 (r352515) @@ -305,6 +305,9 @@ BROKEN_TESTS+= test_read_disk_directory_traversals # (Times out?) [and] crashes BROKEN_TESTS+= test_fuzz_rar +# https://bugs.freebsd.org/240683 +BROKEN_TESTS+= test_write_filter_zstd + # Build the test program. SRCS.libarchive_test= \ ${TESTS_SRCS} \ From owner-svn-src-head@freebsd.org Thu Sep 19 13:25:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57228123844; Thu, 19 Sep 2019 13:25:20 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YyJc1ZMwz3FRb; Thu, 19 Sep 2019 13:25:20 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3662E160; Thu, 19 Sep 2019 13:25:19 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JDPJub070367; Thu, 19 Sep 2019 13:25:19 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JDPJaO070366; Thu, 19 Sep 2019 13:25:19 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909191325.x8JDPJaO070366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 19 Sep 2019 13:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352516 - head/lib/libarchive/tests X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/lib/libarchive/tests X-SVN-Commit-Revision: 352516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 13:25:20 -0000 Author: lwhsu Date: Thu Sep 19 13:25:19 2019 New Revision: 352516 URL: https://svnweb.freebsd.org/changeset/base/352516 Log: Whitespace cleanup, no functional change Sponsored by: The FreeBSD Foundation Modified: head/lib/libarchive/tests/Makefile Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Thu Sep 19 13:23:25 2019 (r352515) +++ head/lib/libarchive/tests/Makefile Thu Sep 19 13:25:19 2019 (r352516) @@ -520,12 +520,12 @@ ${PACKAGE}FILES+= test_read_format_rar5_blake2.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_compressed.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_different_window_size.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_distance_overflow.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_extra_field_version.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_extra_field_version.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_fileattr.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_hardlink.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_invalid_dict_reference.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_leftshift1.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_leftshift2.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_hardlink.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_invalid_dict_reference.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_leftshift1.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_leftshift2.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part01.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part02.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part03.rar.uu @@ -541,13 +541,13 @@ ${PACKAGE}FILES+= test_read_format_rar5_multiarchive_s ${PACKAGE}FILES+= test_read_format_rar5_multiple_files.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_multiple_files_solid.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_nonempty_dir_stream.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_owner.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_readtables_overflow.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_owner.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_readtables_overflow.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_solid.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_stored.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_stored_manyfiles.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_symlink.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_truncated_huff.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_truncated_huff.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_win32.rar.uu ${PACKAGE}FILES+= test_read_format_raw.bufr.uu ${PACKAGE}FILES+= test_read_format_raw.data.Z.uu From owner-svn-src-head@freebsd.org Thu Sep 19 14:45:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56CBD125445; Thu, 19 Sep 2019 14:45:05 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z04d1ccJz3Kr9; Thu, 19 Sep 2019 14:45:05 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BC43F001; Thu, 19 Sep 2019 14:45:05 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JEj4QK017530; Thu, 19 Sep 2019 14:45:04 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JEj4RS017529; Thu, 19 Sep 2019 14:45:04 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909191445.x8JEj4RS017529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 19 Sep 2019 14:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352518 - head/usr.sbin/ntp/libntp X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/usr.sbin/ntp/libntp X-SVN-Commit-Revision: 352518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 14:45:05 -0000 Author: cy Date: Thu Sep 19 14:45:04 2019 New Revision: 352518 URL: https://svnweb.freebsd.org/changeset/base/352518 Log: Reduce calls to close(2) at startup through the use of closefrom(2). Submitted by: pawel.biernacki@gmail.com Reviewed by: mjg, cy MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21715 Modified: head/usr.sbin/ntp/libntp/Makefile Modified: head/usr.sbin/ntp/libntp/Makefile ============================================================================== --- head/usr.sbin/ntp/libntp/Makefile Thu Sep 19 14:36:30 2019 (r352517) +++ head/usr.sbin/ntp/libntp/Makefile Thu Sep 19 14:45:04 2019 (r352518) @@ -83,7 +83,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \ -I${.CURDIR:H} \ -I${.CURDIR}/ -CFLAGS+= -DHAVE_BSD_NICE -DHAVE_STDINT_H +CFLAGS+= -DHAVE_BSD_NICE -DHAVE_STDINT_H -DHAVE_CLOSEFROM CLEANFILES+= .version version.c From owner-svn-src-head@freebsd.org Thu Sep 19 15:24:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45911126648 for ; Thu, 19 Sep 2019 15:24:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z0yd6GV7z3Nd7 for ; Thu, 19 Sep 2019 15:24:57 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568906696; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=MfS86Qi4vjXUGCeF7elXAEwDTin+FYW98BM+o8rUUBNWjMY+YBQD1moDx2e0EkXysaXEfaFkx96/u 4BsKHFkviZOlFs3uaFO7ONKLKOTm6XJKLoAXlWAYIvCDXsj3fb9QjeWu8juBvOsieMIuwI9btvCten jxRvr+o0RZygz5N6lIpB7dPNC3QOaGIvkd7OpYrnTfa5pOzRnpWcfwo6IETM5Nui3wTGmZ2Lt1CCMy oz6/E7X79JPGm/8EzYcffp4QGdjZvPT2E2vepXK6nY/ThnHOKGSz4v/B0fvf095WNgHnvQPgh8NOip PBzJgOAVBfP1vqvg+Ks0BfXmH9V2EKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=S7fxOxi31KmQAldQpXFQcEeugPXJ8gL/HEYxItfH1xQ=; b=CdakdsrsLCPOYU+tu/UE9R4DwlMy0K2cCgOpeMTA+/F6s57RDl+kGgEe+eq1uRiaSnI7VPQoUItXk pQcZHsSXNKANW89+QtP03n/w74jXKyWnhaS97JnZSl81EdXryKJeizPlCQqbQQl7JOXwvmieBXdXfe 3k13lyALh/pxeOM0BInG+GpBcrqOB4ADKRvJhT8khetBMQM9NZfORSts5mzc8HgikAYgpFiCDrzEIU bh5hmBfIq/VSrooGRmzMo1FYXk5pAVU0eaxxN8Io9MLeO0kUqlwuT1pcyJBV32lqE7B0HIIPRrdTzx yKJL/TdtbeNjAi/XJwK44gxx14vzGIQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=S7fxOxi31KmQAldQpXFQcEeugPXJ8gL/HEYxItfH1xQ=; b=j8KKDF+b3FKtcp82xqfo8B2cduN8v06F9lFjMoyqwWXpLClEnMe/40Cbfoq2gwCiwdgzfr/igrqHf M2fGBNcsAbCuRM2cazz6zgj1XeMvx37hnuDMhBCuTRqLPsuh8QYjgXhF7ejo2qX5UFRjKaMVJB5/AP WkLYWhwWpAuyL3+8WrsXr1X+DxWLAKAnapS3j7X8V3f9cU6tlTOnk2FLcJeJu7RcJ2CJdf4NDllsJm 9N8OfTp6PmrVRNh0wxSCvcXkqJuVvK96fNrw9qdHMtDRfI3o+3ul2JBPqJUn6+9MNlc0JqvsLLyNiJ giNcdRnHZMBJyNvFpIRxUNu/cejwLuA== X-MHO-RoutePath: aGlwcGll X-MHO-User: a13cba16-daf1-11e9-b67d-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id a13cba16-daf1-11e9-b67d-cdd75d6ce7a8; Thu, 19 Sep 2019 15:24:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8JFOrhP007234; Thu, 19 Sep 2019 09:24:53 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r352513 - head/usr.sbin/freebsd-update From: Ian Lepore To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 19 Sep 2019 09:24:53 -0600 In-Reply-To: <201909191134.x8JBYZMv004854@repo.freebsd.org> References: <201909191134.x8JBYZMv004854@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46Z0yd6GV7z3Nd7 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 15:24:58 -0000 On Thu, 2019-09-19 at 11:34 +0000, Ed Maste wrote: > Author: emaste > Date: Thu Sep 19 11:34:35 2019 > New Revision: 352513 > URL: https://svnweb.freebsd.org/changeset/base/352513 > > Log: > freebsd-update.8: appease igor > > igor follows American style guides in the belief that abbreviations i.e. > and e.g. are always followed by a comma. Make that change now so that > future updates to freebsd-update.8 do not complain about this. > > Grammatically, English requires a comma after 'i.e.' because it is an adverbial phrase functioning as a conjunctive adverb. If you translate 'e.g.' idiomatically as "for example", then it is also a conjunctive adverbial phrase requiring a comma. -- Ian From owner-svn-src-head@freebsd.org Thu Sep 19 16:43:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E02F512837D; Thu, 19 Sep 2019 16:43:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z2hw5cXXz3ydg; Thu, 19 Sep 2019 16:43:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4A1018589; Thu, 19 Sep 2019 16:43:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JGhCKl089739; Thu, 19 Sep 2019 16:43:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JGhCJu089738; Thu, 19 Sep 2019 16:43:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201909191643.x8JGhCJu089738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 19 Sep 2019 16:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352520 - head/usr.sbin/pkg X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/usr.sbin/pkg X-SVN-Commit-Revision: 352520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 16:43:12 -0000 Author: gjb Date: Thu Sep 19 16:43:12 2019 New Revision: 352520 URL: https://svnweb.freebsd.org/changeset/base/352520 Log: Apply r346792 (cperciva) from stable/12 to head. The original commit message: On non-x86 systems, use "quarterly" packages. x86 architectures have "latest" package builds on stable/*, so keep using those (they'll get switched over to "quarterly" during releases). The original commit was a direct commit to stable/12, as at the time it was presumed it would not be necessary for head. However, when it is time to create a releng branch or switch from PRERELEASE/STABLE to BETA/RC, the pkg(7) Makefile needs further adjusting. This commit includes those further adjustments, evaluating the BRANCH variable from release/Makefile to determine the pkg(7) repository to use. MFC after: immediate (if possible) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/usr.sbin/pkg/Makefile Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Thu Sep 19 15:12:32 2019 (r352519) +++ head/usr.sbin/pkg/Makefile Thu Sep 19 16:43:12 2019 (r352520) @@ -1,6 +1,16 @@ # $FreeBSD$ +.if ${MACHINE} != "amd64" && ${MACHINE} != "i386" +PKGCONFBRANCH?= quarterly +.else +_BRANCH!= ${MAKE} -C ${SRCTOP}/release -V BRANCH +BRANCH?= ${_BRANCH} +. if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*} +PKGCONFBRANCH?= quarterly +. else PKGCONFBRANCH?= latest +. endif +.endif CONFS= FreeBSD.conf.${PKGCONFBRANCH} CONFSNAME= FreeBSD.conf CONFSDIR= /etc/pkg From owner-svn-src-head@freebsd.org Thu Sep 19 17:38:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 068F0129B24; Thu, 19 Sep 2019 17:38:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z3x06Mx3z43qq; Thu, 19 Sep 2019 17:38:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id A2386D1C5; Thu, 19 Sep 2019 17:38:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::d05d:2f14:a99b:7df2] (unknown [IPv6:2001:470:7a58:0:d05d:2f14:a99b:7df2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0F73B6C02F; Thu, 19 Sep 2019 19:38:43 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_7D33F55E-C322-41B9-AABE-9757195E930D"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd Date: Thu, 19 Sep 2019 19:38:37 +0200 In-Reply-To: <201909191246.x8JCke4Y003916@slippy.cwsent.com> Cc: src-committers , svn-src-all , svn-src-head@freebsd.org To: Cy Schubert References: <201909132020.x8DKK62j025066@repo.freebsd.org> <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org> <201909191246.x8JCke4Y003916@slippy.cwsent.com> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 17:38:45 -0000 --Apple-Mail=_7D33F55E-C322-41B9-AABE-9757195E930D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 19 Sep 2019, at 14:46, Cy Schubert wrote: >=20 > In message <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org>, Dimitry = Andric writes: >> On 2019-09-13 22:20, Cy Schubert wrote: >>> Author: cy >>> Date: Fri Sep 13 20:20:05 2019 >>> New Revision: 352304 >>> URL: https://svnweb.freebsd.org/changeset/base/352304 >>>=20 >>> Log: >>> No longer mlock() ntpd pages by default in memory thus allowing = its >>> pages to page as necessary. >>>=20 >>> To restore historic BSD behaviour add the following to ntp.conf: >>> rlimit memlock 32 >>=20 >> Apparently this does not completely work, as I still see: >>=20 >> ntpd[824]: ntpd 4.2.8p12-a (1): Starting >> ntpd[825]: Cannot set RLIMIT_MEMLOCK: Operation not permitted >>=20 >> even while my ntp.conf is almost entirely vanilla (it only has a >> different "server" line). >>=20 >> Even explicitly adding: >>=20 >> rlimit memlock -1 >>=20 >> does not work, it results in the same error. >>=20 >> -Dimitry >=20 > Can you try this please? >=20 > diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c > index 2b14431dc7b..bcfca27a535 100644 > --- a/contrib/ntp/ntpd/ntpd.c > +++ b/contrib/ntp/ntpd/ntpd.c > @@ -999,7 +999,7 @@ ntpdmain( > # if defined(HAVE_MLOCKALL) > # ifdef HAVE_SETRLIMIT > ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); > -# ifdef RLIMIT_MEMLOCK > +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && > DFLT_RLIMIT_MEMLOCK !=3D -1 > /* > * The default RLIMIT_MEMLOCK is very low on Linux systems. > * Unless we increase this limit malloc calls are likely to Yes, I already had something similar edited in (though I tested DLT_RLIMIT_MEMLOCK > 0), and that works for me. -Dimitry --Apple-Mail=_7D33F55E-C322-41B9-AABE-9757195E930D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXYO9HQAKCRCwXqMKLiCW o+bKAJ4yObZeTSfli2jwIpS48AeeeeRkAgCgwI2gFdOJWghEdvhTS0n9Ucn8ACI= =qFIb -----END PGP SIGNATURE----- --Apple-Mail=_7D33F55E-C322-41B9-AABE-9757195E930D-- From owner-svn-src-head@freebsd.org Thu Sep 19 19:38:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7361712C8B1; Thu, 19 Sep 2019 19:38:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z6b20YX4z4BSP; Thu, 19 Sep 2019 19:38:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id B2FtiYasRsAGkB2Fui1mt6; Thu, 19 Sep 2019 13:38:19 -0600 X-Authority-Analysis: v=2.3 cv=WeVylHpX c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=J70Eh1EUuV4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=A-G1zzc3P0URKbUEIbsA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 58E024E8; Thu, 19 Sep 2019 12:38:16 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x8JJcFSr064445; Thu, 19 Sep 2019 12:38:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x8JJcFSb064442; Thu, 19 Sep 2019 12:38:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201909191938.x8JJcFSb064442@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Dimitry Andric cc: Cy Schubert , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd In-reply-to: References: <201909132020.x8DKK62j025066@repo.freebsd.org> <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org> <201909191246.x8JCke4Y003916@slippy.cwsent.com> Comments: In-reply-to Dimitry Andric message dated "Thu, 19 Sep 2019 19:38:37 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 19 Sep 2019 12:38:15 -0700 X-CMAE-Envelope: MS4wfP8XZIx2JXZTW0FqfbX5HFiZky6dCCBehg2mZqKSHC/ZvqZIYaiWy4ugwsc2mwDdSnngyM0SWQKqsji9Sg0r+c/2I07rJNLJ1Heb0oTJ675en8hiskfQ 7GbfLF/tDlGRntpFxnbItEU4N1YvJc0N8msGnqr+OjfFE/K751uuVmzt0veicUMcmcq1HhjoHSB4jYJezYACjQ/HkzzMti0RL0GikCFfLDYQ8nJX01buP/6a 29kbzhCqeuMCe+6qHxaAQEkNcwxuff8e2Vb3XipwNxQUNRy1YG3xFnHdxdhHMaRP X-Rspamd-Queue-Id: 46Z6b20YX4z4BSP X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 19:38:22 -0000 In message , Dimitry Andric w rites: > > On 19 Sep 2019, at 14:46, Cy Schubert wrote: > >=20 > > In message <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org>, Dimitry = > Andric writes: > >> On 2019-09-13 22:20, Cy Schubert wrote: > >>> Author: cy > >>> Date: Fri Sep 13 20:20:05 2019 > >>> New Revision: 352304 > >>> URL: https://svnweb.freebsd.org/changeset/base/352304 > >>>=20 > >>> Log: > >>> No longer mlock() ntpd pages by default in memory thus allowing = > its > >>> pages to page as necessary. > >>>=20 > >>> To restore historic BSD behaviour add the following to ntp.conf: > >>> rlimit memlock 32 > >>=20 > >> Apparently this does not completely work, as I still see: > >>=20 > >> ntpd[824]: ntpd 4.2.8p12-a (1): Starting > >> ntpd[825]: Cannot set RLIMIT_MEMLOCK: Operation not permitted > >>=20 > >> even while my ntp.conf is almost entirely vanilla (it only has a > >> different "server" line). > >>=20 > >> Even explicitly adding: > >>=20 > >> rlimit memlock -1 > >>=20 > >> does not work, it results in the same error. > >>=20 > >> -Dimitry > >=20 > > Can you try this please? > >=20 > > diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c > > index 2b14431dc7b..bcfca27a535 100644 > > --- a/contrib/ntp/ntpd/ntpd.c > > +++ b/contrib/ntp/ntpd/ntpd.c > > @@ -999,7 +999,7 @@ ntpdmain( > > # if defined(HAVE_MLOCKALL) > > # ifdef HAVE_SETRLIMIT > > ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); > > -# ifdef RLIMIT_MEMLOCK > > +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && > > DFLT_RLIMIT_MEMLOCK !=3D -1 > > /* > > * The default RLIMIT_MEMLOCK is very low on Linux systems. > > * Unless we increase this limit malloc calls are likely to > > Yes, I already had something similar edited in (though I tested > DLT_RLIMIT_MEMLOCK > 0), and that works for me. That would work too, as it sets defaults before it reads the config file, which overrides the defaults. I'll commit the fix and put a corresponding fix into both ports as well and let our upstrem know. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Sep 19 20:16:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 927E512D967; Thu, 19 Sep 2019 20:16:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z7RS3Mgxz4F1K; Thu, 19 Sep 2019 20:16:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56F6B1AAC1; Thu, 19 Sep 2019 20:16:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JKGqOC014331; Thu, 19 Sep 2019 20:16:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JKGqjH014330; Thu, 19 Sep 2019 20:16:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909192016.x8JKGqjH014330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 19 Sep 2019 20:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352540 - head/contrib/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ntp/ntpd X-SVN-Commit-Revision: 352540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 20:16:52 -0000 Author: cy Date: Thu Sep 19 20:16:51 2019 New Revision: 352540 URL: https://svnweb.freebsd.org/changeset/base/352540 Log: Follow up on r352304 which disabled default mlockall() at startup. Unfortunately though the original tarball supports this in ./configure (for Linux), to fully support disabling of mlockall() by default requires a little extra help otherwise the following is logged in syslog: Cannot set RLIMIT_MEMLOCK: Operation not permitted MFC after: 2 weeks X-MFC with: r352304 Modified: head/contrib/ntp/ntpd/ntpd.c Modified: head/contrib/ntp/ntpd/ntpd.c ============================================================================== --- head/contrib/ntp/ntpd/ntpd.c Thu Sep 19 19:42:59 2019 (r352539) +++ head/contrib/ntp/ntpd/ntpd.c Thu Sep 19 20:16:51 2019 (r352540) @@ -999,7 +999,7 @@ ntpdmain( # if defined(HAVE_MLOCKALL) # ifdef HAVE_SETRLIMIT ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); -# ifdef RLIMIT_MEMLOCK +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 /* * The default RLIMIT_MEMLOCK is very low on Linux systems. * Unless we increase this limit malloc calls are likely to From owner-svn-src-head@freebsd.org Thu Sep 19 21:13:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3D8112EAE9; Thu, 19 Sep 2019 21:13:51 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z8jC5mDpz4HrK; Thu, 19 Sep 2019 21:13:51 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8E511B54F; Thu, 19 Sep 2019 21:13:51 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JLDpH3049800; Thu, 19 Sep 2019 21:13:51 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JLDpih049799; Thu, 19 Sep 2019 21:13:51 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201909192113.x8JLDpih049799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Thu, 19 Sep 2019 21:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352542 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: grembo X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 352542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 21:13:52 -0000 Author: grembo (ports committer) Date: Thu Sep 19 21:13:51 2019 New Revision: 352542 URL: https://svnweb.freebsd.org/changeset/base/352542 Log: Fix src component detection Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21579 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 19 20:45:23 2019 (r352541) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Sep 19 21:13:51 2019 (r352542) @@ -221,6 +221,14 @@ config_KeepModifiedMetadata () { # Add to the list of components which should be kept updated. config_Components () { for C in $@; do + COMPONENTS="${COMPONENTS} ${C}" + done +} + +# Remove src component from list if it isn't installed +finalize_components_config () { + COMPONENTS="" + for C in $@; do if [ "$C" = "src" ]; then if [ -e "${BASEDIR}/usr/src/COPYRIGHT" ]; then COMPONENTS="${COMPONENTS} ${C}" @@ -3284,6 +3292,7 @@ get_params () { parse_cmdline $@ parse_conffile default_params + finalize_components_config ${COMPONENTS} } # Fetch command. Make sure that we're being called From owner-svn-src-head@freebsd.org Thu Sep 19 21:23:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E17512EF56; Thu, 19 Sep 2019 21:23:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z8w31sqqz4JWb; Thu, 19 Sep 2019 21:23:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 238191B71B; Thu, 19 Sep 2019 21:23:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JLNFs8055613; Thu, 19 Sep 2019 21:23:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JLNETp055611; Thu, 19 Sep 2019 21:23:14 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909192123.x8JLNETp055611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 19 Sep 2019 21:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352543 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 352543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 21:23:15 -0000 Author: mjg Date: Thu Sep 19 21:23:14 2019 New Revision: 352543 URL: https://svnweb.freebsd.org/changeset/base/352543 Log: vfs: group fields used for per-cpu ops in one cacheline Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_mount.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Sep 19 21:13:51 2019 (r352542) +++ head/sys/kern/vfs_mount.c Thu Sep 19 21:23:14 2019 (r352543) @@ -157,7 +157,7 @@ vfs_mount_init(void *dummy __unused) { mount_zone = uma_zcreate("Mountpoints", sizeof(struct mount), NULL, - NULL, mount_init, mount_fini, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + NULL, mount_init, mount_fini, UMA_ALIGN_CACHE, UMA_ZONE_NOFREE); } SYSINIT(vfs_mount, SI_SUB_VFS, SI_ORDER_ANY, vfs_mount_init, NULL); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Thu Sep 19 21:13:51 2019 (r352542) +++ head/sys/sys/mount.h Thu Sep 19 21:23:14 2019 (r352543) @@ -226,7 +226,7 @@ struct mount { struct lock mnt_explock; /* vfs_export walkers lock */ TAILQ_ENTRY(mount) mnt_upper_link; /* (m) we in the all uppers */ TAILQ_HEAD(, mount) mnt_uppers; /* (m) upper mounts over us*/ - int mnt_vfs_ops; /* (i) pending vfs ops */ + int __aligned(CACHE_LINE_SIZE) mnt_vfs_ops;/* (i) pending vfs ops */ int *mnt_thread_in_ops_pcpu; int *mnt_ref_pcpu; int *mnt_lockref_pcpu; From owner-svn-src-head@freebsd.org Thu Sep 19 22:15:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8523112FF2E; Thu, 19 Sep 2019 22:15:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZB4t2qyKz4MBl; Thu, 19 Sep 2019 22:15:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 409B91C071; Thu, 19 Sep 2019 22:15:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JMFwuD085360; Thu, 19 Sep 2019 22:15:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JMFv8j085358; Thu, 19 Sep 2019 22:15:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909192215.x8JMFv8j085358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 Sep 2019 22:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352544 - head/sys/dev/ioat X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ioat X-SVN-Commit-Revision: 352544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 22:15:58 -0000 Author: mav Date: Thu Sep 19 22:15:57 2019 New Revision: 352544 URL: https://svnweb.freebsd.org/changeset/base/352544 Log: Improve ioat(4) NUMA-awareness. Allocate ioat->ring memory from the device domain. Schedule ioat->poll_timer to the first CPU of the device domain. According to pcm-numa tool from intel-pcm port, this reduces number of remote DRAM accesses while copying data by 75%. And unless it is a noise, I've noticed some speed improvement when copying data to other domain. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Thu Sep 19 21:23:14 2019 (r352543) +++ head/sys/dev/ioat/ioat.c Thu Sep 19 22:15:57 2019 (r352544) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -44,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -266,6 +268,11 @@ ioat_attach(device_t device) ioat = DEVICE2SOFTC(device); ioat->device = device; + if (bus_get_domain(device, &ioat->domain) != 0) + ioat->domain = 0; + ioat->cpu = CPU_FFS(&cpuset_domain[ioat->domain]) - 1; + if (ioat->cpu < 0) + ioat->cpu = CPU_FIRST(); error = ioat_map_pci_bar(ioat); if (error != 0) @@ -600,8 +607,8 @@ ioat3_attach(device_t device) __func__, error); return (error); } - ioat->ring = malloc(num_descriptors * sizeof(*ring), M_IOAT, - M_ZERO | M_WAITOK); + ioat->ring = malloc_domainset(num_descriptors * sizeof(*ring), M_IOAT, + DOMAINSET_PREF(ioat->domain), M_ZERO | M_WAITOK); ring = ioat->ring; for (i = 0; i < num_descriptors; i++) { @@ -1107,8 +1114,8 @@ ioat_release(bus_dmaengine_t dmaengine) (uint16_t)ioat->head); if (!callout_pending(&ioat->poll_timer)) { - callout_reset(&ioat->poll_timer, 1, - ioat_poll_timer_callback, ioat); + callout_reset_on(&ioat->poll_timer, 1, + ioat_poll_timer_callback, ioat, ioat->cpu); } } mtx_unlock(&ioat->submit_lock); @@ -1644,7 +1651,7 @@ ioat_free_ring(struct ioat_softc *ioat, uint32_t size, struct ioat_descriptor *ring) { - free(ring, M_IOAT); + free_domain(ring, M_IOAT); } static struct ioat_descriptor * Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Thu Sep 19 21:23:14 2019 (r352543) +++ head/sys/dev/ioat/ioat_internal.h Thu Sep 19 22:15:57 2019 (r352544) @@ -442,6 +442,8 @@ struct ioat_softc { }) device_t device; + int domain; + int cpu; int version; unsigned chan_idx; From owner-svn-src-head@freebsd.org Fri Sep 20 05:22:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2B52F2A10; Fri, 20 Sep 2019 05:22:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZMY65Gj4z3FGW; Fri, 20 Sep 2019 05:22:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9850420CDA; Fri, 20 Sep 2019 05:22:34 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8K5MYqT039077; Fri, 20 Sep 2019 05:22:34 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8K5MYMX039076; Fri, 20 Sep 2019 05:22:34 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909200522.x8K5MYMX039076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 20 Sep 2019 05:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352548 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 352548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 05:22:34 -0000 Author: tsoome Date: Fri Sep 20 05:22:34 2019 New Revision: 352548 URL: https://svnweb.freebsd.org/changeset/base/352548 Log: loader: fix typo in zalloc. Modified: head/stand/libsa/zalloc.c Modified: head/stand/libsa/zalloc.c ============================================================================== --- head/stand/libsa/zalloc.c Fri Sep 20 00:07:48 2019 (r352547) +++ head/stand/libsa/zalloc.c Fri Sep 20 05:22:34 2019 (r352548) @@ -125,7 +125,8 @@ znalloc(MemPool *mp, uintptr_t bytes, size_t align) continue; /* - * Cut extra from head and create new memory node from reminder. + * Cut extra from head and create new memory node from + * remainder. */ if (extra != 0) { From owner-svn-src-head@freebsd.org Fri Sep 20 08:20:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44774F6A26; Fri, 20 Sep 2019 08:20:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZRVF16Vbz3NK1; Fri, 20 Sep 2019 08:20:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 094A222B49; Fri, 20 Sep 2019 08:20:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8K8KKW1039493; Fri, 20 Sep 2019 08:20:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8K8KKwP039492; Fri, 20 Sep 2019 08:20:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909200820.x8K8KKwP039492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 20 Sep 2019 08:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352550 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 08:20:21 -0000 Author: tuexen Date: Fri Sep 20 08:20:20 2019 New Revision: 352550 URL: https://svnweb.freebsd.org/changeset/base/352550 Log: Fix the handling of invalid parameters in ASCONF chunks. Thanks to Mark Wodrich from Google for reproting the issue in https://github.com/sctplab/usrsctp/issues/376 for the userland stack. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Fri Sep 20 07:24:18 2019 (r352549) +++ head/sys/netinet/sctp_asconf.c Fri Sep 20 08:20:20 2019 (r352550) @@ -703,6 +703,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset if (param_length <= sizeof(struct sctp_paramhdr)) { SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: param length (%u) too short\n", param_length); sctp_m_freem(m_ack); + return; } /* get the entire parameter */ aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, param_length, aparam_buf); From owner-svn-src-head@freebsd.org Fri Sep 20 09:04:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C01D9F802B; Fri, 20 Sep 2019 09:04:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZSTc4YLNz3Qq0; Fri, 20 Sep 2019 09:04:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 805D52350A; Fri, 20 Sep 2019 09:04:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8K94qOM068776; Fri, 20 Sep 2019 09:04:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8K94qs0068775; Fri, 20 Sep 2019 09:04:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909200904.x8K94qs0068775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Sep 2019 09:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352551 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 352551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 09:04:52 -0000 Author: emaste Date: Fri Sep 20 09:04:52 2019 New Revision: 352551 URL: https://svnweb.freebsd.org/changeset/base/352551 Log: elf_common: add ELF note names r348628 added a definition of NT_GNU_BUILD_ID. Some software (Valgrind) also expects a #define for the note name (ELF_NOTE_GNU) in the case that NT_GNU_BUILD_ID is defined. PR: 239669 Reported by: Yuichiro NAITO Sponsored by: The FreeBSD Foundation Event: EuroBSDCon FreeBSD DevSummit 2019 Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Sep 20 08:20:20 2019 (r352550) +++ head/sys/sys/elf_common.h Fri Sep 20 09:04:52 2019 (r352551) @@ -769,6 +769,12 @@ typedef struct { #define LL_DELAY_LOAD 0x10 #define LL_DELTA 0x20 +/* Note section names */ +#define ELF_NOTE_FREEBSD "FreeBSD" +#define ELF_NOTE_NETBSD "NetBSD" +#define ELF_NOTE_SOLARIS "SUNW Solaris" +#define ELF_NOTE_GNU "GNU" + /* Values for n_type used in executables. */ #define NT_FREEBSD_ABI_TAG 1 #define NT_FREEBSD_NOINIT_TAG 2 From owner-svn-src-head@freebsd.org Fri Sep 20 09:36:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E89CF8879; Fri, 20 Sep 2019 09:36:08 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZT9h2HWqz3xSg; Fri, 20 Sep 2019 09:36:08 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D58623A6C; Fri, 20 Sep 2019 09:36:08 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8K9a8iC086789; Fri, 20 Sep 2019 09:36:08 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8K9a8m3086788; Fri, 20 Sep 2019 09:36:08 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201909200936.x8K9a8m3086788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 20 Sep 2019 09:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352552 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 09:36:08 -0000 Author: gallatin Date: Fri Sep 20 09:36:07 2019 New Revision: 352552 URL: https://svnweb.freebsd.org/changeset/base/352552 Log: remove redundant "ktls" in KTLS thr name This reducesthe string width of the ktls thread name and improves "ps" output. Glanced at by: jhb Event: EuroBSDCon hackathon Sponsored by: Netflix Modified: head/sys/kern/uipc_ktls.c Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Fri Sep 20 09:04:52 2019 (r352551) +++ head/sys/kern/uipc_ktls.c Fri Sep 20 09:36:07 2019 (r352552) @@ -349,7 +349,7 @@ ktls_init(void *dummy __unused) STAILQ_INIT(&ktls_wq[i].head); mtx_init(&ktls_wq[i].mtx, "ktls work queue", NULL, MTX_DEF); error = kproc_kthread_add(ktls_work_thread, &ktls_wq[i], - &ktls_proc, &td, 0, 0, "KTLS", "ktls_thr_%d", i); + &ktls_proc, &td, 0, 0, "KTLS", "thr_%d", i); if (error) panic("Can't add KTLS thread %d error %d", i, error); From owner-svn-src-head@freebsd.org Fri Sep 20 09:45:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E5F1F8CB3; Fri, 20 Sep 2019 09:45:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZTNg1Hv5z3yBm; Fri, 20 Sep 2019 09:45:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B30823C40; Fri, 20 Sep 2019 09:45:39 +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 x8K9jcwe092705; Fri, 20 Sep 2019 09:45:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8K9jcC0092704; Fri, 20 Sep 2019 09:45:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201909200945.x8K9jcC0092704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 20 Sep 2019 09:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352553 - head X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 09:45:39 -0000 Author: bapt Date: Fri Sep 20 09:45:38 2019 New Revision: 352553 URL: https://svnweb.freebsd.org/changeset/base/352553 Log: Ensure libthr is always built before libprivatezstd when building the startup libs Reported by: "Galazka, Krzysztof" Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Sep 20 09:36:07 2019 (r352552) +++ head/Makefile.inc1 Fri Sep 20 09:45:38 2019 (r352553) @@ -2832,6 +2832,7 @@ _lib_casper= lib/libcasper lib/libpjdlog__L: lib/libutil__L lib/libcasper__L: lib/libnv__L lib/liblzma__L: lib/libthr__L +lib/libzstd__L: lib/libthr__L _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib .if ${MK_IPFILTER} != "no" From owner-svn-src-head@freebsd.org Fri Sep 20 10:56:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59FC4F9EB2; Fri, 20 Sep 2019 10:56:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZVy61fZPz428R; Fri, 20 Sep 2019 10:56:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18B7F24881; Fri, 20 Sep 2019 10:56:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8KAuDQo034202; Fri, 20 Sep 2019 10:56:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8KAuD3k034201; Fri, 20 Sep 2019 10:56:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909201056.x8KAuD3k034201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Sep 2019 10:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352554 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 352554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 10:56:14 -0000 Author: hselasky Date: Fri Sep 20 10:56:13 2019 New Revision: 352554 URL: https://svnweb.freebsd.org/changeset/base/352554 Log: The maximum TD size is 31 and not 15. Found at: EuroBSDcon 2019 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Fri Sep 20 09:45:38 2019 (r352553) +++ head/sys/dev/usb/controller/xhci.c Fri Sep 20 10:56:13 2019 (r352554) @@ -2003,7 +2003,7 @@ restart: /* clear TD SIZE to zero, hence this is the last TRB */ /* remove chain bit because this is the last data TRB in the chain */ - td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); + td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(31)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); /* remove CHAIN-BIT from last LINK TRB */ td->td_trb[td->ntrb].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); From owner-svn-src-head@freebsd.org Fri Sep 20 11:00:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 860E6F9FA9; Fri, 20 Sep 2019 11:00:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZW2W31kMz42Lg; Fri, 20 Sep 2019 11:00:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B1A82488D; Fri, 20 Sep 2019 11:00:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8KB032h034489; Fri, 20 Sep 2019 11:00:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8KB03er034488; Fri, 20 Sep 2019 11:00:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909201100.x8KB03er034488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Sep 2019 11:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352555 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 352555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 11:00:03 -0000 Author: hselasky Date: Fri Sep 20 11:00:02 2019 New Revision: 352555 URL: https://svnweb.freebsd.org/changeset/base/352555 Log: Increase the maximum user-space buffer size from 256kBytes to 32MBytes for libusb. This is useful for speeding up large data transfers while reducing the interrupt rate. Found at: EuroBSDcon 2019 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_ioctl.h Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Fri Sep 20 10:56:13 2019 (r352554) +++ head/sys/dev/usb/usb_ioctl.h Fri Sep 20 11:00:02 2019 (r352555) @@ -224,7 +224,7 @@ struct usb_fs_uninit { } USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_open { -#define USB_FS_MAX_BUFSIZE (1 << 18) +#define USB_FS_MAX_BUFSIZE (1 << 25) /* 32 MBytes */ uint32_t max_bufsize; #define USB_FS_MAX_FRAMES (1U << 12) #define USB_FS_MAX_FRAMES_PRE_SCALE (1U << 31) /* for ISOCHRONOUS transfers */ From owner-svn-src-head@freebsd.org Fri Sep 20 11:28:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D068FA87E; Fri, 20 Sep 2019 11:28:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZWgf1qWpz43jZ; Fri, 20 Sep 2019 11:28:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21C2C24E12; Fri, 20 Sep 2019 11:28:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8KBSkw5051838; Fri, 20 Sep 2019 11:28:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8KBSjjR051835; Fri, 20 Sep 2019 11:28:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909201128.x8KBSjjR051835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Sep 2019 11:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352556 - in head/sys/dev/usb: . controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . controller X-SVN-Commit-Revision: 352556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 11:28:46 -0000 Author: hselasky Date: Fri Sep 20 11:28:45 2019 New Revision: 352556 URL: https://svnweb.freebsd.org/changeset/base/352556 Log: Add quirk for XHCI(4) controllers to support USB control transfers above 1Kbyte. It might look like some XHCI(4) controllers do not support when the USB control transfer is split using a link TRB. The next NORMAL TRB after the link TRB is simply failing with XHCI error code 4. The quirk ensures we allocate a 64Kbyte buffer so that the data stage TRB is not broken with a link TRB. Found at: EuroBSDcon 2019 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/usb_bus.h head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Fri Sep 20 11:00:02 2019 (r352555) +++ head/sys/dev/usb/controller/xhci.c Fri Sep 20 11:28:45 2019 (r352556) @@ -601,6 +601,9 @@ xhci_init(struct xhci_softc *sc, device_t self, uint8_ device_printf(self, "%d bytes context size, %d-bit DMA\n", sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits); + /* enable 64Kbyte control endpoint quirk */ + sc->sc_bus.control_ep_quirk = 1; + temp = XREAD4(sc, capa, XHCI_HCSPARAMS1); /* get number of device slots */ Modified: head/sys/dev/usb/usb_bus.h ============================================================================== --- head/sys/dev/usb/usb_bus.h Fri Sep 20 11:00:02 2019 (r352555) +++ head/sys/dev/usb/usb_bus.h Fri Sep 20 11:28:45 2019 (r352556) @@ -131,6 +131,7 @@ struct usb_bus { uint8_t do_probe; /* set if USB should be re-probed */ uint8_t no_explore; /* don't explore USB ports */ uint8_t dma_bits; /* number of DMA address lines */ + uint8_t control_ep_quirk; /* need 64kByte buffer for data stage */ }; #endif /* _USB_BUS_H_ */ Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Fri Sep 20 11:00:02 2019 (r352555) +++ head/sys/dev/usb/usb_transfer.c Fri Sep 20 11:28:45 2019 (r352556) @@ -106,6 +106,33 @@ static const struct usb_config usb_control_ep_cfg[USB_ }, }; +static const struct usb_config usb_control_ep_quirk_cfg[USB_CTRL_XFER_MAX] = { + + /* This transfer is used for generic control endpoint transfers */ + + [0] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control endpoint */ + .direction = UE_DIR_ANY, + .bufsize = 65535, /* bytes */ + .callback = &usb_request_callback, + .usb_mode = USB_MODE_DUAL, /* both modes */ + }, + + /* This transfer is used for generic clear stall only */ + + [1] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = UE_DIR_ANY, + .bufsize = sizeof(struct usb_device_request), + .callback = &usb_do_clear_stall_callback, + .timeout = 1000, /* 1 second */ + .interval = 50, /* 50ms */ + .usb_mode = USB_MODE_HOST, + }, +}; + /* function prototypes */ static void usbd_update_max_frame_size(struct usb_xfer *); @@ -1021,7 +1048,8 @@ usbd_transfer_setup(struct usb_device *udev, * context, else there is a chance of * deadlock! */ - if (setup_start == usb_control_ep_cfg) + if (setup_start == usb_control_ep_cfg || + setup_start == usb_control_ep_quirk_cfg) info->done_p = USB_BUS_CONTROL_XFER_PROC(udev->bus); else if (xfer_mtx == &Giant) @@ -3149,7 +3177,8 @@ repeat: */ iface_index = 0; if (usbd_transfer_setup(udev, &iface_index, - udev->ctrl_xfer, usb_control_ep_cfg, USB_CTRL_XFER_MAX, NULL, + udev->ctrl_xfer, udev->bus->control_ep_quirk ? + usb_control_ep_quirk_cfg : usb_control_ep_cfg, USB_CTRL_XFER_MAX, NULL, &udev->device_mtx)) { DPRINTFN(0, "could not setup default " "USB transfer\n"); From owner-svn-src-head@freebsd.org Fri Sep 20 12:14:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8486CFBB16; Fri, 20 Sep 2019 12:14:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 46ZXhg2FhKz45yt; Fri, 20 Sep 2019 12:14:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id D38A736182F; Fri, 20 Sep 2019 22:14:40 +1000 (AEST) Date: Fri, 20 Sep 2019 22:14:39 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351700 - head/lib/libc/string In-Reply-To: <201909021356.x82Dui6v077765@repo.freebsd.org> Message-ID: <20190920212702.N1017@besplex.bde.org> References: <201909021356.x82Dui6v077765@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=cn9ZTVXxRq8eMFPCvVIA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 46ZXhg2FhKz45yt X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.249 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-2.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23:c]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[optusnet.com.au]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RWL_MAILSPIKE_POSSIBLE(0.00)[249.132.29.211.rep.mailspike.net : 127.0.0.17]; IP_SCORE(0.00)[ip: (-5.26), ipnet: 211.28.0.0/14(-3.26), asn: 4804(-2.40), country: AU(0.01)]; IP_SCORE_FREEMAIL(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 12:14:44 -0000 On Mon, 2 Sep 2019, Ed Maste wrote: > Author: emaste > Date: Mon Sep 2 13:56:44 2019 > New Revision: 351700 > URL: https://svnweb.freebsd.org/changeset/base/351700 > > Log: > libc: Use musl's optimized memchr > > Parentheses added to HASZERO macro to avoid a GCC warning. > > Reviewed by: kib, mjg > Obtained from: musl (snapshot at commit 4d0a82170a) > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17631 > > Modified: > head/lib/libc/string/memchr.c > > Modified: head/lib/libc/string/memchr.c > ============================================================================== > --- head/lib/libc/string/memchr.c Mon Sep 2 13:55:31 2019 (r351699) > +++ head/lib/libc/string/memchr.c Mon Sep 2 13:56:44 2019 (r351700) > @@ -1,55 +1,54 @@ > /*- > - * SPDX-License-Identifier: BSD-3-Clause > + * SPDX-License-Identifier: MIT > * > - * Copyright (c) 1990, 1993 > - * The Regents of the University of California. All rights reserved. > + * Copyright (c) 2005-2014 Rich Felker, et al. > * > - * This code is derived from software contributed to Berkeley by > - * Chris Torek. I prefer Torek's version. Optimizing this function is especially unimportant, and this version has mounds of style bugs. > -void * > -memchr(const void *s, int c, size_t n) > -{ > - if (n != 0) { > - const unsigned char *p = s; > +#define SS (sizeof(size_t)) > +#define ALIGN (sizeof(size_t)-1) > +#define ONES ((size_t)-1/UCHAR_MAX) > +#define HIGHS (ONES * (UCHAR_MAX/2+1)) > +#define HASZERO(x) (((x)-ONES) & ~(x) & HIGHS) > > - do { > - if (*p++ == (unsigned char)c) > - return ((void *)(p - 1)); > - } while (--n != 0); Old KNF code. In the !__GNUC__ #else clausew , this is replaced by equivalent code with a style that is very far from KNF. If compilers understood this function, then they could reasonably optimize the old code in very AMD ways, e.g., use AVX512. This is not so reasonable for the new code. clang does such optimizations to a fault, but knows that it doesn't understand this code or even strlen(), so it does a naive translation. > +void *memchr(const void *src, int c, size_t n) > +{ > + const unsigned char *s = src; > + c = (unsigned char)c; > +#ifdef __GNUC__ > + for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--); > + if (n && *s != c) { > + typedef size_t __attribute__((__may_alias__)) word; This seems to have no dependencies on __GNUC__ except the use of anti-aliasing, and that dependendency is broken (very old versions of gcc don't even have __attribute__(()), and old versions don't have __may_alias). > + const word *w; > + size_t k = ONES * c; > + for (w = (const void *)s; n>=SS && !HASZERO(*w^k); w++, n-=SS); > + s = (const void *)w; > } This is cryptic as well as non-KNF. libc/string/strlen.c uses the same dubious optimization method, but it is at least clearly written and it is even in KNF. > - return (NULL); > +#endif > + for (; n && *s != c; s++, n--); > + return n ? (void *)s : 0; > } I checked that this optimization actually works. For long strings, it is almost sizeof(size_t) times faster, by accessing memory with a size sizeof(size_t). size_t is a not very good way of hard-coding the word size. Related silly optimizations: - i386 has memchr() in asm. This uses scasb, which was last optimal on the 8088, or perhaps the original i386. On freefall, it is several times slower than the naive translation of the naive C code. - i386 pessimizes several old string functions using scasb. amd64 mostly doesn't copy this mistake. Similarly for wide char string functions. Optimizing these is even more unimportant and just writing them in asm is quite complicated. They are perhaps not fully pessimized in asm on i386. amd64 doesn't have any of them in asm. - i386 also does dubious alignment optimizations - amd64 pessimizes strcpy() by implementing it as a C wrapper for stpcpy(). The wrapper code is MI, but is only used for amd64. - amd64 stpcpy(), strcat() and strcmp() uses the fancy optimization using the 0x0101... and 0x8080... tricks (as in this version of memchr() except not so cryptically since the constants are literal instead of constructed using macros from the word type). Optimizing strcat() some of these functions is unimportant. Worth doing at most once, in the C version. - the generic strlen() (but no other generic string function) is optimized using the 0x0101... and 0x8080... tricks. This optimization is dubious since it is a pessimization for short strings. Compilers often inline string functions, especially strlen() anyway. I think x86 compilers used to routinely inline strlen(), but now they know that they don't understand it, so they just call the library strlen() for most strings that are not known at compile time. This results in the fancy optimization actually being used. Sometimes this optimization improves the speed of a large program by as much as 0.001%. Bruce From owner-svn-src-head@freebsd.org Fri Sep 20 13:35:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 104D3FD3E3; Fri, 20 Sep 2019 13:35:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZZTr6hzRz4BjS; Fri, 20 Sep 2019 13:35:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C93DC265CE; Fri, 20 Sep 2019 13:35:28 +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 x8KDZS4i031095; Fri, 20 Sep 2019 13:35:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8KDZSuP031094; Fri, 20 Sep 2019 13:35:28 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201909201335.x8KDZSuP031094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 20 Sep 2019 13:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352557 - head/stand/powerpc/uboot X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/stand/powerpc/uboot X-SVN-Commit-Revision: 352557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 13:35:29 -0000 Author: jhibbits Date: Fri Sep 20 13:35:28 2019 New Revision: 352557 URL: https://svnweb.freebsd.org/changeset/base/352557 Log: powerpc/loader: Install ubldr without stripping Summary: Install's strip capability, by way of strip(1), doesn't seem to work correctly on msdosfs, and instead ends up truncating the resulting binary to 0-length. As a workaround, don't strip ubldr(8). This fixes installworld on Book-E ubldr-based platforms, which prior to this would need to manually install ubldr separately after installworld, in order to have a functional ubldr. The same thing could be done on PowerNV platforms that use msdosfs /boot volumes, since loader and loader.kboot, etc, all get truncated to 0 on install. However, PowerNV does not use loader, instead loading from petitboot, so it's not really necessary at this time. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D21725 Modified: head/stand/powerpc/uboot/Makefile Modified: head/stand/powerpc/uboot/Makefile ============================================================================== --- head/stand/powerpc/uboot/Makefile Fri Sep 20 11:28:45 2019 (r352556) +++ head/stand/powerpc/uboot/Makefile Fri Sep 20 13:35:28 2019 (r352557) @@ -13,6 +13,7 @@ LOADER_BZIP2_SUPPORT?= no BINDIR= /boot/uboot PROG= ubldr +STRIP= NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b From owner-svn-src-head@freebsd.org Fri Sep 20 17:37:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7E9A123117; Fri, 20 Sep 2019 17:37:24 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Zgs05q3zz4Qmd; Fri, 20 Sep 2019 17:37:24 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAF111276; Fri, 20 Sep 2019 17:37:24 +0000 (UTC) (envelope-from daichi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8KHbOtP071878; Fri, 20 Sep 2019 17:37:24 GMT (envelope-from daichi@FreeBSD.org) Received: (from daichi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8KHbNhf071874; Fri, 20 Sep 2019 17:37:23 GMT (envelope-from daichi@FreeBSD.org) Message-Id: <201909201737.x8KHbNhf071874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: daichi set sender to daichi@FreeBSD.org using -f From: Daichi GOTO Date: Fri, 20 Sep 2019 17:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352558 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: daichi X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 352558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 17:37:25 -0000 Author: daichi Date: Fri Sep 20 17:37:23 2019 New Revision: 352558 URL: https://svnweb.freebsd.org/changeset/base/352558 Log: top(1): support multibyte characters in command names (ARGV array) depending on locale. - add setlocale() - remove printable() function - add VIS_OCTAL and VIS_SAFE to the flag of strvisx() to display non-printable characters that do not use C-style backslash sequences in three digit octal sequence, or remove it This change allows multibyte characters to be displayed according to locale. If it is recognized as a non-display character according to the locale, it is displayed in three digit octal sequence. Reference: https://www.mail-archive.com/svn-src-all@freebsd.org/msg165751.html https://www.mail-archive.com/svn-src-all@freebsd.org/msg165766.html https://www.mail-archive.com/svn-src-all@freebsd.org/msg165833.html https://www.mail-archive.com/svn-src-all@freebsd.org/msg165846.html https://www.mail-archive.com/svn-src-all@freebsd.org/msg165891.html Submitted by: hrs Differential Revision: https://reviews.freebsd.org/D16204 Modified: head/usr.bin/top/display.c head/usr.bin/top/display.h head/usr.bin/top/machine.c head/usr.bin/top/top.1 head/usr.bin/top/top.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Fri Sep 20 13:35:28 2019 (r352557) +++ head/usr.bin/top/display.c Fri Sep 20 17:37:23 2019 (r352558) @@ -1291,31 +1291,6 @@ line_update(char *old, char *new, int start, int line) } } -/* - * printable(str) - make the string pointed to by "str" into one that is - * printable (i.e.: all ascii), by converting all non-printable - * characters into '?'. Replacements are done in place and a pointer - * to the original buffer is returned. - */ - -char * -printable(char str[]) -{ - char *ptr; - char ch; - - ptr = str; - while ((ch = *ptr) != '\0') - { - if (!isprint(ch)) - { - *ptr = '?'; - } - ptr++; - } - return(str); -} - void i_uptime(struct timeval *bt, time_t *tod) { Modified: head/usr.bin/top/display.h ============================================================================== --- head/usr.bin/top/display.h Fri Sep 20 13:35:28 2019 (r352557) +++ head/usr.bin/top/display.h Fri Sep 20 17:37:23 2019 (r352558) @@ -11,7 +11,6 @@ int display_updatecpus(struct statics *statics); void clear_message(void); int display_resize(void); void i_header(const char *text); -char *printable(char *string); void display_header(int t); int display_init(struct statics *statics); void i_arc(int *stats); Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Sep 20 13:35:28 2019 (r352557) +++ head/usr.bin/top/machine.c Fri Sep 20 17:37:23 2019 (r352558) @@ -1003,7 +1003,7 @@ format_next_process(struct handle * xhandle, char *(*g len = (argbuflen - (dst - argbuf) - 1) / 4; strvisx(dst, src, MIN(strlen(src), len), - VIS_NL | VIS_CSTYLE); + VIS_NL | VIS_CSTYLE | VIS_OCTAL | VIS_SAFE); while (*dst != '\0') dst++; if ((argbuflen - (dst - argbuf) - 1) / 4 > 0) @@ -1102,7 +1102,7 @@ format_next_process(struct handle * xhandle, char *(*g sbuf_printf(procbuf, "%6s ", format_time(cputime)); sbuf_printf(procbuf, "%6.2f%% ", ps.wcpu ? 100.0 * weighted_cpu(PCTCPU(pp), pp) : 100.0 * PCTCPU(pp)); } - sbuf_printf(procbuf, "%s", printable(cmdbuf)); + sbuf_printf(procbuf, "%s", cmdbuf); free(cmdbuf); return (sbuf_data(procbuf)); } Modified: head/usr.bin/top/top.1 ============================================================================== --- head/usr.bin/top/top.1 Fri Sep 20 13:35:28 2019 (r352557) +++ head/usr.bin/top/top.1 Fri Sep 20 17:37:23 2019 (r352558) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd October 2, 2018 +.Dd September 20, 2019 .Dt TOP 1 .Os .Sh NAME @@ -192,6 +192,10 @@ or \*(lqall\*(rq. Boolean flags are toggles. A second specification of any of these options will negate the first. +.Pp +The display of command names changes according to the locale. +If command names displayed in the locale settings are recognized as +non-display characters, they are displayed in three digit octal sequence. .Sh "INTERACTIVE MODE" When .Nm Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Fri Sep 20 13:35:28 2019 (r352557) +++ head/usr.bin/top/top.c Fri Sep 20 17:37:23 2019 (r352558) @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -264,6 +265,11 @@ main(int argc, const char *argv[]) #else setbuffer(stdout, stdoutbuf, Buffersize); #endif + + if (setlocale(LC_ALL, "") == NULL) { + fprintf(stderr, "invalid locale.\n"); + exit(1); + } mypid = getpid(); From owner-svn-src-head@freebsd.org Fri Sep 20 19:43:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE57212560E; Fri, 20 Sep 2019 19:43:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Zkfj57xMz4XYc; Fri, 20 Sep 2019 19:43:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 836B729C8; Fri, 20 Sep 2019 19:43:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8KJhfYW048951; Fri, 20 Sep 2019 19:43:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8KJhegB048949; Fri, 20 Sep 2019 19:43:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909201943.x8KJhegB048949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Sep 2019 19:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352559 - in head/stand: forth lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: forth lua X-SVN-Commit-Revision: 352559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 19:43:41 -0000 Author: kevans Date: Fri Sep 20 19:43:40 2019 New Revision: 352559 URL: https://svnweb.freebsd.org/changeset/base/352559 Log: loader: Respect loader_color=YES for serial consoles It's not uncommon these days for the terminals attached to serial consoles to support ANSI escape sequences. However, we assume escape sequences may break some serial consoles and default to not using them when boot_serial or boot_multicons (or if console contains "comconsole" in the forth loader) for broader compatibility. We also have loader_color which can be explicitly set to "NO" to disable the use of ANSI escape sequences. The problem is that loader_color=YES gets ignored when boot_serial=YES or boot_multicons=YES (or when console contains "comconsole" in the forth loader). To fix, the existing default behavior remains unchanged when loader_color is unset, loader_color=NO explicitly disables the use of ANSI escape sequences still, and the change is that loader_color=YES can now be used to explicitly allow ANSI escapes when a serial console is enabled. Submitted by: Ryan Moeller Reviewed by: tsoome (forth), kevans (lua) MFC after: 1 week Sponsored by: iXsystems, Inc. (Ryan) Differential Revision: https://reviews.freebsd.org/D21732 Modified: head/stand/forth/color.4th head/stand/lua/color.lua Modified: head/stand/forth/color.4th ============================================================================== --- head/stand/forth/color.4th Fri Sep 20 17:37:23 2019 (r352558) +++ head/stand/forth/color.4th Fri Sep 20 19:43:40 2019 (r352559) @@ -27,12 +27,14 @@ marker task-color.4th \ This function returns FALSE if the `loader_color' environment variable is set -\ to NO, no, or 0. Otherwise, TRUE is returned (unless booting serial). +\ to NO, no, or 0. It returns TRUE if `loader_color' is set to any other value. +\ If `loader_color' is unset, TRUE is returned (unless booting serial). \ -: loader_color? ( -- N ) +: loader_color? ( -- t ) s" loader_color" getenv dup -1 <> if - + \ `loader_color' is set. + \ Check if it is explicitly disabled. 2dup s" NO" compare-insensitive 0= if 2drop FALSE exit @@ -42,8 +44,12 @@ marker task-color.4th FALSE exit then drop + \ It is enabled. + TRUE + else + \ `loader_color' is unset. + \ Default to using color unless serial boot is active. + drop + boot_serial? 0= then - drop - - boot_serial? if FALSE else TRUE then ; Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Fri Sep 20 17:37:23 2019 (r352558) +++ head/stand/lua/color.lua Fri Sep 20 19:43:40 2019 (r352559) @@ -49,9 +49,7 @@ color.DIM = 2 function color.isEnabled() local c = loader.getenv("loader_color") if c ~= nil then - if c:lower() == "no" or c == "0" then - return false - end + return c:lower() ~= "no" and c ~= "0" end return not core.isSerialBoot() end From owner-svn-src-head@freebsd.org Fri Sep 20 20:47:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A2BE126BF6; Fri, 20 Sep 2019 20:47:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Zm3z284Zz4cR7; Fri, 20 Sep 2019 20:47:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 282C134D2; Fri, 20 Sep 2019 20:47:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8KKlBGV086361; Fri, 20 Sep 2019 20:47:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8KKlAX2086360; Fri, 20 Sep 2019 20:47:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909202047.x8KKlAX2086360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Sep 2019 20:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352564 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 352564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2019 20:47:11 -0000 Author: kevans Date: Fri Sep 20 20:47:10 2019 New Revision: 352564 URL: https://svnweb.freebsd.org/changeset/base/352564 Log: msdosfs: do not deget unlinked denodes When a file is unlinked, the denode is not reclaimed until the last reference is dropped, but the directory entry is immediately up for reuse. This is a problem later when createde goes to grab a denode for the newly created entry -- we search the hash and find a dead denode, then return that without even bumping the reference count and the data later gets truncated when the the last reference to the unlinked file is dropped. This manifested itself as a broken in-place strip(1) on msdosfs. elfcopy will do a sequence incredibly roughly like this: open("/mnt/foo", ...) => fd 3 mmap() unlink("/mnt/foo") open("/mnt/foo", ...) => fd 4 write(4, ...) close(4) close(3) and the resulting file would be truncated, but the write succeeded, as long as a reference to the unlinked file had not been closed. Some archaeology indicates that this bug has likely existed since msdosfs was converted to use vfs_hash instead of a home rolled hash implementation in r143570. Prior to that point, the hashget implementation would do a refcnt check while searching and explicitly only return a denode with de_refcnt != 0. vfs_hash did not yet have the callback that it does today, so this slipped away and did not come back when it later grew that functionality. The comment indicating that we want to skip these denodes has been updated to reflect where this is actually done. My repo-diving session seems to indicate that the refcnt check was likely never actually below the comment, to be pedantic, but instead a detail wrapped up in the hashget implementation since the beginning of its inclusion into FreeBSD. This bug was the cause behind the issue addressed in r352557. Reported by: jhibbits Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21731 Modified: head/sys/fs/msdosfs/msdosfs_denode.c Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Fri Sep 20 19:56:55 2019 (r352563) +++ head/sys/fs/msdosfs/msdosfs_denode.c Fri Sep 20 20:47:10 2019 (r352564) @@ -79,7 +79,7 @@ de_vncmpf(struct vnode *vp, void *arg) a = arg; de = VTODE(vp); - return (de->de_inode != *a); + return (de->de_inode != *a) || (de->de_refcnt <= 0); } /* @@ -124,8 +124,9 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_lon * address of "." entry. For root dir (if not FAT32) use cluster * MSDOSFSROOT, offset MSDOSFSROOT_OFS * - * NOTE: The check for de_refcnt > 0 below insures the denode being - * examined does not represent an unlinked but still open file. + * NOTE: de_vncmpf will explicitly skip any denodes that do not have + * a de_refcnt > 0. This insures that that we do not attempt to use + * a denode that represents an unlinked but still open file. * These files are not to be accessible even when the directory * entry that represented the file happens to be reused while the * deleted file is still open. From owner-svn-src-head@freebsd.org Sat Sep 21 00:17:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8CCBEC2E3; Sat, 21 Sep 2019 00:17:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Zrkr4x2bz3KQ0; Sat, 21 Sep 2019 00:17:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CBD15C86; Sat, 21 Sep 2019 00:17:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8L0HerE008981; Sat, 21 Sep 2019 00:17:40 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8L0HeQ8008980; Sat, 21 Sep 2019 00:17:40 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201909210017.x8L0HeQ8008980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 21 Sep 2019 00:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352567 - head/usr.bin/quota X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/usr.bin/quota X-SVN-Commit-Revision: 352567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 00:17:40 -0000 Author: hrs Date: Sat Sep 21 00:17:40 2019 New Revision: 352567 URL: https://svnweb.freebsd.org/changeset/base/352567 Log: Add a workaround for servers which respond RPC_PROGNOTREGISTERED to a clnt_create() call even when it is actually a program version mismatch. Normally the server is supposed to return RPC_PROGVERSMISMATCH when it supports the specified program but not support the specified version. Some filers return RPC_PROGNOTREGISTERED to RQUOTA v2 calls and FreeBSD does not retry with the old v1 calls. This change fixes this failure scenario. Submitted by: Jian-Bo Liao PR: 236179 Modified: head/usr.bin/quota/quota.c Modified: head/usr.bin/quota/quota.c ============================================================================== --- head/usr.bin/quota/quota.c Fri Sep 20 22:07:59 2019 (r352566) +++ head/usr.bin/quota/quota.c Sat Sep 21 00:17:40 2019 (r352567) @@ -606,7 +606,7 @@ getnfsquota(struct statfs *fst, struct quotause *qup, call_stat = callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS, RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_ext_getquota_args, (char *)&gq_args, (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt); - if (call_stat == RPC_PROGVERSMISMATCH) { + if (call_stat == RPC_PROGVERSMISMATCH || call_stat == RPC_PROGNOTREGISTERED) { if (quotatype == USRQUOTA) { old_gq_args.gqa_pathp = cp + 1; old_gq_args.gqa_uid = id; From owner-svn-src-head@freebsd.org Sat Sep 21 00:44:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E158ECE0E; Sat, 21 Sep 2019 00:44:38 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZsKy35b0z3M3K; Sat, 21 Sep 2019 00:44:38 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EBAF61DD; Sat, 21 Sep 2019 00:44:38 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8L0ic35027188; Sat, 21 Sep 2019 00:44:38 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8L0icEp027187; Sat, 21 Sep 2019 00:44:38 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201909210044.x8L0icEp027187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 21 Sep 2019 00:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352568 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 352568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 00:44:38 -0000 Author: hrs Date: Sat Sep 21 00:44:37 2019 New Revision: 352568 URL: https://svnweb.freebsd.org/changeset/base/352568 Log: Impove wording and move descriptions about locale to LC_CTYPE in the ENVIRONMENT section. Modified: head/usr.bin/top/top.1 Modified: head/usr.bin/top/top.1 ============================================================================== --- head/usr.bin/top/top.1 Sat Sep 21 00:17:40 2019 (r352567) +++ head/usr.bin/top/top.1 Sat Sep 21 00:44:37 2019 (r352568) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd September 20, 2019 +.Dd September 21, 2019 .Dt TOP 1 .Os .Sh NAME @@ -66,6 +66,9 @@ It it useful when you want to watch applications, that puts their status information there. If the real name differs from argv[0], it will be displayed in parenthesis. +Non-printable characters in the command line are +encoded in C-style backslash sequences or +a three digit octal sequences. .It Fl b Use \*(lqbatch\*(rq mode. In this mode, all input from the terminal is @@ -192,10 +195,6 @@ or \*(lqall\*(rq. Boolean flags are toggles. A second specification of any of these options will negate the first. -.Pp -The display of command names changes according to the locale. -If command names displayed in the locale settings are recognized as -non-display characters, they are displayed in three digit octal sequence. .Sh "INTERACTIVE MODE" When .Nm @@ -426,6 +425,12 @@ bytes paged out to swap devices (last interval) .It Ev TOP Default set of arguments to .Nm . +.It Ev LC_CTYPE +The locale to use when displaying the +.Va argv +vector when +.Fl a +flag is specified. .El .Sh SEE ALSO .Xr kill 1 , From owner-svn-src-head@freebsd.org Sat Sep 21 01:30:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80BC2EF500; Sat, 21 Sep 2019 01:30:00 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ZtLJ2Dy5z3PRt; Sat, 21 Sep 2019 01:30:00 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3184B6997; Sat, 21 Sep 2019 01:30:00 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8L1U0Cv050868; Sat, 21 Sep 2019 01:30:00 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8L1Txev050828; Sat, 21 Sep 2019 01:29:59 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201909210129.x8L1Txev050828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 21 Sep 2019 01:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352570 - head/usr.sbin/rpc.statd X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/usr.sbin/rpc.statd X-SVN-Commit-Revision: 352570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 01:30:00 -0000 Author: hrs Date: Sat Sep 21 01:29:59 2019 New Revision: 352570 URL: https://svnweb.freebsd.org/changeset/base/352570 Log: Fix build errors of test.c, which had been broken for a long time. This is a temporary fix and should be converted to a complete test scenarios by using this tool. Modified: head/usr.sbin/rpc.statd/Makefile head/usr.sbin/rpc.statd/test.c Modified: head/usr.sbin/rpc.statd/Makefile ============================================================================== --- head/usr.sbin/rpc.statd/Makefile Sat Sep 21 01:23:08 2019 (r352569) +++ head/usr.sbin/rpc.statd/Makefile Sat Sep 21 01:29:59 2019 (r352570) @@ -20,7 +20,8 @@ sm_inter_svc.c: ${RPCSRC} sm_inter.h: ${RPCSRC} ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} -test: test.c - cc -o test test.c -lrpcsvc +test: test.o + ${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} ${LIBADD:S/^/-l/} +CLEANFILES+= test test.o .include Modified: head/usr.sbin/rpc.statd/test.c ============================================================================== --- head/usr.sbin/rpc.statd/test.c Sat Sep 21 01:23:08 2019 (r352569) +++ head/usr.sbin/rpc.statd/test.c Sat Sep 21 01:29:59 2019 (r352570) @@ -1,14 +1,14 @@ - #ifndef lint static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ #include +#include +#include #include #include - /* Default timeout can be changed using clnt_control() */ static struct timeval TIMEOUT = { 25, 0 }; @@ -20,7 +20,8 @@ sm_stat_1(argp, clnt) static struct sm_stat_res res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_STAT, xdr_sm_name, argp, xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_STAT, (xdrproc_t)xdr_sm_name, argp, + (xdrproc_t)xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -35,7 +36,8 @@ sm_mon_1(argp, clnt) static struct sm_stat_res res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_MON, xdr_mon, argp, xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_MON, (xdrproc_t)xdr_mon, argp, + (xdrproc_t)xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -50,7 +52,8 @@ sm_unmon_1(argp, clnt) static struct sm_stat res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_UNMON, xdr_mon_id, argp, xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_UNMON, (xdrproc_t)xdr_mon_id, argp, + (xdrproc_t)xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -65,7 +68,8 @@ sm_unmon_all_1(argp, clnt) static struct sm_stat res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_UNMON_ALL, xdr_my_id, argp, xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_UNMON_ALL, (xdrproc_t)xdr_my_id, argp, + (xdrproc_t)xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -80,7 +84,8 @@ sm_simu_crash_1(argp, clnt) static char res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_SIMU_CRASH, xdr_void, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_SIMU_CRASH, (xdrproc_t)xdr_void, argp, + (xdrproc_t)xdr_void, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return ((void *)&res); @@ -119,25 +124,20 @@ int main(int argc, char **argv) { /* Hostname given */ struct sm_stat_res *res; - if (res = sm_mon_1(&mon, cli)) - { + + res = sm_mon_1(&mon, cli); + if (res) printf("Success!\n"); - } else - { printf("Fail\n"); - } } else { - if (out = sm_simu_crash_1(&dummy, cli)) - { + out = sm_simu_crash_1(&dummy, cli); + if (out) printf("Success!\n"); - } else - { printf("Fail\n"); - } } return 0; From owner-svn-src-head@freebsd.org Sat Sep 21 12:33:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D1E21229AF; Sat, 21 Sep 2019 12:33:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46b9462cyPz4SSl; Sat, 21 Sep 2019 12:33:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D2D7E426; Sat, 21 Sep 2019 12:33:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LCXghd050009; Sat, 21 Sep 2019 12:33:42 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LCXfIp050007; Sat, 21 Sep 2019 12:33:41 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201909211233.x8LCXfIp050007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 21 Sep 2019 12:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352572 - head/usr.sbin/rpc.statd X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/usr.sbin/rpc.statd X-SVN-Commit-Revision: 352572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 12:33:42 -0000 Author: hrs Date: Sat Sep 21 12:33:41 2019 New Revision: 352572 URL: https://svnweb.freebsd.org/changeset/base/352572 Log: Fix warnings and set WARNS=6. Modified: head/usr.sbin/rpc.statd/Makefile head/usr.sbin/rpc.statd/file.c head/usr.sbin/rpc.statd/statd.c Modified: head/usr.sbin/rpc.statd/Makefile ============================================================================== --- head/usr.sbin/rpc.statd/Makefile Sat Sep 21 01:39:49 2019 (r352571) +++ head/usr.sbin/rpc.statd/Makefile Sat Sep 21 12:33:41 2019 (r352572) @@ -4,9 +4,7 @@ PROG= rpc.statd MAN= rpc.statd.8 SRCS= file.c sm_inter_svc.c sm_inter.h statd.c procs.c -CFLAGS+= -I. -WARNS?= 2 - +CFLAGS+= -I${.OBJDIR} LIBADD= rpcsvc CLEANFILES= sm_inter_svc.c sm_inter.h Modified: head/usr.sbin/rpc.statd/file.c ============================================================================== --- head/usr.sbin/rpc.statd/file.c Sat Sep 21 01:39:49 2019 (r352571) +++ head/usr.sbin/rpc.statd/file.c Sat Sep 21 12:33:41 2019 (r352572) @@ -201,8 +201,8 @@ void init_file(const char *filename) /* defective, re-create from scratch. */ if (!new_file) { - if ((status_file_len < HEADER_LEN) || (status_file_len - < (HEADER_LEN + sizeof(HostInfo) * status_info->noOfHosts)) ) + if ((status_file_len < (off_t)HEADER_LEN) || (status_file_len + < (off_t)(HEADER_LEN + sizeof(HostInfo) * status_info->noOfHosts)) ) { warnx("status file is corrupt"); new_file = TRUE; Modified: head/usr.sbin/rpc.statd/statd.c ============================================================================== --- head/usr.sbin/rpc.statd/statd.c Sat Sep 21 01:39:49 2019 (r352571) +++ head/usr.sbin/rpc.statd/statd.c Sat Sep 21 12:33:41 2019 (r352572) @@ -62,9 +62,9 @@ __FBSDID("$FreeBSD$"); int debug = 0; /* Controls syslog() calls for debug messages */ -char **hosts, *svcport_str = NULL; -int nhosts = 0; -int xcreated = 0; +static char **hosts, *svcport_str = NULL; +static int nhosts = 0; +static int xcreated = 0; static int mallocd_svcport = 0; static int *sock_fd; static int sock_fdcnt; @@ -86,7 +86,8 @@ main(int argc, char **argv) void *nc_handle; in_port_t svcport; int ch, i, s; - char *endptr, **hosts_bak; + char *endptr; + char **hosts_bak; int have_v6 = 1; int maxrec = RPC_MAXDATASIZE; int attempt_cnt, port_len, port_pos, ret; @@ -156,7 +157,7 @@ main(int argc, char **argv) if (hosts == NULL) out_of_mem(); - hosts[0] = "*"; + hosts[0] = strdup("*"); nhosts = 1; } else { hosts_bak = hosts; @@ -172,7 +173,7 @@ main(int argc, char **argv) hosts = hosts_bak; nhosts += 2; - hosts[nhosts - 2] = "::1"; + hosts[nhosts - 2] = strdup("::1"); } else { hosts_bak = realloc(hosts, (nhosts + 1) * sizeof(char *)); if (hosts_bak == NULL) { @@ -186,7 +187,7 @@ main(int argc, char **argv) hosts = hosts_bak; } } - hosts[nhosts - 1] = "127.0.0.1"; + hosts[nhosts - 1] = strdup("127.0.0.1"); } attempt_cnt = 1; From owner-svn-src-head@freebsd.org Sat Sep 21 13:34:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BA37123B96; Sat, 21 Sep 2019 13:34:07 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bBPq1H8lz4VfB; Sat, 21 Sep 2019 13:34:07 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F473EEEE; Sat, 21 Sep 2019 13:34:07 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LDY6E1085804; Sat, 21 Sep 2019 13:34:06 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LDY63O085803; Sat, 21 Sep 2019 13:34:06 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201909211334.x8LDY63O085803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 21 Sep 2019 13:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352574 - head/usr.sbin/rpc.statd X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/usr.sbin/rpc.statd X-SVN-Commit-Revision: 352574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 13:34:07 -0000 Author: hrs Date: Sat Sep 21 13:34:06 2019 New Revision: 352574 URL: https://svnweb.freebsd.org/changeset/base/352574 Log: - Revert WARNS to 2 because of mismatch between (xdrproc_t) and xdr_void(). - Add prototype of from_addr(). Modified: head/usr.sbin/rpc.statd/Makefile head/usr.sbin/rpc.statd/procs.c Modified: head/usr.sbin/rpc.statd/Makefile ============================================================================== --- head/usr.sbin/rpc.statd/Makefile Sat Sep 21 13:00:38 2019 (r352573) +++ head/usr.sbin/rpc.statd/Makefile Sat Sep 21 13:34:06 2019 (r352574) @@ -7,6 +7,9 @@ SRCS= file.c sm_inter_svc.c sm_inter.h statd.c procs.c CFLAGS+= -I${.OBJDIR} LIBADD= rpcsvc +# XXX: mismatch between (xdrproc_t) and xdr_void(). +WARNS?= 2 + CLEANFILES= sm_inter_svc.c sm_inter.h RPCSRC= ${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc/sm_inter.x Modified: head/usr.sbin/rpc.statd/procs.c ============================================================================== --- head/usr.sbin/rpc.statd/procs.c Sat Sep 21 13:00:38 2019 (r352573) +++ head/usr.sbin/rpc.statd/procs.c Sat Sep 21 13:34:06 2019 (r352574) @@ -52,9 +52,10 @@ __FBSDID("$FreeBSD$"); #include "statd.h" +static const char *from_addr(struct sockaddr *); + static const char * -from_addr(saddr) - struct sockaddr *saddr; +from_addr(struct sockaddr *saddr) { static char inet_buf[INET6_ADDRSTRLEN]; From owner-svn-src-head@freebsd.org Sat Sep 21 14:16:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B184125137; Sat, 21 Sep 2019 14:16:38 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bCLt0qpqz4Xyt; Sat, 21 Sep 2019 14:16:38 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0FEDF659; Sat, 21 Sep 2019 14:16:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LEGbfK009999; Sat, 21 Sep 2019 14:16:37 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LEGbKd009998; Sat, 21 Sep 2019 14:16:37 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201909211416.x8LEGbKd009998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sat, 21 Sep 2019 14:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352577 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 352577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 14:16:38 -0000 Author: 0mp (ports committer) Date: Sat Sep 21 14:16:37 2019 New Revision: 352577 URL: https://svnweb.freebsd.org/changeset/base/352577 Log: ascii(7): Add STANDARDS section and update HISTORY section PR: 240727 Submitted by: Gordon Bergling Approved by: src (imp) Event: EuroBSDcon 2019 Modified: head/share/man/man7/ascii.7 Modified: head/share/man/man7/ascii.7 ============================================================================== --- head/share/man/man7/ascii.7 Sat Sep 21 14:06:16 2019 (r352576) +++ head/share/man/man7/ascii.7 Sat Sep 21 14:16:37 2019 (r352577) @@ -28,7 +28,7 @@ .\" @(#)ascii.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 30, 2017 +.Dd September 21, 2019 .Dt ASCII 7 .Os .Sh NAME @@ -146,8 +146,15 @@ ESC ; [ { 11011 .Bl -tag -width /usr/share/misc/ascii -compact .It Pa /usr/share/misc/ascii .El +.Sh STANDARDS +.Rs +.%T Information Systems - Coded Character Sets - 7-Bit American National\ + Standard Code for Information Interchange (7-Bit ASCII) +.%R INCITS 4-1986[R2017] +.%Q InterNational Committee for Information Technology Standards +.Re .Sh HISTORY An .Nm manual page appeared in -.At v7 . +.At v2 . From owner-svn-src-head@freebsd.org Sat Sep 21 15:01:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2AC2126AC0; Sat, 21 Sep 2019 15:01:12 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bDLJ1Hh0z4bvD; Sat, 21 Sep 2019 15:01:12 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FC86FE25; Sat, 21 Sep 2019 15:01:12 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LF1Bf4038298; Sat, 21 Sep 2019 15:01:11 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LF1BvL038297; Sat, 21 Sep 2019 15:01:11 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201909211501.x8LF1BvL038297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sat, 21 Sep 2019 15:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352578 - head/usr.bin/jot X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/jot X-SVN-Commit-Revision: 352578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 15:01:12 -0000 Author: 0mp (ports committer) Date: Sat Sep 21 15:01:11 2019 New Revision: 352578 URL: https://svnweb.freebsd.org/changeset/base/352578 Log: jot.1: Explain default argument values more precisely The way jot(1) defaults missing arguments doesn't match the behaviour described in the manpage, which states that with fewer than 3 arguments missing values are supplied from left to right. In fact, with one or two arguments, the last (s which is step size or seed) defaults to 1 (or -1 if begin and end specify a descending range), and then omitted arguments are set to default starting with the leftmost until three arguments are available. This is why `jot 2 1000` prints 1000 and 1001 instead of 1000 and 100. PR: 135475 Submitted by: Jonathan McKeown Approved by: doc (bcr) Differential Revision: https://reviews.freebsd.org/D21736 Event: EuroBSDcon 2019 Modified: head/usr.bin/jot/jot.1 Modified: head/usr.bin/jot/jot.1 ============================================================================== --- head/usr.bin/jot/jot.1 Sat Sep 21 14:16:37 2019 (r352577) +++ head/usr.bin/jot/jot.1 Sat Sep 21 15:01:11 2019 (r352578) @@ -28,7 +28,7 @@ .\" @(#)jot.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 7, 2015 +.Dd September 21, 2019 .Dt JOT 1 .Os .Sh NAME @@ -108,14 +108,16 @@ Any three of these arguments determines the fourth. If four are specified and the given and computed values of .Ar reps conflict, the lower value is used. -If fewer than three are specified, defaults are assigned -left to right, except for +If one or two are specified, defaults are assigned +starting with .Ar s , -which assumes a default of 1 or -1 if both +which assumes a default of 1 (or -1 if .Ar begin and .Ar end -are given. +specify a descending range). +Then the default values are assigned to the leftmost omitted arguments until +three arguments are set. .Pp Defaults for the four arguments are, respectively, 100, 1, 100, and 1, except that when random data are requested, From owner-svn-src-head@freebsd.org Sat Sep 21 15:38:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FFE0127A9B; Sat, 21 Sep 2019 15:38:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bF8w6gkPz4fqD; Sat, 21 Sep 2019 15:38:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C841E18574; Sat, 21 Sep 2019 15:38:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LFc8jg059767; Sat, 21 Sep 2019 15:38:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LFc82r059766; Sat, 21 Sep 2019 15:38:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909211538.x8LFc82r059766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Sep 2019 15:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352579 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 15:38:09 -0000 Author: mav Date: Sat Sep 21 15:38:08 2019 New Revision: 352579 URL: https://svnweb.freebsd.org/changeset/base/352579 Log: Allocate callout wheel from the respective memory domain. MFC after: 1 week Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sat Sep 21 15:01:11 2019 (r352578) +++ head/sys/kern/kern_timeout.c Sat Sep 21 15:38:08 2019 (r352579) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -325,8 +326,9 @@ callout_cpu_init(struct callout_cpu *cc, int cpu) mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE); SLIST_INIT(&cc->cc_callfree); cc->cc_inited = 1; - cc->cc_callwheel = malloc(sizeof(struct callout_list) * callwheelsize, - M_CALLOUT, M_WAITOK); + cc->cc_callwheel = malloc_domainset(sizeof(struct callout_list) * + callwheelsize, M_CALLOUT, + DOMAINSET_PREF(pcpu_find(cpu)->pc_domain), M_WAITOK); for (i = 0; i < callwheelsize; i++) LIST_INIT(&cc->cc_callwheel[i]); TAILQ_INIT(&cc->cc_expireq); From owner-svn-src-head@freebsd.org Sat Sep 21 17:54:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1838412B0B0; Sat, 21 Sep 2019 17:54:43 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bJBV6hW7z3K9G; Sat, 21 Sep 2019 17:54:42 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5DE019E8C; Sat, 21 Sep 2019 17:54:42 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LHsgZS042670; Sat, 21 Sep 2019 17:54:42 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LHsgpV042669; Sat, 21 Sep 2019 17:54:42 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201909211754.x8LHsgpV042669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Sat, 21 Sep 2019 17:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352580 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 352580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 17:54:43 -0000 Author: sef Date: Sat Sep 21 17:54:42 2019 New Revision: 352580 URL: https://svnweb.freebsd.org/changeset/base/352580 Log: Fix a regression introduced in r344601, and work properly with the -v and -n options. PR: 240640 Reported by: Andriy Gapon Reviewed by: avg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21709 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sat Sep 21 15:38:08 2019 (r352579) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sat Sep 21 17:54:42 2019 (r352580) @@ -1289,13 +1289,11 @@ dump_snapshot(zfs_handle_t *zhp, void *arg) fromorigin = sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate); - if (sdd->progress && sdd->dryrun) { + if (sdd->verbose || sdd->progress) { (void) estimate_ioctl(zhp, sdd->prevsnap_obj, fromorigin, flags, &size); sdd->size += size; - } - if (sdd->verbose) { send_print_verbose(fout, zhp->zfs_name, sdd->prevsnap[0] ? sdd->prevsnap : NULL, size, sdd->parsable); @@ -1663,7 +1661,7 @@ zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *fla fromname = name; } - if (flags->progress) { + if (flags->progress || flags->verbose) { error = lzc_send_space(zhp->zfs_name, fromname, lzc_flags, &size); if (error == 0) @@ -1933,7 +1931,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, cons sdd.cleanup_fd = -1; sdd.snapholds = NULL; } - if (flags->progress || sdd.snapholds != NULL) { + if (flags->progress || flags->verbose || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output * or to gather snapshot hold's before generating any data, From owner-svn-src-head@freebsd.org Sat Sep 21 17:59:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7903312B390; Sat, 21 Sep 2019 17:59:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bJHm2bfXz3KYT; Sat, 21 Sep 2019 17:59:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D1CE19EA0; Sat, 21 Sep 2019 17:59:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LHxGmD043117; Sat, 21 Sep 2019 17:59:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LHxGtd043116; Sat, 21 Sep 2019 17:59:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909211759.x8LHxGtd043116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 Sep 2019 17:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352581 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 352581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 17:59:16 -0000 Author: kib Date: Sat Sep 21 17:59:15 2019 New Revision: 352581 URL: https://svnweb.freebsd.org/changeset/base/352581 Log: amd64 pmap: Fix formats for 64bit addresses in ddb and sysctl output. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21737 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Sep 21 17:54:42 2019 (r352580) +++ head/sys/amd64/amd64/pmap.c Sat Sep 21 17:59:15 2019 (r352581) @@ -10030,13 +10030,13 @@ sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_ mode = "WC"; break; default: - printf("%s: unknown PAT mode %#x for range %#016lx-%#016lx\n", + printf("%s: unknown PAT mode %#x for range 0x%016lx-0x%016lx\n", __func__, i, range->sva, eva); mode = "??"; break; } - sbuf_printf(sb, "%#016lx-%#016lx r%c%c%c%c %s %d %d %d\n", + sbuf_printf(sb, "0x%016lx-0x%016lx r%c%c%c%c %s %d %d %d\n", range->sva, eva, (range->attrs & X86_PG_RW) != 0 ? 'w' : '-', (range->attrs & pg_nx) != 0 ? '-' : 'x', @@ -10271,25 +10271,25 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) PG_V = pmap_valid_bit(pmap); pml4 = pmap_pml4e(pmap, va); - db_printf("VA %#016lx pml4e %#016lx", va, *pml4); + db_printf("VA 0x%016lx pml4e 0x%016lx", va, *pml4); if ((*pml4 & PG_V) == 0) { db_printf("\n"); return; } pdp = pmap_pml4e_to_pdpe(pml4, va); - db_printf(" pdpe %#016lx", *pdp); + db_printf(" pdpe 0x%016lx", *pdp); if ((*pdp & PG_V) == 0 || (*pdp & PG_PS) != 0) { db_printf("\n"); return; } pde = pmap_pdpe_to_pde(pdp, va); - db_printf(" pde %#016lx", *pde); + db_printf(" pde 0x%016lx", *pde); if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0) { db_printf("\n"); return; } pte = pmap_pde_to_pte(pde, va); - db_printf(" pte %#016lx\n", *pte); + db_printf(" pte 0x%016lx\n", *pte); } DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap) From owner-svn-src-head@freebsd.org Sat Sep 21 18:00:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCC4912B455; Sat, 21 Sep 2019 18:00:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bJK34zPdz3KjG; Sat, 21 Sep 2019 18:00:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E2DB19EAD; Sat, 21 Sep 2019 18:00:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LI0NaI043287; Sat, 21 Sep 2019 18:00:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LI0Np1043286; Sat, 21 Sep 2019 18:00:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909211800.x8LI0Np1043286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 Sep 2019 18:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352582 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 18:00:23 -0000 Author: kib Date: Sat Sep 21 18:00:23 2019 New Revision: 352582 URL: https://svnweb.freebsd.org/changeset/base/352582 Log: Make non-ASLR pie base tunable. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Sep 21 17:59:15 2019 (r352581) +++ head/sys/kern/imgact_elf.c Sat Sep 21 18:00:23 2019 (r352582) @@ -135,6 +135,11 @@ SYSCTL_INT(_kern_elf32, OID_AUTO, read_exec, CTLFLAG_R "enable execution from readable segments"); #endif +static u_long __elfN(pie_base) = ET_DYN_LOAD_ADDR; +SYSCTL_ULONG(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base, + CTLFLAG_RWTUN, &__elfN(pie_base), 0, + "PIE load base without randomization"); + SYSCTL_NODE(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, aslr, CTLFLAG_RW, 0, ""); #define ASLR_NODE_OID __CONCAT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), _aslr) @@ -1146,13 +1151,13 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i if (baddr == 0) { if ((sv->sv_flags & SV_ASLR) == 0 || (fctl0 & NT_FREEBSD_FCTL_ASLR_DISABLE) != 0) - et_dyn_addr = ET_DYN_LOAD_ADDR; + et_dyn_addr = __elfN(pie_base); else if ((__elfN(pie_aslr_enabled) && (imgp->proc->p_flag2 & P2_ASLR_DISABLE) == 0) || (imgp->proc->p_flag2 & P2_ASLR_ENABLE) != 0) et_dyn_addr = ET_DYN_ADDR_RAND; else - et_dyn_addr = ET_DYN_LOAD_ADDR; + et_dyn_addr = __elfN(pie_base); } } From owner-svn-src-head@freebsd.org Sat Sep 21 19:05:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E768C12CC41; Sat, 21 Sep 2019 19:05:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bKmL5nw4z3PJ9; Sat, 21 Sep 2019 19:05:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA0121AB9F; Sat, 21 Sep 2019 19:05:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LJ5cm8086094; Sat, 21 Sep 2019 19:05:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LJ5ceX086093; Sat, 21 Sep 2019 19:05:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909211905.x8LJ5ceX086093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 21 Sep 2019 19:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352583 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 19:05:39 -0000 Author: mjg Date: Sat Sep 21 19:05:38 2019 New Revision: 352583 URL: https://svnweb.freebsd.org/changeset/base/352583 Log: lockprof: use CPUFOREACH and drop always false lp_cpu NULL checks Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_lock.c Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Sat Sep 21 18:00:23 2019 (r352582) +++ head/sys/kern/subr_lock.c Sat Sep 21 19:05:38 2019 (r352583) @@ -287,7 +287,7 @@ lock_prof_init(void *arg) { int cpu; - for (cpu = 0; cpu <= mp_maxid; cpu++) { + CPU_FOREACH(cpu) { lp_cpu[cpu] = malloc(sizeof(*lp_cpu[cpu]), M_DEVBUF, M_WAITOK | M_ZERO); lock_prof_init_type(&lp_cpu[cpu]->lpc_types[0]); @@ -330,14 +330,14 @@ lock_prof_reset(void) * before we zero the structures. Some items may still be linked * into per-thread lists as well. */ - for (cpu = 0; cpu <= mp_maxid; cpu++) { + CPU_FOREACH(cpu) { lpc = lp_cpu[cpu]; for (i = 0; i < LPROF_CACHE_SIZE; i++) { LIST_REMOVE(&lpc->lpc_types[0].lpt_objs[i], lpo_link); LIST_REMOVE(&lpc->lpc_types[1].lpt_objs[i], lpo_link); } } - for (cpu = 0; cpu <= mp_maxid; cpu++) { + CPU_FOREACH(cpu) { lpc = lp_cpu[cpu]; bzero(lpc, sizeof(*lpc)); lock_prof_init_type(&lpc->lpc_types[0]); @@ -378,9 +378,7 @@ lock_prof_sum(struct lock_prof *match, struct lock_pro dst->class = match->class; dst->name = match->name; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (lp_cpu[cpu] == NULL) - continue; + CPU_FOREACH(cpu) { type = &lp_cpu[cpu]->lpc_types[spin]; SLIST_FOREACH(l, &type->lpt_hash[hash], link) { if (l->ticks == t) @@ -399,7 +397,6 @@ lock_prof_sum(struct lock_prof *match, struct lock_pro dst->cnt_contest_locking += l->cnt_contest_locking; } } - } static void @@ -438,9 +435,7 @@ dump_lock_prof_stats(SYSCTL_HANDLER_ARGS) lock_prof_enable = 0; quiesce_all_cpus("profstat", 0); t = ticks; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (lp_cpu[cpu] == NULL) - continue; + CPU_FOREACH(cpu) { lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[0], sb, 0, t); lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[1], sb, 1, t); } From owner-svn-src-head@freebsd.org Sat Sep 21 19:51:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 724A512DDA1; Sat, 21 Sep 2019 19:51:58 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bLnp2WTZz3wYk; Sat, 21 Sep 2019 19:51:58 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AA011B432; Sat, 21 Sep 2019 19:51:58 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LJpwhp012347; Sat, 21 Sep 2019 19:51:58 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LJpwDd012346; Sat, 21 Sep 2019 19:51:58 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201909211951.x8LJpwDd012346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 21 Sep 2019 19:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352584 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 352584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 19:51:58 -0000 Author: alc Date: Sat Sep 21 19:51:57 2019 New Revision: 352584 URL: https://svnweb.freebsd.org/changeset/base/352584 Log: In case a translation fault on the kernel address space occurs from within a critical section, we must perform a lock-free check on the faulting address. Reported by: andrew Reviewed by: andrew, markj X-MFC with: r350579 Differential Revision: https://reviews.freebsd.org/D21685 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sat Sep 21 19:05:38 2019 (r352583) +++ head/sys/arm64/arm64/pmap.c Sat Sep 21 19:51:57 2019 (r352584) @@ -5810,23 +5810,33 @@ pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far) case ISS_DATA_DFSC_TF_L1: case ISS_DATA_DFSC_TF_L2: case ISS_DATA_DFSC_TF_L3: - PMAP_LOCK(pmap); - /* Ask the MMU to check the address */ - intr = intr_disable(); - if (pmap == kernel_pmap) - par = arm64_address_translate_s1e1r(far); - else - par = arm64_address_translate_s1e0r(far); - intr_restore(intr); - PMAP_UNLOCK(pmap); - /* - * If the translation was successful the address was invalid - * due to a break-before-make sequence. We can unlock and - * return success to the trap handler. + * Retry the translation. A break-before-make sequence can + * produce a transient fault. */ - if (PAR_SUCCESS(par)) - rv = KERN_SUCCESS; + if (pmap == kernel_pmap) { + /* + * The translation fault may have occurred within a + * critical section. Therefore, we must check the + * address without acquiring the kernel pmap's lock. + */ + if (pmap_kextract(far) != 0) + rv = KERN_SUCCESS; + } else { + PMAP_LOCK(pmap); + /* Ask the MMU to check the address. */ + intr = intr_disable(); + par = arm64_address_translate_s1e0r(far); + intr_restore(intr); + PMAP_UNLOCK(pmap); + + /* + * If the translation was successful, then we can + * return success to the trap handler. + */ + if (PAR_SUCCESS(par)) + rv = KERN_SUCCESS; + } break; } From owner-svn-src-head@freebsd.org Sat Sep 21 20:03:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0862C12E1BA; Sat, 21 Sep 2019 20:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bM2s6Smnz3x7S; Sat, 21 Sep 2019 20:03:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C267E1B657; Sat, 21 Sep 2019 20:03:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LK3Hq7021502; Sat, 21 Sep 2019 20:03:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LK3HFK021501; Sat, 21 Sep 2019 20:03:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909212003.x8LK3HFK021501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 Sep 2019 20:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352585 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 20:03:18 -0000 Author: kib Date: Sat Sep 21 20:03:17 2019 New Revision: 352585 URL: https://svnweb.freebsd.org/changeset/base/352585 Log: kern.elf{32,64}.pie_base sysctl: enforce page alignment. Requested by: rstone Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Sep 21 19:51:57 2019 (r352584) +++ head/sys/kern/imgact_elf.c Sat Sep 21 20:03:17 2019 (r352585) @@ -136,8 +136,24 @@ SYSCTL_INT(_kern_elf32, OID_AUTO, read_exec, CTLFLAG_R #endif static u_long __elfN(pie_base) = ET_DYN_LOAD_ADDR; -SYSCTL_ULONG(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base, - CTLFLAG_RWTUN, &__elfN(pie_base), 0, +static int +sysctl_pie_base(SYSCTL_HANDLER_ARGS) +{ + u_long val; + int error; + + val = __elfN(pie_base); + error = sysctl_handle_long(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if ((val & PAGE_MASK) != 0) + return (EINVAL); + __elfN(pie_base) = val; + return (0); +} +SYSCTL_PROC(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base, + CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, + sysctl_pie_base, "LU", "PIE load base without randomization"); SYSCTL_NODE(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, aslr, CTLFLAG_RW, 0,