From owner-svn-src-head@freebsd.org Sun Oct 9 03:20:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC09EAF7D05; Sun, 9 Oct 2016 03:20:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8815C1A40; Sun, 9 Oct 2016 03:20:59 +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 u993KwZS008495; Sun, 9 Oct 2016 03:20:58 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u993KwVD008493; Sun, 9 Oct 2016 03:20:58 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201610090320.u993KwVD008493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 9 Oct 2016 03:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306896 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 03:20:59 -0000 Author: allanjude Date: Sun Oct 9 03:20:58 2016 New Revision: 306896 URL: https://svnweb.freebsd.org/changeset/base/306896 Log: Fix spurious white space introduced in r301059 r301059 accidently introduced a subtle change for point to point interfaces where an extra space is inserted before the netmask. This can cause issues for scripts that parse ifconfig output. Submitted by: Kevin Bowling Reviewed by: hiren MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8199 Modified: head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Sun Oct 9 01:58:29 2016 (r306895) +++ head/sbin/ifconfig/af_inet.c Sun Oct 9 03:20:58 2016 (r306896) @@ -88,7 +88,7 @@ in_status(int s __unused, const struct i sin = (struct sockaddr_in *)ifa->ifa_dstaddr; if (sin == NULL) sin = &null_sin; - printf(" --> %s ", inet_ntoa(sin->sin_addr)); + printf(" --> %s", inet_ntoa(sin->sin_addr)); } sin = (struct sockaddr_in *)ifa->ifa_netmask; Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Sun Oct 9 01:58:29 2016 (r306895) +++ head/sbin/ifconfig/af_inet6.c Sun Oct 9 03:20:58 2016 (r306896) @@ -237,7 +237,7 @@ in6_status(int s __unused, const struct if (error != 0) inet_ntop(AF_INET6, &sin->sin6_addr, addr_buf, sizeof(addr_buf)); - printf(" --> %s ", addr_buf); + printf(" --> %s", addr_buf); } } From owner-svn-src-head@freebsd.org Sun Oct 9 04:29:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1298CC076A4; Sun, 9 Oct 2016 04:29:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7A89FE7; Sun, 9 Oct 2016 04:29:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u994TgPY031695; Sun, 9 Oct 2016 04:29:42 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u994TgoR031694; Sun, 9 Oct 2016 04:29:42 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610090429.u994TgoR031694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 9 Oct 2016 04:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306897 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 04:29:44 -0000 Author: gonzo Date: Sun Oct 9 04:29:42 2016 New Revision: 306897 URL: https://svnweb.freebsd.org/changeset/base/306897 Log: Fix MSI allocation for NVidia Tegra - Fix range check - Due to checking found value in for(;;) condition irq after loop was always + 1 from actually found slot and wrong entry was marked as used which lead to returning slot 0 for all requests. Modified: head/sys/arm/nvidia/tegra_pcie.c Modified: head/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- head/sys/arm/nvidia/tegra_pcie.c Sun Oct 9 03:20:58 2016 (r306896) +++ head/sys/arm/nvidia/tegra_pcie.c Sun Oct 9 04:29:42 2016 (r306897) @@ -710,7 +710,7 @@ tegra_pcib_msi_alloc_msi(device_t dev, d mtx_lock(&sc->mtx); found = false; - for (irq = 0; irq < TEGRA_PCIB_MAX_MSI && !found; irq++) { + for (irq = 0; (irq + count - 1) < TEGRA_PCIB_MAX_MSI; irq++) { /* Start on an aligned interrupt */ if ((irq & (maxcount - 1)) != 0) continue; @@ -719,20 +719,17 @@ tegra_pcib_msi_alloc_msi(device_t dev, d found = true; /* Check this range is valid */ - for (end_irq = irq; end_irq != irq + count - 1; end_irq++) { - /* No free interrupts */ - if (end_irq == (TEGRA_PCIB_MAX_MSI - 1)) { - found = false; - break; - } - + for (end_irq = irq; end_irq < irq + count; end_irq++) { /* This is already used */ - if ((sc->isrcs[irq].flags & TEGRA_FLAG_MSI_USED) == + if ((sc->isrcs[end_irq].flags & TEGRA_FLAG_MSI_USED) == TEGRA_FLAG_MSI_USED) { found = false; break; } } + + if (found) + break; } /* Not enough interrupts were found */ From owner-svn-src-head@freebsd.org Sun Oct 9 04:36:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44133C0782D; Sun, 9 Oct 2016 04:36:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B14B785; Sun, 9 Oct 2016 04:36:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u994afge035455; Sun, 9 Oct 2016 04:36:41 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u994afTR035454; Sun, 9 Oct 2016 04:36:41 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610090436.u994afTR035454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 9 Oct 2016 04:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306898 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 04:36:42 -0000 Author: gonzo Date: Sun Oct 9 04:36:40 2016 New Revision: 306898 URL: https://svnweb.freebsd.org/changeset/base/306898 Log: Fix release MSI method for NVidia Tegra PCI controller Modified: head/sys/arm/nvidia/tegra_pcie.c Modified: head/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- head/sys/arm/nvidia/tegra_pcie.c Sun Oct 9 04:29:42 2016 (r306897) +++ head/sys/arm/nvidia/tegra_pcie.c Sun Oct 9 04:36:40 2016 (r306898) @@ -762,15 +762,15 @@ tegra_pcib_msi_release_msi(device_t dev, sc = device_get_softc(dev); mtx_lock(&sc->mtx); for (i = 0; i < count; i++) { - ti = (struct tegra_pcib_irqsrc *)isrc; + ti = (struct tegra_pcib_irqsrc *)isrc[i]; KASSERT((ti->flags & TEGRA_FLAG_MSI_USED) == TEGRA_FLAG_MSI_USED, ("%s: Trying to release an unused MSI-X interrupt", __func__)); ti->flags &= ~TEGRA_FLAG_MSI_USED; - mtx_unlock(&sc->mtx); } + mtx_unlock(&sc->mtx); return (0); } From owner-svn-src-head@freebsd.org Sun Oct 9 04:37:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 403D8C0787F; Sun, 9 Oct 2016 04:37:23 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA88901; Sun, 9 Oct 2016 04:37:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u994bMFb035523; Sun, 9 Oct 2016 04:37:22 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u994bMOP035522; Sun, 9 Oct 2016 04:37:22 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610090437.u994bMOP035522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 9 Oct 2016 04:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306899 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 04:37:23 -0000 Author: gonzo Date: Sun Oct 9 04:37:21 2016 New Revision: 306899 URL: https://svnweb.freebsd.org/changeset/base/306899 Log: Fix release MSI method for ARM GIC Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Sun Oct 9 04:36:40 2016 (r306898) +++ head/sys/arm/arm/gic.c Sun Oct 9 04:37:21 2016 (r306899) @@ -1474,15 +1474,15 @@ arm_gicv2m_release_msi(device_t dev, dev mtx_lock(&sc->sc_mutex); for (i = 0; i < count; i++) { - gi = (struct gic_irqsrc *)isrc; + gi = (struct gic_irqsrc *)isrc[i]; KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) == GI_FLAG_MSI_USED, ("%s: Trying to release an unused MSI-X interrupt", __func__)); gi->gi_flags &= ~GI_FLAG_MSI_USED; - mtx_unlock(&sc->sc_mutex); } + mtx_unlock(&sc->sc_mutex); return (0); } From owner-svn-src-head@freebsd.org Sun Oct 9 10:21:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FD8FC07373; Sun, 9 Oct 2016 10:21:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 416C024C; Sun, 9 Oct 2016 10:21:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u99ALS0K066768; Sun, 9 Oct 2016 10:21:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u99ALSDM066767; Sun, 9 Oct 2016 10:21:28 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201610091021.u99ALSDM066767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 9 Oct 2016 10:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306900 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 10:21:29 -0000 Author: avos Date: Sun Oct 9 10:21:28 2016 New Revision: 306900 URL: https://svnweb.freebsd.org/changeset/base/306900 Log: iwm: add missing 'Rx errors' counter incrementation. Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun Oct 9 04:37:21 2016 (r306899) +++ head/sys/dev/iwm/if_iwm.c Sun Oct 9 10:21:28 2016 (r306900) @@ -2918,14 +2918,14 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, device_printf(sc->sc_dev, "dsp size out of range [0,20]: %d\n", phy_info->cfg_phy_cnt); - return; + goto fail; } if (!(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_CRC_OK) || !(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_OVERRUN_OK)) { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "Bad CRC or FIFO: 0x%08X.\n", rx_pkt_status); - return; /* drop */ + goto fail; } if (sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_RX_ENERGY_API) { @@ -2947,7 +2947,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, if (iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { device_printf(sc->sc_dev, "%s: unable to add more buffers\n", __func__); - return; + goto fail; } IWM_DPRINTF(sc, IWM_DEBUG_RECV, @@ -3020,6 +3020,10 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, ieee80211_input_mimo_all(ic, m, &rxs); } IWM_LOCK(sc); + + return; + +fail: counter_u64_add(ic->ic_ierrors, 1); } static int From owner-svn-src-head@freebsd.org Sun Oct 9 10:24:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4817C074C5; Sun, 9 Oct 2016 10:24:11 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB386C2; Sun, 9 Oct 2016 10:24:11 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u99AOAmK067510; Sun, 9 Oct 2016 10:24:10 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u99AOAOC067506; Sun, 9 Oct 2016 10:24:10 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201610091024.u99AOAOC067506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 9 Oct 2016 10:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306901 - in head/sys: arm/arm arm/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 10:24:11 -0000 Author: mmel Date: Sun Oct 9 10:24:10 2016 New Revision: 306901 URL: https://svnweb.freebsd.org/changeset/base/306901 Log: ARM: Split identify_arm_cpu() into ARMv4 and ARMv6 variant. On ARMv6, be more verbose about supported CPU features and/or optional instructions. Added: head/sys/arm/arm/identcpu-v4.c - copied, changed from r306899, head/sys/arm/arm/identcpu.c head/sys/arm/arm/identcpu-v6.c - copied, changed from r306900, head/sys/arm/arm/identcpu.c Deleted: head/sys/arm/arm/identcpu.c Modified: head/sys/arm/arm/cpuinfo.c head/sys/arm/include/cpuinfo.h head/sys/conf/files.arm Modified: head/sys/arm/arm/cpuinfo.c ============================================================================== --- head/sys/arm/arm/cpuinfo.c Sun Oct 9 10:21:28 2016 (r306900) +++ head/sys/arm/arm/cpuinfo.c Sun Oct 9 10:24:10 2016 (r306901) @@ -111,6 +111,10 @@ cpuinfo_init(void) /* Not yet - CBAR only exist on ARM SMP Cortex A CPUs cpuinfo.cbar = cp15_cbar_get(); */ + if (CPU_CT_FORMAT(cpuinfo.ctr) == CPU_CT_ARMV7) { + cpuinfo.ccsidr = cp15_ccsidr_get(); + cpuinfo.clidr = cp15_clidr_get(); + } /* Test if revidr is implemented */ if (cpuinfo.revidr == cpuinfo.midr) @@ -165,6 +169,7 @@ cpuinfo_get_actlr_modifier(uint32_t *act if (cpuinfo.implementer == CPU_IMPLEMENTER_ARM) { switch (cpuinfo.part_number) { + case CPU_ARCH_CORTEX_A73: case CPU_ARCH_CORTEX_A72: case CPU_ARCH_CORTEX_A57: case CPU_ARCH_CORTEX_A53: Copied and modified: head/sys/arm/arm/identcpu-v4.c (from r306899, head/sys/arm/arm/identcpu.c) ============================================================================== --- head/sys/arm/arm/identcpu.c Sun Oct 9 04:37:21 2016 (r306899, copy source) +++ head/sys/arm/arm/identcpu-v4.c Sun Oct 9 10:24:10 2016 (r306901) @@ -45,9 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include #include #include @@ -169,39 +166,6 @@ const struct cpuidtab cpuids[] = { { CPU_ID_ARM1026EJS, CPU_CLASS_ARM10EJ, "ARM1026EJ-S", generic_steppings }, - { CPU_ID_CORTEXA5, CPU_CLASS_CORTEXA, "Cortex A5", - generic_steppings }, - { CPU_ID_CORTEXA7, CPU_CLASS_CORTEXA, "Cortex A7", - generic_steppings }, - { CPU_ID_CORTEXA8R1, CPU_CLASS_CORTEXA, "Cortex A8-r1", - generic_steppings }, - { CPU_ID_CORTEXA8R2, CPU_CLASS_CORTEXA, "Cortex A8-r2", - generic_steppings }, - { CPU_ID_CORTEXA8R3, CPU_CLASS_CORTEXA, "Cortex A8-r3", - generic_steppings }, - { CPU_ID_CORTEXA9R1, CPU_CLASS_CORTEXA, "Cortex A9-r1", - generic_steppings }, - { CPU_ID_CORTEXA9R2, CPU_CLASS_CORTEXA, "Cortex A9-r2", - generic_steppings }, - { CPU_ID_CORTEXA9R3, CPU_CLASS_CORTEXA, "Cortex A9-r3", - generic_steppings }, - { CPU_ID_CORTEXA9R4, CPU_CLASS_CORTEXA, "Cortex A9-r4", - generic_steppings }, - { CPU_ID_CORTEXA12R0, CPU_CLASS_CORTEXA, "Cortex A12-r0", - generic_steppings }, - { CPU_ID_CORTEXA15R0, CPU_CLASS_CORTEXA, "Cortex A15-r0", - generic_steppings }, - { CPU_ID_CORTEXA15R1, CPU_CLASS_CORTEXA, "Cortex A15-r1", - generic_steppings }, - { CPU_ID_CORTEXA15R2, CPU_CLASS_CORTEXA, "Cortex A15-r2", - generic_steppings }, - { CPU_ID_CORTEXA15R3, CPU_CLASS_CORTEXA, "Cortex A15-r3", - generic_steppings }, - { CPU_ID_KRAIT300R0, CPU_CLASS_KRAIT, "Krait 300-r0", - generic_steppings }, - { CPU_ID_KRAIT300R1, CPU_CLASS_KRAIT, "Krait 300-r1", - generic_steppings }, - { CPU_ID_80200, CPU_CLASS_XSCALE, "i80200", xscale_steppings }, @@ -248,24 +212,11 @@ const struct cpuidtab cpuids[] = { { CPU_ID_IXP435, CPU_CLASS_XSCALE, "IXP435", ixp425_steppings }, - { CPU_ID_ARM1136JS, CPU_CLASS_ARM11J, "ARM1136J-S", - generic_steppings }, - { CPU_ID_ARM1136JSR1, CPU_CLASS_ARM11J, "ARM1136J-S R1", - generic_steppings }, - { CPU_ID_ARM1176JZS, CPU_CLASS_ARM11J, "ARM1176JZ-S", - generic_steppings }, - { CPU_ID_MV88FR131, CPU_CLASS_MARVELL, "Feroceon 88FR131", generic_steppings }, { CPU_ID_MV88FR571_VD, CPU_CLASS_MARVELL, "Feroceon 88FR571-VD", generic_steppings }, - { CPU_ID_MV88SV581X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV581x", - generic_steppings }, - { CPU_ID_ARM_88SV581X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV581x", - generic_steppings }, - { CPU_ID_MV88SV584X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV584x", - generic_steppings }, { 0, CPU_CLASS_NONE, NULL, NULL } }; @@ -282,10 +233,7 @@ const struct cpu_classtab cpu_classes[] { "ARM9EJ-S", "CPU_ARM9E" }, /* CPU_CLASS_ARM9EJS */ { "ARM10E", "CPU_ARM10" }, /* CPU_CLASS_ARM10E */ { "ARM10EJ", "CPU_ARM10" }, /* CPU_CLASS_ARM10EJ */ - { "Cortex-A", "CPU_CORTEXA" }, /* CPU_CLASS_CORTEXA */ - { "Krait", "CPU_KRAIT" }, /* CPU_CLASS_KRAIT */ { "XScale", "CPU_XSCALE_..." }, /* CPU_CLASS_XSCALE */ - { "ARM11J", "CPU_ARM11" }, /* CPU_CLASS_ARM11J */ { "Marvell", "CPU_MARVELL" }, /* CPU_CLASS_MARVELL */ }; @@ -344,50 +292,11 @@ u_int cpu_pfr(int num) return (feat); } -static -void identify_armv7(void) -{ - u_int feature; - - printf("Supported features:"); - /* Get Processor Feature Register 0 */ - feature = cpu_pfr(0); - - if (feature & ARM_PFR0_ARM_ISA_MASK) - printf(" ARM_ISA"); - - if (feature & ARM_PFR0_THUMB2) - printf(" THUMB2"); - else if (feature & ARM_PFR0_THUMB) - printf(" THUMB"); - - if (feature & ARM_PFR0_JAZELLE_MASK) - printf(" JAZELLE"); - - if (feature & ARM_PFR0_THUMBEE_MASK) - printf(" THUMBEE"); - - - /* Get Processor Feature Register 1 */ - feature = cpu_pfr(1); - - if (feature & ARM_PFR1_ARMV4_MASK) - printf(" ARMv4"); - - if (feature & ARM_PFR1_SEC_EXT_MASK) - printf(" Security_Ext"); - - if (feature & ARM_PFR1_MICROCTRL_MASK) - printf(" M_profile"); - - printf("\n"); -} - void identify_arm_cpu(void) { - u_int cpuid, reg, size, sets, ways; - u_int8_t type, linesize, ctrl; + u_int cpuid; + u_int8_t ctrl; int i; ctrl = cpu_get_control(); @@ -413,43 +322,38 @@ identify_arm_cpu(void) printf(" "); - if ((cpuid & CPU_ID_ARCH_MASK) == CPU_ID_CPUID_SCHEME) { - identify_armv7(); - } else { - if (ctrl & CPU_CONTROL_BEND_ENABLE) - printf(" Big-endian"); - else - printf(" Little-endian"); - - switch (cpu_class) { - case CPU_CLASS_ARM9TDMI: - case CPU_CLASS_ARM9ES: - case CPU_CLASS_ARM9EJS: - case CPU_CLASS_ARM10E: - case CPU_CLASS_ARM10EJ: - case CPU_CLASS_XSCALE: - case CPU_CLASS_ARM11J: - case CPU_CLASS_MARVELL: - print_enadis(ctrl & CPU_CONTROL_DC_ENABLE, "DC"); - print_enadis(ctrl & CPU_CONTROL_IC_ENABLE, "IC"); + if (ctrl & CPU_CONTROL_BEND_ENABLE) + printf(" Big-endian"); + else + printf(" Little-endian"); + + switch (cpu_class) { + case CPU_CLASS_ARM9TDMI: + case CPU_CLASS_ARM9ES: + case CPU_CLASS_ARM9EJS: + case CPU_CLASS_ARM10E: + case CPU_CLASS_ARM10EJ: + case CPU_CLASS_XSCALE: + case CPU_CLASS_MARVELL: + print_enadis(ctrl & CPU_CONTROL_DC_ENABLE, "DC"); + print_enadis(ctrl & CPU_CONTROL_IC_ENABLE, "IC"); #ifdef CPU_XSCALE_81342 - print_enadis(ctrl & CPU_CONTROL_L2_ENABLE, "L2"); + print_enadis(ctrl & CPU_CONTROL_L2_ENABLE, "L2"); #endif #if defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) - i = sheeva_control_ext(0, 0); - print_enadis(i & MV_WA_ENABLE, "WA"); - print_enadis(i & MV_DC_STREAM_ENABLE, "DC streaming"); - printf("\n "); - print_enadis((i & MV_BTB_DISABLE) == 0, "BTB"); - print_enadis(i & MV_L2_ENABLE, "L2"); - print_enadis((i & MV_L2_PREFETCH_DISABLE) == 0, - "L2 prefetch"); - printf("\n "); + i = sheeva_control_ext(0, 0); + print_enadis(i & MV_WA_ENABLE, "WA"); + print_enadis(i & MV_DC_STREAM_ENABLE, "DC streaming"); + printf("\n "); + print_enadis((i & MV_BTB_DISABLE) == 0, "BTB"); + print_enadis(i & MV_L2_ENABLE, "L2"); + print_enadis((i & MV_L2_PREFETCH_DISABLE) == 0, + "L2 prefetch"); + printf("\n "); #endif - break; - default: - break; - } + break; + default: + break; } print_enadis(ctrl & CPU_CONTROL_WBUF_ENABLE, "WB"); @@ -461,74 +365,22 @@ identify_arm_cpu(void) print_enadis(ctrl & CPU_CONTROL_BPRD_ENABLE, "branch prediction"); printf("\n"); - if (arm_cache_level) { - printf("LoUU:%d LoC:%d LoUIS:%d \n", CPU_CLIDR_LOUU(arm_cache_level) + 1, - arm_cache_loc + 1, CPU_CLIDR_LOUIS(arm_cache_level) + 1); - i = 0; - while (((type = CPU_CLIDR_CTYPE(arm_cache_level, i)) != 0) && i < 7) { - printf("Cache level %d: \n", i + 1); - if (type == CACHE_DCACHE || type == CACHE_UNI_CACHE || - type == CACHE_SEP_CACHE) { - reg = arm_cache_type[2 * i]; - ways = CPUV7_CT_xSIZE_ASSOC(reg) + 1; - sets = CPUV7_CT_xSIZE_SET(reg) + 1; - linesize = 1 << (CPUV7_CT_xSIZE_LEN(reg) + 4); - size = (ways * sets * linesize) / 1024; - - if (type == CACHE_UNI_CACHE) - printf(" %dKB/%dB %d-way unified cache", size, linesize,ways); - else - printf(" %dKB/%dB %d-way data cache", size, linesize, ways); - if (reg & CPUV7_CT_CTYPE_WT) - printf(" WT"); - if (reg & CPUV7_CT_CTYPE_WB) - printf(" WB"); - if (reg & CPUV7_CT_CTYPE_RA) - printf(" Read-Alloc"); - if (reg & CPUV7_CT_CTYPE_WA) - printf(" Write-Alloc"); - printf("\n"); - } - - if (type == CACHE_ICACHE || type == CACHE_SEP_CACHE) { - reg = arm_cache_type[(2 * i) + 1]; - - ways = CPUV7_CT_xSIZE_ASSOC(reg) + 1; - sets = CPUV7_CT_xSIZE_SET(reg) + 1; - linesize = 1 << (CPUV7_CT_xSIZE_LEN(reg) + 4); - size = (ways * sets * linesize) / 1024; - - printf(" %dKB/%dB %d-way instruction cache", size, linesize, ways); - if (reg & CPUV7_CT_CTYPE_WT) - printf(" WT"); - if (reg & CPUV7_CT_CTYPE_WB) - printf(" WB"); - if (reg & CPUV7_CT_CTYPE_RA) - printf(" Read-Alloc"); - if (reg & CPUV7_CT_CTYPE_WA) - printf(" Write-Alloc"); - printf("\n"); - } - i++; - } + /* Print cache info. */ + if (arm_picache_line_size == 0 && arm_pdcache_line_size == 0) + return; + + if (arm_pcache_unified) { + printf(" %dKB/%dB %d-way %s unified cache\n", + arm_pdcache_size / 1024, + arm_pdcache_line_size, arm_pdcache_ways, + wtnames[arm_pcache_type]); } else { - /* Print cache info. */ - if (arm_picache_line_size == 0 && arm_pdcache_line_size == 0) - return; - - if (arm_pcache_unified) { - printf(" %dKB/%dB %d-way %s unified cache\n", - arm_pdcache_size / 1024, - arm_pdcache_line_size, arm_pdcache_ways, - wtnames[arm_pcache_type]); - } else { - printf(" %dKB/%dB %d-way instruction cache\n", - arm_picache_size / 1024, - arm_picache_line_size, arm_picache_ways); - printf(" %dKB/%dB %d-way %s data cache\n", - arm_pdcache_size / 1024, - arm_pdcache_line_size, arm_pdcache_ways, - wtnames[arm_pcache_type]); - } + printf(" %dKB/%dB %d-way instruction cache\n", + arm_picache_size / 1024, + arm_picache_line_size, arm_picache_ways); + printf(" %dKB/%dB %d-way %s data cache\n", + arm_pdcache_size / 1024, + arm_pdcache_line_size, arm_pdcache_ways, + wtnames[arm_pcache_type]); } } Copied and modified: head/sys/arm/arm/identcpu-v6.c (from r306900, head/sys/arm/arm/identcpu.c) ============================================================================== --- head/sys/arm/arm/identcpu.c Sun Oct 9 10:21:28 2016 (r306900, copy source) +++ head/sys/arm/arm/identcpu-v6.c Sun Oct 9 10:24:10 2016 (r306901) @@ -45,16 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include #include #include #include -#include - -#include #include char machine[] = "arm"; @@ -62,473 +56,305 @@ char machine[] = "arm"; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); -static const char * const generic_steppings[16] = { - "rev 0", "rev 1", "rev 2", "rev 3", - "rev 4", "rev 5", "rev 6", "rev 7", - "rev 8", "rev 9", "rev 10", "rev 11", - "rev 12", "rev 13", "rev 14", "rev 15", -}; - -static const char * const xscale_steppings[16] = { - "step A-0", "step A-1", "step B-0", "step C-0", - "step D-0", "rev 5", "rev 6", "rev 7", - "rev 8", "rev 9", "rev 10", "rev 11", - "rev 12", "rev 13", "rev 14", "rev 15", -}; - -static const char * const i80219_steppings[16] = { - "step A-0", "rev 1", "rev 2", "rev 3", - "rev 4", "rev 5", "rev 6", "rev 7", - "rev 8", "rev 9", "rev 10", "rev 11", - "rev 12", "rev 13", "rev 14", "rev 15", -}; - -static const char * const i80321_steppings[16] = { - "step A-0", "step B-0", "rev 2", "rev 3", - "rev 4", "rev 5", "rev 6", "rev 7", - "rev 8", "rev 9", "rev 10", "rev 11", - "rev 12", "rev 13", "rev 14", "rev 15", -}; - -static const char * const i81342_steppings[16] = { - "step A-0", "rev 1", "rev 2", "rev 3", - "rev 4", "rev 5", "rev 6", "rev 7", - "rev 8", "rev 9", "rev 10", "rev 11", - "rev 12", "rev 13", "rev 14", "rev 15", -}; +static char hw_buf[81]; +static int hw_buf_idx; +static bool hw_buf_newline; + +static struct { + int implementer; + int part_number; + char *impl_name; + char *core_name; +} cpu_names[] = { + {CPU_IMPLEMENTER_ARM, CPU_ARCH_ARM1176, "ARM", "ARM1176"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A5 , "ARM", "Cortex-A5"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A7 , "ARM", "Cortex-A7"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A8 , "ARM", "Cortex-A8"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A9 , "ARM", "Cortex-A9"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A12, "ARM", "Cortex-A12"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A15, "ARM", "Cortex-A15"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A17, "ARM", "Cortex-A17"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A53, "ARM", "Cortex-A53"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A57, "ARM", "Cortex-A57"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A72, "ARM", "Cortex-A72"}, + {CPU_IMPLEMENTER_ARM, CPU_ARCH_CORTEX_A73, "ARM", "Cortex-A73"}, -/* Steppings for PXA2[15]0 */ -static const char * const pxa2x0_steppings[16] = { - "step A-0", "step A-1", "step B-0", "step B-1", - "step B-2", "step C-0", "rev 6", "rev 7", - "rev 8", "rev 9", "rev 10", "rev 11", - "rev 12", "rev 13", "rev 14", "rev 15", -}; + {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_581, "Marwell", "PJ4 v7"}, + {CPU_IMPLEMENTER_MRVL, CPU_ARCH_SHEEVA_584, "Marwell", "PJ4MP v7"}, -/* Steppings for PXA255/26x. - * rev 5: PXA26x B0, rev 6: PXA255 A0 - */ -static const char * const pxa255_steppings[16] = { - "rev 0", "rev 1", "rev 2", "step A-0", - "rev 4", "step B-0", "step A-0", "rev 7", - "rev 8", "rev 9", "rev 10", "rev 11", - "rev 12", "rev 13", "rev 14", "rev 15", + {CPU_IMPLEMENTER_QCOM, CPU_ARCH_KRAIT_300, "Qualcomm", "Krait 300"}, }; -/* Stepping for PXA27x */ -static const char * const pxa27x_steppings[16] = { - "step A-0", "step A-1", "step B-0", "step B-1", - "step C-0", "rev 5", "rev 6", "rev 7", - "rev 8", "rev 9", "rev 10", "rev 11", - "rev 12", "rev 13", "rev 14", "rev 15", -}; - -static const char * const ixp425_steppings[16] = { - "step 0 (A0)", "rev 1 (ARMv5TE)", "rev 2", "rev 3", - "rev 4", "rev 5", "rev 6", "rev 7", - "rev 8", "rev 9", "rev 10", "rev 11", - "rev 12", "rev 13", "rev 14", "rev 15", -}; - -struct cpuidtab { - u_int32_t cpuid; - enum cpu_class cpu_class; - const char *cpu_name; - const char * const *cpu_steppings; -}; - -const struct cpuidtab cpuids[] = { - { CPU_ID_ARM920T, CPU_CLASS_ARM9TDMI, "ARM920T", - generic_steppings }, - { CPU_ID_ARM920T_ALT, CPU_CLASS_ARM9TDMI, "ARM920T", - generic_steppings }, - { CPU_ID_ARM922T, CPU_CLASS_ARM9TDMI, "ARM922T", - generic_steppings }, - { CPU_ID_ARM926EJS, CPU_CLASS_ARM9EJS, "ARM926EJ-S", - generic_steppings }, - { CPU_ID_ARM940T, CPU_CLASS_ARM9TDMI, "ARM940T", - generic_steppings }, - { CPU_ID_ARM946ES, CPU_CLASS_ARM9ES, "ARM946E-S", - generic_steppings }, - { CPU_ID_ARM966ES, CPU_CLASS_ARM9ES, "ARM966E-S", - generic_steppings }, - { CPU_ID_ARM966ESR1, CPU_CLASS_ARM9ES, "ARM966E-S", - generic_steppings }, - { CPU_ID_FA526, CPU_CLASS_ARM9TDMI, "FA526", - generic_steppings }, - { CPU_ID_FA626TE, CPU_CLASS_ARM9ES, "FA626TE", - generic_steppings }, - - { CPU_ID_TI925T, CPU_CLASS_ARM9TDMI, "TI ARM925T", - generic_steppings }, - - { CPU_ID_ARM1020E, CPU_CLASS_ARM10E, "ARM1020E", - generic_steppings }, - { CPU_ID_ARM1022ES, CPU_CLASS_ARM10E, "ARM1022E-S", - generic_steppings }, - { CPU_ID_ARM1026EJS, CPU_CLASS_ARM10EJ, "ARM1026EJ-S", - generic_steppings }, - - { CPU_ID_CORTEXA5, CPU_CLASS_CORTEXA, "Cortex A5", - generic_steppings }, - { CPU_ID_CORTEXA7, CPU_CLASS_CORTEXA, "Cortex A7", - generic_steppings }, - { CPU_ID_CORTEXA8R1, CPU_CLASS_CORTEXA, "Cortex A8-r1", - generic_steppings }, - { CPU_ID_CORTEXA8R2, CPU_CLASS_CORTEXA, "Cortex A8-r2", - generic_steppings }, - { CPU_ID_CORTEXA8R3, CPU_CLASS_CORTEXA, "Cortex A8-r3", - generic_steppings }, - { CPU_ID_CORTEXA9R1, CPU_CLASS_CORTEXA, "Cortex A9-r1", - generic_steppings }, - { CPU_ID_CORTEXA9R2, CPU_CLASS_CORTEXA, "Cortex A9-r2", - generic_steppings }, - { CPU_ID_CORTEXA9R3, CPU_CLASS_CORTEXA, "Cortex A9-r3", - generic_steppings }, - { CPU_ID_CORTEXA9R4, CPU_CLASS_CORTEXA, "Cortex A9-r4", - generic_steppings }, - { CPU_ID_CORTEXA12R0, CPU_CLASS_CORTEXA, "Cortex A12-r0", - generic_steppings }, - { CPU_ID_CORTEXA15R0, CPU_CLASS_CORTEXA, "Cortex A15-r0", - generic_steppings }, - { CPU_ID_CORTEXA15R1, CPU_CLASS_CORTEXA, "Cortex A15-r1", - generic_steppings }, - { CPU_ID_CORTEXA15R2, CPU_CLASS_CORTEXA, "Cortex A15-r2", - generic_steppings }, - { CPU_ID_CORTEXA15R3, CPU_CLASS_CORTEXA, "Cortex A15-r3", - generic_steppings }, - { CPU_ID_KRAIT300R0, CPU_CLASS_KRAIT, "Krait 300-r0", - generic_steppings }, - { CPU_ID_KRAIT300R1, CPU_CLASS_KRAIT, "Krait 300-r1", - generic_steppings }, - - { CPU_ID_80200, CPU_CLASS_XSCALE, "i80200", - xscale_steppings }, - - { CPU_ID_80321_400, CPU_CLASS_XSCALE, "i80321 400MHz", - i80321_steppings }, - { CPU_ID_80321_600, CPU_CLASS_XSCALE, "i80321 600MHz", - i80321_steppings }, - { CPU_ID_80321_400_B0, CPU_CLASS_XSCALE, "i80321 400MHz", - i80321_steppings }, - { CPU_ID_80321_600_B0, CPU_CLASS_XSCALE, "i80321 600MHz", - i80321_steppings }, - - { CPU_ID_81342, CPU_CLASS_XSCALE, "i81342", - i81342_steppings }, - - { CPU_ID_80219_400, CPU_CLASS_XSCALE, "i80219 400MHz", - i80219_steppings }, - { CPU_ID_80219_600, CPU_CLASS_XSCALE, "i80219 600MHz", - i80219_steppings }, - - { CPU_ID_PXA27X, CPU_CLASS_XSCALE, "PXA27x", - pxa27x_steppings }, - { CPU_ID_PXA250A, CPU_CLASS_XSCALE, "PXA250", - pxa2x0_steppings }, - { CPU_ID_PXA210A, CPU_CLASS_XSCALE, "PXA210", - pxa2x0_steppings }, - { CPU_ID_PXA250B, CPU_CLASS_XSCALE, "PXA250", - pxa2x0_steppings }, - { CPU_ID_PXA210B, CPU_CLASS_XSCALE, "PXA210", - pxa2x0_steppings }, - { CPU_ID_PXA250C, CPU_CLASS_XSCALE, "PXA255", - pxa255_steppings }, - { CPU_ID_PXA210C, CPU_CLASS_XSCALE, "PXA210", - pxa2x0_steppings }, - - { CPU_ID_IXP425_533, CPU_CLASS_XSCALE, "IXP425 533MHz", - ixp425_steppings }, - { CPU_ID_IXP425_400, CPU_CLASS_XSCALE, "IXP425 400MHz", - ixp425_steppings }, - { CPU_ID_IXP425_266, CPU_CLASS_XSCALE, "IXP425 266MHz", - ixp425_steppings }, - - /* XXX ixp435 steppings? */ - { CPU_ID_IXP435, CPU_CLASS_XSCALE, "IXP435", - ixp425_steppings }, - - { CPU_ID_ARM1136JS, CPU_CLASS_ARM11J, "ARM1136J-S", - generic_steppings }, - { CPU_ID_ARM1136JSR1, CPU_CLASS_ARM11J, "ARM1136J-S R1", - generic_steppings }, - { CPU_ID_ARM1176JZS, CPU_CLASS_ARM11J, "ARM1176JZ-S", - generic_steppings }, - - { CPU_ID_MV88FR131, CPU_CLASS_MARVELL, "Feroceon 88FR131", - generic_steppings }, - - { CPU_ID_MV88FR571_VD, CPU_CLASS_MARVELL, "Feroceon 88FR571-VD", - generic_steppings }, - { CPU_ID_MV88SV581X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV581x", - generic_steppings }, - { CPU_ID_ARM_88SV581X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV581x", - generic_steppings }, - { CPU_ID_MV88SV584X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV584x", - generic_steppings }, - - { 0, CPU_CLASS_NONE, NULL, NULL } -}; - -struct cpu_classtab { - const char *class_name; - const char *class_option; -}; - -const struct cpu_classtab cpu_classes[] = { - { "unknown", NULL }, /* CPU_CLASS_NONE */ - { "ARM9TDMI", "CPU_ARM9TDMI" }, /* CPU_CLASS_ARM9TDMI */ - { "ARM9E-S", "CPU_ARM9E" }, /* CPU_CLASS_ARM9ES */ - { "ARM9EJ-S", "CPU_ARM9E" }, /* CPU_CLASS_ARM9EJS */ - { "ARM10E", "CPU_ARM10" }, /* CPU_CLASS_ARM10E */ - { "ARM10EJ", "CPU_ARM10" }, /* CPU_CLASS_ARM10EJ */ - { "Cortex-A", "CPU_CORTEXA" }, /* CPU_CLASS_CORTEXA */ - { "Krait", "CPU_KRAIT" }, /* CPU_CLASS_KRAIT */ - { "XScale", "CPU_XSCALE_..." }, /* CPU_CLASS_XSCALE */ - { "ARM11J", "CPU_ARM11" }, /* CPU_CLASS_ARM11J */ - { "Marvell", "CPU_MARVELL" }, /* CPU_CLASS_MARVELL */ -}; - -/* - * Report the type of the specified arm processor. This uses the generic and - * arm specific information in the cpu structure to identify the processor. - * The remaining fields in the cpu structure are filled in appropriately. - */ - -static const char * const wtnames[] = { - "write-through", - "write-back", - "write-back", - "**unknown 3**", - "**unknown 4**", - "write-back-locking", /* XXX XScale-specific? */ - "write-back-locking-A", - "write-back-locking-B", - "**unknown 8**", - "**unknown 9**", - "**unknown 10**", - "**unknown 11**", - "**unknown 12**", - "**unknown 13**", - "write-back-locking-C", - "**unknown 15**", -}; static void -print_enadis(int enadis, char *s) +print_v5_cache(void) { + uint32_t isize, dsize; + uint32_t multiplier; + int pcache_type; + int pcache_unified; + int picache_size; + int picache_line_size; + int picache_ways; + int pdcache_size; + int pdcache_line_size; + int pdcache_ways; + + pcache_unified = 0; + picache_size = 0 ; + picache_line_size = 0 ; + picache_ways = 0 ; + pdcache_size = 0; + pdcache_line_size = 0; + pdcache_ways = 0; + + if ((cpuinfo.ctr & CPU_CT_S) == 0) + pcache_unified = 1; + + /* + * If you want to know how this code works, go read the ARM ARM. + */ + pcache_type = CPU_CT_CTYPE(cpuinfo.ctr); + + if (pcache_unified == 0) { + isize = CPU_CT_ISIZE(cpuinfo.ctr); + multiplier = (isize & CPU_CT_xSIZE_M) ? 3 : 2; + picache_line_size = 1U << (CPU_CT_xSIZE_LEN(isize) + 3); + if (CPU_CT_xSIZE_ASSOC(isize) == 0) { + if (isize & CPU_CT_xSIZE_M) + picache_line_size = 0; /* not present */ + else + picache_ways = 1; + } else { + picache_ways = multiplier << + (CPU_CT_xSIZE_ASSOC(isize) - 1); + } + picache_size = multiplier << (CPU_CT_xSIZE_SIZE(isize) + 8); + } - printf(" %s %sabled", s, (enadis == 0) ? "dis" : "en"); -} + dsize = CPU_CT_DSIZE(cpuinfo.ctr); + multiplier = (dsize & CPU_CT_xSIZE_M) ? 3 : 2; + pdcache_line_size = 1U << (CPU_CT_xSIZE_LEN(dsize) + 3); + if (CPU_CT_xSIZE_ASSOC(dsize) == 0) { + if (dsize & CPU_CT_xSIZE_M) + pdcache_line_size = 0; /* not present */ + else + pdcache_ways = 1; + } else { + pdcache_ways = multiplier << + (CPU_CT_xSIZE_ASSOC(dsize) - 1); + } + pdcache_size = multiplier << (CPU_CT_xSIZE_SIZE(dsize) + 8); -enum cpu_class cpu_class = CPU_CLASS_NONE; -u_int cpu_pfr(int num) -{ - u_int feat; + /* Print cache info. */ + if (picache_line_size == 0 && pdcache_line_size == 0) + return; - switch (num) { - case 0: - __asm __volatile("mrc p15, 0, %0, c0, c1, 0" - : "=r" (feat)); - break; - case 1: - __asm __volatile("mrc p15, 0, %0, c0, c1, 1" - : "=r" (feat)); - break; - default: - panic("Processor Feature Register %d not implemented", num); - break; + if (pcache_unified) { + printf(" %dKB/%dB %d-way %s unified cache\n", + pdcache_size / 1024, + pdcache_line_size, pdcache_ways, + pcache_type == 0 ? "WT" : "WB"); + } else { + printf(" %dKB/%dB %d-way instruction cache\n", + picache_size / 1024, + picache_line_size, picache_ways); + printf(" %dKB/%dB %d-way %s data cache\n", + pdcache_size / 1024, + pdcache_line_size, pdcache_ways, + pcache_type == 0 ? "WT" : "WB"); } - - return (feat); } -static -void identify_armv7(void) +static void +print_v7_cache(void ) { - u_int feature; - - printf("Supported features:"); - /* Get Processor Feature Register 0 */ - feature = cpu_pfr(0); - - if (feature & ARM_PFR0_ARM_ISA_MASK) - printf(" ARM_ISA"); - - if (feature & ARM_PFR0_THUMB2) - printf(" THUMB2"); - else if (feature & ARM_PFR0_THUMB) - printf(" THUMB"); - - if (feature & ARM_PFR0_JAZELLE_MASK) - printf(" JAZELLE"); + uint32_t type, val, size, sets, ways, linesize; + int i; - if (feature & ARM_PFR0_THUMBEE_MASK) - printf(" THUMBEE"); + printf("LoUU:%d LoC:%d LoUIS:%d \n", + CPU_CLIDR_LOUU(cpuinfo.clidr) + 1, + CPU_CLIDR_LOC(cpuinfo.clidr) + 1, + CPU_CLIDR_LOUIS(cpuinfo.clidr) + 1); + + for (i = 0; i < 7; i++) { + type = CPU_CLIDR_CTYPE(cpuinfo.clidr, i); + if (type == 0) + break; + printf("Cache level %d:\n", i + 1); + if (type == CACHE_DCACHE || type == CACHE_UNI_CACHE || + type == CACHE_SEP_CACHE) { + cp15_csselr_set(i << 1); + val = cp15_ccsidr_get(); + ways = CPUV7_CT_xSIZE_ASSOC(val) + 1; + sets = CPUV7_CT_xSIZE_SET(val) + 1; + linesize = 1 << (CPUV7_CT_xSIZE_LEN(val) + 4); + size = (ways * sets * linesize) / 1024; + + if (type == CACHE_UNI_CACHE) + printf(" %dKB/%dB %d-way unified cache", + size, linesize,ways); + else + printf(" %dKB/%dB %d-way data cache", + size, linesize, ways); + if (val & CPUV7_CT_CTYPE_WT) + printf(" WT"); + if (val & CPUV7_CT_CTYPE_WB) + printf(" WB"); + if (val & CPUV7_CT_CTYPE_RA) + printf(" Read-Alloc"); + if (val & CPUV7_CT_CTYPE_WA) + printf(" Write-Alloc"); + printf("\n"); + } + if (type == CACHE_ICACHE || type == CACHE_SEP_CACHE) { + cp15_csselr_set(i << 1 | 1); + val = cp15_ccsidr_get(); + ways = CPUV7_CT_xSIZE_ASSOC(val) + 1; + sets = CPUV7_CT_xSIZE_SET(val) + 1; + linesize = 1 << (CPUV7_CT_xSIZE_LEN(val) + 4); + size = (ways * sets * linesize) / 1024; + printf(" %dKB/%dB %d-way instruction cache", + size, linesize, ways); + if (val & CPUV7_CT_CTYPE_WT) + printf(" WT"); + if (val & CPUV7_CT_CTYPE_WB) + printf(" WB"); + if (val & CPUV7_CT_CTYPE_RA) + printf(" Read-Alloc"); + if (val & CPUV7_CT_CTYPE_WA) + printf(" Write-Alloc"); + printf("\n"); + } + } + cp15_csselr_set(0); +} - /* Get Processor Feature Register 1 */ - feature = cpu_pfr(1); +static void +add_cap(char *cap) +{ + int len; - if (feature & ARM_PFR1_ARMV4_MASK) - printf(" ARMv4"); + len = strlen(cap); - if (feature & ARM_PFR1_SEC_EXT_MASK) - printf(" Security_Ext"); + if ((hw_buf_idx + len + 2) >= 79) { + printf("%s,\n", hw_buf); + hw_buf_idx = 0; + hw_buf_newline = true; + } + if (hw_buf_newline) + hw_buf_idx += sprintf(hw_buf + hw_buf_idx, " "); + else + hw_buf_idx += sprintf(hw_buf + hw_buf_idx, ", "); + hw_buf_newline = false; - if (feature & ARM_PFR1_MICROCTRL_MASK) - printf(" M_profile"); - printf("\n"); + hw_buf_idx += sprintf(hw_buf + hw_buf_idx, "%s", cap); } void identify_arm_cpu(void) { - u_int cpuid, reg, size, sets, ways; - u_int8_t type, linesize, ctrl; int i; + u_int val; - ctrl = cpu_get_control(); - cpuid = cpu_ident(); - - if (cpuid == 0) { - printf("Processor failed probe - no CPU ID\n"); - return; - } - - for (i = 0; cpuids[i].cpuid != 0; i++) - if (cpuids[i].cpuid == (cpuid & CPU_ID_CPU_MASK)) { - cpu_class = cpuids[i].cpu_class; - printf("CPU: %s %s (%s core)\n", - cpuids[i].cpu_name, - cpuids[i].cpu_steppings[cpuid & - CPU_ID_REVISION_MASK], - cpu_classes[cpu_class].class_name); + /* + * CPU + */ + for(i = 0; i < nitems(cpu_names); i++) { + if (cpu_names[i].implementer == cpuinfo.implementer && + cpu_names[i].part_number == cpuinfo.part_number) { + printf("CPU: %s %s r%dp%d (ECO: 0x%08X)\n", + cpu_names[i].impl_name, cpu_names[i].core_name, + cpuinfo.revision, cpuinfo.patch, + cpuinfo.midr != cpuinfo.revidr ? + cpuinfo.revidr : 0); break; } - if (cpuids[i].cpuid == 0) - printf("unknown CPU (ID = 0x%x)\n", cpuid); - printf(" "); - - if ((cpuid & CPU_ID_ARCH_MASK) == CPU_ID_CPUID_SCHEME) { - identify_armv7(); - } else { - if (ctrl & CPU_CONTROL_BEND_ENABLE) - printf(" Big-endian"); - else - printf(" Little-endian"); + } + if (i >= nitems(cpu_names)) + printf("unknown CPU (ID = 0x%x)\n", cpuinfo.midr); - switch (cpu_class) { - case CPU_CLASS_ARM9TDMI: - case CPU_CLASS_ARM9ES: - case CPU_CLASS_ARM9EJS: - case CPU_CLASS_ARM10E: - case CPU_CLASS_ARM10EJ: - case CPU_CLASS_XSCALE: - case CPU_CLASS_ARM11J: - case CPU_CLASS_MARVELL: - print_enadis(ctrl & CPU_CONTROL_DC_ENABLE, "DC"); - print_enadis(ctrl & CPU_CONTROL_IC_ENABLE, "IC"); -#ifdef CPU_XSCALE_81342 - print_enadis(ctrl & CPU_CONTROL_L2_ENABLE, "L2"); -#endif -#if defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) - i = sheeva_control_ext(0, 0); - print_enadis(i & MV_WA_ENABLE, "WA"); - print_enadis(i & MV_DC_STREAM_ENABLE, "DC streaming"); - printf("\n "); - print_enadis((i & MV_BTB_DISABLE) == 0, "BTB"); - print_enadis(i & MV_L2_ENABLE, "L2"); - print_enadis((i & MV_L2_PREFETCH_DISABLE) == 0, - "L2 prefetch"); - printf("\n "); -#endif - break; - default: - break; - } + printf("CPU Features: \n"); + hw_buf_idx = 0; + hw_buf_newline = true; + + val = (cpuinfo.mpidr >> 4)& 0xF; + if (cpuinfo.mpidr & (1 << 31U)) + add_cap("Multiprocessing"); + val = (cpuinfo.id_pfr0 >> 4)& 0xF; + if (val == 1) + add_cap("Thumb"); + else if (val == 3) + add_cap("Thumb2"); + + val = (cpuinfo.id_pfr1 >> 4)& 0xF; + if (val == 1 || val == 2) + add_cap("Security"); + + val = (cpuinfo.id_pfr1 >> 12)& 0xF; + if (val == 1) + add_cap("Virtualization"); + + val = (cpuinfo.id_pfr1 >> 16)& 0xF; + if (val == 1) + add_cap("Generic Timer"); + + val = (cpuinfo.id_mmfr0 >> 0)& 0xF; + if (val == 2) { + add_cap("VMSAv6"); + } else if (val >= 3) { + add_cap("VMSAv7"); + if (val >= 4) + add_cap("PXN"); + if (val >= 5) + add_cap("LPAE"); } - print_enadis(ctrl & CPU_CONTROL_WBUF_ENABLE, "WB"); - if (ctrl & CPU_CONTROL_LABT_ENABLE) - printf(" LABT"); + val = (cpuinfo.id_mmfr3 >> 20)& 0xF; + if (val == 1) + add_cap("Coherent Walk"); + + if (hw_buf_idx != 0) + printf("%s\n", hw_buf); + + printf("Optional instructions: \n"); + hw_buf_idx = 0; + hw_buf_newline = true; + val = (cpuinfo.id_isar0 >> 24)& 0xF; + if (val == 1) + add_cap("SDIV/UDIV (Thumb)"); + else if (val == 2) + add_cap("SDIV/UDIV"); + + val = (cpuinfo.id_isar2 >> 20)& 0xF; + if (val == 1 || val == 2) + add_cap("UMULL"); + + val = (cpuinfo.id_isar2 >> 16)& 0xF; + if (val == 1 || val == 2 || val == 3) + add_cap("SMULL"); + + val = (cpuinfo.id_isar2 >> 12)& 0xF; + if (val == 1) + add_cap("MLA"); + + val = (cpuinfo.id_isar3 >> 4)& 0xF; + if (val == 1) + add_cap("SIMD"); + else if (val == 3) + add_cap("SIMD(ext)"); + if (hw_buf_idx != 0) + printf("%s\n", hw_buf); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Oct 9 10:25:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A297C07538; Sun, 9 Oct 2016 10:25:53 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA547897; Sun, 9 Oct 2016 10:25:52 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u99APqhF067646; Sun, 9 Oct 2016 10:25:52 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u99APl98067605; Sun, 9 Oct 2016 10:25:47 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201610091025.u99APl98067605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 9 Oct 2016 10:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306902 - in head/sys/arm: allwinner amlogic/aml8726 at91 broadcom/bcm2835 freescale/imx lpc mv rockchip ti ti/am335x ti/omap4 ti/twl xscale/i8134x xscale/ixp425 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 10:25:53 -0000 Author: mmel Date: Sun Oct 9 10:25:47 2016 New Revision: 306902 URL: https://svnweb.freebsd.org/changeset/base/306902 Log: ARM: Remove unused includes. MFC after: 1 week Modified: head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/aw_wdog.c head/sys/arm/amlogic/aml8726/aml8726_machdep.c head/sys/arm/amlogic/aml8726/aml8726_wdt.c head/sys/arm/at91/at91_aic.c head/sys/arm/at91/at91_cfata.c head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_pit.c head/sys/arm/at91/at91_pmc.c head/sys/arm/at91/at91_st.c head/sys/arm/broadcom/bcm2835/bcm2835_dma.c head/sys/arm/broadcom/bcm2835/bcm2835_spi.c head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c head/sys/arm/freescale/imx/imx51_ipuv3.c head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c head/sys/arm/lpc/lpc_fb.c head/sys/arm/lpc/lpc_gpio.c head/sys/arm/lpc/lpc_mmc.c head/sys/arm/lpc/lpc_spi.c head/sys/arm/mv/mpic.c head/sys/arm/rockchip/rk30xx_gpio.c head/sys/arm/rockchip/rk30xx_wdog.c head/sys/arm/ti/am335x/am335x_gpio.c head/sys/arm/ti/am335x/am335x_lcd_syscons.c head/sys/arm/ti/am335x/am335x_scm_padconf.c head/sys/arm/ti/omap4/omap4_prcm_clks.c head/sys/arm/ti/ti_cpuid.c head/sys/arm/ti/ti_pinmux.c head/sys/arm/ti/ti_prcm.c head/sys/arm/ti/ti_scm.c head/sys/arm/ti/twl/twl.c head/sys/arm/ti/twl/twl_clks.c head/sys/arm/ti/twl/twl_vreg.c head/sys/arm/xscale/i8134x/i80321_timer.c head/sys/arm/xscale/i8134x/i80321_wdog.c head/sys/arm/xscale/ixp425/avila_ata.c head/sys/arm/xscale/ixp425/ixp425_intr.h head/sys/arm/xscale/ixp425/ixp425_npe.c head/sys/arm/xscale/ixp425/ixp425_qmgr.c head/sys/arm/xscale/ixp425/ixp425_timer.c head/sys/arm/xscale/ixp425/ixp425_wdog.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/allwinner/a10_gpio.c Sun Oct 9 10:25:47 2016 (r306902) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/allwinner/aw_wdog.c ============================================================================== --- head/sys/arm/allwinner/aw_wdog.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/allwinner/aw_wdog.c Sun Oct 9 10:25:47 2016 (r306902) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/amlogic/aml8726/aml8726_machdep.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_machdep.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/amlogic/aml8726/aml8726_machdep.c Sun Oct 9 10:25:47 2016 (r306902) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/amlogic/aml8726/aml8726_wdt.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_wdt.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/amlogic/aml8726/aml8726_wdt.c Sun Oct 9 10:25:47 2016 (r306902) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/at91/at91_aic.c ============================================================================== --- head/sys/arm/at91/at91_aic.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/at91/at91_aic.c Sun Oct 9 10:25:47 2016 (r306902) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/at91/at91_cfata.c ============================================================================== --- head/sys/arm/at91/at91_cfata.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/at91/at91_cfata.c Sun Oct 9 10:25:47 2016 (r306902) @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/at91/at91_mci.c Sun Oct 9 10:25:47 2016 (r306902) @@ -51,8 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/at91/at91_pit.c ============================================================================== --- head/sys/arm/at91/at91_pit.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/at91/at91_pit.c Sun Oct 9 10:25:47 2016 (r306902) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/at91/at91_pmc.c Sun Oct 9 10:25:47 2016 (r306902) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/at91/at91_st.c ============================================================================== --- head/sys/arm/at91/at91_st.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/at91/at91_st.c Sun Oct 9 10:25:47 2016 (r306902) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Sun Oct 9 10:25:47 2016 (r306902) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include "bcm2835_dma.h" #include "bcm2835_vcbus.h" Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sun Oct 9 10:25:47 2016 (r306902) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Sun Oct 9 10:25:47 2016 (r306902) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/freescale/imx/imx51_ipuv3.c Sun Oct 9 10:25:47 2016 (r306902) @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sun Oct 9 10:25:47 2016 (r306902) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/lpc/lpc_fb.c ============================================================================== --- head/sys/arm/lpc/lpc_fb.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/lpc/lpc_fb.c Sun Oct 9 10:25:47 2016 (r306902) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/lpc/lpc_gpio.c ============================================================================== --- head/sys/arm/lpc/lpc_gpio.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/lpc/lpc_gpio.c Sun Oct 9 10:25:47 2016 (r306902) @@ -73,8 +73,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/lpc/lpc_mmc.c ============================================================================== --- head/sys/arm/lpc/lpc_mmc.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/lpc/lpc_mmc.c Sun Oct 9 10:25:47 2016 (r306902) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/lpc/lpc_spi.c ============================================================================== --- head/sys/arm/lpc/lpc_spi.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/lpc/lpc_spi.c Sun Oct 9 10:25:47 2016 (r306902) @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/mv/mpic.c Sun Oct 9 10:25:47 2016 (r306902) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/rockchip/rk30xx_gpio.c Sun Oct 9 10:25:47 2016 (r306902) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/rockchip/rk30xx_wdog.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_wdog.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/rockchip/rk30xx_wdog.c Sun Oct 9 10:25:47 2016 (r306902) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/ti/am335x/am335x_gpio.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_gpio.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/am335x/am335x_gpio.c Sun Oct 9 10:25:47 2016 (r306902) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/ti/am335x/am335x_lcd_syscons.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd_syscons.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/am335x/am335x_lcd_syscons.c Sun Oct 9 10:25:47 2016 (r306902) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm_padconf.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/am335x/am335x_scm_padconf.c Sun Oct 9 10:25:47 2016 (r306902) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Sun Oct 9 10:25:47 2016 (r306902) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/ti/ti_cpuid.c ============================================================================== --- head/sys/arm/ti/ti_cpuid.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/ti_cpuid.c Sun Oct 9 10:25:47 2016 (r306902) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/ti/ti_pinmux.c ============================================================================== --- head/sys/arm/ti/ti_pinmux.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/ti_pinmux.c Sun Oct 9 10:25:47 2016 (r306902) @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/ti/ti_prcm.c ============================================================================== --- head/sys/arm/ti/ti_prcm.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/ti_prcm.c Sun Oct 9 10:25:47 2016 (r306902) @@ -52,8 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/ti/ti_scm.c ============================================================================== --- head/sys/arm/ti/ti_scm.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/ti_scm.c Sun Oct 9 10:25:47 2016 (r306902) @@ -59,8 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/ti/twl/twl.c ============================================================================== --- head/sys/arm/ti/twl/twl.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/twl/twl.c Sun Oct 9 10:25:47 2016 (r306902) @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/ti/twl/twl_clks.c ============================================================================== --- head/sys/arm/ti/twl/twl_clks.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/twl/twl_clks.c Sun Oct 9 10:25:47 2016 (r306902) @@ -62,8 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/ti/twl/twl_vreg.c ============================================================================== --- head/sys/arm/ti/twl/twl_vreg.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/ti/twl/twl_vreg.c Sun Oct 9 10:25:47 2016 (r306902) @@ -63,8 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: head/sys/arm/xscale/i8134x/i80321_timer.c ============================================================================== --- head/sys/arm/xscale/i8134x/i80321_timer.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/xscale/i8134x/i80321_timer.c Sun Oct 9 10:25:47 2016 (r306902) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/arm/xscale/i8134x/i80321_wdog.c ============================================================================== --- head/sys/arm/xscale/i8134x/i80321_wdog.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/xscale/i8134x/i80321_wdog.c Sun Oct 9 10:25:47 2016 (r306902) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/xscale/ixp425/avila_ata.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_ata.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/xscale/ixp425/avila_ata.c Sun Oct 9 10:25:47 2016 (r306902) @@ -53,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/xscale/ixp425/ixp425_intr.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_intr.h Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/xscale/ixp425/ixp425_intr.h Sun Oct 9 10:25:47 2016 (r306902) @@ -46,7 +46,6 @@ #ifndef _LOCORE #include -#include #include Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npe.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/xscale/ixp425/ixp425_npe.c Sun Oct 9 10:25:47 2016 (r306902) @@ -92,8 +92,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/xscale/ixp425/ixp425_qmgr.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_qmgr.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/xscale/ixp425/ixp425_qmgr.c Sun Oct 9 10:25:47 2016 (r306902) @@ -84,8 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/arm/xscale/ixp425/ixp425_timer.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_timer.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/xscale/ixp425/ixp425_timer.c Sun Oct 9 10:25:47 2016 (r306902) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/arm/xscale/ixp425/ixp425_wdog.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_wdog.c Sun Oct 9 10:24:10 2016 (r306901) +++ head/sys/arm/xscale/ixp425/ixp425_wdog.c Sun Oct 9 10:25:47 2016 (r306902) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include From owner-svn-src-head@freebsd.org Sun Oct 9 21:47:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 519DAC0B52F; Sun, 9 Oct 2016 21:47:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1647F82C; Sun, 9 Oct 2016 21:47:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u99LlL2p029085; Sun, 9 Oct 2016 21:47:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u99LlLun029084; Sun, 9 Oct 2016 21:47:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201610092147.u99LlLun029084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 9 Oct 2016 21:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306928 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 21:47:22 -0000 Author: andrew Date: Sun Oct 9 21:47:20 2016 New Revision: 306928 URL: https://svnweb.freebsd.org/changeset/base/306928 Log: Set INLINE_LIMIT in the aarch64 case for gcc. Submitted by: andreast MFC after: 1 week Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Oct 9 21:39:51 2016 (r306927) +++ head/sys/conf/kern.mk Sun Oct 9 21:47:20 2016 (r306928) @@ -114,6 +114,7 @@ INLINE_LIMIT?= 8000 CFLAGS += -mgeneral-regs-only # Reserve x18 for pcpu data CFLAGS += -ffixed-x18 +INLINE_LIMIT?= 8000 .endif .if ${MACHINE_CPUARCH} == "riscv" From owner-svn-src-head@freebsd.org Mon Oct 10 03:21:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 154C5C07CD9; Mon, 10 Oct 2016 03:21:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5F72FED8; Mon, 10 Oct 2016 03:21:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id A53BB3C2A48; Mon, 10 Oct 2016 14:21:08 +1100 (AEDT) Date: Mon, 10 Oct 2016 14:21:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Michal Meloun cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r306902 - in head/sys/arm: allwinner amlogic/aml8726 at91 broadcom/bcm2835 freescale/imx lpc mv rockchip ti ti/am335x ti/omap4 ti/twl xscale/i8134x xscale/ixp425 In-Reply-To: <201610091025.u99APl98067605@repo.freebsd.org> Message-ID: <20161010140648.Y1935@besplex.bde.org> References: <201610091025.u99APl98067605@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.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=M87QekrunEUvCcydvxMA:9 a=CjuIK1q_8ugA:10 a=chvjmp5bT-K0Np4W8Gpx:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 03:21:12 -0000 On Sun, 9 Oct 2016, Michal Meloun wrote: > Log: > ARM: Remove unused includes. > > MFC after: 1 week > ... > Modified: head/sys/arm/allwinner/a10_gpio.c > ============================================================================== > --- head/sys/arm/allwinner/a10_gpio.c Sun Oct 9 10:24:10 2016 (r306901) > +++ head/sys/arm/allwinner/a10_gpio.c Sun Oct 9 10:25:47 2016 (r306902) > @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); > #include > > #include > -#include > -#include > #include > #include > ... It is correct to remove them, but are they really unused? machine/cpufunc.h is my invention for holding miscellaneous 1-lime asms on i386. It is apparently something completely different (much larger and uglier) on arm. On i386, it is considered as an extension of likbern so it is included in . It is included there for all arches, and it is a style bug to not depend on that. Including sys/libkern.h is another style bug. machine/cpu.h is for holding MD definitions of MI APIs like TRAPF_USERMODE() and not much else. Almost nothing needs these APIs so almost nothing should include this header. But the header has lots of namespace pollution and might provide other APIs accidentally. On arm, it isn't much larger than on i386, but has a few definitions like struct arm_boot_params that are completely unrelated to MI APIs. get_cyclecount() is misimplemented on most arches, and arm is no exception. It is an MI API, but not worth inlining unless it is 1 fast instruction. Bruce From owner-svn-src-head@freebsd.org Mon Oct 10 04:53:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61FBEC0B1CF; Mon, 10 Oct 2016 04:53:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31408D5F; Mon, 10 Oct 2016 04:53:16 +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 u9A4rFow092758; Mon, 10 Oct 2016 04:53:15 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9A4rFqC092757; Mon, 10 Oct 2016 04:53:15 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201610100453.u9A4rFqC092757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 10 Oct 2016 04:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306934 - head/sys/modules/dtb/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 04:53:16 -0000 Author: manu Date: Mon Oct 10 04:53:15 2016 New Revision: 306934 URL: https://svnweb.freebsd.org/changeset/base/306934 Log: Add CHIP dts into the build Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Sun Oct 9 23:27:08 2016 (r306933) +++ head/sys/modules/dtb/allwinner/Makefile Mon Oct 10 04:53:15 2016 (r306934) @@ -9,6 +9,7 @@ DTS= \ olinuxino-lime.dts \ pcduino3.dts \ sinovoip-bpi-m3.dts \ - sun5i-a13-olinuxino.dts + sun5i-a13-olinuxino.dts \ + sun5i-r8-chip.dts .include From owner-svn-src-head@freebsd.org Mon Oct 10 05:41:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB846C0B08C; Mon, 10 Oct 2016 05:41:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B73FEDBA; Mon, 10 Oct 2016 05:41:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9A5fdUP011128; Mon, 10 Oct 2016 05:41:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9A5fd2C011125; Mon, 10 Oct 2016 05:41:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610100541.u9A5fd2C011125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 10 Oct 2016 05:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306936 - in head/sys: dev/hyperv/netvsc net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 05:41:41 -0000 Author: sephe Date: Mon Oct 10 05:41:39 2016 New Revision: 306936 URL: https://svnweb.freebsd.org/changeset/base/306936 Log: hyperv/hn: Fix checksum offload settings The _correct_ way to identify the supported checksum offloading and TSO parameters is to query OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8088 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/ndis.h head/sys/net/rndis.h Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Oct 10 04:57:33 2016 (r306935) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Oct 10 05:41:39 2016 (r306936) @@ -68,6 +68,16 @@ __FBSDID("$FreeBSD$"); #define HN_RNDIS_XFER_SIZE 2048 +#define HN_NDIS_TXCSUM_CAP_IP4 \ + (NDIS_TXCSUM_CAP_IP4 | NDIS_TXCSUM_CAP_IP4OPT) +#define HN_NDIS_TXCSUM_CAP_TCP4 \ + (NDIS_TXCSUM_CAP_TCP4 | NDIS_TXCSUM_CAP_TCP4OPT) +#define HN_NDIS_TXCSUM_CAP_TCP6 \ + (NDIS_TXCSUM_CAP_TCP6 | NDIS_TXCSUM_CAP_TCP6OPT | \ + NDIS_TXCSUM_CAP_IP6EXT) +#define HN_NDIS_TXCSUM_CAP_UDP6 \ + (NDIS_TXCSUM_CAP_UDP6 | NDIS_TXCSUM_CAP_IP6EXT) + /* * Forward declarations */ @@ -78,9 +88,14 @@ static void hv_rf_receive_data(struct hn static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, const void *idata, size_t idlen, void *odata, size_t *odlen0); +static int hn_rndis_query2(struct hn_softc *sc, uint32_t oid, + const void *idata, size_t idlen, void *odata, size_t *odlen0, + size_t min_odlen); static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, size_t dlen); static int hn_rndis_conf_offload(struct hn_softc *sc); +static int hn_rndis_query_hwcaps(struct hn_softc *sc, + struct ndis_offload *caps); static __inline uint32_t hn_rndis_rid(struct hn_softc *sc) @@ -624,6 +639,15 @@ static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, const void *idata, size_t idlen, void *odata, size_t *odlen0) { + + return (hn_rndis_query2(sc, oid, idata, idlen, odata, odlen0, *odlen0)); +} + +static int +hn_rndis_query2(struct hn_softc *sc, uint32_t oid, + const void *idata, size_t idlen, void *odata, size_t *odlen0, + size_t min_odlen) +{ struct rndis_query_req *req; const struct rndis_query_comp *comp; struct vmbus_xact *xact; @@ -661,7 +685,7 @@ hn_rndis_query(struct hn_softc *sc, uint memcpy(req + 1, idata, idlen); } - comp_len = sizeof(*comp) + odlen; + comp_len = sizeof(*comp) + min_odlen; comp = hn_rndis_xact_execute(sc, xact, rid, reqlen, &comp_len, REMOTE_NDIS_QUERY_CMPLT); if (comp == NULL) { @@ -808,11 +832,18 @@ done: static int hn_rndis_conf_offload(struct hn_softc *sc) { + struct ndis_offload hwcaps; struct ndis_offload_params params; - uint32_t caps; + uint32_t caps = 0; size_t paramsz; int error; + error = hn_rndis_query_hwcaps(sc, &hwcaps); + if (error) { + if_printf(sc->hn_ifp, "hwcaps query failed: %d\n", error); + return (error); + } + /* NOTE: 0 means "no change" */ memset(¶ms, 0, sizeof(params)); @@ -826,18 +857,96 @@ hn_rndis_conf_offload(struct hn_softc *s } params.ndis_hdr.ndis_size = paramsz; - caps = HN_CAP_IPCS | HN_CAP_TCP4CS | HN_CAP_TCP6CS; - params.ndis_ip4csum = NDIS_OFFLOAD_PARAM_TXRX; - params.ndis_tcp4csum = NDIS_OFFLOAD_PARAM_TXRX; - params.ndis_tcp6csum = NDIS_OFFLOAD_PARAM_TXRX; - if (sc->hn_ndis_ver >= HN_NDIS_VERSION_6_30) { - caps |= HN_CAP_UDP4CS | HN_CAP_UDP6CS; - params.ndis_udp4csum = NDIS_OFFLOAD_PARAM_TXRX; - params.ndis_udp6csum = NDIS_OFFLOAD_PARAM_TXRX; - } - caps |= HN_CAP_TSO4; - params.ndis_lsov2_ip4 = NDIS_OFFLOAD_LSOV2_ON; - /* XXX ndis_lsov2_ip6 = NDIS_OFFLOAD_LSOV2_ON */ + /* TSO */ + if (hwcaps.ndis_lsov2.ndis_ip4_encap & NDIS_OFFLOAD_ENCAP_8023) { + caps |= HN_CAP_TSO4; + params.ndis_lsov2_ip4 = NDIS_OFFLOAD_LSOV2_ON; + /* TODO: tso_max */ + } + if (hwcaps.ndis_lsov2.ndis_ip6_encap & NDIS_OFFLOAD_ENCAP_8023) { +#ifdef notyet + caps |= HN_CAP_TSO6; + params.ndis_lsov2_ip6 = NDIS_OFFLOAD_LSOV2_ON; +#endif + /* TODO: tso_max */ + } + + /* IPv4 checksum */ + if ((hwcaps.ndis_csum.ndis_ip4_txcsum & HN_NDIS_TXCSUM_CAP_IP4) == + HN_NDIS_TXCSUM_CAP_IP4) { + caps |= HN_CAP_IPCS; + params.ndis_ip4csum = NDIS_OFFLOAD_PARAM_TX; + } + if (hwcaps.ndis_csum.ndis_ip4_rxcsum & NDIS_RXCSUM_CAP_IP4) { + if (params.ndis_ip4csum == NDIS_OFFLOAD_PARAM_TX) + params.ndis_ip4csum = NDIS_OFFLOAD_PARAM_TXRX; + else + params.ndis_ip4csum = NDIS_OFFLOAD_PARAM_RX; + } + + /* TCP4 checksum */ + if ((hwcaps.ndis_csum.ndis_ip4_txcsum & HN_NDIS_TXCSUM_CAP_TCP4) == + HN_NDIS_TXCSUM_CAP_TCP4) { + caps |= HN_CAP_TCP4CS; + params.ndis_tcp4csum = NDIS_OFFLOAD_PARAM_TX; + } + if (hwcaps.ndis_csum.ndis_ip4_rxcsum & NDIS_RXCSUM_CAP_TCP4) { + if (params.ndis_tcp4csum == NDIS_OFFLOAD_PARAM_TX) + params.ndis_tcp4csum = NDIS_OFFLOAD_PARAM_TXRX; + else + params.ndis_tcp4csum = NDIS_OFFLOAD_PARAM_RX; + } + + /* UDP4 checksum */ + if (hwcaps.ndis_csum.ndis_ip4_txcsum & NDIS_TXCSUM_CAP_UDP4) { + caps |= HN_CAP_UDP4CS; + params.ndis_udp4csum = NDIS_OFFLOAD_PARAM_TX; + } + if (hwcaps.ndis_csum.ndis_ip4_rxcsum & NDIS_RXCSUM_CAP_UDP4) { + if (params.ndis_udp4csum == NDIS_OFFLOAD_PARAM_TX) + params.ndis_udp4csum = NDIS_OFFLOAD_PARAM_TXRX; + else + params.ndis_udp4csum = NDIS_OFFLOAD_PARAM_RX; + } + + /* TCP6 checksum */ + if ((hwcaps.ndis_csum.ndis_ip6_txcsum & HN_NDIS_TXCSUM_CAP_TCP6) == + HN_NDIS_TXCSUM_CAP_TCP6) { + caps |= HN_CAP_TCP6CS; + params.ndis_tcp6csum = NDIS_OFFLOAD_PARAM_TX; + } + if (hwcaps.ndis_csum.ndis_ip6_rxcsum & NDIS_RXCSUM_CAP_TCP6) { + if (params.ndis_tcp6csum == NDIS_OFFLOAD_PARAM_TX) + params.ndis_tcp6csum = NDIS_OFFLOAD_PARAM_TXRX; + else + params.ndis_tcp6csum = NDIS_OFFLOAD_PARAM_RX; + } + + /* UDP6 checksum */ + if ((hwcaps.ndis_csum.ndis_ip6_txcsum & HN_NDIS_TXCSUM_CAP_UDP6) == + HN_NDIS_TXCSUM_CAP_UDP6) { + caps |= HN_CAP_UDP6CS; + params.ndis_udp6csum = NDIS_OFFLOAD_PARAM_TX; + } + if (hwcaps.ndis_csum.ndis_ip6_rxcsum & NDIS_RXCSUM_CAP_UDP6) { + if (params.ndis_udp6csum == NDIS_OFFLOAD_PARAM_TX) + params.ndis_udp6csum = NDIS_OFFLOAD_PARAM_TXRX; + else + params.ndis_udp6csum = NDIS_OFFLOAD_PARAM_RX; + } + + if (bootverbose) { + if_printf(sc->hn_ifp, "offload csum: " + "ip4 %u, tcp4 %u, udp4 %u, tcp6 %u, udp6 %u\n", + params.ndis_ip4csum, + params.ndis_tcp4csum, + params.ndis_udp4csum, + params.ndis_tcp6csum, + params.ndis_udp6csum); + if_printf(sc->hn_ifp, "offload lsov2: ip4 %u, ip6 %u\n", + params.ndis_lsov2_ip4, + params.ndis_lsov2_ip6); + } error = hn_rndis_set(sc, OID_TCP_OFFLOAD_PARAMETERS, ¶ms, paramsz); if (error) { @@ -994,6 +1103,88 @@ hn_rndis_halt(struct hn_softc *sc) return (0); } +static int +hn_rndis_query_hwcaps(struct hn_softc *sc, struct ndis_offload *caps) +{ + struct ndis_offload in; + size_t caps_len, size; + int error; + + memset(&in, 0, sizeof(in)); + in.ndis_hdr.ndis_type = NDIS_OBJTYPE_OFFLOAD; + if (sc->hn_ndis_ver >= HN_NDIS_VERSION_6_30) { + in.ndis_hdr.ndis_rev = NDIS_OFFLOAD_REV_3; + size = NDIS_OFFLOAD_SIZE; + } else if (sc->hn_ndis_ver >= HN_NDIS_VERSION_6_1) { + in.ndis_hdr.ndis_rev = NDIS_OFFLOAD_REV_2; + size = NDIS_OFFLOAD_SIZE_2; + } else { + in.ndis_hdr.ndis_rev = NDIS_OFFLOAD_REV_1; + size = NDIS_OFFLOAD_SIZE_1; + } + in.ndis_hdr.ndis_size = size; + + caps_len = NDIS_OFFLOAD_SIZE; + error = hn_rndis_query2(sc, OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES, + &in, size, caps, &caps_len, NDIS_OFFLOAD_SIZE_1); + if (error) + return (error); + + /* + * Preliminary verification. + */ + if (caps->ndis_hdr.ndis_type != NDIS_OBJTYPE_OFFLOAD) { + if_printf(sc->hn_ifp, "invalid NDIS objtype 0x%02x\n", + caps->ndis_hdr.ndis_type); + return (EINVAL); + } + if (caps->ndis_hdr.ndis_rev < NDIS_OFFLOAD_REV_1) { + if_printf(sc->hn_ifp, "invalid NDIS objrev 0x%02x\n", + caps->ndis_hdr.ndis_rev); + return (EINVAL); + } + if (caps->ndis_hdr.ndis_size > caps_len) { + if_printf(sc->hn_ifp, "invalid NDIS objsize %u, " + "data size %zu\n", caps->ndis_hdr.ndis_size, caps_len); + return (EINVAL); + } else if (caps->ndis_hdr.ndis_size < NDIS_OFFLOAD_SIZE_1) { + if_printf(sc->hn_ifp, "invalid NDIS objsize %u\n", + caps->ndis_hdr.ndis_size); + return (EINVAL); + } + + if (bootverbose) { + /* + * Fields for NDIS 6.0 are accessable. + */ + if_printf(sc->hn_ifp, "hwcaps rev %u\n", + caps->ndis_hdr.ndis_rev); + + if_printf(sc->hn_ifp, "hwcaps csum: " + "ip4 tx 0x%x/0x%x rx 0x%x/0x%x, " + "ip6 tx 0x%x/0x%x rx 0x%x/0x%x\n", + caps->ndis_csum.ndis_ip4_txcsum, + caps->ndis_csum.ndis_ip4_txenc, + caps->ndis_csum.ndis_ip4_rxcsum, + caps->ndis_csum.ndis_ip4_rxenc, + caps->ndis_csum.ndis_ip6_txcsum, + caps->ndis_csum.ndis_ip6_txenc, + caps->ndis_csum.ndis_ip6_rxcsum, + caps->ndis_csum.ndis_ip6_rxenc); + if_printf(sc->hn_ifp, "hwcaps lsov2: " + "ip4 maxsz %u minsg %u encap 0x%x, " + "ip6 maxsz %u minsg %u encap 0x%x opts 0x%x\n", + caps->ndis_lsov2.ndis_ip4_maxsz, + caps->ndis_lsov2.ndis_ip4_minsg, + caps->ndis_lsov2.ndis_ip4_encap, + caps->ndis_lsov2.ndis_ip6_maxsz, + caps->ndis_lsov2.ndis_ip6_minsg, + caps->ndis_lsov2.ndis_ip6_encap, + caps->ndis_lsov2.ndis_ip6_opts); + } + return (0); +} + int hn_rndis_attach(struct hn_softc *sc) { Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Mon Oct 10 04:57:33 2016 (r306935) +++ head/sys/dev/hyperv/netvsc/ndis.h Mon Oct 10 05:41:39 2016 (r306936) @@ -59,6 +59,7 @@ #define NDIS_OBJTYPE_DEFAULT 0x80 #define NDIS_OBJTYPE_RSS_CAPS 0x88 #define NDIS_OBJTYPE_RSS_PARAMS 0x89 +#define NDIS_OBJTYPE_OFFLOAD 0xa7 struct ndis_object_hdr { uint8_t ndis_type; /* NDIS_OBJTYPE_ */ @@ -205,6 +206,129 @@ struct ndis_rssprm_toeplitz { }; /* + * OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES + * ndis_type: NDIS_OBJTYPE_OFFLOAD + */ + +#define NDIS_OFFLOAD_ENCAP_NONE 0x0000 +#define NDIS_OFFLOAD_ENCAP_NULL 0x0001 +#define NDIS_OFFLOAD_ENCAP_8023 0x0002 +#define NDIS_OFFLOAD_ENCAP_8023PQ 0x0004 +#define NDIS_OFFLOAD_ENCAP_8023PQ_OOB 0x0008 +#define NDIS_OFFLOAD_ENCAP_RFC1483 0x0010 + +struct ndis_csum_offload { + uint32_t ndis_ip4_txenc; /*NDIS_OFFLOAD_ENCAP_*/ + uint32_t ndis_ip4_txcsum; +#define NDIS_TXCSUM_CAP_IP4OPT 0x001 +#define NDIS_TXCSUM_CAP_TCP4OPT 0x004 +#define NDIS_TXCSUM_CAP_TCP4 0x010 +#define NDIS_TXCSUM_CAP_UDP4 0x040 +#define NDIS_TXCSUM_CAP_IP4 0x100 + uint32_t ndis_ip4_rxenc; /*NDIS_OFFLOAD_ENCAP_*/ + uint32_t ndis_ip4_rxcsum; +#define NDIS_RXCSUM_CAP_IP4OPT 0x001 +#define NDIS_RXCSUM_CAP_TCP4OPT 0x004 +#define NDIS_RXCSUM_CAP_TCP4 0x010 +#define NDIS_RXCSUM_CAP_UDP4 0x040 +#define NDIS_RXCSUM_CAP_IP4 0x100 + uint32_t ndis_ip6_txenc; /*NDIS_OFFLOAD_ENCAP_*/ + uint32_t ndis_ip6_txcsum; +#define NDIS_TXCSUM_CAP_IP6EXT 0x001 +#define NDIS_TXCSUM_CAP_TCP6OPT 0x004 +#define NDIS_TXCSUM_CAP_TCP6 0x010 +#define NDIS_TXCSUM_CAP_UDP6 0x040 + uint32_t ndis_ip6_rxenc; /*NDIS_OFFLOAD_ENCAP_*/ + uint32_t ndis_ip6_rxcsum; +#define NDIS_RXCSUM_CAP_IP6EXT 0x001 +#define NDIS_RXCSUM_CAP_TCP6OPT 0x004 +#define NDIS_RXCSUM_CAP_TCP6 0x010 +#define NDIS_RXCSUM_CAP_UDP6 0x040 +}; + +struct ndis_lsov1_offload { + uint32_t ndis_encap; /*NDIS_OFFLOAD_ENCAP_*/ + uint32_t ndis_maxsize; + uint32_t ndis_minsegs; + uint32_t ndis_opts; +}; + +struct ndis_ipsecv1_offload { + uint32_t ndis_encap; /*NDIS_OFFLOAD_ENCAP_*/ + uint32_t ndis_ah_esp; + uint32_t ndis_xport_tun; + uint32_t ndis_ip4_opts; + uint32_t ndis_flags; + uint32_t ndis_ip4_ah; + uint32_t ndis_ip4_esp; +}; + +struct ndis_lsov2_offload { + uint32_t ndis_ip4_encap; /*NDIS_OFFLOAD_ENCAP_*/ + uint32_t ndis_ip4_maxsz; + uint32_t ndis_ip4_minsg; + uint32_t ndis_ip6_encap; /*NDIS_OFFLOAD_ENCAP_*/ + uint32_t ndis_ip6_maxsz; + uint32_t ndis_ip6_minsg; + uint32_t ndis_ip6_opts; +#define NDIS_LSOV2_CAP_IP6EXT 0x001 +#define NDIS_LSOV2_CAP_TCP6OPT 0x004 +}; + +struct ndis_ipsecv2_offload { + uint32_t ndis_encap; /*NDIS_OFFLOAD_ENCAP_*/ + uint16_t ndis_ip6; + uint16_t ndis_ip4opt; + uint16_t ndis_ip6ext; + uint16_t ndis_ah; + uint16_t ndis_esp; + uint16_t ndis_ah_esp; + uint16_t ndis_xport; + uint16_t ndis_tun; + uint16_t ndis_xport_tun; + uint16_t ndis_lso; + uint16_t ndis_extseq; + uint32_t ndis_udp_esp; + uint32_t ndis_auth; + uint32_t ndis_crypto; + uint32_t ndis_sa_caps; +}; + +struct ndis_rsc_offload { + uint16_t ndis_ip4; + uint16_t ndis_ip6; +}; + +struct ndis_encap_offload { + uint32_t ndis_flags; + uint32_t ndis_maxhdr; +}; + +struct ndis_offload { + struct ndis_object_hdr ndis_hdr; + struct ndis_csum_offload ndis_csum; + struct ndis_lsov1_offload ndis_lsov1; + struct ndis_ipsecv1_offload ndis_ipsecv1; + struct ndis_lsov2_offload ndis_lsov2; + uint32_t ndis_flags; + /* NDIS >= 6.1 */ + struct ndis_ipsecv2_offload ndis_ipsecv2; + /* NDIS >= 6.30 */ + struct ndis_rsc_offload ndis_rsc; + struct ndis_encap_offload ndis_encap_gre; +}; + +#define NDIS_OFFLOAD_SIZE sizeof(struct ndis_offload) +#define NDIS_OFFLOAD_SIZE_1 \ + __offsetof(struct ndis_offload, ndis_ipsecv2) +#define NDIS_OFFLOAD_SIZE_2 \ + __offsetof(struct ndis_offload, ndis_rsc) + +#define NDIS_OFFLOAD_REV_1 1 /* NDIS 6.0 */ +#define NDIS_OFFLOAD_REV_2 2 /* NDIS 6.1 */ +#define NDIS_OFFLOAD_REV_3 3 /* NDIS 6.30 */ + +/* * Per-packet-info */ Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Mon Oct 10 04:57:33 2016 (r306935) +++ head/sys/net/rndis.h Mon Oct 10 05:41:39 2016 (r306936) @@ -87,6 +87,7 @@ #define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 #define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C +#define OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES 0xFC01020D #define RNDIS_MEDIUM_802_3 0x00000000 From owner-svn-src-head@freebsd.org Mon Oct 10 05:50:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45C88C0B33A; Mon, 10 Oct 2016 05:50:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2282015A; Mon, 10 Oct 2016 05:50:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9A5o2kA012153; Mon, 10 Oct 2016 05:50:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9A5o1qg012149; Mon, 10 Oct 2016 05:50:01 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610100550.u9A5o1qg012149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 10 Oct 2016 05:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306937 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 05:50:03 -0000 Author: sephe Date: Mon Oct 10 05:50:01 2016 New Revision: 306937 URL: https://svnweb.freebsd.org/changeset/base/306937 Log: hyperv/hn: Fix if_hw_tsomax setup. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8089 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Oct 10 05:41:39 2016 (r306936) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Oct 10 05:50:01 2016 (r306937) @@ -244,6 +244,8 @@ struct hn_softc { uint32_t hn_rndis_rid; uint32_t hn_ndis_ver; + int hn_ndis_tso_szmax; + int hn_ndis_tso_sgmin; struct ndis_rssprm_toeplitz hn_rss; }; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Oct 10 05:41:39 2016 (r306936) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Oct 10 05:50:01 2016 (r306937) @@ -230,7 +230,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, trust_hosti "when csum info is missing (global setting)"); /* Limit TSO burst size */ -static int hn_tso_maxlen = 0; +static int hn_tso_maxlen = IP_MAXPACKET; SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, &hn_tso_maxlen, 0, "TSO burst limit"); @@ -338,6 +338,7 @@ static int hn_encap(struct hn_tx_ring *, static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_chim_size(struct hn_softc *, int); +static void hn_set_tso_maxsize(struct hn_softc *, int, int); static int hn_chan_attach(struct hn_softc *, struct vmbus_channel *); static void hn_chan_detach(struct hn_softc *, struct vmbus_channel *); static int hn_attach_subchans(struct hn_softc *); @@ -520,7 +521,6 @@ netvsc_attach(device_t dev) uint32_t link_status; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; - int tso_maxlen; sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -720,18 +720,16 @@ netvsc_attach(device_t dev) /* Enable all available capabilities by default. */ ifp->if_capenable = ifp->if_capabilities; - tso_maxlen = hn_tso_maxlen; - if (tso_maxlen <= 0 || tso_maxlen > IP_MAXPACKET) - tso_maxlen = IP_MAXPACKET; - ifp->if_hw_tsomaxsegcount = HN_TX_DATA_SEGCNT_MAX; - ifp->if_hw_tsomaxsegsize = PAGE_SIZE; - ifp->if_hw_tsomax = tso_maxlen - - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + if (ifp->if_capabilities & (IFCAP_TSO6 | IFCAP_TSO4)) { + hn_set_tso_maxsize(sc, hn_tso_maxlen, ETHERMTU); + ifp->if_hw_tsomaxsegcount = HN_TX_DATA_SEGCNT_MAX; + ifp->if_hw_tsomaxsegsize = PAGE_SIZE; + } ether_ifattach(ifp, eaddr); - if (bootverbose) { - if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, + if ((ifp->if_capabilities & (IFCAP_TSO6 | IFCAP_TSO4)) && bootverbose) { + if_printf(ifp, "TSO segcnt %u segsz %u\n", ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); } @@ -1672,6 +1670,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) hn_set_chim_size(sc, sc->hn_chim_szmax); + hn_set_tso_maxsize(sc, hn_tso_maxlen, ifr->ifr_mtu); /* All done! Resume now. */ if (ifp->if_drv_flags & IFF_DRV_RUNNING) @@ -2919,6 +2918,34 @@ hn_set_chim_size(struct hn_softc *sc, in } static void +hn_set_tso_maxsize(struct hn_softc *sc, int tso_maxlen, int mtu) +{ + struct ifnet *ifp = sc->hn_ifp; + int tso_minlen; + + if ((ifp->if_capabilities & (IFCAP_TSO4 | IFCAP_TSO6)) == 0) + return; + + KASSERT(sc->hn_ndis_tso_sgmin >= 2, + ("invalid NDIS tso sgmin %d", sc->hn_ndis_tso_sgmin)); + tso_minlen = sc->hn_ndis_tso_sgmin * mtu; + + KASSERT(sc->hn_ndis_tso_szmax >= tso_minlen && + sc->hn_ndis_tso_szmax <= IP_MAXPACKET, + ("invalid NDIS tso szmax %d", sc->hn_ndis_tso_szmax)); + + if (tso_maxlen < tso_minlen) + tso_maxlen = tso_minlen; + else if (tso_maxlen > IP_MAXPACKET) + tso_maxlen = IP_MAXPACKET; + if (tso_maxlen > sc->hn_ndis_tso_szmax) + tso_maxlen = sc->hn_ndis_tso_szmax; + ifp->if_hw_tsomax = tso_maxlen - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + if (bootverbose) + if_printf(ifp, "TSO size max %u\n", ifp->if_hw_tsomax); +} + +static void hn_fixup_tx_data(struct hn_softc *sc) { uint64_t csum_assist; @@ -3424,7 +3451,7 @@ hn_synth_attach(struct hn_softc *sc, int /* * Attach RNDIS _after_ NVS is attached. */ - error = hn_rndis_attach(sc); + error = hn_rndis_attach(sc, mtu); if (error) return (error); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Oct 10 05:41:39 2016 (r306936) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Oct 10 05:50:01 2016 (r306937) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -77,6 +79,8 @@ __FBSDID("$FreeBSD$"); NDIS_TXCSUM_CAP_IP6EXT) #define HN_NDIS_TXCSUM_CAP_UDP6 \ (NDIS_TXCSUM_CAP_UDP6 | NDIS_TXCSUM_CAP_IP6EXT) +#define HN_NDIS_LSOV2_CAP_IP6 \ + (NDIS_LSOV2_CAP_IP6EXT | NDIS_LSOV2_CAP_TCP6OPT) /* * Forward declarations @@ -93,7 +97,7 @@ static int hn_rndis_query2(struct hn_sof size_t min_odlen); static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, size_t dlen); -static int hn_rndis_conf_offload(struct hn_softc *sc); +static int hn_rndis_conf_offload(struct hn_softc *sc, int mtu); static int hn_rndis_query_hwcaps(struct hn_softc *sc, struct ndis_offload *caps); @@ -830,13 +834,13 @@ done: } static int -hn_rndis_conf_offload(struct hn_softc *sc) +hn_rndis_conf_offload(struct hn_softc *sc, int mtu) { struct ndis_offload hwcaps; struct ndis_offload_params params; uint32_t caps = 0; size_t paramsz; - int error; + int error, tso_maxsz, tso_minsg; error = hn_rndis_query_hwcaps(sc, &hwcaps); if (error) { @@ -857,18 +861,58 @@ hn_rndis_conf_offload(struct hn_softc *s } params.ndis_hdr.ndis_size = paramsz; - /* TSO */ + /* + * TSO4/TSO6 setup. + */ + tso_maxsz = IP_MAXPACKET; + tso_minsg = 2; if (hwcaps.ndis_lsov2.ndis_ip4_encap & NDIS_OFFLOAD_ENCAP_8023) { caps |= HN_CAP_TSO4; params.ndis_lsov2_ip4 = NDIS_OFFLOAD_LSOV2_ON; - /* TODO: tso_max */ - } - if (hwcaps.ndis_lsov2.ndis_ip6_encap & NDIS_OFFLOAD_ENCAP_8023) { + + if (hwcaps.ndis_lsov2.ndis_ip4_maxsz < tso_maxsz) + tso_maxsz = hwcaps.ndis_lsov2.ndis_ip4_maxsz; + if (hwcaps.ndis_lsov2.ndis_ip4_minsg > tso_minsg) + tso_minsg = hwcaps.ndis_lsov2.ndis_ip4_minsg; + } + if ((hwcaps.ndis_lsov2.ndis_ip6_encap & NDIS_OFFLOAD_ENCAP_8023) && + (hwcaps.ndis_lsov2.ndis_ip6_opts & HN_NDIS_LSOV2_CAP_IP6) == + HN_NDIS_LSOV2_CAP_IP6) { #ifdef notyet caps |= HN_CAP_TSO6; params.ndis_lsov2_ip6 = NDIS_OFFLOAD_LSOV2_ON; + + if (hwcaps.ndis_lsov2.ndis_ip6_maxsz < tso_maxsz) + tso_maxsz = hwcaps.ndis_lsov2.ndis_ip6_maxsz; + if (hwcaps.ndis_lsov2.ndis_ip6_minsg > tso_minsg) + tso_minsg = hwcaps.ndis_lsov2.ndis_ip6_minsg; #endif - /* TODO: tso_max */ + } + sc->hn_ndis_tso_szmax = 0; + sc->hn_ndis_tso_sgmin = 0; + if (caps & (HN_CAP_TSO4 | HN_CAP_TSO6)) { + KASSERT(tso_maxsz <= IP_MAXPACKET, + ("invalid NDIS TSO maxsz %d", tso_maxsz)); + KASSERT(tso_minsg >= 2, + ("invalid NDIS TSO minsg %d", tso_minsg)); + if (tso_maxsz < tso_minsg * mtu) { + if_printf(sc->hn_ifp, "invalid NDIS TSO config: " + "maxsz %d, minsg %d, mtu %d; " + "disable TSO4 and TSO6\n", + tso_maxsz, tso_minsg, mtu); + caps &= ~(HN_CAP_TSO4 | HN_CAP_TSO6); + params.ndis_lsov2_ip4 = NDIS_OFFLOAD_LSOV2_OFF; + params.ndis_lsov2_ip6 = NDIS_OFFLOAD_LSOV2_OFF; + } else { + sc->hn_ndis_tso_szmax = tso_maxsz; + sc->hn_ndis_tso_sgmin = tso_minsg; + if (bootverbose) { + if_printf(sc->hn_ifp, "NDIS TSO " + "szmax %d sgmin %d\n", + sc->hn_ndis_tso_szmax, + sc->hn_ndis_tso_sgmin); + } + } } /* IPv4 checksum */ @@ -1186,7 +1230,7 @@ hn_rndis_query_hwcaps(struct hn_softc *s } int -hn_rndis_attach(struct hn_softc *sc) +hn_rndis_attach(struct hn_softc *sc, int mtu) { int error; @@ -1201,7 +1245,7 @@ hn_rndis_attach(struct hn_softc *sc) * Configure NDIS offload settings. * XXX no offloading, if error happened? */ - hn_rndis_conf_offload(sc); + hn_rndis_conf_offload(sc, mtu); return (0); } Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Oct 10 05:41:39 2016 (r306936) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Oct 10 05:50:01 2016 (r306937) @@ -117,7 +117,7 @@ struct rndis_packet_msg; uint32_t hn_chim_alloc(struct hn_softc *sc); void hn_chim_free(struct hn_softc *sc, uint32_t chim_idx); -int hn_rndis_attach(struct hn_softc *sc); +int hn_rndis_attach(struct hn_softc *sc, int mtu); void hn_rndis_detach(struct hn_softc *sc); int hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags); void *hn_rndis_pktinfo_append(struct rndis_packet_msg *, From owner-svn-src-head@freebsd.org Mon Oct 10 05:59:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31ECFC0B4C2; Mon, 10 Oct 2016 05:59:32 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3CA87F4; Mon, 10 Oct 2016 05:59:31 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9A5xUYV015967; Mon, 10 Oct 2016 05:59:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9A5xUkL015966; Mon, 10 Oct 2016 05:59:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610100559.u9A5xUkL015966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 10 Oct 2016 05:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306938 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 05:59:32 -0000 Author: sephe Date: Mon Oct 10 05:59:30 2016 New Revision: 306938 URL: https://svnweb.freebsd.org/changeset/base/306938 Log: hyperv/hn: Generalize RSS capabilities query. - Support NDIS < 6.30. - Stringent response checks. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8090 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Oct 10 05:50:01 2016 (r306937) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Oct 10 05:59:30 2016 (r306938) @@ -745,26 +745,44 @@ hn_rndis_get_rsscaps(struct hn_softc *sc size_t caps_len; int error; - /* - * Only NDIS 6.30+ is supported. - */ - KASSERT(sc->hn_ndis_ver >= HN_NDIS_VERSION_6_30, - ("NDIS 6.30+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); *rxr_cnt = 0; memset(&in, 0, sizeof(in)); in.ndis_hdr.ndis_type = NDIS_OBJTYPE_RSS_CAPS; - in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_2; - in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE; + if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30) { + in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_1; + in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE_6_0; + } else { + in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_2; + in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE; + } caps_len = NDIS_RSS_CAPS_SIZE; - error = hn_rndis_query(sc, OID_GEN_RECEIVE_SCALE_CAPABILITIES, - &in, NDIS_RSS_CAPS_SIZE, &caps, &caps_len); + error = hn_rndis_query2(sc, OID_GEN_RECEIVE_SCALE_CAPABILITIES, + &in, NDIS_RSS_CAPS_SIZE, &caps, &caps_len, NDIS_RSS_CAPS_SIZE_6_0); if (error) return (error); - if (caps_len < NDIS_RSS_CAPS_SIZE_6_0) { - if_printf(sc->hn_ifp, "invalid NDIS RSS caps len %zu", - caps_len); + + /* + * Preliminary verification. + */ + if (caps.ndis_hdr.ndis_type != NDIS_OBJTYPE_RSS_CAPS) { + if_printf(sc->hn_ifp, "invalid NDIS objtype 0x%02x\n", + caps.ndis_hdr.ndis_type); + return (EINVAL); + } + if (caps.ndis_hdr.ndis_rev < NDIS_RSS_CAPS_REV_1) { + if_printf(sc->hn_ifp, "invalid NDIS objrev 0x%02x\n", + caps.ndis_hdr.ndis_rev); + return (EINVAL); + } + if (caps.ndis_hdr.ndis_size > caps_len) { + if_printf(sc->hn_ifp, "invalid NDIS objsize %u, " + "data size %zu\n", caps.ndis_hdr.ndis_size, caps_len); + return (EINVAL); + } else if (caps.ndis_hdr.ndis_size < NDIS_RSS_CAPS_SIZE_6_0) { + if_printf(sc->hn_ifp, "invalid NDIS objsize %u\n", + caps.ndis_hdr.ndis_size); return (EINVAL); } @@ -774,7 +792,7 @@ hn_rndis_get_rsscaps(struct hn_softc *sc } *rxr_cnt = caps.ndis_nrxr; - if (caps_len == NDIS_RSS_CAPS_SIZE) { + if (caps.ndis_hdr.ndis_size == NDIS_RSS_CAPS_SIZE) { if (bootverbose) { if_printf(sc->hn_ifp, "RSS indirect table size %u\n", caps.ndis_nind); From owner-svn-src-head@freebsd.org Mon Oct 10 06:14:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32783C0B868; Mon, 10 Oct 2016 06:14:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1CC7FF8; Mon, 10 Oct 2016 06:14:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9A6Ec3Y023201; Mon, 10 Oct 2016 06:14:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9A6Ecm6023198; Mon, 10 Oct 2016 06:14:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610100614.u9A6Ecm6023198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 10 Oct 2016 06:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306939 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 06:14:40 -0000 Author: sephe Date: Mon Oct 10 06:14:38 2016 New Revision: 306939 URL: https://svnweb.freebsd.org/changeset/base/306939 Log: hyperv/hn: Suffix NDIS offload size with NDIS version. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8091 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Oct 10 05:59:30 2016 (r306938) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Oct 10 06:14:38 2016 (r306939) @@ -1179,16 +1179,16 @@ hn_rndis_query_hwcaps(struct hn_softc *s size = NDIS_OFFLOAD_SIZE; } else if (sc->hn_ndis_ver >= HN_NDIS_VERSION_6_1) { in.ndis_hdr.ndis_rev = NDIS_OFFLOAD_REV_2; - size = NDIS_OFFLOAD_SIZE_2; + size = NDIS_OFFLOAD_SIZE_6_1; } else { in.ndis_hdr.ndis_rev = NDIS_OFFLOAD_REV_1; - size = NDIS_OFFLOAD_SIZE_1; + size = NDIS_OFFLOAD_SIZE_6_0; } in.ndis_hdr.ndis_size = size; caps_len = NDIS_OFFLOAD_SIZE; error = hn_rndis_query2(sc, OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES, - &in, size, caps, &caps_len, NDIS_OFFLOAD_SIZE_1); + &in, size, caps, &caps_len, NDIS_OFFLOAD_SIZE_6_0); if (error) return (error); @@ -1209,7 +1209,7 @@ hn_rndis_query_hwcaps(struct hn_softc *s if_printf(sc->hn_ifp, "invalid NDIS objsize %u, " "data size %zu\n", caps->ndis_hdr.ndis_size, caps_len); return (EINVAL); - } else if (caps->ndis_hdr.ndis_size < NDIS_OFFLOAD_SIZE_1) { + } else if (caps->ndis_hdr.ndis_size < NDIS_OFFLOAD_SIZE_6_0) { if_printf(sc->hn_ifp, "invalid NDIS objsize %u\n", caps->ndis_hdr.ndis_size); return (EINVAL); @@ -1217,7 +1217,9 @@ hn_rndis_query_hwcaps(struct hn_softc *s if (bootverbose) { /* - * Fields for NDIS 6.0 are accessable. + * NOTE: + * caps->ndis_hdr.ndis_size MUST be checked before accessing + * NDIS 6.1+ specific fields. */ if_printf(sc->hn_ifp, "hwcaps rev %u\n", caps->ndis_hdr.ndis_rev); Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Mon Oct 10 05:59:30 2016 (r306938) +++ head/sys/dev/hyperv/netvsc/ndis.h Mon Oct 10 06:14:38 2016 (r306939) @@ -319,9 +319,9 @@ struct ndis_offload { }; #define NDIS_OFFLOAD_SIZE sizeof(struct ndis_offload) -#define NDIS_OFFLOAD_SIZE_1 \ +#define NDIS_OFFLOAD_SIZE_6_0 \ __offsetof(struct ndis_offload, ndis_ipsecv2) -#define NDIS_OFFLOAD_SIZE_2 \ +#define NDIS_OFFLOAD_SIZE_6_1 \ __offsetof(struct ndis_offload, ndis_rsc) #define NDIS_OFFLOAD_REV_1 1 /* NDIS 6.0 */ From owner-svn-src-head@freebsd.org Mon Oct 10 09:54:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1EA2C063CA; Mon, 10 Oct 2016 09:54:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B28FE785; Mon, 10 Oct 2016 09:54:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9A9s12t005786; Mon, 10 Oct 2016 09:54:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9A9s1vh005784; Mon, 10 Oct 2016 09:54:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201610100954.u9A9s1vh005784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 10 Oct 2016 09:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306944 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 09:54:03 -0000 Author: arybchik Date: Mon Oct 10 09:54:01 2016 New Revision: 306944 URL: https://svnweb.freebsd.org/changeset/base/306944 Log: sfxge(4): sync tlv_layout.h with firmwaresrc and update port-mode definition use It fixes driver attach issue to a new firmware which reports a new port-modes. Reviewed by: gnn Submitted by: Tom Millington Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8203 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_tlv_layout.h Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Mon Oct 10 08:46:26 2016 (r306943) +++ head/sys/dev/sfxge/common/ef10_nic.c Mon Oct 10 09:54:01 2016 (r306944) @@ -164,6 +164,7 @@ ef10_nic_get_port_mode_bandwidth( break; case TLV_PORT_MODE_10G_10G_10G_10G: case TLV_PORT_MODE_10G_10G_10G_10G_Q: + case TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2: case TLV_PORT_MODE_10G_10G_10G_10G_Q2: bandwidth = 10000 * 4; break; @@ -1122,8 +1123,7 @@ static struct { { EFX_FAMILY_MEDFORD, (1 << TLV_PORT_MODE_10G) | - (1 << TLV_PORT_MODE_10G_10G) | - (1 << TLV_PORT_MODE_10G_10G_10G_10G), + (1 << TLV_PORT_MODE_10G_10G), 1 }, /* Supported modes requiring 2 outputs per port */ @@ -1140,13 +1140,15 @@ static struct { (1 << TLV_PORT_MODE_40G) | (1 << TLV_PORT_MODE_40G_40G) | (1 << TLV_PORT_MODE_40G_10G_10G) | - (1 << TLV_PORT_MODE_10G_10G_40G), + (1 << TLV_PORT_MODE_10G_10G_40G) | + (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2), 2 }, /* Supported modes requiring 4 outputs per port */ { EFX_FAMILY_MEDFORD, (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q) | + (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q1) | (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q2), 4 }, Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon Oct 10 08:46:26 2016 (r306943) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon Oct 10 09:54:01 2016 (r306944) @@ -553,12 +553,14 @@ struct tlv_global_port_mode { #define TLV_PORT_MODE_40G (1) /* 40G, single QSFP/40G-KR */ #define TLV_PORT_MODE_10G_10G (2) /* 2x10G, dual SFP/10G-KR or single QSFP */ #define TLV_PORT_MODE_40G_40G (3) /* 40G + 40G, dual QSFP/40G-KR (Greenport, Medford) */ -#define TLV_PORT_MODE_10G_10G_10G_10G (4) /* 2x10G + 2x10G, quad SFP/10G-KR or dual QSFP (Greenport, Medford) */ -#define TLV_PORT_MODE_10G_10G_10G_10G_Q (5) /* 4x10G, single QSFP, cage 0 (Medford) */ +#define TLV_PORT_MODE_10G_10G_10G_10G (4) /* 2x10G + 2x10G, quad SFP/10G-KR or dual QSFP (Greenport) */ +#define TLV_PORT_MODE_10G_10G_10G_10G_Q1 (4) /* 4x10G, single QSFP, cage 0 (Medford) */ +#define TLV_PORT_MODE_10G_10G_10G_10G_Q (5) /* 4x10G, single QSFP, cage 0 (Medford) OBSOLETE DO NOT USE */ #define TLV_PORT_MODE_40G_10G_10G (6) /* 1x40G + 2x10G, dual QSFP (Greenport, Medford) */ #define TLV_PORT_MODE_10G_10G_40G (7) /* 2x10G + 1x40G, dual QSFP (Greenport, Medford) */ #define TLV_PORT_MODE_10G_10G_10G_10G_Q2 (8) /* 4x10G, single QSFP, cage 1 (Medford) */ -#define TLV_PORT_MODE_MAX TLV_PORT_MODE_10G_10G_10G_10G_Q2 +#define TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2 (9) /* 2x10G + 2x10G, dual QSFP (Medford) */ +#define TLV_PORT_MODE_MAX TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2 }; /* Type of the v-switch created implicitly by the firmware */ @@ -765,8 +767,8 @@ struct tlv_rx_event_merging_config { #define TLV_RX_EVENT_MERGING_CONFIG_MAX_EVENTS_MAX ((1 << 4) - 1) uint32_t timeout_ns; }; -#define TLV_RX_EVENT_MERGING_MAX_EVENTS_DEFAULT 7 -#define TLV_RX_EVENT_MERGING_TIMEOUT_NS_DEFAULT 8740 +#define TLV_RX_EVENT_MERGING_MAX_EVENTS_DEFAULT (0xffffffff) +#define TLV_RX_EVENT_MERGING_TIMEOUT_NS_DEFAULT (0xffffffff) #define TLV_TAG_PCIE_LINK_SETTINGS (0x101f0000) struct tlv_pcie_link_settings { @@ -791,9 +793,9 @@ struct tlv_tx_event_merging_config { uint32_t timeout_ns; uint32_t qempty_timeout_ns; /* Medford only */ }; -#define TLV_TX_EVENT_MERGING_MAX_EVENTS_DEFAULT 7 -#define TLV_TX_EVENT_MERGING_TIMEOUT_NS_DEFAULT 1400 -#define TLV_TX_EVENT_MERGING_QEMPTY_TIMEOUT_NS_DEFAULT 700 +#define TLV_TX_EVENT_MERGING_MAX_EVENTS_DEFAULT (0xffffffff) +#define TLV_TX_EVENT_MERGING_TIMEOUT_NS_DEFAULT (0xffffffff) +#define TLV_TX_EVENT_MERGING_QEMPTY_TIMEOUT_NS_DEFAULT (0xffffffff) /* Tx vFIFO Low latency configuration * @@ -809,6 +811,20 @@ struct tlv_tx_vfifo_ull_mode { #define TLV_TX_VFIFO_ULL_MODE_DEFAULT 0 }; +/* BIU mode + * + * Medford2 tag for selecting VI window decode (see values below) + */ +#define TLV_TAG_BIU_VI_WINDOW_MODE (0x10280000) +struct tlv_biu_vi_window_mode { + uint32_t tag; + uint32_t length; + uint8_t mode; +#define TLV_BIU_VI_WINDOW_MODE_8K 0 /* 8k per VI, CTPIO not mapped, medford/hunt compatible */ +#define TLV_BIU_VI_WINDOW_MODE_16K 1 /* 16k per VI, CTPIO mapped */ +#define TLV_BIU_VI_WINDOW_MODE_64K 2 /* 64k per VI, CTPIO mapped, POWER-friendly */ +}; + #define TLV_TAG_LICENSE (0x30800000) typedef struct tlv_license { From owner-svn-src-head@freebsd.org Mon Oct 10 13:40:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC752C072F2; Mon, 10 Oct 2016 13:40:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BF027A; Mon, 10 Oct 2016 13:40:06 +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 u9ADe5Qu093069; Mon, 10 Oct 2016 13:40:05 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ADe5XW093068; Mon, 10 Oct 2016 13:40:05 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610101340.u9ADe5XW093068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 10 Oct 2016 13:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306962 - head/tests/sys/kern/pipe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 13:40:06 -0000 Author: br Date: Mon Oct 10 13:40:05 2016 New Revision: 306962 URL: https://svnweb.freebsd.org/changeset/base/306962 Log: Ensure data in pipe is available to read. Useful for latest (5th, direct mode) test only. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/tests/sys/kern/pipe/pipe_fstat_bug_test.c Modified: head/tests/sys/kern/pipe/pipe_fstat_bug_test.c ============================================================================== --- head/tests/sys/kern/pipe/pipe_fstat_bug_test.c Mon Oct 10 11:53:54 2016 (r306961) +++ head/tests/sys/kern/pipe/pipe_fstat_bug_test.c Mon Oct 10 13:40:05 2016 (r306962) @@ -26,6 +26,7 @@ SUCH DAMAGE. #include #include #include +#include #include #include #include @@ -49,10 +50,12 @@ main(void) { char buffer[32768], buffer2[32768], go[] = "go", go2[] = "go2"; int desc[2], ipc_coord[2]; + struct kevent event, ke; ssize_t error; int successes = 0; struct stat status; pid_t new_pid; + int kq; error = pipe(desc); if (error == -1) @@ -118,9 +121,24 @@ main(void) _exit(0); } + kq = kqueue(); + if (kq == -1) + _exit(1); + + EV_SET(&ke, desc[0], EVFILT_READ, EV_ADD, 0, 0, NULL); + + /* Attach event to the kqueue. */ + if (kevent(kq, &ke, 1, NULL, 0, NULL) != 0) + _exit(2); + while (successes < 5) { SYNC_W(1, go); SYNC_R(1, go2); + + /* Ensure data is available to read */ + if (kevent(kq, NULL, 0, &event, 1, NULL) != 1) + _exit(3); + fstat(desc[0], &status); error = read(desc[0], &buffer2, sizeof(buffer2)); From owner-svn-src-head@freebsd.org Mon Oct 10 14:21:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87377C07F33; Mon, 10 Oct 2016 14:21:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 539DDABD; Mon, 10 Oct 2016 14:21:22 +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 u9AELLEv010800; Mon, 10 Oct 2016 14:21:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AELLim010799; Mon, 10 Oct 2016 14:21:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610101421.u9AELLim010799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Oct 2016 14:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306963 - head/usr.sbin/chown X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 14:21:22 -0000 Author: emaste Date: Mon Oct 10 14:21:21 2016 New Revision: 306963 URL: https://svnweb.freebsd.org/changeset/base/306963 Log: chown: use NULL instead of 0 for null pointer Modified: head/usr.sbin/chown/chown.c Modified: head/usr.sbin/chown/chown.c ============================================================================== --- head/usr.sbin/chown/chown.c Mon Oct 10 13:40:05 2016 (r306962) +++ head/usr.sbin/chown/chown.c Mon Oct 10 14:21:21 2016 (r306963) @@ -159,7 +159,7 @@ main(int argc, char **argv) } else a_gid(*argv); - if ((ftsp = fts_open(++argv, fts_options, 0)) == NULL) + if ((ftsp = fts_open(++argv, fts_options, NULL)) == NULL) err(1, NULL); for (rval = 0; (p = fts_read(ftsp)) != NULL;) { From owner-svn-src-head@freebsd.org Mon Oct 10 14:21:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F1B7C07FAA; Mon, 10 Oct 2016 14:21:42 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0128CC72; Mon, 10 Oct 2016 14:21:41 +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 u9AELfmQ012118; Mon, 10 Oct 2016 14:21:41 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AELfwG012117; Mon, 10 Oct 2016 14:21:41 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610101421.u9AELfwG012117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 10 Oct 2016 14:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306964 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 14:21:42 -0000 Author: br Date: Mon Oct 10 14:21:40 2016 New Revision: 306964 URL: https://svnweb.freebsd.org/changeset/base/306964 Log: Skip test on MIPS as we don't have shared page implemented yet. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/tests/sys/kern/kern_copyin.c Modified: head/tests/sys/kern/kern_copyin.c ============================================================================== --- head/tests/sys/kern/kern_copyin.c Mon Oct 10 14:21:21 2016 (r306963) +++ head/tests/sys/kern/kern_copyin.c Mon Oct 10 14:21:40 2016 (r306964) @@ -59,6 +59,11 @@ ATF_TC_BODY(kern_copyin, tc) { char template[] = "copyin.XXXXXX"; +#ifdef __mips__ + /* MIPS has no shared page implemented yet. */ + atf_tc_skip("Platform is not supported."); +#endif + scratch_file = mkstemp(template); ATF_REQUIRE(scratch_file != -1); unlink(template); From owner-svn-src-head@freebsd.org Mon Oct 10 15:30:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 789E0C07BCC; Mon, 10 Oct 2016 15:30:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 453EF385; Mon, 10 Oct 2016 15:30:00 +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 u9AFTxB6034970; Mon, 10 Oct 2016 15:29:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AFTxvJ034969; Mon, 10 Oct 2016 15:29:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610101529.u9AFTxvJ034969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Oct 2016 15:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306965 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 15:30:00 -0000 Author: emaste Date: Mon Oct 10 15:29:59 2016 New Revision: 306965 URL: https://svnweb.freebsd.org/changeset/base/306965 Log: Remove old makewhatis(1) man page when using mandoc mandoc installs makewhatis(8) Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Oct 10 14:21:40 2016 (r306964) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Oct 10 15:29:59 2016 (r306965) @@ -6014,6 +6014,10 @@ OLD_FILES+=usr/share/man/whatis OLD_FILES+=usr/share/openssl/man/whatis .endif +.if ${MK_MANDOCDB} != no +OLD_FILES+=usr/share/man/man1/makewhatis.1.gz +.endif + .if ${MK_NDIS} == no OLD_FILES+=usr/sbin/ndiscvt OLD_FILES+=usr/sbin/ndisgen From owner-svn-src-head@freebsd.org Mon Oct 10 15:35:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF021C07E1D; Mon, 10 Oct 2016 15:35:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CDD4AF1; Mon, 10 Oct 2016 15:35:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f175.google.com with SMTP id i202so114290809ioi.2; Mon, 10 Oct 2016 08:35:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=+LDSNEmS0Ut98gJ0QU25qfYN8c4DnbRfO21d5AIXJY4=; b=QGpmVLLf98c+bbnxvyHlKnjS9zkHxAMIzB9+l4HxtbPbawVcw9EajRH4S7YL+nDInU ZNW3JDA6AsfSDGD9V8Oy9onm3KZbF9JdSst2qIQBjZ+dWkfF1ONlIgS+8pIHX9UaF0OG oGHl7e3maNedNZl6csh5Vh4Ia3VnLffeeuB8kJtUero8Z3ad7sFz0vNZQqcYPxxgXUMd 3B/Bd65j/Ty6v5eGNVJ39S0LNsPI+ER8m643qJ5q1X/53RFNurtxrLiAuGZ7W1FIvEOj x+nM1N+3RYEwN/U938jPT1vwP6gKotN37HGN2qRGQsOejuaLpHeN+dGcQCShZMcqkMlw DxIw== X-Gm-Message-State: AA6/9RmkQv6M0fj4OhdMRSjL6P3XOS45Gyg/QvaOw3wlmLBlrtTiNVzUD5iNfIL9u0naVQ== X-Received: by 10.107.29.21 with SMTP id d21mr18784589iod.10.1476111885721; Mon, 10 Oct 2016 08:04:45 -0700 (PDT) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com. [209.85.223.177]) by smtp.gmail.com with ESMTPSA id a192sm6897434itc.8.2016.10.10.08.04.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Oct 2016 08:04:45 -0700 (PDT) Received: by mail-io0-f177.google.com with SMTP id i202so113270486ioi.2; Mon, 10 Oct 2016 08:04:45 -0700 (PDT) X-Received: by 10.107.168.96 with SMTP id r93mr31796675ioe.31.1476111884796; Mon, 10 Oct 2016 08:04:44 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Mon, 10 Oct 2016 08:04:44 -0700 (PDT) In-Reply-To: <201610101340.u9ADe5XW093068@repo.freebsd.org> References: <201610101340.u9ADe5XW093068@repo.freebsd.org> From: Conrad Meyer Date: Mon, 10 Oct 2016 08:04:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r306962 - head/tests/sys/kern/pipe To: Ruslan Bukin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 15:35:00 -0000 We also observed this test was broken, but I think the right fix is much smaller: --- a/tests/sys/kern/pipe/pipe_fstat_bug_test.c +++ b/tests/sys/kern/pipe/pipe_fstat_bug_test.c @@ -108,7 +108,6 @@ main(void) SYNC_W(0, go2); SYNC_R(0, go); - SYNC_W(0, go2); /* XXX: why is this required? */ WRITE(8192); SYNC_W(0, go2); (That line breaks the synchronization mechanism that is the only guarantee the test passes.) Best, Conrad On Mon, Oct 10, 2016 at 6:40 AM, Ruslan Bukin wrote: > Author: br > Date: Mon Oct 10 13:40:05 2016 > New Revision: 306962 > URL: https://svnweb.freebsd.org/changeset/base/306962 > > Log: > Ensure data in pipe is available to read. > Useful for latest (5th, direct mode) test only. > > Sponsored by: DARPA, AFRL > Sponsored by: HEIF5 > > Modified: > head/tests/sys/kern/pipe/pipe_fstat_bug_test.c > > Modified: head/tests/sys/kern/pipe/pipe_fstat_bug_test.c > ============================================================================== > --- head/tests/sys/kern/pipe/pipe_fstat_bug_test.c Mon Oct 10 11:53:54 2016 (r306961) > +++ head/tests/sys/kern/pipe/pipe_fstat_bug_test.c Mon Oct 10 13:40:05 2016 (r306962) > @@ -26,6 +26,7 @@ SUCH DAMAGE. > #include > #include > #include > +#include > #include > #include > #include > @@ -49,10 +50,12 @@ main(void) > { > char buffer[32768], buffer2[32768], go[] = "go", go2[] = "go2"; > int desc[2], ipc_coord[2]; > + struct kevent event, ke; > ssize_t error; > int successes = 0; > struct stat status; > pid_t new_pid; > + int kq; > > error = pipe(desc); > if (error == -1) > @@ -118,9 +121,24 @@ main(void) > _exit(0); > } > > + kq = kqueue(); > + if (kq == -1) > + _exit(1); > + > + EV_SET(&ke, desc[0], EVFILT_READ, EV_ADD, 0, 0, NULL); > + > + /* Attach event to the kqueue. */ > + if (kevent(kq, &ke, 1, NULL, 0, NULL) != 0) > + _exit(2); > + > while (successes < 5) { > SYNC_W(1, go); > SYNC_R(1, go2); > + > + /* Ensure data is available to read */ > + if (kevent(kq, NULL, 0, &event, 1, NULL) != 1) > + _exit(3); > + > fstat(desc[0], &status); > error = read(desc[0], &buffer2, sizeof(buffer2)); > > From owner-svn-src-head@freebsd.org Mon Oct 10 15:40:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8799C07EB4; Mon, 10 Oct 2016 15:40:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4C00CF5; Mon, 10 Oct 2016 15:40:09 +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 u9AFe82l039249; Mon, 10 Oct 2016 15:40:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AFe8X4039248; Mon, 10 Oct 2016 15:40:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610101540.u9AFe8X4039248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Oct 2016 15:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306966 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 15:40:10 -0000 Author: emaste Date: Mon Oct 10 15:40:08 2016 New Revision: 306966 URL: https://svnweb.freebsd.org/changeset/base/306966 Log: Correct sense of WITHOUT_MANDOCDB knob WITHOUT_MANDOCDB *disables* the use of mandoc's makewhatis. Modified: head/tools/build/options/WITHOUT_MANDOCDB Modified: head/tools/build/options/WITHOUT_MANDOCDB ============================================================================== --- head/tools/build/options/WITHOUT_MANDOCDB Mon Oct 10 15:29:59 2016 (r306965) +++ head/tools/build/options/WITHOUT_MANDOCDB Mon Oct 10 15:40:08 2016 (r306966) @@ -1,6 +1,9 @@ .\" $FreeBSD$ -Use the -.Xr mandoc 1 -version of +Use the version of +.Xr makewhatis 1 +introduced in +.Fx 2.1 , +instead of the .Xr makewhatis 8 -database and utilities. +database and utilities from +.Xr mandoc 1 . From owner-svn-src-head@freebsd.org Mon Oct 10 15:47:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AB11C0C0EF; Mon, 10 Oct 2016 15:47:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 269A867D; Mon, 10 Oct 2016 15:47:31 +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 u9AFlUZ0042952; Mon, 10 Oct 2016 15:47:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AFlUFv042951; Mon, 10 Oct 2016 15:47:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610101547.u9AFlUFv042951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Oct 2016 15:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306969 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 15:47:31 -0000 Author: emaste Date: Mon Oct 10 15:47:30 2016 New Revision: 306969 URL: https://svnweb.freebsd.org/changeset/base/306969 Log: src.conf.5: regen after r306965 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Oct 10 15:44:42 2016 (r306968) +++ head/share/man/man5/src.conf.5 Mon Oct 10 15:47:30 2016 (r306969) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 306729 2016-10-05 20:12:00Z emaste .\" $FreeBSD$ -.Dd October 5, 2016 +.Dd October 10, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1075,12 +1075,15 @@ is set explicitly) Set to not to install compressed man pages. Only the uncompressed versions will be installed. .It Va WITHOUT_MANDOCDB -.\" from FreeBSD: head/tools/build/options/WITHOUT_MANDOCDB 283777 2015-05-30 17:41:37Z bapt -Use the -.Xr mandoc 1 -version of +.\" from FreeBSD: head/tools/build/options/WITHOUT_MANDOCDB 306966 2016-10-10 15:40:08Z emaste +Use the version of +.Xr makewhatis 1 +introduced in +.Fx 2.1 , +instead of the .Xr makewhatis 8 -database and utilities. +database and utilities from +.Xr mandoc 1 . .It Va WITHOUT_MAN_UTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim Set to not build utilities for manual pages, From owner-svn-src-head@freebsd.org Mon Oct 10 16:01:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C53EAC0C6F0; Mon, 10 Oct 2016 16:01:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 404FEB24; Mon, 10 Oct 2016 16:01:25 +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 u9AG1EB5025167 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 10 Oct 2016 19:01:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u9AG1EB5025167 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u9AG1Enc025166; Mon, 10 Oct 2016 19:01:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 10 Oct 2016 19:01:14 +0300 From: Konstantin Belousov To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r306964 - head/tests/sys/kern Message-ID: <20161010160114.GL68202@kib.kiev.ua> References: <201610101421.u9AELfwG012117@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201610101421.u9AELfwG012117@repo.freebsd.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 16:01:25 -0000 On Mon, Oct 10, 2016 at 02:21:41PM +0000, Ruslan Bukin wrote: > Author: br > Date: Mon Oct 10 14:21:40 2016 > New Revision: 306964 > URL: https://svnweb.freebsd.org/changeset/base/306964 > > Log: > Skip test on MIPS as we don't have shared page implemented yet. > > Sponsored by: DARPA, AFRL > Sponsored by: HEIF5 > > Modified: > head/tests/sys/kern/kern_copyin.c > > Modified: head/tests/sys/kern/kern_copyin.c > ============================================================================== > --- head/tests/sys/kern/kern_copyin.c Mon Oct 10 14:21:21 2016 (r306963) > +++ head/tests/sys/kern/kern_copyin.c Mon Oct 10 14:21:40 2016 (r306964) > @@ -59,6 +59,11 @@ ATF_TC_BODY(kern_copyin, tc) > { > char template[] = "copyin.XXXXXX"; > > +#ifdef __mips__ > + /* MIPS has no shared page implemented yet. */ > + atf_tc_skip("Platform is not supported."); > +#endif > + > scratch_file = mkstemp(template); > ATF_REQUIRE(scratch_file != -1); > unlink(template); Shared page does not have much to do with the test failure. The cause is that the UVA map on mips ends the highest mapped entry at the VM_MAXUSER_ADDRESS - PAGE_SIZE, while all other arches map either stack or shared page up to the VM_MAXUSER_ADDRESS. >From the comment in mips/include/vmparam.h it is not clear whether the test could be fixed by mapping a page at VM_MAXUSER_ADDRESS - PAGE_SIZE. From owner-svn-src-head@freebsd.org Mon Oct 10 16:50:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60569C0BD1D; Mon, 10 Oct 2016 16:50:54 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-31.csi.cam.ac.uk (ppsw-31.csi.cam.ac.uk [131.111.8.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B5491E8; Mon, 10 Oct 2016 16:50:53 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from sc1.bsdpad.com ([163.172.212.18]:35514) by ppsw-31.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1btdmu-000vmT-KG (Exim 4.86_36-e07b163) (return-path ); Mon, 10 Oct 2016 17:50:52 +0100 Date: Mon, 10 Oct 2016 16:50:38 +0000 From: Ruslan Bukin To: Conrad Meyer Cc: Ruslan Bukin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r306962 - head/tests/sys/kern/pipe Message-ID: <20161010165038.GA31246@bsdpad.com> References: <201610101340.u9ADe5XW093068@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 10 Oct 2016 16:50:54 -0000 There is some direct mode activated when you send >=8192, so this line is required Ruslan On Mon, Oct 10, 2016 at 08:04:44AM -0700, Conrad Meyer wrote: > We also observed this test was broken, but I think the right fix is > much smaller: > > --- a/tests/sys/kern/pipe/pipe_fstat_bug_test.c > +++ b/tests/sys/kern/pipe/pipe_fstat_bug_test.c > @@ -108,7 +108,6 @@ main(void) > SYNC_W(0, go2); > > SYNC_R(0, go); > - SYNC_W(0, go2); /* XXX: why is this required? */ > WRITE(8192); > SYNC_W(0, go2); > > (That line breaks the synchronization mechanism that is the only > guarantee the test passes.) > > Best, > Conrad > > > On Mon, Oct 10, 2016 at 6:40 AM, Ruslan Bukin wrote: > > Author: br > > Date: Mon Oct 10 13:40:05 2016 > > New Revision: 306962 > > URL: https://svnweb.freebsd.org/changeset/base/306962 > > > > Log: > > Ensure data in pipe is available to read. > > Useful for latest (5th, direct mode) test only. > > > > Sponsored by: DARPA, AFRL > > Sponsored by: HEIF5 > > > > Modified: > > head/tests/sys/kern/pipe/pipe_fstat_bug_test.c > > > > Modified: head/tests/sys/kern/pipe/pipe_fstat_bug_test.c > > ============================================================================== > > --- head/tests/sys/kern/pipe/pipe_fstat_bug_test.c Mon Oct 10 11:53:54 2016 (r306961) > > +++ head/tests/sys/kern/pipe/pipe_fstat_bug_test.c Mon Oct 10 13:40:05 2016 (r306962) > > @@ -26,6 +26,7 @@ SUCH DAMAGE. > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -49,10 +50,12 @@ main(void) > > { > > char buffer[32768], buffer2[32768], go[] = "go", go2[] = "go2"; > > int desc[2], ipc_coord[2]; > > + struct kevent event, ke; > > ssize_t error; > > int successes = 0; > > struct stat status; > > pid_t new_pid; > > + int kq; > > > > error = pipe(desc); > > if (error == -1) > > @@ -118,9 +121,24 @@ main(void) > > _exit(0); > > } > > > > + kq = kqueue(); > > + if (kq == -1) > > + _exit(1); > > + > > + EV_SET(&ke, desc[0], EVFILT_READ, EV_ADD, 0, 0, NULL); > > + > > + /* Attach event to the kqueue. */ > > + if (kevent(kq, &ke, 1, NULL, 0, NULL) != 0) > > + _exit(2); > > + > > while (successes < 5) { > > SYNC_W(1, go); > > SYNC_R(1, go2); > > + > > + /* Ensure data is available to read */ > > + if (kevent(kq, NULL, 0, &event, 1, NULL) != 1) > > + _exit(3); > > + > > fstat(desc[0], &status); > > error = read(desc[0], &buffer2, sizeof(buffer2)); > > > > > From owner-svn-src-head@freebsd.org Mon Oct 10 17:00:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A89EC0C09F; Mon, 10 Oct 2016 17:00:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C607A8C; Mon, 10 Oct 2016 17:00:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9AH0CCZ072817; Mon, 10 Oct 2016 17:00:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AH0CXj072816; Mon, 10 Oct 2016 17:00:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201610101700.u9AH0CXj072816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 10 Oct 2016 17:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306999 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 17:00:13 -0000 Author: jhb Date: Mon Oct 10 17:00:12 2016 New Revision: 306999 URL: https://svnweb.freebsd.org/changeset/base/306999 Log: Add a missing word. MFC after: 1 month Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Oct 10 16:41:17 2016 (r306998) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Oct 10 17:00:12 2016 (r306999) @@ -149,7 +149,7 @@ &intel; EM64T is an extended version of IA-32 (x86) and - different from &intel; IA-64 (Itanium) architecture. Some + different from &intel; IA-64 (Itanium) architecture. Some of &intel;'s old documentation refers to &intel; EM64T as 64-bit extension technology or IA-32e. From owner-svn-src-head@freebsd.org Mon Oct 10 17:16:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A239C0C3B3; Mon, 10 Oct 2016 17:16:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30F7E34D; Mon, 10 Oct 2016 17:16:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9AHG3ED079940; Mon, 10 Oct 2016 17:16:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AHG2XI079936; Mon, 10 Oct 2016 17:16:02 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201610101716.u9AHG2XI079936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 10 Oct 2016 17:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307000 - in head: . share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 17:16:04 -0000 Author: avos Date: Mon Oct 10 17:16:02 2016 New Revision: 307000 URL: https://svnweb.freebsd.org/changeset/base/307000 Log: mbuf(9), mbuf_tags(9): fix function prototypes. - Add m_getclr(9) symlink to ObsoleteFiles.inc (removed in r295481). - Add const qualifiers in m_dup(), m_dup_pkthdr() and m_tag_copy_chain() (r286450). - Fix m_dup_pkthdr() definition (it's not the same as m_move_pkthdr()). MFC after: 5 days Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/mbuf.9 head/share/man/man9/mbuf_tags.9 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 10 17:00:12 2016 (r306999) +++ head/ObsoleteFiles.inc Mon Oct 10 17:16:02 2016 (r307000) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20161010: remove link to removed m_getclr(9) macro +OLD_FILES+=usr/share/man/man9/m_getclr.9 # 20161003: MK_ELFCOPY_AS_OBJCOPY option retired OLD_FILES+=usr/bin/elfcopy OLD_FILES+=usr/share/man/man1/elfcopy.1.gz Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Oct 10 17:00:12 2016 (r306999) +++ head/share/man/man9/Makefile Mon Oct 10 17:16:02 2016 (r307000) @@ -1138,7 +1138,6 @@ MLINKS+=\ mbuf.9 m_get2.9 \ mbuf.9 m_getjcl.9 \ mbuf.9 m_getcl.9 \ - mbuf.9 m_getclr.9 \ mbuf.9 MGETHDR.9 \ mbuf.9 m_gethdr.9 \ mbuf.9 m_getm.9 \ Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Mon Oct 10 17:00:12 2016 (r306999) +++ head/share/man/man9/mbuf.9 Mon Oct 10 17:16:02 2016 (r307000) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2016 +.Dd October 10, 2016 .Dt MBUF 9 .Os .\" @@ -79,8 +79,6 @@ .Ft struct mbuf * .Fn m_getcl "int how" "short type" "int flags" .Ft struct mbuf * -.Fn m_getclr "int how" "short type" -.Ft struct mbuf * .Fn m_gethdr "int how" "short type" .Ft struct mbuf * .Fn m_free "struct mbuf *mbuf" @@ -107,7 +105,7 @@ .Ft struct mbuf * .Fn m_copypacket "struct mbuf *mbuf" "int how" .Ft struct mbuf * -.Fn m_dup "struct mbuf *mbuf" "int how" +.Fn m_dup "const struct mbuf *mbuf" "int how" .Ft void .Fn m_copydata "const struct mbuf *mbuf" "int offset" "int len" "caddr_t buf" .Ft void @@ -126,8 +124,8 @@ .Fn m_catpkt "struct mbuf *m" "struct mbuf *n" .Ft u_int .Fn m_fixhdr "struct mbuf *mbuf" -.Ft void -.Fn m_dup_pkthdr "struct mbuf *to" "struct mbuf *from" +.Ft int +.Fn m_dup_pkthdr "struct mbuf *to" "const struct mbuf *from" "int how" .Ft void .Fn m_move_pkthdr "struct mbuf *to" "struct mbuf *from" .Ft u_int @@ -602,10 +600,6 @@ This is like but it the size of the cluster allocated will be large enough for .Fa size bytes. -.It Fn m_getclr how type -Allocate an -.Vt mbuf -and zero out the data region. .It Fn m_free mbuf Frees .Vt mbuf . Modified: head/share/man/man9/mbuf_tags.9 ============================================================================== --- head/share/man/man9/mbuf_tags.9 Mon Oct 10 17:00:12 2016 (r306999) +++ head/share/man/man9/mbuf_tags.9 Mon Oct 10 17:16:02 2016 (r307000) @@ -33,7 +33,7 @@ .Ft "struct m_tag *" .Fn m_tag_copy "struct m_tag *t" "int how" .Ft int -.Fn m_tag_copy_chain "struct mbuf *to" "struct mbuf *from" "int how" +.Fn m_tag_copy_chain "struct mbuf *to" "const struct mbuf *from" "int how" .Ft void .Fn m_tag_delete "struct mbuf *m" "struct m_tag *t" .Ft void From owner-svn-src-head@freebsd.org Mon Oct 10 17:18:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEFCCC0C412; Mon, 10 Oct 2016 17:18:24 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5CE1766; Mon, 10 Oct 2016 17:18:24 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9AHINwL080057; Mon, 10 Oct 2016 17:18:23 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AHINd2080056; Mon, 10 Oct 2016 17:18:23 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201610101718.u9AHINd2080056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 10 Oct 2016 17:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307001 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 17:18:25 -0000 Author: avos Date: Mon Oct 10 17:18:23 2016 New Revision: 307001 URL: https://svnweb.freebsd.org/changeset/base/307001 Log: Add missing *.gz extension. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 10 17:16:02 2016 (r307000) +++ head/ObsoleteFiles.inc Mon Oct 10 17:18:23 2016 (r307001) @@ -39,7 +39,7 @@ # done # 20161010: remove link to removed m_getclr(9) macro -OLD_FILES+=usr/share/man/man9/m_getclr.9 +OLD_FILES+=usr/share/man/man9/m_getclr.9.gz # 20161003: MK_ELFCOPY_AS_OBJCOPY option retired OLD_FILES+=usr/bin/elfcopy OLD_FILES+=usr/share/man/man1/elfcopy.1.gz From owner-svn-src-head@freebsd.org Mon Oct 10 17:21:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A41BDC0C490; Mon, 10 Oct 2016 17:21:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 183D29BD; Mon, 10 Oct 2016 17:21:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f178.google.com with SMTP id q192so118049441iod.0; Mon, 10 Oct 2016 10:21:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=bwVek/zWoj0aofDu1oUriTo7k0+aXhV9rSr2/roD5wQ=; b=eq5Moq99018jnGkYEKHjDoNzGb2T2T2iyIPLb/KWqLU0I7+ZHQJW1grdR8yIRyduwh OTM3HJz2RS9kGMfgIiOVOPnBq42WlOFlcTq4w9KcbAHvyOsKxs66a0ln65/EsoJ3kpFU tVw7Jxl/z6jH2UjGknl85b9/kAdVrGebKhd51OCfm7EZKstIGa7TODh21efAzi6pqRFi bi28J5qfWlDk1TUDMMUV2Gb4mLqQ2r3424y+iJXyJUMiephqkU4f9vS9Icv/GEsVeUeR jSUMOqVS8TV8eVd7jP6nDHJIp7Wwx2K2OHbog++FlrRLOeQJaMUSOCLtXcYsuVoZ0BfS WV8A== X-Gm-Message-State: AA6/9RnTu3TWH4mFD8qXOUeVtJlJWpdgFlXoEUU4Ht3PGRFaNK6M1ZyIqGTeyVrbbMv4vQ== X-Received: by 10.107.130.16 with SMTP id e16mr34003298iod.38.1476120080414; Mon, 10 Oct 2016 10:21:20 -0700 (PDT) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com. [209.85.223.182]) by smtp.gmail.com with ESMTPSA id e69sm4619909iod.39.2016.10.10.10.21.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Oct 2016 10:21:20 -0700 (PDT) Received: by mail-io0-f182.google.com with SMTP id q192so118049075iod.0; Mon, 10 Oct 2016 10:21:19 -0700 (PDT) X-Received: by 10.107.168.96 with SMTP id r93mr32589024ioe.31.1476120079707; Mon, 10 Oct 2016 10:21:19 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Mon, 10 Oct 2016 10:21:19 -0700 (PDT) In-Reply-To: <20161010165038.GA31246@bsdpad.com> References: <201610101340.u9ADe5XW093068@repo.freebsd.org> <20161010165038.GA31246@bsdpad.com> From: Conrad Meyer Date: Mon, 10 Oct 2016 10:21:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r306962 - head/tests/sys/kern/pipe To: Ruslan Bukin Cc: Ruslan Bukin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 17:21:27 -0000 On Mon, Oct 10, 2016 at 9:50 AM, Ruslan Bukin wrote: > On Mon, Oct 10, 2016 at 08:04:44AM -0700, Conrad Meyer wrote: >> We also observed this test was broken, but I think the right fix is >> much smaller: >> >> --- a/tests/sys/kern/pipe/pipe_fstat_bug_test.c >> +++ b/tests/sys/kern/pipe/pipe_fstat_bug_test.c >> @@ -108,7 +108,6 @@ main(void) >> SYNC_W(0, go2); >> >> SYNC_R(0, go); >> - SYNC_W(0, go2); /* XXX: why is this required? */ >> WRITE(8192); >> SYNC_W(0, go2); >> >> (That line breaks the synchronization mechanism that is the only >> guarantee the test passes.) > > There is some direct mode activated when you send >=8192, > so this line is required Given that line breaks the parent-child synchronization entirely and your kevent replaces it, why not remove the remaining go/go2 pipe and read/writes? Best, Conrad From owner-svn-src-head@freebsd.org Mon Oct 10 18:36:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD01AC0CB4E; Mon, 10 Oct 2016 18:36:27 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B595102E; Mon, 10 Oct 2016 18:36:27 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9AIaQpw010736; Mon, 10 Oct 2016 18:36:26 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AIaQbo010735; Mon, 10 Oct 2016 18:36:26 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201610101836.u9AIaQbo010735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Mon, 10 Oct 2016 18:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307002 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 18:36:27 -0000 Author: maxim Date: Mon Oct 10 18:36:26 2016 New Revision: 307002 URL: https://svnweb.freebsd.org/changeset/base/307002 Log: FreeBSD 11.0 release date added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Oct 10 17:18:23 2016 (r307001) +++ head/share/misc/bsd-family-tree Mon Oct 10 18:36:26 2016 (r307002) @@ -703,6 +703,7 @@ FreeBSD 10.3 2016-04-04 [FBD] NetBSD 7.0.1 2016-05-22 [NBD] DragonFly 4.6.0 2016-08-02 [DFB] OpenBSD 6.0 2016-09-01 [OBD] +FreeBSD 11.0 2016-10-10 [FBD] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Mon Oct 10 19:09:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6891C0C1DA; Mon, 10 Oct 2016 19:09:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76A95164; Mon, 10 Oct 2016 19:09:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9AJ9ZWZ022086; Mon, 10 Oct 2016 19:09:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AJ9ZH0022085; Mon, 10 Oct 2016 19:09:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610101909.u9AJ9ZH0022085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Oct 2016 19:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307003 - head/contrib/mdocml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 19:09:36 -0000 Author: emaste Date: Mon Oct 10 19:09:35 2016 New Revision: 307003 URL: https://svnweb.freebsd.org/changeset/base/307003 Log: makewhatis: make output reproducible The mandoc search database generation uses each page's inode number as a hash key to index hard linked pages only once. However, it also processed the pages ordered by hash key resulting in effectively non- deterministic output. Instead: 1) provide fts_open() with a comparison function to process directories and files in a deterministic order 2) in addition to the existing hash, insert pages into a linked list which will be sorted (by virtue of 1) 3) iterate over pages by the list in 2, instead of hash order I will work on upstreaming this change. Reviewed by: bapt MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8213 Modified: head/contrib/mdocml/mandocdb.c Modified: head/contrib/mdocml/mandocdb.c ============================================================================== --- head/contrib/mdocml/mandocdb.c Mon Oct 10 18:36:26 2016 (r307002) +++ head/contrib/mdocml/mandocdb.c Mon Oct 10 19:09:35 2016 (r307003) @@ -103,6 +103,7 @@ struct mpage { char *arch; /* architecture from file content */ char *title; /* title from file content */ char *desc; /* description from file content */ + struct mpage *next; /* singly linked list */ struct mlink *mlinks; /* singly linked list */ int form; /* format from file content */ int name_head_done; @@ -146,6 +147,7 @@ static void dbadd_mlink_name(const stru static int dbopen(int); static void dbprune(void); static void filescan(const char *); +static int fts_compare(const FTSENT *const *, const FTSENT *const *); static void mlink_add(struct mlink *, const struct stat *); static void mlink_check(struct mpage *, struct mlink *); static void mlink_free(struct mlink *); @@ -204,6 +206,7 @@ static struct ohash strings; /* table o static sqlite3 *db = NULL; /* current database */ static sqlite3_stmt *stmts[STMT__MAX]; /* current statements */ static uint64_t name_mask; +static struct mpage *mpage_head; static const struct mdoc_handler mdocs[MDOC_MAX] = { { NULL, 0 }, /* Ap */ @@ -571,6 +574,20 @@ usage: return (int)MANDOCLEVEL_BADARG; } +static int +fts_compare(const FTSENT *const *a, const FTSENT *const *b) +{ + + /* + * The mpage list is processed in the opposite order to which pages are + * added, so traverse the hierarchy in reverse alpha order, resulting + * in database inserts in alpha order. This is not required for correct + * operation, but is helpful when inspecting the database during + * development. + */ + return -strcmp((*a)->fts_name, (*b)->fts_name); +} + /* * Scan a directory tree rooted at "basedir" for manpages. * We use fts(), scanning directory parts along the way for clues to our @@ -600,8 +617,8 @@ treescan(void) argv[0] = "."; argv[1] = (char *)NULL; - f = fts_open((char * const *)argv, - FTS_PHYSICAL | FTS_NOCHDIR, NULL); + f = fts_open((char * const *)argv, FTS_PHYSICAL | FTS_NOCHDIR, + fts_compare); if (f == NULL) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "&fts_open"); @@ -966,6 +983,8 @@ mlink_add(struct mlink *mlink, const str mpage = mandoc_calloc(1, sizeof(struct mpage)); mpage->inodev.st_ino = inodev.st_ino; mpage->inodev.st_dev = inodev.st_dev; + mpage->next = mpage_head; + mpage_head = mpage; ohash_insert(&mpages, slot, mpage); } else mlink->next = mpage->mlinks; @@ -989,20 +1008,18 @@ mpages_free(void) { struct mpage *mpage; struct mlink *mlink; - unsigned int slot; - mpage = ohash_first(&mpages, &slot); - while (NULL != mpage) { + while (NULL != (mpage = mpage_head)) { while (NULL != (mlink = mpage->mlinks)) { mpage->mlinks = mlink->next; mlink_free(mlink); } + mpage_head = mpage->next; free(mpage->sec); free(mpage->arch); free(mpage->title); free(mpage->desc); free(mpage); - mpage = ohash_next(&mpages, &slot); } } @@ -1123,16 +1140,14 @@ mpages_merge(struct mparse *mp) char *sodest; char *cp; int fd; - unsigned int pslot; if ( ! nodb) SQL_EXEC("BEGIN TRANSACTION"); - mpage = ohash_first(&mpages, &pslot); - while (mpage != NULL) { + for (mpage = mpage_head; mpage != NULL; mpage = mpage->next) { mlinks_undupe(mpage); if ((mlink = mpage->mlinks) == NULL) { - mpage = ohash_next(&mpages, &pslot); + mpage = mpage->next; continue; } @@ -1256,7 +1271,6 @@ mpages_merge(struct mparse *mp) nextpage: ohash_delete(&strings); ohash_delete(&names); - mpage = ohash_next(&mpages, &pslot); } if (0 == nodb) From owner-svn-src-head@freebsd.org Mon Oct 10 22:36:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C501C0C716; Mon, 10 Oct 2016 22:36:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E6D6B6C; Mon, 10 Oct 2016 22:36:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9AMajLm006514; Mon, 10 Oct 2016 22:36:45 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9AMajg6006512; Mon, 10 Oct 2016 22:36:45 GMT (envelope-from np@FreeBSD.org) Message-Id: <201610102236.u9AMajg6006512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 10 Oct 2016 22:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307008 - in head/release: . tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 22:36:46 -0000 Author: np Date: Mon Oct 10 22:36:44 2016 New Revision: 307008 URL: https://svnweb.freebsd.org/changeset/base/307008 Log: Add the ability to override the size of the swap partition when building VM images. The default continues to be 1G. Reviewed by: gjb@ Sponsored by: Chelsio Communications Modified: head/release/Makefile.vm head/release/tools/vmimage.subr Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Mon Oct 10 21:12:56 2016 (r307007) +++ head/release/Makefile.vm Mon Oct 10 22:36:44 2016 (r307008) @@ -8,6 +8,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw VMSIZE?= 20G +SWAPSIZE?= 1G VMBASE?= vm VHD_DESC= Azure, VirtualPC, Hyper-V, Xen disk image Modified: head/release/tools/vmimage.subr ============================================================================== --- head/release/tools/vmimage.subr Mon Oct 10 21:12:56 2016 (r307007) +++ head/release/tools/vmimage.subr Mon Oct 10 22:36:44 2016 (r307008) @@ -11,7 +11,7 @@ trap "cleanup" INT QUIT TRAP ABRT TERM write_partition_layout() { if [ -z "${NOSWAP}" ]; then - SWAPOPT="-p freebsd-swap/swapfs::1G" + SWAPOPT="-p freebsd-swap/swapfs::${SWAPSIZE}" fi _OBJDIR="$(make -C ${WORLDDIR} -V .OBJDIR)" From owner-svn-src-head@freebsd.org Tue Oct 11 02:43:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A949C0CE39; Tue, 11 Oct 2016 02:43:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C213D06; Tue, 11 Oct 2016 02:43:24 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9B2hNsD000740; Tue, 11 Oct 2016 02:43:23 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9B2hNUJ000738; Tue, 11 Oct 2016 02:43:23 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610110243.u9B2hNUJ000738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 11 Oct 2016 02:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307012 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 02:43:24 -0000 Author: sephe Date: Tue Oct 11 02:43:23 2016 New Revision: 307012 URL: https://svnweb.freebsd.org/changeset/base/307012 Log: hyperv/vmbus: Allow driver to inject synchronous task into channel taskq. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8208 Modified: head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Tue Oct 11 02:25:59 2016 (r307011) +++ head/sys/dev/hyperv/include/vmbus.h Tue Oct 11 02:43:23 2016 (r307012) @@ -117,6 +117,7 @@ struct vmbus_chan_br { struct vmbus_channel; struct hyperv_guid; +struct task; typedef void (*vmbus_chan_callback_t)(struct vmbus_channel *, void *); @@ -134,6 +135,8 @@ int vmbus_chan_open_br(struct vmbus_cha int udlen, vmbus_chan_callback_t cb, void *cbarg); void vmbus_chan_close(struct vmbus_channel *chan); void vmbus_chan_intr_drain(struct vmbus_channel *chan); +void vmbus_chan_run_task(struct vmbus_channel *chan, + struct task *task); int vmbus_chan_gpadl_connect(struct vmbus_channel *chan, bus_addr_t paddr, int size, uint32_t *gpadl); Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Tue Oct 11 02:25:59 2016 (r307011) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Tue Oct 11 02:43:23 2016 (r307012) @@ -1713,3 +1713,11 @@ vmbus_chan_rx_empty(const struct vmbus_c return (vmbus_rxbr_empty(&chan->ch_rxbr)); } + +void +vmbus_chan_run_task(struct vmbus_channel *chan, struct task *task) +{ + + taskqueue_enqueue(chan->ch_tq, task); + taskqueue_drain(chan->ch_tq, task); +} From owner-svn-src-head@freebsd.org Tue Oct 11 02:54:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61D43C0B208; Tue, 11 Oct 2016 02:54:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C11430E; Tue, 11 Oct 2016 02:54:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9B2svRB004790; Tue, 11 Oct 2016 02:54:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9B2svVx004785; Tue, 11 Oct 2016 02:54:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610110254.u9B2svVx004785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 11 Oct 2016 02:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307013 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 02:54:58 -0000 Author: sephe Date: Tue Oct 11 02:54:56 2016 New Revision: 307013 URL: https://svnweb.freebsd.org/changeset/base/307013 Log: hyperv/hn: Rework link status support. This is the preamble for network device SR-IOV and NDIS_STATUS_NETWORK_CHANGE handling. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8209 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Oct 11 02:43:23 2016 (r307012) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Oct 11 02:54:56 2016 (r307013) @@ -233,6 +233,10 @@ struct hn_softc { struct vmbus_xact_ctx *hn_xact; uint32_t hn_nvs_ver; + struct taskqueue *hn_mgmt_taskq; + struct taskqueue *hn_mgmt_taskq0; + struct task hn_link_task; + uint32_t hn_caps; /* HN_CAP_ */ uint32_t hn_flags; /* HN_FLAG_ */ void *hn_rxbuf; @@ -271,7 +275,6 @@ struct hn_softc { */ struct hn_send_ctx; -void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status); int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Oct 11 02:43:23 2016 (r307012) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Oct 11 02:54:56 2016 (r307013) @@ -334,6 +334,8 @@ static void hn_fixup_tx_data(struct hn_s static void hn_destroy_tx_data(struct hn_softc *); static void hn_start_taskfunc(void *, int); static void hn_start_txeof_taskfunc(void *, int); +static void hn_link_taskfunc(void *, int); +static void hn_suspend_mgmt_taskfunc(void *, int); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); @@ -349,6 +351,8 @@ static int hn_synth_attach(struct hn_sof static void hn_synth_detach(struct hn_softc *); static bool hn_tx_ring_pending(struct hn_tx_ring *); static void hn_suspend(struct hn_softc *); +static void hn_suspend_data(struct hn_softc *); +static void hn_suspend_mgmt(struct hn_softc *); static void hn_resume(struct hn_softc *); static void hn_rx_drain(struct vmbus_channel *); static void hn_tx_resume(struct hn_softc *, int); @@ -518,7 +522,6 @@ netvsc_attach(device_t dev) struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; uint8_t eaddr[ETHER_ADDR_LEN]; - uint32_t link_status; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; @@ -551,6 +554,15 @@ netvsc_attach(device_t dev) } /* + * Setup taskqueue for mangement tasks, e.g. link status. + */ + sc->hn_mgmt_taskq0 = taskqueue_create("hn_mgmt", M_WAITOK, + taskqueue_thread_enqueue, &sc->hn_mgmt_taskq0); + taskqueue_start_threads(&sc->hn_mgmt_taskq0, 1, PI_NET, "%s mgmt", + device_get_nameunit(dev)); + TASK_INIT(&sc->hn_link_task, 0, hn_link_taskfunc, sc); + + /* * Allocate ifnet and setup its name earlier, so that if_printf * can be used by functions, which will be called after * ether_ifattach(). @@ -621,12 +633,6 @@ netvsc_attach(device_t dev) if (error) goto failed; - error = hn_rndis_get_linkstatus(sc, &link_status); - if (error) - goto failed; - if (link_status == NDIS_MEDIA_STATE_CONNECTED) - sc->hn_carrier = 1; - error = hn_rndis_get_eaddr(sc, eaddr); if (error) goto failed; @@ -736,6 +742,12 @@ netvsc_attach(device_t dev) /* Inform the upper layer about the long frame support. */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); + /* + * Kick off link status check. + */ + sc->hn_mgmt_taskq = sc->hn_mgmt_taskq0; + hn_link_status_update(sc); + return (0); failed: if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) @@ -755,6 +767,12 @@ netvsc_detach(device_t dev) if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) hn_stop(sc); + /* + * NOTE: + * hn_stop() only suspends data, so managment + * stuffs have to be suspended manually here. + */ + hn_suspend_mgmt(sc); hn_synth_detach(sc); } HN_UNLOCK(sc); @@ -767,6 +785,7 @@ netvsc_detach(device_t dev) if (sc->hn_tx_taskq != hn_tx_taskq) taskqueue_free(sc->hn_tx_taskq); + taskqueue_free(sc->hn_mgmt_taskq0); if (sc->hn_xact != NULL) vmbus_xact_ctx_destroy(sc->hn_xact); @@ -786,6 +805,36 @@ netvsc_shutdown(device_t dev) return (0); } +static void +hn_link_taskfunc(void *xsc, int pending __unused) +{ + struct hn_softc *sc = xsc; + struct ifnet *ifp = sc->hn_ifp; + uint32_t link_status; + int error; + + error = hn_rndis_get_linkstatus(sc, &link_status); + if (error) { + /* XXX what to do? */ + return; + } + + if (link_status == NDIS_MEDIA_STATE_CONNECTED) + sc->hn_carrier = 1; + else + sc->hn_carrier = 0; + if_link_state_change(ifp, + sc->hn_carrier ? LINK_STATE_UP : LINK_STATE_DOWN); +} + +void +hn_link_status_update(struct hn_softc *sc) +{ + + if (sc->hn_mgmt_taskq != NULL) + taskqueue_enqueue(sc->hn_mgmt_taskq, &sc->hn_link_task); +} + static __inline int hn_txdesc_dmamap_load(struct hn_tx_ring *txr, struct hn_txdesc *txd, struct mbuf **m_head, bus_dma_segment_t *segs, int *nsegs) @@ -1311,19 +1360,6 @@ hn_start_locked(struct hn_tx_ring *txr, } /* - * Link up/down notification - */ -void -netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status) -{ - if (status == 1) { - sc->hn_carrier = 1; - } else { - sc->hn_carrier = 0; - } -} - -/* * Append the specified data to the indicated mbuf chain, * Extend the mbuf chain if the new data does not fit in * existing space. @@ -1801,9 +1837,9 @@ hn_stop(struct hn_softc *sc) KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, ("synthetic parts were not attached")); - /* Clear RUNNING bit _before_ hn_suspend() */ + /* Clear RUNNING bit _before_ hn_suspend_data() */ atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_RUNNING); - hn_suspend(sc); + hn_suspend_data(sc); /* Clear OACTIVE bit. */ atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); @@ -1896,9 +1932,6 @@ hn_init_locked(struct hn_softc *sc) /* Everything is ready; unleash! */ atomic_set_int(&ifp->if_drv_flags, IFF_DRV_RUNNING); - - /* TODO: check RNDIS link status. */ - if_link_state_change(ifp, LINK_STATE_UP); } static void @@ -3600,7 +3633,7 @@ hn_rx_drain(struct vmbus_channel *chan) } static void -hn_suspend(struct hn_softc *sc) +hn_suspend_data(struct hn_softc *sc) { struct vmbus_channel **subch = NULL; int i, nsubch; @@ -3654,6 +3687,41 @@ hn_suspend(struct hn_softc *sc) } static void +hn_suspend_mgmt_taskfunc(void *xsc, int pending __unused) +{ + + ((struct hn_softc *)xsc)->hn_mgmt_taskq = NULL; +} + +static void +hn_suspend_mgmt(struct hn_softc *sc) +{ + struct task task; + + HN_LOCK_ASSERT(sc); + + /* + * Make sure that hn_mgmt_taskq0 can nolonger be accessed + * through hn_mgmt_taskq. + */ + TASK_INIT(&task, 0, hn_suspend_mgmt_taskfunc, sc); + vmbus_chan_run_task(sc->hn_prichan, &task); + + /* + * Make sure that all pending management tasks are completed. + */ + taskqueue_drain_all(sc->hn_mgmt_taskq0); +} + +static void +hn_suspend(struct hn_softc *sc) +{ + + hn_suspend_data(sc); + hn_suspend_mgmt(sc); +} + +static void hn_tx_resume(struct hn_softc *sc, int tx_ring_cnt) { int i; @@ -3685,7 +3753,8 @@ hn_resume(struct hn_softc *sc) /* * Make sure to clear suspend status on "all" TX rings, - * since hn_tx_ring_inuse can be changed after hn_suspend(). + * since hn_tx_ring_inuse can be changed after + * hn_suspend_data(). */ hn_tx_resume(sc, sc->hn_tx_ring_cnt); @@ -3710,6 +3779,12 @@ hn_resume(struct hn_softc *sc) */ taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_txeof_task); } + + /* + * Kick off link status check. + */ + sc->hn_mgmt_taskq = sc->hn_mgmt_taskq0; + hn_link_status_update(sc); } static void Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Oct 11 02:43:23 2016 (r307012) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Oct 11 02:54:56 2016 (r307013) @@ -167,11 +167,8 @@ hv_rf_receive_indicate_status(struct hn_ switch (msg->rm_status) { case RNDIS_STATUS_MEDIA_CONNECT: - netvsc_linkstatus_callback(sc, 1); - break; - case RNDIS_STATUS_MEDIA_DISCONNECT: - netvsc_linkstatus_callback(sc, 0); + hn_link_status_update(sc); break; case RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG: Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 11 02:43:23 2016 (r307012) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 11 02:54:56 2016 (r307013) @@ -138,6 +138,7 @@ void hn_nvs_sent_xact(struct hn_send_ct int hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info); void hn_chan_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); +void hn_link_status_update(struct hn_softc *sc); extern struct hn_send_ctx hn_send_ctx_none; From owner-svn-src-head@freebsd.org Tue Oct 11 11:45:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4754C0DC26; Tue, 11 Oct 2016 11:45:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F6DD9DB; Tue, 11 Oct 2016 11:45: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 u9BBjCSI005774; Tue, 11 Oct 2016 11:45:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BBjC1x005773; Tue, 11 Oct 2016 11:45:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610111145.u9BBjC1x005773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Oct 2016 11:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307036 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 11:45:13 -0000 Author: kib Date: Tue Oct 11 11:45:12 2016 New Revision: 307036 URL: https://svnweb.freebsd.org/changeset/base/307036 Log: Fill msg_len for the initial element of msgvec. Submitted by: Daniel Salzman MFC after: 3 days Modified: head/lib/libc/gen/recvmmsg.c Modified: head/lib/libc/gen/recvmmsg.c ============================================================================== --- head/lib/libc/gen/recvmmsg.c Tue Oct 11 09:19:30 2016 (r307035) +++ head/lib/libc/gen/recvmmsg.c Tue Oct 11 11:45:12 2016 (r307036) @@ -69,6 +69,8 @@ recvmmsg(int s, struct mmsghdr *__restri if (ret == -1) return (ret); + msgvec[0].msg_len = ret; + /* * Do non-blocking receive for second and later messages if * WAITFORONE is set. From owner-svn-src-head@freebsd.org Tue Oct 11 11:46:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B661CC0DC72; Tue, 11 Oct 2016 11:46:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86993B69; Tue, 11 Oct 2016 11:46:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BBk290005846; Tue, 11 Oct 2016 11:46:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BBk2cF005845; Tue, 11 Oct 2016 11:46:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610111146.u9BBk2cF005845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Oct 2016 11:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307037 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 11:46:03 -0000 Author: kib Date: Tue Oct 11 11:46:02 2016 New Revision: 307037 URL: https://svnweb.freebsd.org/changeset/base/307037 Log: Correct indent. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/gen/recvmmsg.c Modified: head/lib/libc/gen/recvmmsg.c ============================================================================== --- head/lib/libc/gen/recvmmsg.c Tue Oct 11 11:45:12 2016 (r307036) +++ head/lib/libc/gen/recvmmsg.c Tue Oct 11 11:46:02 2016 (r307037) @@ -83,10 +83,9 @@ recvmmsg(int s, struct mmsghdr *__restri ret = __sys_recvmsg(s, &msgvec[i].msg_hdr, flags); if (ret == -1) { /* We have received messages. Let caller know - * about the data received, socket - * error is returned on next - * invocation. - */ + * about the data received, socket error is + * returned on next invocation. + */ return (rcvd); } From owner-svn-src-head@freebsd.org Tue Oct 11 13:08:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEAF7C0C089; Tue, 11 Oct 2016 13:08:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FDBD199; Tue, 11 Oct 2016 13:08:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BD8mHp035586; Tue, 11 Oct 2016 13:08:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BD8mog035585; Tue, 11 Oct 2016 13:08:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201610111308.u9BD8mog035585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 11 Oct 2016 13:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307038 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 13:08:49 -0000 Author: arybchik Date: Tue Oct 11 13:08:48 2016 New Revision: 307038 URL: https://svnweb.freebsd.org/changeset/base/307038 Log: sfxge(4): update external port mapping for Medford Extend the mapping table for external port numbering to support port modes which output to the second external port only. Where supported, map from the current port mode rather than inferring from all the available modes. Updated comments for clarity. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8210 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Tue Oct 11 11:46:02 2016 (r307037) +++ head/sys/dev/sfxge/common/ef10_nic.c Tue Oct 11 13:08:48 2016 (r307038) @@ -1099,41 +1099,50 @@ fail1: /* - * The external port mapping is a one-based numbering of the external - * connectors on the board. It does not distinguish off-board separated - * outputs such as multi-headed cables. - * The number of ports that map to each external port connector - * on the board is determined by the chip family and the port modes to - * which the NIC can be configured. The mapping table lists modes with - * port numbering requirements in increasing order. + * Table of mapping schemes from port number to the number of the external + * connector on the board. The external numbering does not distinguish + * off-board separated outputs such as from multi-headed cables. + * + * The count of adjacent port numbers that map to each external port + * and the offset in the numbering, is determined by the chip family and + * current port mode. + * + * For the Huntington family, the current port mode cannot be discovered, + * so the mapping used is instead the last match in the table to the full + * set of port modes to which the NIC can be configured. Therefore the + * ordering of entries in the the mapping table is significant. */ static struct { efx_family_t family; uint32_t modes_mask; - uint32_t stride; + int32_t count; + int32_t offset; } __ef10_external_port_mappings[] = { - /* Supported modes requiring 1 output per port */ + /* Supported modes with 1 output per external port */ { EFX_FAMILY_HUNTINGTON, (1 << TLV_PORT_MODE_10G) | (1 << TLV_PORT_MODE_10G_10G) | (1 << TLV_PORT_MODE_10G_10G_10G_10G), + 1, 1 }, { EFX_FAMILY_MEDFORD, (1 << TLV_PORT_MODE_10G) | (1 << TLV_PORT_MODE_10G_10G), + 1, 1 }, - /* Supported modes requiring 2 outputs per port */ + /* Supported modes with 2 outputs per external port */ { EFX_FAMILY_HUNTINGTON, (1 << TLV_PORT_MODE_40G) | (1 << TLV_PORT_MODE_40G_40G) | (1 << TLV_PORT_MODE_40G_10G_10G) | (1 << TLV_PORT_MODE_10G_10G_40G), - 2 + 2, + 1 }, { EFX_FAMILY_MEDFORD, @@ -1142,15 +1151,22 @@ static struct { (1 << TLV_PORT_MODE_40G_10G_10G) | (1 << TLV_PORT_MODE_10G_10G_40G) | (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2), - 2 + 2, + 1 }, - /* Supported modes requiring 4 outputs per port */ + /* Supported modes with 4 outputs per external port */ { EFX_FAMILY_MEDFORD, (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q) | - (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q1) | + (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q1), + 4, + 1, + }, + { + EFX_FAMILY_MEDFORD, (1 << TLV_PORT_MODE_10G_10G_10G_10G_Q2), - 4 + 4, + 2 }, }; @@ -1164,11 +1180,26 @@ ef10_external_port_mapping( int i; uint32_t port_modes; uint32_t matches; - uint32_t stride = 1; /* default 1-1 mapping */ - - if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, NULL)) != 0) { - /* No port mode information available - use default mapping */ - goto out; + uint32_t current; + int32_t count = 1; /* Default 1-1 mapping */ + int32_t offset = 1; /* Default starting external port number */ + + if ((rc = efx_mcdi_get_port_modes(enp, &port_modes, ¤t)) != 0) { + /* + * No current port mode information + * - infer mapping from available modes + */ + if ((rc = efx_mcdi_get_port_modes(enp, + &port_modes, NULL)) != 0) { + /* + * No port mode information available + * - use default mapping + */ + goto out; + } + } else { + /* Only need to scan the current mode */ + port_modes = 1 << current; } /* @@ -1182,7 +1213,8 @@ ef10_external_port_mapping( matches = (__ef10_external_port_mappings[i].modes_mask & port_modes); if (matches != 0) { - stride = __ef10_external_port_mappings[i].stride; + count = __ef10_external_port_mappings[i].count; + offset = __ef10_external_port_mappings[i].offset; port_modes &= ~matches; } } @@ -1196,9 +1228,9 @@ ef10_external_port_mapping( out: /* * Scale as required by last matched mode and then convert to - * one-based numbering + * correctly offset numbering */ - *external_portp = (uint8_t)(port / stride) + 1; + *external_portp = (uint8_t)((port / count) + offset); return (0); fail1: From owner-svn-src-head@freebsd.org Tue Oct 11 13:30:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20E24C0C4B5; Tue, 11 Oct 2016 13:30:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6E2FE10; Tue, 11 Oct 2016 13:30:40 +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 u9BDUemU043447; Tue, 11 Oct 2016 13:30:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BDUekl043446; Tue, 11 Oct 2016 13:30:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610111330.u9BDUekl043446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 11 Oct 2016 13:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307040 - head/release/doc/share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 13:30:41 -0000 Author: emaste Date: Tue Oct 11 13:30:39 2016 New Revision: 307040 URL: https://svnweb.freebsd.org/changeset/base/307040 Log: Add Cavium sponsor entity Modified: head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Tue Oct 11 13:22:37 2016 (r307039) +++ head/release/doc/share/xml/sponsor.ent Tue Oct 11 13:30:39 2016 (r307040) @@ -11,6 +11,7 @@ + From owner-svn-src-head@freebsd.org Tue Oct 11 14:08:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9FF4C0D41E; Tue, 11 Oct 2016 14:08:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69069174C; Tue, 11 Oct 2016 14:08:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BE8rfu058458; Tue, 11 Oct 2016 14:08:53 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BE8rHp058457; Tue, 11 Oct 2016 14:08:53 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610111408.u9BE8rHp058457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 11 Oct 2016 14:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307041 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 14:08:54 -0000 Author: sbruno Date: Tue Oct 11 14:08:53 2016 New Revision: 307041 URL: https://svnweb.freebsd.org/changeset/base/307041 Log: Fix bug where malloc(.., M_NOWAIT) return value is not checked, Change to M_WAITOK and move outside the mutex Submitted by: shurd Reviewed by: mmacy@nextbsd.org MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D7649 Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Tue Oct 11 13:30:39 2016 (r307040) +++ head/sys/kern/subr_gtaskqueue.c Tue Oct 11 14:08:53 2016 (r307041) @@ -728,7 +728,7 @@ taskqgroup_bind(struct taskqgroup *qgrou * one. */ for (i = 0; i < qgroup->tqg_cnt; i++) { - gtask = malloc(sizeof (*gtask), M_DEVBUF, M_NOWAIT); + gtask = malloc(sizeof (*gtask), M_DEVBUF, M_WAITOK); GTASK_INIT(>ask->bt_task, 0, 0, taskqgroup_binder, gtask); gtask->bt_cpuid = qgroup->tqg_queue[i].tgc_cpu; grouptaskqueue_enqueue(qgroup->tqg_queue[i].tgc_taskq, @@ -827,11 +827,11 @@ _taskqgroup_adjust(struct taskqgroup *qg for (i = cnt; i < old_cnt; i++) taskqgroup_cpu_remove(qgroup, i); + taskqgroup_bind(qgroup); + mtx_lock(&qgroup->tqg_lock); qgroup->tqg_adjusting = 0; - taskqgroup_bind(qgroup); - return (0); } From owner-svn-src-head@freebsd.org Tue Oct 11 15:27:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0893EC0D8F3; Tue, 11 Oct 2016 15:27:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0B6BEE9; Tue, 11 Oct 2016 15:27: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 u9BFRd1r090146; Tue, 11 Oct 2016 15:27:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BFRdPG090145; Tue, 11 Oct 2016 15:27:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610111527.u9BFRdPG090145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 11 Oct 2016 15:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307042 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 15:27:41 -0000 Author: mav Date: Tue Oct 11 15:27:39 2016 New Revision: 307042 URL: https://svnweb.freebsd.org/changeset/base/307042 Log: Fix copy/paste bug in r306747. Submitted by: emaste, pfg MFC after: 3 days Modified: head/sys/cam/cam_compat.c Modified: head/sys/cam/cam_compat.c ============================================================================== --- head/sys/cam/cam_compat.c Tue Oct 11 14:08:53 2016 (r307041) +++ head/sys/cam/cam_compat.c Tue Oct 11 15:27:39 2016 (r307042) @@ -228,7 +228,7 @@ cam_compat_handle_0x17(struct cdev *dev, cts = &ccb->cts; cts17 = (struct ccb_trans_settings_0x17 *)hdr17; - cts17->type = cts17->type; + cts17->type = cts->type; cts17->protocol = cts->protocol; cts17->protocol_version = cts->protocol_version; cts17->transport = cts->transport; @@ -335,7 +335,7 @@ cam_compat_handle_0x18(struct cdev *dev, cts = &ccb->cts; cts18 = (struct ccb_trans_settings_0x18 *)hdr18; - cts18->type = cts18->type; + cts18->type = cts->type; cts18->protocol = cts->protocol; cts18->protocol_version = cts->protocol_version; cts18->transport = cts->transport; From owner-svn-src-head@freebsd.org Tue Oct 11 15:39:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E5A4C0DBA4; Tue, 11 Oct 2016 15:39:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E41616D3; Tue, 11 Oct 2016 15:39:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22c.google.com with SMTP id e6so4321413pfk.3; Tue, 11 Oct 2016 08:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4WZztBL4BoA+13Xr4WiV7rLfTAdGBJobymVABe7kZow=; b=pxI8+VRYWaZJc7qz79PhaT/koYTR64cInkuRhkqMrkkPjfT0YN6oHsLgDbOW8UVUkk hq4NCeSkVBbg0Qc2etVBEksku8jhuF0YZePLgomEMESXnalUTu5+3RVBp8WnC85YrFdr Ts5wETud3NB0/LzdIXCcL3iquTOAlcvjZ5Jr03HavvctWbss8+xJJMrClS0DOPEUuU/D 53r7qlancpMsrsB/fGHePrzRn5ueSwi9hn4S2nzRhPkwW1m0VNUAJeOubtj7UsN0eLzi C1Xenokj11ZFJyt1TB5IU0Uji/dNWVcKVAscntNyh4Mp7CkIwbeeibB3UiX6tMncmoST 0Asg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4WZztBL4BoA+13Xr4WiV7rLfTAdGBJobymVABe7kZow=; b=gG/XY1QHMe6Do4lMF6kNB0mPL4+etUmeHqR0mEVvaidQ3RblSQKYOcyXEIjnKvXjGk 2QN4n2qNjpODkFVWWKU2Og7jaZgXE5/FlbyKML2Yo0/Wsdrjt4ZYFTlu3wqi2Z40/OLF 81sL7lA76C7V6YgPAxFPi8iMiiYWkchKIRU4aNF9tEZF+Ha6NPatkYhzHM1hpDrdfgLi wkm0H//+nmi2if+xC7dva52VQsIISvL68DxVyeQ+GMtA1TvyO2z9CJafGDPjQ9mIHNW7 VaA+NXDp97226Ch8RrlP6c4tXrawVuM+8d5r/hOMY5GVdCelze6YCMRowQKmvy+Z/hWE 45YQ== X-Gm-Message-State: AA6/9RmordRrZdVRSTHw/G9JOkEmYJ4juo18QXqclvrtYdkKAFzPY93HMxzxADCwFq5+qg== X-Received: by 10.99.156.10 with SMTP id f10mr1973754pge.123.1476200382292; Tue, 11 Oct 2016 08:39:42 -0700 (PDT) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id n2sm4947283pfa.75.2016.10.11.08.39.41 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Oct 2016 08:39:41 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r307042 - head/sys/cam From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201610111527.u9BFRdPG090145@repo.freebsd.org> Date: Tue, 11 Oct 2016 08:40:24 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0103086C-F7CE-4B56-8AF8-164403642AF2@gmail.com> References: <201610111527.u9BFRdPG090145@repo.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 15:39:43 -0000 > On Oct 11, 2016, at 8:27 AM, Alexander Motin wrote: >=20 > Author: mav > Date: Tue Oct 11 15:27:39 2016 > New Revision: 307042 > URL: https://svnweb.freebsd.org/changeset/base/307042 >=20 > Log: > Fix copy/paste bug in r306747. >=20 > Submitted by: emaste, pfg > MFC after: 3 days Also, Coverity (I=E2=80=99ve marked the CIDs fixed): CID: 1364119, 1364120 Thanks, -Ngie= From owner-svn-src-head@freebsd.org Tue Oct 11 15:55:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ABE2C0D01C; Tue, 11 Oct 2016 15:55:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A242FC; Tue, 11 Oct 2016 15:55:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BFtjrZ001680; Tue, 11 Oct 2016 15:55:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BFtjSH001679; Tue, 11 Oct 2016 15:55:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610111555.u9BFtjSH001679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Oct 2016 15:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307043 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 15:55:46 -0000 Author: kib Date: Tue Oct 11 15:55:45 2016 New Revision: 307043 URL: https://svnweb.freebsd.org/changeset/base/307043 Log: Remove mqtest{3,4} from the obsoleted list. Reported by: O. Hartmann Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Oct 11 15:27:39 2016 (r307042) +++ head/ObsoleteFiles.inc Tue Oct 11 15:55:45 2016 (r307043) @@ -482,9 +482,6 @@ OLD_FILES+=usr/lib/clang/3.7.0/lib/freeb OLD_DIRS+=usr/lib/clang/3.7.0/lib/freebsd OLD_DIRS+=usr/lib/clang/3.7.0/lib OLD_DIRS+=usr/lib/clang/3.7.0 -# 20151201: mqueue tests 3 and 4 disabled -OLD_FILES+=usr/tests/sys/mqueue/mqtest3 -OLD_FILES+=usr/tests/sys/mqueue/mqtest4 # 20151130: libelf moved from /usr/lib to /lib (libkvm dependency in r291406) OLD_LIBS+=usr/lib/libelf.so.2 # 20151115: Fox bad upgrade scheme From owner-svn-src-head@freebsd.org Tue Oct 11 16:12:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2179DC0D6F2; Tue, 11 Oct 2016 16:12:14 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC5B0174; Tue, 11 Oct 2016 16:12:13 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BGCCmT009776; Tue, 11 Oct 2016 16:12:12 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BGCCuW009775; Tue, 11 Oct 2016 16:12:12 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201610111612.u9BGCCuW009775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 11 Oct 2016 16:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307044 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 16:12:14 -0000 Author: gnn Date: Tue Oct 11 16:12:12 2016 New Revision: 307044 URL: https://svnweb.freebsd.org/changeset/base/307044 Log: Corrected non-portable reuse of va_list in dt_printf() Submitted by: Graeme Jenkinson Reviewed by: markj MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8157 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Tue Oct 11 15:55:45 2016 (r307043) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Tue Oct 11 16:12:12 2016 (r307044) @@ -581,6 +581,7 @@ int dt_printf(dtrace_hdl_t *dtp, FILE *fp, const char *format, ...) { va_list ap; + va_list ap2; int n; #ifndef illumos @@ -605,11 +606,13 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c len = dtp->dt_sprintf_buflen - len; assert(len >= 0); - if ((n = vsnprintf(buf, len, format, ap)) < 0) + va_copy(ap2, ap); + if ((n = vsnprintf(buf, len, format, ap2)) < 0) n = dt_set_errno(dtp, errno); + va_end(ap2); va_end(ap); - + return (n); } @@ -640,11 +643,14 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c dtp->dt_buffered_buf[0] = '\0'; } - if ((needed = vsnprintf(NULL, 0, format, ap)) < 0) { + va_copy(ap2, ap); + if ((needed = vsnprintf(NULL, 0, format, ap2)) < 0) { rval = dt_set_errno(dtp, errno); + va_end(ap2); va_end(ap); return (rval); } + va_end(ap2); if (needed == 0) { va_end(ap); @@ -670,12 +676,15 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c dtp->dt_buffered_size <<= 1; } + va_copy(ap2, ap); if (vsnprintf(&dtp->dt_buffered_buf[dtp->dt_buffered_offs], - avail, format, ap) < 0) { + avail, format, ap2) < 0) { rval = dt_set_errno(dtp, errno); + va_end(ap2); va_end(ap); return (rval); } + va_end(ap2); dtp->dt_buffered_offs += needed; assert(dtp->dt_buffered_buf[dtp->dt_buffered_offs] == '\0'); @@ -683,8 +692,10 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c return (0); } - n = vfprintf(fp, format, ap); + va_copy(ap2, ap); + n = vfprintf(fp, format, ap2); fflush(fp); + va_end(ap2); va_end(ap); if (n < 0) { From owner-svn-src-head@freebsd.org Tue Oct 11 17:00:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F19BC0CE37; Tue, 11 Oct 2016 17:00:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11FD4796; Tue, 11 Oct 2016 17:00:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BH0T1W026712; Tue, 11 Oct 2016 17:00:29 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BH0Trk026711; Tue, 11 Oct 2016 17:00:29 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610111700.u9BH0Trk026711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 11 Oct 2016 17:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307059 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 17:00:30 -0000 Author: gonzo Date: Tue Oct 11 17:00:29 2016 New Revision: 307059 URL: https://svnweb.freebsd.org/changeset/base/307059 Log: INTRNG - fix MSI/MSIX release path Use isrc in attached MSI data structure instead of using map's isrc directly. map's isrc is set to NULL on IRQ deactivation which happens prior to pci_release_msi so MSI_RELEASE_MSI receives array of NULLs Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D8206 Modified: head/sys/kern/subr_intr.c Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Tue Oct 11 16:53:50 2016 (r307058) +++ head/sys/kern/subr_intr.c Tue Oct 11 17:00:29 2016 (r307059) @@ -145,6 +145,7 @@ static u_int intrcnt_index; static struct intr_irqsrc *intr_map_get_isrc(u_int res_id); static void intr_map_set_isrc(u_int res_id, struct intr_irqsrc *isrc); +static struct intr_map_data * intr_map_get_map_data(u_int res_id); static void intr_map_copy_map_data(u_int res_id, device_t *dev, intptr_t *xref, struct intr_map_data **data); @@ -1309,6 +1310,7 @@ intr_release_msi(device_t pci, device_t { struct intr_irqsrc **isrc; struct intr_pic *pic; + struct intr_map_data_msi *msi; int i, err; pic = pic_lookup(NULL, xref); @@ -1321,8 +1323,14 @@ intr_release_msi(device_t pci, device_t isrc = malloc(sizeof(*isrc) * count, M_INTRNG, M_WAITOK); - for (i = 0; i < count; i++) - isrc[i] = intr_map_get_isrc(irqs[i]); + for (i = 0; i < count; i++) { + msi = (struct intr_map_data_msi *) + intr_map_get_map_data(irqs[i]); + KASSERT(msi->hdr.type == INTR_MAP_DATA_MSI, + ("%s: irq %d map data is not MSI", __func__, + irqs[i])); + isrc[i] = msi->isrc; + } err = MSI_RELEASE_MSI(pic->pic_dev, child, count, isrc); @@ -1369,6 +1377,7 @@ intr_release_msix(device_t pci, device_t { struct intr_irqsrc *isrc; struct intr_pic *pic; + struct intr_map_data_msi *msi; int err; pic = pic_lookup(NULL, xref); @@ -1379,7 +1388,12 @@ intr_release_msix(device_t pci, device_t ("%s: Found a non-MSI controller: %s", __func__, device_get_name(pic->pic_dev))); - isrc = intr_map_get_isrc(irq); + msi = (struct intr_map_data_msi *) + intr_map_get_map_data(irq); + KASSERT(msi->hdr.type == INTR_MAP_DATA_MSI, + ("%s: irq %d map data is not MSI", __func__, + irq)); + isrc = msi->isrc; if (isrc == NULL) { intr_unmap_irq(irq); return (EINVAL); @@ -1516,6 +1530,24 @@ intr_map_set_isrc(u_int res_id, struct i /* * Get a copy of intr_map_entry data */ +static struct intr_map_data * +intr_map_get_map_data(u_int res_id) +{ + struct intr_map_data *data; + + data = NULL; + mtx_lock(&irq_map_lock); + if (res_id >= irq_map_count || irq_map[res_id] == NULL) + panic("Attempt to copy invalid resource id: %u\n", res_id); + data = irq_map[res_id]->map_data; + mtx_unlock(&irq_map_lock); + + return (data); +} + +/* + * Get a copy of intr_map_entry data + */ static void intr_map_copy_map_data(u_int res_id, device_t *map_dev, intptr_t *map_xref, struct intr_map_data **data) From owner-svn-src-head@freebsd.org Tue Oct 11 17:11:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB25DC0D1BE; Tue, 11 Oct 2016 17:11:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A18FDD8B; Tue, 11 Oct 2016 17:11:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BHBHe3030409; Tue, 11 Oct 2016 17:11:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BHBHVm030408; Tue, 11 Oct 2016 17:11:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201610111711.u9BHBHVm030408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 11 Oct 2016 17:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307060 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 17:11:19 -0000 Author: jhb Date: Tue Oct 11 17:11:17 2016 New Revision: 307060 URL: https://svnweb.freebsd.org/changeset/base/307060 Log: Fix printf format warning. Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Oct 11 17:00:29 2016 (r307059) +++ head/usr.bin/truss/syscalls.c Tue Oct 11 17:11:17 2016 (r307060) @@ -1924,9 +1924,9 @@ print_arg(struct syscall_args *sc, unsig cloudabi_filestat_t fsb; if (get_struct(pid, (void *)args[sc->offset], &fsb, sizeof(fsb)) != -1) - fprintf(fp, "{ %s, %lu }", + fprintf(fp, "{ %s, %ju }", xlookup(cloudabi_filetype, fsb.st_filetype), - fsb.st_size); + (uintmax_t)fsb.st_size); else fprintf(fp, "0x%lx", args[sc->offset]); break; From owner-svn-src-head@freebsd.org Tue Oct 11 17:41:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 577FCC0DB93; Tue, 11 Oct 2016 17:41:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 347DC61D; Tue, 11 Oct 2016 17:41:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BHfDmM041808; Tue, 11 Oct 2016 17:41:13 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BHfDsr041806; Tue, 11 Oct 2016 17:41:13 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201610111741.u9BHfDsr041806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 11 Oct 2016 17:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307062 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 17:41:14 -0000 Author: ae Date: Tue Oct 11 17:41:13 2016 New Revision: 307062 URL: https://svnweb.freebsd.org/changeset/base/307062 Log: Make LLTABLE list lock private for if_llatbl.c Rename lock and macros to reflect that it protects V_lltables list. Modified: head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Tue Oct 11 17:12:26 2016 (r307061) +++ head/sys/net/if_llatbl.c Tue Oct 11 17:41:13 2016 (r307062) @@ -66,8 +66,13 @@ static VNET_DEFINE(SLIST_HEAD(, lltable) SLIST_HEAD_INITIALIZER(lltables); #define V_lltables VNET(lltables) -struct rwlock lltable_rwlock; -RW_SYSINIT(lltable_rwlock, &lltable_rwlock, "lltable_rwlock"); +static struct rwlock lltable_list_lock; +RW_SYSINIT(lltable_list_lock, &lltable_list_lock, "lltable_list_lock"); +#define LLTABLE_LIST_RLOCK() rw_rlock(&lltable_list_lock) +#define LLTABLE_LIST_RUNLOCK() rw_runlock(&lltable_list_lock) +#define LLTABLE_LIST_WLOCK() rw_wlock(&lltable_list_lock) +#define LLTABLE_LIST_WUNLOCK() rw_wunlock(&lltable_list_lock) +#define LLTABLE_LIST_LOCK_ASSERT() rw_assert(&lltable_list_lock, RA_LOCKED) static void lltable_unlink(struct lltable *llt); static void llentries_unlink(struct lltable *llt, struct llentries *head); @@ -85,7 +90,7 @@ lltable_dump_af(struct lltable *llt, str { int error; - LLTABLE_LOCK_ASSERT(); + LLTABLE_LIST_LOCK_ASSERT(); if (llt->llt_ifp->if_flags & IFF_LOOPBACK) return (0); @@ -108,7 +113,7 @@ lltable_sysctl_dumparp(int af, struct sy struct lltable *llt; int error = 0; - LLTABLE_RLOCK(); + LLTABLE_LIST_RLOCK(); SLIST_FOREACH(llt, &V_lltables, llt_link) { if (llt->llt_af == af) { error = lltable_dump_af(llt, wr); @@ -117,7 +122,7 @@ lltable_sysctl_dumparp(int af, struct sy } } done: - LLTABLE_RUNLOCK(); + LLTABLE_LIST_RUNLOCK(); return (error); } @@ -531,7 +536,7 @@ lltable_drain(int af) struct llentry *lle; register int i; - LLTABLE_RLOCK(); + LLTABLE_LIST_RLOCK(); SLIST_FOREACH(llt, &V_lltables, llt_link) { if (llt->llt_af != af) continue; @@ -547,7 +552,7 @@ lltable_drain(int af) } } } - LLTABLE_RUNLOCK(); + LLTABLE_LIST_RUNLOCK(); } #endif @@ -591,14 +596,14 @@ lltable_prefix_free(int af, struct socka { struct lltable *llt; - LLTABLE_RLOCK(); + LLTABLE_LIST_RLOCK(); SLIST_FOREACH(llt, &V_lltables, llt_link) { if (llt->llt_af != af) continue; llt->llt_prefix_free(llt, addr, mask, flags); } - LLTABLE_RUNLOCK(); + LLTABLE_LIST_RUNLOCK(); } struct lltable * @@ -632,18 +637,18 @@ void lltable_link(struct lltable *llt) { - LLTABLE_WLOCK(); + LLTABLE_LIST_WLOCK(); SLIST_INSERT_HEAD(&V_lltables, llt, llt_link); - LLTABLE_WUNLOCK(); + LLTABLE_LIST_WUNLOCK(); } static void lltable_unlink(struct lltable *llt) { - LLTABLE_WLOCK(); + LLTABLE_LIST_WLOCK(); SLIST_REMOVE(&V_lltables, llt, lltable, llt_link); - LLTABLE_WUNLOCK(); + LLTABLE_LIST_WUNLOCK(); } @@ -739,13 +744,13 @@ lla_rt_output(struct rt_msghdr *rtm, str } /* XXX linked list may be too expensive */ - LLTABLE_RLOCK(); + LLTABLE_LIST_RLOCK(); SLIST_FOREACH(llt, &V_lltables, llt_link) { if (llt->llt_af == dst->sa_family && llt->llt_ifp == ifp) break; } - LLTABLE_RUNLOCK(); + LLTABLE_LIST_RUNLOCK(); KASSERT(llt != NULL, ("Yep, ugly hacks are bad\n")); error = 0; Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Tue Oct 11 17:12:26 2016 (r307061) +++ head/sys/net/if_llatbl.h Tue Oct 11 17:41:13 2016 (r307062) @@ -37,17 +37,9 @@ struct ifnet; struct sysctl_req; struct rt_msghdr; struct rt_addrinfo; - struct llentry; LIST_HEAD(llentries, llentry); -extern struct rwlock lltable_rwlock; -#define LLTABLE_RLOCK() rw_rlock(&lltable_rwlock) -#define LLTABLE_RUNLOCK() rw_runlock(&lltable_rwlock) -#define LLTABLE_WLOCK() rw_wlock(&lltable_rwlock) -#define LLTABLE_WUNLOCK() rw_wunlock(&lltable_rwlock) -#define LLTABLE_LOCK_ASSERT() rw_assert(&lltable_rwlock, RA_LOCKED) - #define LLE_MAX_LINKHDR 24 /* Full IB header */ /* * Code referencing llentry must at least hold From owner-svn-src-head@freebsd.org Tue Oct 11 18:09:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E892C0D2B6; Tue, 11 Oct 2016 18:09:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E6909AF; Tue, 11 Oct 2016 18:09:38 +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 u9BI9c64053136; Tue, 11 Oct 2016 18:09:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BI9cCI053135; Tue, 11 Oct 2016 18:09:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610111809.u9BI9cCI053135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 11 Oct 2016 18:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307064 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 18:09:39 -0000 Author: kib Date: Tue Oct 11 18:09:37 2016 New Revision: 307064 URL: https://svnweb.freebsd.org/changeset/base/307064 Log: When downgrading exclusively busied page to shared-busy state, wakeup waiters. Otherwise, owners of the shared-busy state are left blocked and might get into a deadlock. Note that the vm_page_busy_downgrade() function is not used in the tree right now. Reported and tested by: pho (previous version) Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D8195 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Oct 11 17:47:54 2016 (r307063) +++ head/sys/vm/vm_page.c Tue Oct 11 18:09:37 2016 (r307064) @@ -655,15 +655,26 @@ void vm_page_busy_downgrade(vm_page_t m) { u_int x; + bool locked; vm_page_assert_xbusied(m); + locked = mtx_owned(vm_page_lockptr(m)); for (;;) { x = m->busy_lock; x &= VPB_BIT_WAITERS; + if (x != 0 && !locked) + vm_page_lock(m); if (atomic_cmpset_rel_int(&m->busy_lock, - VPB_SINGLE_EXCLUSIVER | x, VPB_SHARERS_WORD(1) | x)) + VPB_SINGLE_EXCLUSIVER | x, VPB_SHARERS_WORD(1))) break; + if (x != 0 && !locked) + vm_page_unlock(m); + } + if (x != 0) { + wakeup(m); + if (!locked) + vm_page_unlock(m); } } From owner-svn-src-head@freebsd.org Tue Oct 11 20:32:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 228F6C0DEC8; Tue, 11 Oct 2016 20:32:01 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B76F6; Tue, 11 Oct 2016 20:32:00 +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 u9BKVxrL009109; Tue, 11 Oct 2016 20:31:59 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BKVx8v009106; Tue, 11 Oct 2016 20:31:59 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610112031.u9BKVx8v009106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 11 Oct 2016 20:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307066 - in head/lib/msun: . src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 20:32:01 -0000 Author: br Date: Tue Oct 11 20:31:59 2016 New Revision: 307066 URL: https://svnweb.freebsd.org/changeset/base/307066 Log: Don't use fmaxl/fminl on platforms with no long double support, use fmax/fmin instead. This fixes fmaxmin test failure on MIPS64. Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8216 Modified: head/lib/msun/Makefile head/lib/msun/src/s_fmax.c head/lib/msun/src/s_fmin.c Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Tue Oct 11 18:51:03 2016 (r307065) +++ head/lib/msun/Makefile Tue Oct 11 20:31:59 2016 (r307066) @@ -63,8 +63,8 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c s_exp2.c s_exp2f.c s_expm1.c s_expm1f.c s_fabsf.c s_fdim.c \ s_finite.c s_finitef.c \ s_floor.c s_floorf.c s_fma.c s_fmaf.c \ - s_fmax.c s_fmaxf.c s_fmaxl.c s_fmin.c \ - s_fminf.c s_fminl.c s_frexp.c s_frexpf.c s_ilogb.c s_ilogbf.c \ + s_fmax.c s_fmaxf.c s_fmin.c \ + s_fminf.c s_frexp.c s_frexpf.c s_ilogb.c s_ilogbf.c \ s_ilogbl.c s_isfinite.c s_isnan.c s_isnormal.c \ s_llrint.c s_llrintf.c s_llround.c s_llroundf.c s_llroundl.c \ s_log1p.c s_log1pf.c s_logb.c s_logbf.c s_lrint.c s_lrintf.c \ @@ -101,9 +101,9 @@ COMMON_SRCS+= e_acoshl.c e_acosl.c e_asi invtrig.c k_cosl.c k_sinl.c k_tanl.c \ s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \ s_csqrtl.c s_erfl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \ - s_frexpl.c s_logbl.c s_logl.c s_nanl.c s_nextafterl.c \ - s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c s_scalbnl.c \ - s_sinl.c s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c + s_fmaxl.c s_fminl.c s_frexpl.c s_logbl.c s_logl.c s_nanl.c \ + s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ + s_scalbnl.c s_sinl.c s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c .endif # C99 complex functions Modified: head/lib/msun/src/s_fmax.c ============================================================================== --- head/lib/msun/src/s_fmax.c Tue Oct 11 18:51:03 2016 (r307065) +++ head/lib/msun/src/s_fmax.c Tue Oct 11 20:31:59 2016 (r307066) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include "fpmath.h" @@ -51,3 +52,7 @@ fmax(double x, double y) return (x > y ? x : y); } + +#if (LDBL_MANT_DIG == 53) +__weak_reference(fmax, fmaxl); +#endif Modified: head/lib/msun/src/s_fmin.c ============================================================================== --- head/lib/msun/src/s_fmin.c Tue Oct 11 18:51:03 2016 (r307065) +++ head/lib/msun/src/s_fmin.c Tue Oct 11 20:31:59 2016 (r307066) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include "fpmath.h" @@ -51,3 +52,7 @@ fmin(double x, double y) return (x < y ? x : y); } + +#if (LDBL_MANT_DIG == 53) +__weak_reference(fmin, fminl); +#endif From owner-svn-src-head@freebsd.org Tue Oct 11 21:37:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6965AC0ED82; Tue, 11 Oct 2016 21:37:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26F7379A; Tue, 11 Oct 2016 21:37:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BLbZCI033473; Tue, 11 Oct 2016 21:37:35 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BLbZu7033471; Tue, 11 Oct 2016 21:37:35 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610112137.u9BLbZu7033471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 11 Oct 2016 21:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307067 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 21:37:36 -0000 Author: gonzo Date: Tue Oct 11 21:37:34 2016 New Revision: 307067 URL: https://svnweb.freebsd.org/changeset/base/307067 Log: Make intc driver compatible with upstream DTS - Fix compatibility strings - Properly decode upstream's two-cell interrupt specs. Our home-made dts does not have two-cell interrupts so no need to preserve backward compatibility Modified: head/sys/arm/broadcom/bcm2835/bcm2835_common.c head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_common.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_common.c Tue Oct 11 20:31:59 2016 (r307066) +++ head/sys/arm/broadcom/bcm2835/bcm2835_common.c Tue Oct 11 21:37:34 2016 (r307067) @@ -52,7 +52,8 @@ fdt_intc_decode_ic(phandle_t node, pcell int *pol) { - if (fdt_is_compatible(node, "broadcom,bcm2835-armctrl-ic")) { + if (fdt_is_compatible(node, "broadcom,bcm2835-armctrl-ic") || + fdt_is_compatible(node, "brcm,bcm2836-armctrl-ic")) { *interrupt = fdt32_to_cpu(intr[0]); *trig = INTR_TRIGGER_CONFORM; *pol = INTR_POLARITY_CONFORM; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue Oct 11 20:31:59 2016 (r307066) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue Oct 11 21:37:34 2016 (r307067) @@ -270,6 +270,7 @@ bcm_intc_map_intr(device_t dev, struct i u_int irq; struct intr_map_data_fdt *daf; struct bcm_intc_softc *sc; + bool valid; if (data->type != INTR_MAP_DATA_FDT) return (ENOTSUP); @@ -277,8 +278,36 @@ bcm_intc_map_intr(device_t dev, struct i daf = (struct intr_map_data_fdt *)data; if (daf->ncells == 1) irq = daf->cells[0]; - else if (daf->ncells == 2) - irq = daf->cells[0] * 32 + daf->cells[1]; + else if (daf->ncells == 2) { + valid = true; + switch (daf->cells[0]) { + case 0: + irq = daf->cells[1]; + if (irq >= BANK1_START) + valid = false; + break; + case 1: + irq = daf->cells[1] + BANK1_START; + if (irq > BANK1_END) + valid = false; + break; + case 2: + irq = daf->cells[1] + BANK2_START; + if (irq > BANK2_END) + valid = false; + break; + default: + valid = false; + break; + } + + if (!valid) { + device_printf(dev, + "invalid IRQ config: bank=%d, irq=%d\n", + daf->cells[0], daf->cells[1]); + return (EINVAL); + } + } else return (EINVAL); @@ -355,7 +384,8 @@ bcm_intc_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-armctrl-ic")) + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-armctrl-ic") && + !ofw_bus_is_compatible(dev, "brcm,bcm2836-armctrl-ic")) return (ENXIO); device_set_desc(dev, "BCM2835 Interrupt Controller"); return (BUS_PROBE_DEFAULT); From owner-svn-src-head@freebsd.org Tue Oct 11 21:40:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED709C0EE40; Tue, 11 Oct 2016 21:40:16 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2DA4958; Tue, 11 Oct 2016 21:40:16 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BLeFQr033618; Tue, 11 Oct 2016 21:40:15 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BLeFaS033617; Tue, 11 Oct 2016 21:40:15 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610112140.u9BLeFaS033617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 11 Oct 2016 21:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307068 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 21:40:17 -0000 Author: gonzo Date: Tue Oct 11 21:40:15 2016 New Revision: 307068 URL: https://svnweb.freebsd.org/changeset/base/307068 Log: Make Rapsberry Pi watchdog driver compatible with upstream DTS - Fix compatibility strings - Compensate the difference in base address for our custom DTS and upstream one (for backward compatibility) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Tue Oct 11 21:37:34 2016 (r307067) +++ head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Tue Oct 11 21:40:15 2016 (r307068) @@ -52,8 +52,8 @@ __FBSDID("$FreeBSD$"); #define BCM2835_WDOG_TIME_MASK 0x000fffff #define BCM2835_WDOG_TIME_SHIFT 0 -#define READ(_sc, _r) bus_space_read_4((_sc)->bst, (_sc)->bsh, (_r)) -#define WRITE(_sc, _r, _v) bus_space_write_4((_sc)->bst, (_sc)->bsh, (_r), (_v)) +#define READ(_sc, _r) bus_space_read_4((_sc)->bst, (_sc)->bsh, (_r) + (_sc)->regs_offset) +#define WRITE(_sc, _r, _v) bus_space_write_4((_sc)->bst, (_sc)->bsh, (_r) + (_sc)->regs_offset, (_v)) #define BCM2835_RSTC_WRCFG_CLR 0xffffffcf #define BCM2835_RSTC_WRCFG_SET 0x00000030 @@ -75,6 +75,17 @@ struct bcmwd_softc { int wdog_period; char wdog_passwd; struct mtx mtx; + int regs_offset; +}; + +#define BSD_DTB 1 +#define UPSTREAM_DTB 2 +#define UPSTREAM_DTB_REGS_OFFSET 0x1c + +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-wdt", BSD_DTB}, + {"brcm,bcm2835-pm-wdt", UPSTREAM_DTB}, + {NULL, 0} }; static void bcmwd_watchdog_fn(void *private, u_int cmd, int *error); @@ -86,12 +97,12 @@ bcmwd_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-wdt")) { - device_set_desc(dev, "BCM2708/2835 Watchdog"); - return (BUS_PROBE_DEFAULT); - } + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "BCM2708/2835 Watchdog"); - return (ENXIO); + return (BUS_PROBE_DEFAULT); } static int @@ -119,6 +130,11 @@ bcmwd_attach(device_t dev) sc->bst = rman_get_bustag(sc->res); sc->bsh = rman_get_bushandle(sc->res); + /* compensate base address difference */ + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data + == UPSTREAM_DTB) + sc->regs_offset = UPSTREAM_DTB_REGS_OFFSET; + bcmwd_lsc = sc; mtx_init(&sc->mtx, "BCM2835 Watchdog", "bcmwd", MTX_DEF); EVENTHANDLER_REGISTER(watchdog_list, bcmwd_watchdog_fn, sc, 0); From owner-svn-src-head@freebsd.org Tue Oct 11 22:24:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01145C0BB08; Tue, 11 Oct 2016 22:24:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC3ED1EA; Tue, 11 Oct 2016 22:24:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BMOUBo053195; Tue, 11 Oct 2016 22:24:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BMOUlp053188; Tue, 11 Oct 2016 22:24:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610112224.u9BMOUlp053188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 11 Oct 2016 22:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307070 - in head/sys: amd64/amd64 conf dev/efidev i386/include modules/efirt sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 22:24:32 -0000 Author: imp Date: Tue Oct 11 22:24:30 2016 New Revision: 307070 URL: https://svnweb.freebsd.org/changeset/base/307070 Log: Create /dev/efidev to provide an ioctl interface to userland. It supports userland interfaces to UEFI Runtime Services. This is indended to the the MI portion of EFI RuntimeServices support. Differential Revision: https://reviews.freebsd.org/D8128 Reviewed by: kib@, wblock@, Ganael Laplanche Added: head/sys/dev/efidev/ head/sys/dev/efidev/efidev.c (contents, props changed) head/sys/i386/include/efi.h (contents, props changed) head/sys/sys/efiio.h (contents, props changed) Modified: head/sys/amd64/amd64/efirt.c head/sys/conf/files head/sys/modules/efirt/Makefile head/sys/sys/efi.h Modified: head/sys/amd64/amd64/efirt.c ============================================================================== --- head/sys/amd64/amd64/efirt.c Tue Oct 11 21:59:22 2016 (r307069) +++ head/sys/amd64/amd64/efirt.c Tue Oct 11 22:24:30 2016 (r307070) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); static struct efi_systbl *efi_systbl; static struct efi_cfgtbl *efi_cfgtbl; static struct efi_rt *efi_runtime; +static struct cdev *efi_cdev; static int efi_status2err[25] = { 0, /* EFI_SUCCESS */ @@ -402,13 +403,15 @@ efi_init(void) return (ENXIO); } - return (0); + return (efidev_init(&efi_cdev)); } static void efi_uninit(void) { + efidev_uninit(efi_cdev); + efi_destroy_1t1_map(); efi_systbl = NULL; Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Oct 11 21:59:22 2016 (r307069) +++ head/sys/conf/files Tue Oct 11 22:24:30 2016 (r307070) @@ -1431,6 +1431,7 @@ dev/ed/if_ed_novell.c optional ed dev/ed/if_ed_rtl80x9.c optional ed dev/ed/if_ed_pccard.c optional ed pccard dev/ed/if_ed_pci.c optional ed pci +dev/efidev/efidev.c optional efirt dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa dev/e1000/if_em.c optional em \ Added: head/sys/dev/efidev/efidev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/efidev/efidev.c Tue Oct 11 22:24:30 2016 (r307070) @@ -0,0 +1,199 @@ +/*- + * Copyright (c) 2016 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static d_ioctl_t efidev_ioctl; + +static struct cdevsw efi_cdevsw = { + .d_name = "efi", + .d_version = D_VERSION, + .d_ioctl = efidev_ioctl, +}; + +/* ARGSUSED */ +static int +efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, + int flags __unused, struct thread *td __unused) +{ + int error; + + switch (cmd) { + case EFIIOC_GET_TABLE: + { + struct efi_get_table_ioc *egtioc = + (struct efi_get_table_ioc *)addr; + + error = efi_get_table(&egtioc->uuid, &egtioc->ptr); + break; + } + case EFIIOC_GET_TIME: + { + struct efi_tm *tm = (struct efi_tm *)addr; + + error = efi_get_time(tm); + break; + } + case EFIIOC_SET_TIME: + { + struct efi_tm *tm = (struct efi_tm *)addr; + + error = efi_set_time(tm); + break; + } + case EFIIOC_VAR_GET: + { + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; + void *data; + efi_char *name; + + data = malloc(ev->datasize, M_TEMP, M_WAITOK); + name = malloc(ev->namesize, M_TEMP, M_WAITOK); + error = copyin(ev->name, name, ev->namesize); + if (error) + goto vg_out; + if (name[ev->namesize / sizeof(efi_char) - 1] != 0) { + error = EINVAL; + goto vg_out; + } + + error = efi_var_get(name, &ev->vendor, &ev->attrib, + &ev->datasize, data); + + if (error == 0) { + error = copyout(data, ev->data, ev->datasize); + } else if (error == EOVERFLOW) { + /* + * Pass back the size we really need, but + * convert the error to 0 so the copyout + * happens. datasize was updated in the + * efi_var_get call. + */ + ev->data = NULL; + error = 0; + } +vg_out: + free(data, M_TEMP); + free(name, M_TEMP); + break; + } + case EFIIOC_VAR_NEXT: + { + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; + efi_char *name; + + name = malloc(ev->namesize, M_TEMP, M_WAITOK); + if (name == NULL) { + error = ENOMEM; + goto vn_out; + } + error = copyin(ev->name, name, ev->namesize); + if (error) + goto vn_out; + /* Note: namesize is the buffer size, not the string lenght */ + + error = efi_var_nextname(&ev->namesize, name, &ev->vendor); + if (error == 0) { + error = copyout(name, ev->name, ev->namesize); + } else if (error == EOVERFLOW) { + ev->name = NULL; + error = 0; + } + vn_out: + if (name != NULL) + free(name, M_TEMP); + break; + } + case EFIIOC_VAR_SET: + { + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; + void *data = NULL; + efi_char *name; + + /* datasize == 0 -> delete (more or less) */ + if (ev->datasize > 0) + data = malloc(ev->datasize, M_TEMP, M_WAITOK); + name = malloc(ev->namesize, M_TEMP, M_WAITOK); + if (ev->datasize) { + error = copyin(ev->data, data, ev->datasize); + if (error) + goto vs_out; + } + error = copyin(ev->name, name, ev->namesize); + if (error) + goto vs_out; + if (name[ev->namesize / sizeof(efi_char) - 1] != 0) { + error = EINVAL; + goto vs_out; + } + + error = efi_var_set(name, &ev->vendor, ev->attrib, ev->datasize, + data); +vs_out: + if (data != NULL) + free(data, M_TEMP); + free(name, M_TEMP); + break; + } + default: + error = ENOTTY; + break; + } + + return (error); +} + +int +efidev_init(struct cdev **cdev) +{ + + *cdev = make_dev(&efi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0700, + "efidev"); + + return (0); +} + +int +efidev_uninit(struct cdev *cdev) +{ + + destroy_dev(cdev); + + return (0); +} Added: head/sys/i386/include/efi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/include/efi.h Tue Oct 11 22:24:30 2016 (r307070) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __I386_INCLUDE_EFI_H_ +#define __I386_INCLUDE_EFI_H_ + +#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ + +/* Note: we don't actually support this on i386 yet */ + +#endif /* __I386_INCLUDE_EFI_H_ */ Modified: head/sys/modules/efirt/Makefile ============================================================================== --- head/sys/modules/efirt/Makefile Tue Oct 11 21:59:22 2016 (r307069) +++ head/sys/modules/efirt/Makefile Tue Oct 11 22:24:30 2016 (r307070) @@ -1,9 +1,10 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../${MACHINE}/${MACHINE} +.PATH: ${.CURDIR}/../../dev/efidev KMOD= efirt -SRCS= efirt.c +SRCS= efirt.c efidev.c SRCS+= device_if.h bus_if.h .include Modified: head/sys/sys/efi.h ============================================================================== --- head/sys/sys/efi.h Tue Oct 11 21:59:22 2016 (r307069) +++ head/sys/sys/efi.h Tue Oct 11 22:24:30 2016 (r307070) @@ -165,6 +165,9 @@ struct efi_systbl { #ifdef _KERNEL extern vm_paddr_t efi_systbl_phys; +struct cdev; +int efidev_init(struct cdev **); +int efidev_uninit(struct cdev *); #endif /* _KERNEL */ #endif /* _SYS_EFI_H_ */ Added: head/sys/sys/efiio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/efiio.h Tue Oct 11 22:24:30 2016 (r307070) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2016 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_EFIIO_H_ +#define _SYS_EFIIO_H_ + +#include +#include +#include + +struct efi_get_table_ioc +{ + struct uuid uuid; /* UUID to look up */ + void *ptr; /* Pointer to table in KVA space */ +}; + +struct efi_var_ioc +{ + efi_char *name; /* User pointer to name, in wide chars */ + size_t namesize; /* Number of wide characters in name */ + struct uuid vendor; /* Vendor's UUID for variable */ + uint32_t attrib; /* Attributes */ + void *data; /* User pointer to the data */ + size_t datasize; /* Number of *bytes* in the data */ +}; + +#define EFIIOC_GET_TABLE _IOWR('E', 1, struct efi_get_table_ioc) +#define EFIIOC_GET_TIME _IOR('E', 2, struct efi_tm) +#define EFIIOC_SET_TIME _IOW('E', 3, struct efi_tm) +#define EFIIOC_VAR_GET _IOWR('E', 4, struct efi_var_ioc) +#define EFIIOC_VAR_NEXT _IOWR('E', 5, struct efi_var_ioc) +#define EFIIOC_VAR_SET _IOWR('E', 6, struct efi_var_ioc) + +#endif /* _SYS_EFIIO_H_ */ From owner-svn-src-head@freebsd.org Tue Oct 11 22:30:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C7EFC0BC50; Tue, 11 Oct 2016 22:30:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17EB16C5; Tue, 11 Oct 2016 22:30:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BMUgh4053514; Tue, 11 Oct 2016 22:30:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BMUfw2053504; Tue, 11 Oct 2016 22:30:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610112230.u9BMUfw2053504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 11 Oct 2016 22:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307071 - in head: lib lib/libefi lib/libefivar share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 22:30:43 -0000 Author: imp Date: Tue Oct 11 22:30:41 2016 New Revision: 307071 URL: https://svnweb.freebsd.org/changeset/base/307071 Log: Create libefivar library. This library aims to provide the same API as the GPL'd version of this library. It implements the common Linux API for programatically manipulating UEFI environment varibales using the UEFI Runtime Services the kernel provides. It replaces the old efi library since it is programmed to a different interface, but retails the CHAR16 to UTF-8 and vice versa conversion routines. The new name is to match Linux program's expectations. Differential Revision: https://reviews.freebsd.org/D8128 Reviewed by: kib@, wblock@, Ganael Laplanche Added: head/lib/libefivar/ head/lib/libefivar/Makefile (contents, props changed) head/lib/libefivar/efivar.3 (contents, props changed) head/lib/libefivar/efivar.c (contents, props changed) head/lib/libefivar/efivar.h (contents, props changed) head/lib/libefivar/libefivar.c - copied, changed from r307070, head/lib/libefi/libefi.c head/lib/libefivar/libefivar_int.h - copied, changed from r307070, head/lib/libefi/libefi_int.h Deleted: head/lib/libefi/ Modified: head/lib/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/share/mk/src.opts.mk Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Oct 11 22:24:30 2016 (r307070) +++ head/lib/Makefile Tue Oct 11 22:30:41 2016 (r307071) @@ -49,6 +49,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libdevstat \ libdwarf \ libedit \ + ${_libefivar} \ ${_libelftc} \ libevent \ libexecinfo \ @@ -240,6 +241,10 @@ _libcxxrt= libcxxrt _libcplusplus= libc++ .endif +.if ${MACHINE_ARCH} == "amd64" +_libefivar= libefivar +.endif + .if ${MK_LIBTHR} != "no" _libthr= libthr .endif Added: head/lib/libefivar/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libefivar/Makefile Tue Oct 11 22:30:41 2016 (r307071) @@ -0,0 +1,53 @@ +# Copyright 1998 Juniper Networks, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +.include + +PACKAGE=lib${LIB} +LIB= efivar +SRCS= efivar.c libefivar.c +INCS= efivar.h +SHLIB_MAJOR= 1 +MAN= efivar.3 + +MLINKS+=efivar.3 efi_set_variables_supported.3 \ + efivar.3 efi_del_variable.3 \ + efivar.3 efi_get_variable.3 \ + efivar.3 efi_get_variable_attributes.3 \ + efivar.3 efi_get_variable_size.3 \ + efivar.3 efi_append_variable.3 \ + efivar.3 efi_set_variable.3 \ + efivar.3 efi_get_next_variable_name.3 \ + efivar.3 efi_str_to_guid.3 \ + efivar.3 efi_guid_to_str.3 \ + efivar.3 efi_name_to_guid.3 \ + efivar.3 efi_guid_to_name.3 \ + efivar.3 efi_guid_to_symbol.3 \ + efivar.3 libefivar.3 + +WARNS?= 9 + +.include Added: head/lib/libefivar/efivar.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libefivar/efivar.3 Tue Oct 11 22:30:41 2016 (r307071) @@ -0,0 +1,98 @@ +.\" Copyright 2016 Netflix, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 14, 2016 +.Dt LIBEFIVAR 3 +.Os +.Sh NAME +.Nm libefivar +.Nd EFI Non Volatile Variable Suppoert +.Sh SYNOPSIS +.In efivar.h +.Ft int +.Fn efi_append_variable "efi_guid_t guid" "const char *name" "void *data" "size_t data_size" "uint32_t attributes" +.Ft int +.Fn efi_del_variable "efi_guid_t guid" "const char *name" +.Ft int +.Fn efi_get_variable "efi_guid_t guid" "const char *name" "void **data" "ssize_t *data_size" "uint32_t *attributes" +.Ft int +.Fn efi_get_variable_attributes "efi_guid_t guid" "const char *name" "uint32_t *attributes" +.Ft int +.Fn efi_get_variable_size "efi_guid_t guid" "const char *name" "size_t *size" +.Ft int +.Fn efi_get_next_variable_name "efi_guid_t **guid" "char **name" +.Ft int +.Fn efi_guid_to_name "efi_guid_t *guid" "char **name" +.Ft int +.Fn efi_guid_to_symbol "efi_guid_t *guid" "char **symbol" +.Ft int +.Fn efi_guid_to_str "const efi_guid_t *guid" "char **sp" +.Ft int +.Fn efi_name_to_guid "const char *name" "efi_guid_t *guid" +.Ft int +.Fn efi_set_variable "efi_guid_t guid" "const char *name" "void *data" "size_t data_size" "uint32_t attributes" +.Ft int +.Fn efi_str_to_guid "const char *s" "efi_guid_t *guid"; +.Ft int +.Fn efi_variables_supported "void"; +.Sh DESCRIPTION +The +.Nm +library implements access to EFI Variables via the EFI Runtime +Serivces. +All char * strings are converted to 16-bit UTF strings before passing +them to EFI. +.Pp +.Fn efi_variables_supported +returns non-zero if the current machine supports setting of EFI firmware +variables and the kernel support for doing so is present. +Otherwise zero is returned. +.Pp +.Fn efi_del_variable +deletes the EFI variable selected by +.Dv guid +and +.Dv name . +.Pp +.Fn efi_get_variable +.Fn efi_get_variable_attributes +.Fn efi_get_variable_size +.Fn efi_append_variable +.Fn efi_set_variable +.Fn efi_get_next_variable_name +.Fn efi_str_to_guid +.Fn efi_guid_to_str +.Fn efi_name_to_guid +.Fn efi_guid_to_name +.Fn efi_guid_to_symbol +This function is not actually implemented. +.Sh BUGS +No facilities exist to process the strings as native UTF. +This is a limitation in the Linux libefivar library interface. +.Sh AUTHORS +.An -nosplit +This software was originally written by +.An Warner Losh . Added: head/lib/libefivar/efivar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libefivar/efivar.c Tue Oct 11 22:30:41 2016 (r307071) @@ -0,0 +1,380 @@ +/*- + * Copyright (c) 2016 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libefivar_int.h" + +static int efi_fd = -2; + +#define Z { 0, 0, 0, 0, 0, { 0 } } + +const efi_guid_t efi_guid_empty = Z; + +static struct uuid_table +{ + const char *uuid_str; + const char *name; + efi_guid_t guid; +} guid_tbl [] = +{ + { "00000000-0000-0000-0000-000000000000", "zero", Z }, + { "093e0fae-a6c4-4f50-9f1b-d41e2b89c19a", "sha512", Z }, + { "0abba7dc-e516-4167-bbf5-4d9d1c739416", "redhat", Z }, + { "0b6e5233-a65c-44c9-9407-d9ab83bfc8bd", "sha224", Z }, + { "126a762d-5758-4fca-8531-201a7f57f850", "lenovo_boot_menu", Z }, + { "3bd2a492-96c0-4079-b420-fcf98ef103ed", "x509_sha256", Z }, + { "3c5766e8-269c-4e34-aa14-ed776e85b3b6", "rsa2048", Z }, + { "3CC24E96-22C7-41D8-8863-8E39DCDCC2CF", "lenovo", Z }, + { "3f7e615b-0d45-4f80-88dc-26b234958560", "lenovo_diag", Z }, + { "446dbf63-2502-4cda-bcfa-2465d2b0fe9d", "x509_sha512", Z }, + { "4aafd29d-68df-49ee-8aa9-347d375665a7", "pkcs7_cert", Z }, + { "605dab50-e046-4300-abb6-3dd810dd8b23", "shim", Z }, + { "665d3f60-ad3e-4cad-8e26-db46eee9f1b5", "lenovo_rescue", Z }, + { "67f8444f-8743-48f1-a328-1eaab8736080", "rsa2048_sha1", Z }, + { "7076876e-80c2-4ee6-aad2-28b349a6865b", "x509_sha384", Z }, + { "721c8b66-426c-4e86-8e99-3457c46ab0b9", "lenovo_setup", Z }, + { "77fa9abd-0359-4d32-bd60-28f4e78f784b", "microsoft", Z }, + { "7FACC7B6-127F-4E9C-9C5D-080F98994345", "lenovo_2", Z }, + { "826ca512-cf10-4ac9-b187-be01496631bd", "sha1", Z }, + { "82988420-7467-4490-9059-feb448dd1963", "lenovo_me_config", Z }, + { "8be4df61-93ca-11d2-aa0d-00e098032b8c", "global", Z }, + { "a5c059a1-94e4-4aa7-87b5-ab155c2bf072", "x509_cert", Z }, + { "a7717414-c616-4977-9420-844712a735bf", "rsa2048_sha256_cert", Z }, + { "a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380", "lenovo_diag_splash", Z }, + { "ade9e48f-9cb8-98e6-31af-b4e6009e2fe3", "redhat_2", Z }, + { "bc7838d2-0f82-4d60-8316-c068ee79d25b", "lenovo_msg", Z }, + { "c1c41626-504c-4092-aca9-41f936934328", "sha256", Z }, + { "c57ad6b7-0515-40a8-9d21-551652854e37", "shell", Z }, + { "d719b2cb-3d3a-4596-a3bc-dad00e67656f", "security", Z }, + { "e2b36190-879b-4a3d-ad8d-f2e7bba32784", "rsa2048_sha256", Z }, + { "ff3e5307-9fd0-48c9-85f1-8ad56c701e01", "sha384", Z }, + { "f46ee6f4-4785-43a3-923d-7f786c3c8479", "lenovo_startup_interrupt", Z }, + { "ffffffff-ffff-ffff-ffff-ffffffffffff", "zzignore-this-guid", Z }, +}; +#undef Z + +static void +efi_guid_tbl_compile(void) +{ + size_t i; + uint32_t status; + + for (i = 0; i < nitems(guid_tbl); i++) { + uuid_from_string(guid_tbl[i].uuid_str, &guid_tbl[i].guid, + &status); + /* all f's is a bad version, so ignore that error */ + if (status != uuid_s_ok && status != uuid_s_bad_version) + fprintf(stderr, "Can't convert %s to a uuid for %s: %d\n", + guid_tbl[i].uuid_str, guid_tbl[i].name, (int)status); + } +} + +static int +efi_open_dev(void) +{ + + if (efi_fd == -2) + efi_fd = open("/dev/efidev", O_RDWR); + if (efi_fd < 0) + efi_fd = -1; + else + efi_guid_tbl_compile(); + return (efi_fd); +} + +static void +efi_var_reset(struct efi_var_ioc *var) +{ + var->name = NULL; + var->namesize = 0; + memset(&var->vendor, 0, sizeof(var->vendor)); + var->attrib = 0; + var->data = NULL; + var->datasize = 0; +} + +static int +rv_to_linux_rv(int rv) +{ + if (rv == 0) + rv = 1; + else if (errno == ENOENT) { + rv = 0; + errno = 0; + } else + rv = -errno; + return (rv); +} + +int +efi_append_variable(efi_guid_t guid, const char *name, + uint8_t *data, size_t data_size, uint32_t attributes) +{ + + return efi_set_variable(guid, name, data, data_size, + attributes | EFI_VARIABLE_APPEND_WRITE, 0); +} + +int +efi_del_variable(efi_guid_t guid, const char *name) +{ + + /* data_size of 0 deletes the variable */ + return efi_set_variable(guid, name, NULL, 0, 0, 0); +} + +int +efi_get_variable(efi_guid_t guid, const char *name, + uint8_t **data, size_t *data_size, uint32_t *attributes) +{ + struct efi_var_ioc var; + int rv; + static uint8_t buf[1024*32]; + + if (efi_open_dev() == -1) + return -1; + + efi_var_reset(&var); + rv = libefi_utf8_to_ucs2(name, &var.name, &var.namesize); + if (rv != 0) + goto errout; + var.vendor = guid; + var.data = buf; + var.datasize = sizeof(buf); + rv = ioctl(efi_fd, EFIIOC_VAR_GET, &var); + if (data_size != NULL) + *data_size = var.datasize; + if (data != NULL) + *data = buf; + if (attributes != NULL) + *attributes = var.attrib; +errout: + free(var.name); + + return rv_to_linux_rv(rv); +} + +int +efi_get_variable_attributes(efi_guid_t guid, const char *name, + uint32_t *attributes) +{ + /* Make sure this construct works -- I think it will fail */ + + return efi_get_variable(guid, name, NULL, NULL, attributes); +} + +int +efi_get_variable_size(efi_guid_t guid, const char *name, + size_t *size) +{ + + /* XXX check to make sure this matches the linux value */ + + *size = 0; + return efi_get_variable(guid, name, NULL, size, NULL); +} + +int +efi_get_next_variable_name(efi_guid_t **guid, char **name) +{ + struct efi_var_ioc var; + int rv; + static efi_char *buf; + static size_t buflen = 256 * sizeof(efi_char); + static efi_guid_t retguid; + size_t size; + + if (efi_open_dev() == -1) + return -1; + + if (buf == NULL) + buf = malloc(buflen); + +again: + efi_var_reset(&var); + var.name = buf; + var.namesize = buflen; + if (*name == NULL) { + *buf = 0; + /* GUID zeroed in var_reset */ + } else { + rv = libefi_utf8_to_ucs2(*name, &var.name, &size); + if (rv != 0) + goto errout; + var.vendor = **guid; + } + rv = ioctl(efi_fd, EFIIOC_VAR_NEXT, &var); + if (rv == 0 && var.name == NULL) { + /* + * oops, too little space. Try again. + */ + void *new = realloc(buf, buflen); + buflen = var.namesize; + if (new == NULL) { + rv = -1; + errno = ENOMEM; + goto done; + } + buf = new; + goto again; + } + + if (rv == 0) { + *name = NULL; /* XXX */ + var.name[var.namesize / sizeof(efi_char)] = 0; /* EFI doesn't NUL terminate */ + rv = libefi_ucs2_to_utf8(var.name, name); + if (rv != 0) + goto errout; + retguid = var.vendor; + *guid = &retguid; + } +errout: + + /* XXX The linux interface expects name to be a static buffer -- fix or leak memory? */ +done: + return (rv_to_linux_rv(rv)); +} + +int +efi_guid_cmp(const efi_guid_t *guid1, const efi_guid_t *guid2) +{ + uint32_t status; + + return uuid_compare(guid1, guid2, &status); +} + +int +efi_guid_is_zero(const efi_guid_t *guid) +{ + uint32_t status; + + return uuid_is_nil(guid, &status); +} + +int +efi_guid_to_name(efi_guid_t *guid, char **name) +{ + size_t i; + uint32_t status; + + for (i = 0; i < nitems(guid_tbl); i++) { + if (uuid_equal(guid, &guid_tbl[i].guid, &status)) { + *name = strdup(guid_tbl[i].name); + return (0); + } + } + return (efi_guid_to_str(guid, name)); +} + +int +efi_guid_to_symbol(efi_guid_t *guid __unused, char **symbol __unused) +{ + + /* + * Unsure what this is used for, efibootmgr doesn't use it. + * Leave unimplemented for now. + */ + return -1; +} + +int +efi_guid_to_str(const efi_guid_t *guid, char **sp) +{ + uint32_t status; + + /* knows efi_guid_t is a typedef of uuid_t */ + uuid_to_string(guid, sp, &status); + + return (status == uuid_s_ok ? 0 : -1); +} + +int +efi_name_to_guid(const char *name, efi_guid_t *guid) +{ + size_t i; + + for (i = 0; i < nitems(guid_tbl); i++) { + if (strcmp(name, guid_tbl[i].name) == 0) { + *guid = guid_tbl[i].guid; + return (0); + } + } + return (efi_str_to_guid(name, guid)); +} + +int +efi_set_variable(efi_guid_t guid, const char *name, + uint8_t *data, size_t data_size, uint32_t attributes, mode_t mode __unused) +{ + struct efi_var_ioc var; + int rv; + + if (efi_open_dev() == -1) + return -1; + + efi_var_reset(&var); + rv = libefi_utf8_to_ucs2(name, &var.name, &var.namesize); + if (rv != 0) + goto errout; + var.vendor = guid; + var.data = data; + var.datasize = data_size; + var.attrib = attributes; + rv = ioctl(efi_fd, EFIIOC_VAR_SET, &var); +errout: + free(var.name); + + return rv; +} + +int +efi_str_to_guid(const char *s, efi_guid_t *guid) +{ + uint32_t status; + + /* knows efi_guid_t is a typedef of uuid_t */ + uuid_from_string(s, guid, &status); + + return (status == uuid_s_ok ? 0 : -1); +} + +int +efi_variables_supported(void) +{ + + return efi_open_dev() != -1; +} Added: head/lib/libefivar/efivar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libefivar/efivar.h Tue Oct 11 22:30:41 2016 (r307071) @@ -0,0 +1,121 @@ +/*- + * Copyright (c) 2016 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _EFIVAR_H_ +#define _EFIVAR_H_ + +#include +#include +#include +#include + +/* Shoud these be elsewhere ? */ +#define EFI_VARIABLE_NON_VOLATILE 0x00000001 +#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 +#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 +#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008 +#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010 +#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS \ + 0x00000020 +#define EFI_VARIABLE_APPEND_WRITE 0x00000040 +#if 0 /* todo */ +#define EFI_VARIABLE_HAS_AUTH_HEADER +#define EFI_VARIABLE_HAS_SIGNATURE +#endif + + +typedef uuid_t efi_guid_t; +#if BYTE_ORDER == LITTLE_ENDIAN +#define EFI_GUID(a, b, c, d, e0, e1, e2, e3, e4, e5) \ + ((efi_guid_t) {(a), (b), (c), (d) >> 8, (d) & 0xff, \ + { (e0), (e1), (e2), (e3), (e4), (e5) }}) +#else +#define EFI_GUID(a, b, c, d, e0, e1, e2, e3, e4, e5) \ + ((efi_guid_t) {(a), (b), (c), (d) & 0xff, (d) >> 8, \ + { (e0), (e1), (e2), (e3), (e4), (e5) }}) +#endif + +#define EFI_GLOBAL_GUID EFI_GUID(0x8be4df61, 0x93ca, 0x11d2, 0xaa0d, \ + 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c) + +int efi_append_variable(efi_guid_t guid, const char *name, + uint8_t *data, size_t data_size, uint32_t attributes); +int efi_del_variable(efi_guid_t guid, const char *name); +int efi_get_variable(efi_guid_t guid, const char *name, + uint8_t **data, size_t *data_size, uint32_t *attributes); +int efi_get_variable_attributes(efi_guid_t guid, const char *name, + uint32_t *attributes); +int efi_get_variable_size(efi_guid_t guid, const char *name, size_t *size); +int efi_get_next_variable_name(efi_guid_t **guid, char **name); +int efi_guid_cmp(const efi_guid_t *guid1, const efi_guid_t *guid2); +int efi_guid_is_zero(const efi_guid_t *guid1); +int efi_guid_to_name(efi_guid_t *guid, char **name); +int efi_guid_to_symbol(efi_guid_t *guid, char **symbol); +int efi_guid_to_str(const efi_guid_t *guid, char **sp); +int efi_name_to_guid(const char *name, efi_guid_t *guid); +int efi_set_variable(efi_guid_t guid, const char *name, + uint8_t *data, size_t data_size, uint32_t attributes, mode_t mode); +int efi_str_to_guid(const char *s, efi_guid_t *guid); +int efi_variables_supported(void); + +extern const efi_guid_t efi_guid_empty; + +/* Stubs that are expected, but aren't really used */ +static inline int +efi_error_get(unsigned int n __unused, char ** const fn __unused, + char ** const func __unused, int *line __unused, + char ** const msg __unused, int *err __unused) +{ + return 0; +} + +static inline int +efi_error_set(const char *fn __unused, const char *func __unused, + int line __unused, int err __unused, const char *fmt __unused, ...) +{ + return 0; +} + +static inline void +efi_error_clear(void) +{ +} + +static inline int +efi_error(const char *fmt __unused, ...) +{ + return 0; +} + +static inline int +efi_error_val(int val __unused, const char *fmt __unused, ...) +{ + return 0; +} + +#endif /* _EFIVAR_H_ */ Copied and modified: head/lib/libefivar/libefivar.c (from r307070, head/lib/libefi/libefi.c) ============================================================================== --- head/lib/libefi/libefi.c Tue Oct 11 22:24:30 2016 (r307070, copy source) +++ head/lib/libefivar/libefivar.c Tue Oct 11 22:30:41 2016 (r307071) @@ -27,86 +27,105 @@ #include __FBSDID("$FreeBSD$"); -#include #include -#include +#include #include #include #include #include +#include +#include -#include "libefi_int.h" +#include "libefivar_int.h" -static int __iofd = -1; +#include -static void -iodev_fd_close(void) +/* + * If nm were converted to utf8, what what would strlen + * return on the resulting string? + */ +static size_t +utf8_len_of_ucs2(const efi_char *nm) { + size_t len; + efi_char c; - close(__iofd); -} - -static int -iodev_fd(int *fd) -{ - - *fd = __iofd; - if (__iofd != -1) - return (0); - - __iofd = open("/dev/io", O_RDWR); - if (__iofd == -1) - return (errno); + len = 0; + while (*nm) { + c = *nm++; + if (c > 0x7ff) + len += 3; + else if (c > 0x7f) + len += 2; + else + len++; + } - atexit(iodev_fd_close); - *fd = __iofd; - return (0); + return (len); } int -libefi_ucs2_to_utf8(u_short *nm, size_t *szp, char *name) +libefi_ucs2_to_utf8(const efi_char *nm, char **name) { size_t len, sz; - u_short c; + efi_char c; + char *cp; + int freeit = *name == NULL; + sz = utf8_len_of_ucs2(nm) + 1; len = 0; - sz = *szp; + if (*name != NULL) + cp = *name; + else + cp = *name = malloc(sz); + if (*name == NULL) + return (ENOMEM); + while (*nm) { c = *nm++; if (c > 0x7ff) { if (len++ < sz) - *name++ = 0xE0 | (c >> 12); + *cp++ = (char)(0xE0 | (c >> 12)); if (len++ < sz) - *name++ = 0x80 | ((c >> 6) & 0x3f); + *cp++ = (char)(0x80 | ((c >> 6) & 0x3f)); if (len++ < sz) - *name++ = 0x80 | (c & 0x3f); + *cp++ = (char)(0x80 | (c & 0x3f)); } else if (c > 0x7f) { if (len++ < sz) - *name++ = 0xC0 | ((c >> 6) & 0x1f); + *cp++ = (char)(0xC0 | ((c >> 6) & 0x1f)); if (len++ < sz) - *name++ = 0x80 | (c & 0x3f); + *cp++ = (char)(0x80 | (c & 0x3f)); } else { if (len++ < sz) - *name++ = (c & 0x7f); + *cp++ = (char)(c & 0x7f); } } - if (len++ < sz) - *name++ = 0; - *szp = len; - return ((len <= sz) ? 0 : EOVERFLOW); + if (len >= sz) { + /* Absent bugs, we'll never return EOVERFLOW */ + if (freeit) + free(*name); + return (EOVERFLOW); + } + *cp++ = '\0'; + + return (0); } int -libefi_utf8_to_ucs2(char *name, size_t *szp, u_short **nmp) +libefi_utf8_to_ucs2(const char *name, efi_char **nmp, size_t *len) { - u_short *nm; + efi_char *nm; size_t sz; uint32_t ucs4; int c, bytes; + int freeit = *nmp == NULL; - *szp = sz = (*szp == 0) ? strlen(name) * 2 + 2 : *szp; - *nmp = nm = malloc(sz); + sz = strlen(name) * 2 + 2; + if (*nmp == NULL) + *nmp = malloc(sz); + nm = *nmp; + *len = sz; ucs4 = 0; bytes = 0; @@ -119,7 +138,8 @@ libefi_utf8_to_ucs2(char *name, size_t * if ((c & 0xc0) != 0x80) { /* Initial characters. */ if (bytes != 0) { - free(nm); + if (freeit) + free(nm); return (EILSEQ); } if ((c & 0xf8) == 0xf0) { @@ -141,36 +161,28 @@ libefi_utf8_to_ucs2(char *name, size_t * ucs4 = (ucs4 << 6) + (c & 0x3f); bytes--; } else if (bytes == 0) { - free(nm); + if (freeit) + free(nm); return (EILSEQ); } } if (bytes == 0) { if (ucs4 > 0xffff) { - free(nm); + if (freeit) + free(nm); return (EILSEQ); } - *nm++ = (u_short)ucs4; + *nm++ = (efi_char)ucs4; sz -= 2; } } if (sz < 2) { - free(nm); + if (freeit) + free(nm); return (EDOOFUS); } + sz -= 2; *nm = 0; + *len -= sz; return (0); } - -int -libefi_efivar(struct iodev_efivar_req *req) -{ - int error, fd; - - error = iodev_fd(&fd); - if (!error) - error = (ioctl(fd, IODEV_EFIVAR, req) == -1) ? errno : 0; - if (!error) - error = req->result; - return (error); -} Copied and modified: head/lib/libefivar/libefivar_int.h (from r307070, head/lib/libefi/libefi_int.h) ============================================================================== --- head/lib/libefi/libefi_int.h Tue Oct 11 22:24:30 2016 (r307070, copy source) +++ head/lib/libefivar/libefivar_int.h Tue Oct 11 22:30:41 2016 (r307071) @@ -29,12 +29,7 @@ #ifndef _LIBEFI_INT_H_ #define _LIBEFI_INT_H_ -#include -#include - -int libefi_ucs2_to_utf8(u_short *, size_t *, char *); -int libefi_utf8_to_ucs2(char *, size_t *, u_short **); - -int libefi_efivar(struct iodev_efivar_req *); +int libefi_ucs2_to_utf8(const efi_char *, char **); +int libefi_utf8_to_ucs2(const char *, efi_char **, size_t *); #endif /* _LIBEFI_INT_H_ */ Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Tue Oct 11 22:24:30 2016 (r307070) +++ head/share/mk/bsd.libnames.mk Tue Oct 11 22:30:41 2016 (r307071) @@ -59,6 +59,7 @@ LIBDPV?= ${DESTDIR}${LIBDIR}/libdpv.a LIBDTRACE?= ${DESTDIR}${LIBDIR}/libdtrace.a LIBDWARF?= ${DESTDIR}${LIBDIR}/libdwarf.a LIBEDIT?= ${DESTDIR}${LIBDIR}/libedit.a +LIBEFIVAR?= ${DESTDIR}${LIBDIR}/libefivar.a LIBELF?= ${DESTDIR}${LIBDIR}/libelf.a LIBEXECINFO?= ${DESTDIR}${LIBDIR}/libexecinfo.a LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Oct 11 22:24:30 2016 (r307070) +++ head/share/mk/src.libnames.mk Tue Oct 11 22:30:41 2016 (r307071) @@ -91,6 +91,7 @@ _LIBRARIES= \ dtrace \ dwarf \ edit \ + efivar \ elf \ execinfo \ fetch \ Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Oct 11 22:24:30 2016 (r307070) +++ head/share/mk/src.opts.mk Tue Oct 11 22:30:41 2016 (r307071) @@ -82,6 +82,7 @@ __DEFAULT_YES_OPTIONS = \ DYNAMICROOT \ ED_CRYPTO \ EE \ + EFI \ ELFTOOLCHAIN_BOOTSTRAP \ EXAMPLES \ FDT \ @@ -263,6 +264,9 @@ BROKEN_OPTIONS+=LIBSOFT .if ${__T:Mmips*} BROKEN_OPTIONS+=SSP .endif +.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} +BROKEN_OPTIONS+=EFI +.endif .include From owner-svn-src-head@freebsd.org Tue Oct 11 22:31:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A55BC0BCB2; Tue, 11 Oct 2016 22:31:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B915959; Tue, 11 Oct 2016 22:31:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BMVkmt056212; Tue, 11 Oct 2016 22:31:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BMVk8K056208; Tue, 11 Oct 2016 22:31:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610112231.u9BMVk8K056208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 11 Oct 2016 22:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307072 - in head/usr.sbin: . efivar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 22:31:47 -0000 Author: imp Date: Tue Oct 11 22:31:45 2016 New Revision: 307072 URL: https://svnweb.freebsd.org/changeset/base/307072 Log: Add efivar(1) to manipulate EFI variables. It uses a similar command line interface to the Linux program, as well as adding a number of useful features to make using it in shell scripts easier (since we don't have a filesystem to fall back on interacting with). Differential Revision: https://reviews.freebsd.org/D8128 Reviewed by: kib@, wblock@, Ganael Laplanche Added: head/usr.sbin/efivar/ head/usr.sbin/efivar/Makefile (contents, props changed) head/usr.sbin/efivar/efivar.8 (contents, props changed) head/usr.sbin/efivar/efivar.c (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Oct 11 22:30:41 2016 (r307071) +++ head/usr.sbin/Makefile Tue Oct 11 22:31:45 2016 (r307072) @@ -123,6 +123,7 @@ SUBDIR.${MK_BSNMP}+= bsnmpd SUBDIR.${MK_CTM}+= ctm SUBDIR.${MK_DIALOG}+= tzsetup SUBDIR.${MK_DIALOG}+= bsdconfig +SUBDIR.${MK_EFI}+= efivar SUBDIR.${MK_FLOPPY}+= fdcontrol SUBDIR.${MK_FLOPPY}+= fdformat SUBDIR.${MK_FLOPPY}+= fdread Added: head/usr.sbin/efivar/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/efivar/Makefile Tue Oct 11 22:31:45 2016 (r307072) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= efivar +MAN= efivar.8 + +LIBADD= efivar + +.include Added: head/usr.sbin/efivar/efivar.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/efivar/efivar.8 Tue Oct 11 22:31:45 2016 (r307072) @@ -0,0 +1,164 @@ +.\" Copyright (c) 2003 Netflix, Inc +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 29, 2016 +.Dt EFIVAR 8 +.Os +.Sh NAME +.Nm efivar +.Nd UEFI environemnt variable interaction +.Sh SYNOPSIS +.Nm +.Op Fl abdDHlLNpRtw +.Op Fl n Ar name +.Op Fl f Ar file +.Op Fl -append +.Op Fl -ascii +.Op Fl -attributes +.Op Fl -binary +.Op Fl -delete +.Op Fl -fromfile Ar file +.Op Fl -hex +.Op Fl -list-guids +.Op Fl -list +.Op Fl -name Ar name +.Op Fl -no-name +.Op Fl -print +.Op Fl -print-decimal +.Op Fl -raw-guid +.Op Fl -write +.Ar name Ns Op = Ns Ar value +.Sh DESCRIPTION +This program manages +.Dq Unified Extensible Firmware Interface +.Pq UEFI +environment variables. +UEFI variables have three part: A namespace, a name and a value. +The namespace is a GUID that's self assigned by the group defining the +variables. +The name is a Unicode name for the variable. +The value is binary data. +All Unicode data is presented to the user as UTF-8. +.Pp +The following options are available: +.Bl -tag -width 20m +.It Fl n Ar name Fl -name Ar name +Specify the name of the variable to operate on. +The +.Ar name +argument is the GUID of variable, followed by a dash, followed by the +UEFI variable name. +The GUID may be in numeric format, or may be one of the well known +symbolic name (see +.Fl -list-guids +for a complete list). +.It Fl f Ar file Fl -fromfile Ar file +When writing or appending to a variable, take the data for the +variable's value from +.Ar file +instead of from the command line. +This flag implies +.Fl -write +unless the +.Fl -append +flag is given. +This is not well understood and currently unimplemented. +.It Fl a Fl -append +Append the specified value to the UEFI variable rather than replacing +it.p +.It Fl t Ar attr Fl -attributes Ar attr +Specify, in user hostile hexidecimal, the attributes for this +variable. +See section 7.2 (GetVariable subsection, Related Definitions) of the +UEFI Specification for hex values to use. +.It Fl A Fl -ascii +Display the variable data as modified ascii: All printable characters +are printed, while unprintable characters are rendered as a two-digit +hexadecimal number preceeded by a % character. +.It Fl A Fl -binary +Display the variable data as binary data. +Usually will be used with the +.Fl N +or +.Fl -no-name +flag. +Useful in scripts. +.It Fl D Fl -delete +Delete the specified variable. +May not be used with either the +.Fl -write +or the +.Fl -append +flags. +No +.Ar value +may be specified. +.It Fl H Fl -hex +List variable data as a hex dump. +.It Fl L Fl -list-guids +Lists the well known GUIDs. +The names listed here may be used in place of the numeric GUID values. +These names will replace the numeric GUID values unless +.Fl -raw-guid +flag is specified. +.It Fl l Fl -list +List all the variables. +If the +.Fl -print +flag is also listed, their values will be displayed. +.It Fl N Fl -no-name +Do not display the variable name. +.It Fl p Fl -print +Print the value of the variable. +.It Fl d Fl -print-decimal +Treat the value of the variable as a number and print it as a +decimal. +This is currently unimplemented. +.It Fl R Fl -raw-guid +Do not substitute well known names for GUID numeric values in output. +.It Fl w Fl -write +Write (replace) the variable specified with the value specified. +.It Ar name +Display the +.Ar name +environment variable. +.It Ar name Ns = Ns Ar value +Set the specified +.Ar name +to +.Ar value . +This is not yet implemented. +.Sh COMPATIBILITY +The +.Nm +program is intended to be compatible (strict superset) with a progam +of the same name included in the Red Hat libefivar package. +.Sh SEE ALSO +Appendix A of the UEFI specification has the format for GUIDs. +All GUIDs +.Dq Globally Unique Identifiers +have the format described in RFC 4122. +.El Added: head/usr.sbin/efivar/efivar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/efivar/efivar.c Tue Oct 11 22:31:45 2016 (r307072) @@ -0,0 +1,349 @@ +/*- + * Copyright (c) 2016 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* options descriptor */ +static struct option longopts[] = { + { "append", no_argument, NULL, 'a' }, + { "ascii", no_argument, NULL, 'A' }, + { "attributes", required_argument, NULL, 't' }, + { "binary", no_argument, NULL, 'b' }, + { "delete", no_argument, NULL, 'D' }, + { "fromfile", required_argument, NULL, 'f' }, + { "hex", no_argument, NULL, 'H' }, + { "list-guids", no_argument, NULL, 'L' }, + { "list", no_argument, NULL, 'l' }, + { "name", required_argument, NULL, 'n' }, + { "no-name", no_argument, NULL, 'N' }, + { "print", no_argument, NULL, 'p' }, + { "print-decimal", no_argument, NULL, 'd' }, + { "raw-guid", no_argument, NULL, 'R' }, + { "write", no_argument, NULL, 'w' }, + { NULL, 0, NULL, 0 } +}; + + +static int aflag, Aflag, bflag, dflag, Dflag, Hflag, Nflag, + lflag, Lflag, Rflag, wflag, pflag; +static char *varname; +static u_long attrib = 0x7; + +static void +usage(void) +{ + + errx(1, "efivar [-abdDHlLNpRtw] [-n name] [-f file] [--append] [--ascii]\n" + "\t[--attributes] [--binary] [--delete] [--fromfile file] [--hex]\n" + "\t[--list-guids] [--list] [--name name] [--no-name] [--print]\n" + "\t[--print-decimal] [--raw-guid] [--write] name[=value]"); +} + +static void +breakdown_name(char *name, efi_guid_t *guid, char **vname) +{ + char *cp; + + cp = strrchr(name, '-'); + if (cp == NULL) + errx(1, "Invalid name: %s", name); + *vname = cp + 1; + *cp = '\0'; + if (efi_str_to_guid(name, guid) < 0) + errx(1, "Invalid guid %s", name); +} + +static uint8_t * +get_value(char *val, size_t *datalen) +{ + static char buffer[16*1024]; + + if (val != NULL) { + *datalen = strlen(val); + return ((uint8_t *)val); + } + /* Read from stdin */ + *datalen = sizeof(buffer); + *datalen = read(0, buffer, *datalen); + return ((uint8_t *)buffer); +} + +static void +append_variable(char *name, char *val) +{ + char *vname; + efi_guid_t guid; + size_t datalen; + uint8_t *data; + + breakdown_name(name, &guid, &vname); + data = get_value(val, &datalen); + if (efi_append_variable(guid, vname, data, datalen, attrib) < 0) + err(1, "efi_append_variable"); +} + +static void +delete_variable(char *name) +{ + char *vname; + efi_guid_t guid; + + breakdown_name(name, &guid, &vname); + if (efi_del_variable(guid, vname) < 0) + err(1, "efi_del_variable"); +} + +static void +write_variable(char *name, char *val) +{ + char *vname; + efi_guid_t guid; + size_t datalen; + uint8_t *data; + + breakdown_name(name, &guid, &vname); + data = get_value(val, &datalen); + if (efi_set_variable(guid, vname, data, datalen, attrib, 0) < 0) + err(1, "efi_set_variable"); +} + +static void +asciidump(uint8_t *data, size_t datalen) +{ + size_t i; + int len; + + len = 0; + if (!Nflag) + printf("\n"); + for (i = 0; i < datalen; i++) { + if (isprint(data[i])) { + len++; + if (len > 80) { + len = 0; + printf("\n"); + } + printf("%c", data[i]); + } else { + len +=3; + if (len > 80) { + len = 0; + printf("\n"); + } + printf("%%%02x", data[i]); + } + } + printf("\n"); +} + +static void +hexdump(uint8_t *data, size_t datalen) +{ + size_t i; + + if (!Nflag) + printf("\n"); + for (i = 0; i < datalen; i++) { + if (i % 16 == 0) { + if (i != 0) + printf("\n"); + printf("%04x: ", (int)i); + } + printf("%02x ", data[i]); + } + printf("\n"); +} + +static void +bindump(uint8_t *data, size_t datalen) +{ + write(1, data, datalen); +} + +static void +print_var(efi_guid_t *guid, char *name) +{ + uint32_t att; + uint8_t *data; + size_t datalen; + char *gname; + int rv; + + efi_guid_to_str(guid, &gname); + if (!Nflag) + printf("%s-%s", gname, name); + if (pflag) { + rv = efi_get_variable(*guid, name, &data, &datalen, &att); + + if (rv < 0) + printf("\n --- Error getting value --- %d", errno); + else { + if (Aflag) + asciidump(data, datalen); + else if (bflag) + bindump(data, datalen); + else + hexdump(data, datalen); + } + } + free(gname); + if (!Nflag) + printf("\n"); +} + +static void +print_variable(char *name) +{ + char *vname; + efi_guid_t guid; + + breakdown_name(name, &guid, &vname); + print_var(&guid, vname); +} + +static void +print_variables(void) +{ + int rv; + char *name = NULL; + efi_guid_t *guid = NULL; + + while ((rv = efi_get_next_variable_name(&guid, &name)) > 0) + print_var(guid, name); + + if (rv < 0) + err(1, "Error listing names"); +} + +static void +parse_args(int argc, char **argv) +{ + int ch, i; + + while ((ch = getopt_long(argc, argv, "aAbdDf:HlLNn:pRt:w", + longopts, NULL)) != -1) { + switch (ch) { + case 'a': + aflag++; + break; + case 'A': + Aflag++; + break; + case 'b': + bflag++; + break; + case 'd': + dflag++; + break; + case 'D': + Dflag++; + break; + case 'H': + Hflag++; + break; + case 'l': + lflag++; + break; + case 'L': + Lflag++; + break; + case 'n': + varname = optarg; + break; + case 'N': + Nflag++; + break; + case 'p': + pflag++; + break; + case 'R': + Rflag++; + break; + case 'w': + wflag++; + break; + case 'f': + case 't': + case 0: + errx(1, "unknown or unimplemented option\n"); + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (argc == 1) + varname = argv[0]; + + if (aflag + Dflag + wflag > 1) { + warnx("Can only use one of -a (--append), " + "-D (--delete) and -w (--write)"); + usage(); + } + + if (aflag + Dflag + wflag > 0 && varname == NULL) { + warnx("Must specify a variable for -a (--append), " + "-D (--delete) or -w (--write)"); + usage(); + } + + if (aflag) + append_variable(varname, NULL); + else if (Dflag) + delete_variable(varname); + else if (wflag) + write_variable(varname, NULL); + else if (varname) { + pflag++; + print_variable(varname); + } else if (argc > 0) { + pflag++; + for (i = 0; i < argc; i++) + print_variable(argv[i]); + } else + print_variables(); +} + +int +main(int argc, char **argv) +{ + + parse_args(argc, argv); +} From owner-svn-src-head@freebsd.org Tue Oct 11 22:32:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2367C0BDF2; Tue, 11 Oct 2016 22:32:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70FD0BF0; Tue, 11 Oct 2016 22:32:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BMWCHM056272; Tue, 11 Oct 2016 22:32:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BMWCmG056271; Tue, 11 Oct 2016 22:32:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610112232.u9BMWCmG056271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 11 Oct 2016 22:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307073 - head/sys/modules/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 22:32:13 -0000 Author: imp Date: Tue Oct 11 22:32:12 2016 New Revision: 307073 URL: https://svnweb.freebsd.org/changeset/base/307073 Log: Properly include the 802.11n PHY support files when the BWM_GPL_PHY option is included. Remove the comment suggesting that people uncomment things because it is OBE. Modified: head/sys/modules/bwn/Makefile Modified: head/sys/modules/bwn/Makefile ============================================================================== --- head/sys/modules/bwn/Makefile Tue Oct 11 22:31:45 2016 (r307072) +++ head/sys/modules/bwn/Makefile Tue Oct 11 22:32:12 2016 (r307073) @@ -14,17 +14,15 @@ SRCS+= if_bwn_phy_n.c # Other SRCS+= device_if.h bus_if.h pci_if.h opt_bwn.h opt_wlan.h -# Uncomment this for the GPL PHY code; this requires the -# module be built with BWN_GPL_PHY set in the kernel -# configuration. - -#.PATH: ${.CURDIR}/../../gnu/dev/bwn/phy_n -#SRCS+= if_bwn_radio_2055.c -#SRCS+= if_bwn_radio_2056.c -#SRCS+= if_bwn_radio_2057.c -#SRCS+= if_bwn_phy_n_tables.c -#SRCS+= if_bwn_phy_n_ppr.c -#SRCS+= if_bwn_phy_n_core.c +# The following need the BWN_GPL_PHY kenrel option to opt-in +# to the GPL'd 802.11n PHY support for this driver. +.PATH: ${.CURDIR}/../../gnu/dev/bwn/phy_n +SRCS.BWN_GPL_PHY+= if_bwn_radio_2055.c +SRCS.BWN_GPL_PHY+= if_bwn_radio_2056.c +SRCS.BWN_GPL_PHY+= if_bwn_radio_2057.c +SRCS.BWN_GPL_PHY+= if_bwn_phy_n_tables.c +SRCS.BWN_GPL_PHY+= if_bwn_phy_n_ppr.c +SRCS.BWN_GPL_PHY+= if_bwn_phy_n_core.c .include From owner-svn-src-head@freebsd.org Tue Oct 11 22:54:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25060C0D274; Tue, 11 Oct 2016 22:54:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F383C8FA; Tue, 11 Oct 2016 22:54:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9BMsUea064401; Tue, 11 Oct 2016 22:54:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9BMsTQW064396; Tue, 11 Oct 2016 22:54:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610112254.u9BMsTQW064396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 11 Oct 2016 22:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307074 - in head/sys: mips/include pc98/include powerpc/include riscv/include sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 22:54:31 -0000 Author: imp Date: Tue Oct 11 22:54:29 2016 New Revision: 307074 URL: https://svnweb.freebsd.org/changeset/base/307074 Log: Include stubs even on the platforms we don't support so libsysdecode continues to build. Added: head/sys/mips/include/efi.h - copied, changed from r307073, head/sys/i386/include/efi.h head/sys/pc98/include/efi.h - copied, changed from r307073, head/sys/i386/include/efi.h head/sys/powerpc/include/efi.h - copied, changed from r307073, head/sys/i386/include/efi.h head/sys/riscv/include/efi.h - copied, changed from r307073, head/sys/i386/include/efi.h head/sys/sparc64/include/efi.h - copied, changed from r307073, head/sys/i386/include/efi.h Copied and modified: head/sys/mips/include/efi.h (from r307073, head/sys/i386/include/efi.h) ============================================================================== --- head/sys/i386/include/efi.h Tue Oct 11 22:32:12 2016 (r307073, copy source) +++ head/sys/mips/include/efi.h Tue Oct 11 22:54:29 2016 (r307074) @@ -29,11 +29,11 @@ * $FreeBSD$ */ -#ifndef __I386_INCLUDE_EFI_H_ -#define __I386_INCLUDE_EFI_H_ +#ifndef __MIPS_INCLUDE_EFI_H_ +#define __MIPS_INCLUDE_EFI_H_ -#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ +#define EFIABI_ATTR -/* Note: we don't actually support this on i386 yet */ +/* Note: we don't actually support this on mips */ -#endif /* __I386_INCLUDE_EFI_H_ */ +#endif /* __MIPS_INCLUDE_EFI_H_ */ Copied and modified: head/sys/pc98/include/efi.h (from r307073, head/sys/i386/include/efi.h) ============================================================================== --- head/sys/i386/include/efi.h Tue Oct 11 22:32:12 2016 (r307073, copy source) +++ head/sys/pc98/include/efi.h Tue Oct 11 22:54:29 2016 (r307074) @@ -29,11 +29,11 @@ * $FreeBSD$ */ -#ifndef __I386_INCLUDE_EFI_H_ -#define __I386_INCLUDE_EFI_H_ +#ifndef __PC98_INCLUDE_EFI_H_ +#define __PC98_INCLUDE_EFI_H_ -#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ +#define EFIABI_ATTR -/* Note: we don't actually support this on i386 yet */ +/* Note: we don't actually support this on pc98 */ -#endif /* __I386_INCLUDE_EFI_H_ */ +#endif /* __PC98_INCLUDE_EFI_H_ */ Copied and modified: head/sys/powerpc/include/efi.h (from r307073, head/sys/i386/include/efi.h) ============================================================================== --- head/sys/i386/include/efi.h Tue Oct 11 22:32:12 2016 (r307073, copy source) +++ head/sys/powerpc/include/efi.h Tue Oct 11 22:54:29 2016 (r307074) @@ -29,11 +29,11 @@ * $FreeBSD$ */ -#ifndef __I386_INCLUDE_EFI_H_ -#define __I386_INCLUDE_EFI_H_ +#ifndef __POWERPC_INCLUDE_EFI_H_ +#define __POWERPC_INCLUDE_EFI_H_ -#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ +#define EFIABI_ATTR -/* Note: we don't actually support this on i386 yet */ +/* Note: we don't actually support this on powerpc */ -#endif /* __I386_INCLUDE_EFI_H_ */ +#endif /* __POWERPC_INCLUDE_EFI_H_ */ Copied and modified: head/sys/riscv/include/efi.h (from r307073, head/sys/i386/include/efi.h) ============================================================================== --- head/sys/i386/include/efi.h Tue Oct 11 22:32:12 2016 (r307073, copy source) +++ head/sys/riscv/include/efi.h Tue Oct 11 22:54:29 2016 (r307074) @@ -29,11 +29,11 @@ * $FreeBSD$ */ -#ifndef __I386_INCLUDE_EFI_H_ -#define __I386_INCLUDE_EFI_H_ +#ifndef __RISCV_INCLUDE_EFI_H_ +#define __RISCV_INCLUDE_EFI_H_ -#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ +#define EFIABI_ATTR -/* Note: we don't actually support this on i386 yet */ +/* Note: we don't actually support this on riscv */ #endif /* __I386_INCLUDE_EFI_H_ */ Copied and modified: head/sys/sparc64/include/efi.h (from r307073, head/sys/i386/include/efi.h) ============================================================================== --- head/sys/i386/include/efi.h Tue Oct 11 22:32:12 2016 (r307073, copy source) +++ head/sys/sparc64/include/efi.h Tue Oct 11 22:54:29 2016 (r307074) @@ -29,11 +29,11 @@ * $FreeBSD$ */ -#ifndef __I386_INCLUDE_EFI_H_ -#define __I386_INCLUDE_EFI_H_ +#ifndef __SPARC64_INCLUDE_EFI_H_ +#define __SPARC64_INCLUDE_EFI_H_ -#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ +#define EFIABI_ATTR -/* Note: we don't actually support this on i386 yet */ +/* Note: we don't actually support this on sparc64 */ #endif /* __I386_INCLUDE_EFI_H_ */ From owner-svn-src-head@freebsd.org Tue Oct 11 23:11:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 685EBC0D6AE for ; Tue, 11 Oct 2016 23:11:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x229.google.com (mail-qk0-x229.google.com [IPv6:2607:f8b0:400d:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17BC2F6D for ; Tue, 11 Oct 2016 23:11:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x229.google.com with SMTP id o68so56049164qkf.3 for ; Tue, 11 Oct 2016 16:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UHHk5raOvXN6h+TsPRvtcyVAUejtJu7mhJq5Kl2cK1U=; b=P0yjPlAMpbTzcV0BYvB10VILHXtKacKT+cj50NF7dxXldSapYy51R1Zrj28pTg8SIn D28Nevu6UgsyAmxtJ2DN4qbV54ldE3c9Ib4z49UTJCSsSEuretkq3WNe8IfCyBqKsYvu cYpzFT6TrJ9B68AG9+pl/CyRRDzYYlcaTYH2pV+kJlBEq4O3aIHI7OvnSY/xHVl+XGXw u9AepxkbDjLyzTyLqIZyyzHwrJ7fO2praO7GEGi3spx2FGAC34ALj1jY65G+M5KIx/SO pityAaKjVM3ZXGSVK6MEgPWKv5KnnJ5aMOLETN4MVf1UhlseSXK4bX3DpqQ9bHbj+Z3Y OR3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UHHk5raOvXN6h+TsPRvtcyVAUejtJu7mhJq5Kl2cK1U=; b=IDvy9+S49AuBVCzzO77aHgFbcQ+aF/eCS8is/VdQ+Y8noIOAouLd6aWaPIUZmj69Py Om39tvYXQRZ0P2TYzuJ26BQ2VYArCwiPAR/oN644j4rO3SMsESTmSsqtNaEwf+KFc+yb VvJy8CMUGAPRGFmP2mmBNAfODkNwgquzeKURczOGvXhx/mHYxydJYIqSGh5I2O17e8/g t9LHksyLPUyque33aaG4gHFZLaP9/8CtZTcyF+u6cc9/yq3PdVw5EC5q2bSULNHKz3rt EJsqgnFYPArv3kBOy2jrDeqL9Ip/ej34sXC7bwCp121q4+gyE9skzNiTRNTgY1RbZCL3 Naow== X-Gm-Message-State: AA6/9RlKyZlt/Rp6/ViqE5983+j4nQ0RK8Pt6elYXY6NakLOGbT/pnhHeCp+R3V0h7FEb1Qw X-Received: by 10.55.101.201 with SMTP id z192mr5241218qkb.35.1476227517244; Tue, 11 Oct 2016 16:11:57 -0700 (PDT) Received: from mutt-hardenedbsd (pool-100-16-218-231.bltmmd.fios.verizon.net. [100.16.218.231]) by smtp.gmail.com with ESMTPSA id 137sm1868767qkd.42.2016.10.11.16.11.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Oct 2016 16:11:55 -0700 (PDT) Date: Tue, 11 Oct 2016 19:11:53 -0400 From: Shawn Webb To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307072 - in head/usr.sbin: . efivar Message-ID: <20161011231153.GB55764@mutt-hardenedbsd> References: <201610112231.u9BMVk8K056208@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zx4FCpZtqtKETZ7O" Content-Disposition: inline In-Reply-To: <201610112231.u9BMVk8K056208@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 23:11:58 -0000 --zx4FCpZtqtKETZ7O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 11, 2016 at 10:31:46PM +0000, Warner Losh wrote: > Author: imp > Date: Tue Oct 11 22:31:45 2016 > New Revision: 307072 > URL: https://svnweb.freebsd.org/changeset/base/307072 >=20 > Log: > Add efivar(1) to manipulate EFI variables. It uses a similar command > line interface to the Linux program, as well as adding a number of > useful features to make using it in shell scripts easier (since we > don't have a filesystem to fall back on interacting with). > =20 > Differential Revision: https://reviews.freebsd.org/D8128 > Reviewed by: kib@, wblock@, Ganael Laplanche >=20 > Added: > head/usr.sbin/efivar/ > head/usr.sbin/efivar/Makefile (contents, props changed) > head/usr.sbin/efivar/efivar.8 (contents, props changed) > head/usr.sbin/efivar/efivar.c (contents, props changed) > Modified: > head/usr.sbin/Makefile The commit log says efivar(1), but the manpage is efivar(8). Maybe 1 is a typo? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --zx4FCpZtqtKETZ7O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX/XG3AAoJEGqEZY9SRW7ubZoP+gLhkt6OwX7l6E9/5TFMhH6T 74MwJRLgvVZMkZE/nxXdUTPDvhIENztY8DoZaAMvjYF/nrxHL8JAIZkJFatNNmrc AxZWDdwykYWdjU56x9VUJmwkzWNuBFQEtKKDZ4ERC7jLiFP9S7SAx0UeHMRdHQ/s I3HbbadKUc+/HkCv8cbnpW4hvnxQWmZaZmLPG/HPTOppCqDkB381QStVBffP+NkD FzhIjcUQNI1mHYQ3+jATMsF10stmA+MK2xUbInB822l12EAvXxiQo80K2P3zXI1m FJ1SJfQZSqDSMC6eb71OJj2x3MiBNf7ZK8Qs7pD9PDUI3/iGOHg1JrIX0z7cxcS8 eI89UcfQiKwGmgj/AS+CY+zO4s6MqOkXqHR6aICiiqTaVVjdyUSbWRxB75Wfr5zJ lXTfgC35ImmRixmYUUMVruKDF3PmBZBVVatydYkklIf3klpSizT68Kxtl6QalW/g Z6kLCjsVMS8FW9jJ11U60sOFgLaq1KUFoe0nse8rjKTjvkyq5xLg8v/jt9dApVMx DTakoOt/kt/8/Dg8rmE3LF1PVr23rg6uwSsKv2C3uyoNSeErRtHVReLP+MYyyDhV kNXZsqcCcByL4SGjMPsHgq8fyAm9TpibE7yx8wYrPsF2tMVIbbMOIdPtPLQ1Ie81 qXYZOZApGUT/Gd1H2VAK =tsK6 -----END PGP SIGNATURE----- --zx4FCpZtqtKETZ7O-- From owner-svn-src-head@freebsd.org Tue Oct 11 23:13:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61FFFC0D74A for ; Tue, 11 Oct 2016 23:13:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 338C11B0 for ; Tue, 11 Oct 2016 23:13:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id z65so38292358itc.0 for ; Tue, 11 Oct 2016 16:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=KWcj1hItiocGkURBnA7eLU7J5juDXH5oOXBKMMZ06v0=; b=uThz9KDs6lfUa0klkspJJhFtHdgvZkzY7DWmnE9p0n9ySaRex38p/59+umaco6cKEz dYWNGiUUWAXBkBQIyrIDFmdQUSf9UMCbXCdOVzj0ehX5fXrJRXyFTQ0FXh4+pm+ZuFaG L/+eDmAexZbiGk7j9QX3gY+CH6YEn8VhnQLRXZ39Ten02F56/AYZmGh/NBSlD6lqO8Mc 2Yu/1dU0u0H+zWtt8lftUTpGXigQJ/6c5vBd7gh9hQzMS1Nx80pnMw0v4UX9WTXrXegG CH8k1VPzjAZPZCd45sUvY57a+BNKjpyTuHiBapEAl3dsWcpujLKH3IOSCYFKViDelYsk BNzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=KWcj1hItiocGkURBnA7eLU7J5juDXH5oOXBKMMZ06v0=; b=UaupsoJe1C6+3s075OtWUynR76EiHxzNrBZjIPjp7kP6uP7Dp7pRy8sHAr+1MyajQZ 1GfCFbbfZTh6H3PAMCymxToYid6Zp/HWm2aJfVW1Es6EV45624or6NUfRM45nU6KZLyR BeIDvVJHT74+haYpbj73Ty0hCRQqp+iOcnKJqQn70TeYZyay/R+pNKw5tq43nXNBIac4 eun82gTkOqoxXrAgRHm/hqnhK4o5IiaRDirV1dOFLXon4fSWei0QPL1AjrqF9W4guzTK 9rbuOBIHlZF+gd0L4OROj4teBSprnBSJsT2CunT+6R4i+6Mx2EfOfoLBk697J/FW6jPx 8ytw== X-Gm-Message-State: AA6/9RkAyf7TwSY2Nweki5cPQlTHTxA/XWp0VHUfwVKTRyDsvUQX/cRuVtu+2KaHxsRDQw7MNmNbjK4Njy9VKw== X-Received: by 10.107.15.222 with SMTP id 91mr434186iop.19.1476227605533; Tue, 11 Oct 2016 16:13:25 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Tue, 11 Oct 2016 16:13:24 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <20161011231153.GB55764@mutt-hardenedbsd> References: <201610112231.u9BMVk8K056208@repo.freebsd.org> <20161011231153.GB55764@mutt-hardenedbsd> From: Warner Losh Date: Tue, 11 Oct 2016 17:13:24 -0600 X-Google-Sender-Auth: dnCTyi7cQylSF7q6y40lzSZBDRo Message-ID: Subject: Re: svn commit: r307072 - in head/usr.sbin: . efivar To: Shawn Webb Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 23:13:26 -0000 On Tue, Oct 11, 2016 at 5:11 PM, Shawn Webb wrote: > On Tue, Oct 11, 2016 at 10:31:46PM +0000, Warner Losh wrote: >> Author: imp >> Date: Tue Oct 11 22:31:45 2016 >> New Revision: 307072 >> URL: https://svnweb.freebsd.org/changeset/base/307072 >> >> Log: >> Add efivar(1) to manipulate EFI variables. It uses a similar command >> line interface to the Linux program, as well as adding a number of >> useful features to make using it in shell scripts easier (since we >> don't have a filesystem to fall back on interacting with). >> >> Differential Revision: https://reviews.freebsd.org/D8128 >> Reviewed by: kib@, wblock@, Ganael Laplanche >> >> Added: >> head/usr.sbin/efivar/ >> head/usr.sbin/efivar/Makefile (contents, props changed) >> head/usr.sbin/efivar/efivar.8 (contents, props changed) >> head/usr.sbin/efivar/efivar.c (contents, props changed) >> Modified: >> head/usr.sbin/Makefile > > The commit log says efivar(1), but the manpage is efivar(8). Maybe 1 is > a typo? (1) is a typo :( Warner From owner-svn-src-head@freebsd.org Tue Oct 11 23:19:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23176C0D847 for ; Tue, 11 Oct 2016 23:19:04 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x232.google.com (mail-qk0-x232.google.com [IPv6:2607:f8b0:400d:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9AE43BF for ; Tue, 11 Oct 2016 23:19:03 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x232.google.com with SMTP id f128so10177605qkb.1 for ; Tue, 11 Oct 2016 16:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mVUIfriiusj2LbYbUE4F06wFpWNZoAkajZC/pWYUxgA=; b=tRSEQzWjuartWKK/yqyOXvK1PgLXCMC/KQoD96b6o/0Dbc0kSRh0Z0s2sqjBF9Lg0m oIfUwtQevEJc+++Gii5ptkdF3O2OzG7vC7xE9Kz2+UM1vS2plJUkI9xs/k/yE0nRp+F+ FBYuGO8419583RToIrRXxyf4WgN8w0hulZVtYeZshHjpHjFT1h2nvSFuK3EPoHluEQbV hn6pLbkwv5woIDb1XLhKh56KMfgQLPpvrguSkQ8oqXlnJriAHG9orPsBL9n+XoioqiFZ 7SOUzcYENNgIF9TmedMZxBdagnppIMaXt12EaYRcSAz+ZXwzQToPiGqsnX3jdYGpoqd7 9sfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mVUIfriiusj2LbYbUE4F06wFpWNZoAkajZC/pWYUxgA=; b=LPhWhUe1+20P80yzjwuMieDY1V9rA2Ud2GrFobcCloyB2j8dXOfVQtJjncsf7yfPj9 d+EQxhdPi3Sb8ty02UWRUktHW80icK+VhRUdTVZvNCEYtbWWmfs7+gkCB2zl1BIgvAo/ VDprxGP6wm1Su/M/WD9NfUVKLbwQY3swFktjKz4OtxzBfC4sp7Cmuj7vfU/sFH8mkxQM Zj1sDABM0uRVKHx8fjJzCA4hhbtiYBiCdQjN4XA3MCZJaCX2UCh/79IEIdN1g1hEW2ll Q1pNeQojpzUtcTK42uFwhogXXCtfY5F9sEpwtr7toMNasGg9rVSt/bsvg9A+GJEmp/ZY lLlQ== X-Gm-Message-State: AA6/9RkF3QcnHr6q8F9hnhMH5G5mqG/lQaa0nkIeyXtIthY9oo/dllcbN0M6zRwTKdnuQW9x X-Received: by 10.55.154.135 with SMTP id c129mr5461468qke.304.1476227943000; Tue, 11 Oct 2016 16:19:03 -0700 (PDT) Received: from mutt-hardenedbsd (pool-100-16-218-231.bltmmd.fios.verizon.net. [100.16.218.231]) by smtp.gmail.com with ESMTPSA id v24sm1899475qtv.15.2016.10.11.16.19.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Oct 2016 16:19:01 -0700 (PDT) Date: Tue, 11 Oct 2016 19:19:00 -0400 From: Shawn Webb To: Warner Losh Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307072 - in head/usr.sbin: . efivar Message-ID: <20161011231900.GC55764@mutt-hardenedbsd> References: <201610112231.u9BMVk8K056208@repo.freebsd.org> <20161011231153.GB55764@mutt-hardenedbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rQ2U398070+RC21q" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 23:19:04 -0000 --rQ2U398070+RC21q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 11, 2016 at 05:13:24PM -0600, Warner Losh wrote: > On Tue, Oct 11, 2016 at 5:11 PM, Shawn Webb = wrote: > > On Tue, Oct 11, 2016 at 10:31:46PM +0000, Warner Losh wrote: > >> Author: imp > >> Date: Tue Oct 11 22:31:45 2016 > >> New Revision: 307072 > >> URL: https://svnweb.freebsd.org/changeset/base/307072 > >> > >> Log: > >> Add efivar(1) to manipulate EFI variables. It uses a similar command > >> line interface to the Linux program, as well as adding a number of > >> useful features to make using it in shell scripts easier (since we > >> don't have a filesystem to fall back on interacting with). > >> > >> Differential Revision: https://reviews.freebsd.org/D8128 > >> Reviewed by: kib@, wblock@, Ganael Laplanche > >> > >> Added: > >> head/usr.sbin/efivar/ > >> head/usr.sbin/efivar/Makefile (contents, props changed) > >> head/usr.sbin/efivar/efivar.8 (contents, props changed) > >> head/usr.sbin/efivar/efivar.c (contents, props changed) > >> Modified: > >> head/usr.sbin/Makefile > > > > The commit log says efivar(1), but the manpage is efivar(8). Maybe 1 is > > a typo? >=20 > (1) is a typo :( No worries. Thanks for the quick response. I just wanted to make sure that it was supposed to be 8 versus the 1 in the log. Good to see a program like this in base. Good work. --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --rQ2U398070+RC21q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX/XNjAAoJEGqEZY9SRW7uqEEP/Auvue/9rpwkiziq0Kc2NpqB gJY/Dubfl16vk8nId8Wk0ixnEU/92mSmW+QWzpF2rqrmva/N/1lvqezwAeWsd5U5 IjgFr79Dzq8Mdby49hzGiqQQPMOfsPc+eHSvLt3ZR0W+utwpOX89IqdHOVD312tb npT865xNV/bxsGGMRHl7ZFwmJDQ/FZYcpTFSGv9HG463/jCBeNgHH9y0zmvtYOC4 dJvfLkCwHsoyqp+5X1fMpTJu6X9SLAvs6Nfg5bSreg3ueEdfuPne9D/F2kfHsdRI +GB10xH2N5XYQVLAxU696Xk5LM/v56lxPx2ERmk2VYwNzCosZMWXY0EwXzlTohBF xyuEruQhNdAuKAauBeMR03XmpwGX7SkWb2bS5VlU6SJvbBhf+nH7Z8nQSefHba02 ncO68h4BlxYD+IgKPQ3HeG0uQJkbjEfRHlIdLX+kt9WbrzO1QiVRa3l71IVkwhEi uBpBGe4+D5bnwBIgWjanUrPTDEl6+eCAGopcyv9uopAPxCA82HcdePgrYu9kceCF 6RODyjtBADqssRHk7Xnc71Qt932TLc1hyf9lCJJpkN/GcMFIKUy3mshYseNiQMPO 00oY712390e3yUAaNFUamLs7/h3ZLJuPzBLlfxF6r1er2iw+ZjEjvZizwpz6+Ej5 ciXZf8BThtperVBiHyif =ysVG -----END PGP SIGNATURE----- --rQ2U398070+RC21q-- From owner-svn-src-head@freebsd.org Wed Oct 12 00:42:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C28FBC0EBE7; Wed, 12 Oct 2016 00:42:48 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80693E9B; Wed, 12 Oct 2016 00:42:48 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C0gl19006634; Wed, 12 Oct 2016 00:42:47 GMT (envelope-from jonathan@FreeBSD.org) Received: (from jonathan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C0glMP006629; Wed, 12 Oct 2016 00:42:47 GMT (envelope-from jonathan@FreeBSD.org) Message-Id: <201610120042.u9C0glMP006629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jonathan set sender to jonathan@FreeBSD.org using -f From: Jonathan Anderson Date: Wed, 12 Oct 2016 00:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307075 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 00:42:48 -0000 Author: jonathan Date: Wed Oct 12 00:42:46 2016 New Revision: 307075 URL: https://svnweb.freebsd.org/changeset/base/307075 Log: Extract suffix rules into bsd.suffixes[-posix].mk. Refactor make suffix rules into separate files (one for POSIX and one not), and rationalise the rules so that bsd.lib.mk can contain only those rules that are library-specific (.c.po and .c.pico). This can be accomplished by adding ${STATIC_CFLAGS} to the .c.o rule unconditionally. STATIC_CFLAGS are only defined for use by sys.mk rules in lib/libpam/Makefile.inc (see r227797), so it should be safe to include them unconditionally in sys.mk's .c.o rule (tested by make universe and a ports exp-run). Reviewed by: bdrewery, sjg Approved by: rwatson (mentor) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6805 Added: head/share/mk/bsd.suffixes-posix.mk (contents, props changed) head/share/mk/bsd.suffixes.mk (contents, props changed) Modified: head/share/mk/Makefile head/share/mk/bsd.lib.mk head/share/mk/sys.mk Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Tue Oct 11 22:54:29 2016 (r307074) +++ head/share/mk/Makefile Wed Oct 12 00:42:46 2016 (r307075) @@ -49,6 +49,8 @@ FILES= \ bsd.progs.mk \ bsd.snmpmod.mk \ bsd.subdir.mk \ + bsd.suffixes-posix.mk \ + bsd.suffixes.mk \ bsd.symver.mk \ bsd.sys.mk \ bsd.test.mk \ Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Oct 11 22:54:29 2016 (r307074) +++ head/share/mk/bsd.lib.mk Wed Oct 12 00:42:46 2016 (r307075) @@ -78,7 +78,6 @@ CTFFLAGS+= -g # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries # .pico used for PIC object files -.SUFFIXES: .SUFFIXES: .out .o .po .pico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln .if !defined(PICFLAG) @@ -91,10 +90,6 @@ PICFLAG=-fpic PO_FLAG=-pg -.c.o: - ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - .c.po: ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} @@ -103,9 +98,6 @@ PO_FLAG=-pg ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -.cc.o .C.o .cpp.o .cxx.o: - ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} - .cc.po .C.po .cpp.po .cxx.po: ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} Added: head/share/mk/bsd.suffixes-posix.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.suffixes-posix.mk Wed Oct 12 00:42:46 2016 (r307075) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# Posix 1003.2 mandated rules +# +# Quoted directly from the Posix 1003.2 draft, only the macros +# $@, $< and $* have been replaced by ${.TARGET}, ${.IMPSRC}, and +# ${.PREFIX}, resp. + +# SINGLE SUFFIX RULES +.c: + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} + +.f: + ${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} + +.sh: + cp -f ${.IMPSRC} ${.TARGET} + chmod a+x ${.TARGET} + +# DOUBLE SUFFIX RULES + +.c.o: + ${CC} ${CFLAGS} -c ${.IMPSRC} + +.f.o: + ${FC} ${FFLAGS} -c ${.IMPSRC} + +.y.o: + ${YACC} ${YFLAGS} ${.IMPSRC} + ${CC} ${CFLAGS} -c y.tab.c + rm -f y.tab.c + mv y.tab.o ${.TARGET} + +.l.o: + ${LEX} ${LFLAGS} ${.IMPSRC} + ${CC} ${CFLAGS} -c lex.yy.c + rm -f lex.yy.c + mv lex.yy.o ${.TARGET} + +.y.c: + ${YACC} ${YFLAGS} ${.IMPSRC} + mv y.tab.c ${.TARGET} + +.l.c: + ${LEX} ${LFLAGS} ${.IMPSRC} + mv lex.yy.c ${.TARGET} + +.c.a: + ${CC} ${CFLAGS} -c ${.IMPSRC} + ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o + rm -f ${.PREFIX}.o + +.f.a: + ${FC} ${FFLAGS} -c ${.IMPSRC} + ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o + rm -f ${.PREFIX}.o Added: head/share/mk/bsd.suffixes.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.suffixes.mk Wed Oct 12 00:42:46 2016 (r307075) @@ -0,0 +1,99 @@ +# $FreeBSD$ + +.sh: + cp -f ${.IMPSRC} ${.TARGET} + chmod a+x ${.TARGET} + +.c.ln: + ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \ + touch ${.TARGET} + +.cc.ln .C.ln .cpp.ln .cxx.ln: + ${LINT} ${LINTOBJFLAGS} ${CXXFLAGS:M-[DIU]*} ${.IMPSRC} || \ + touch ${.TARGET} + +.c: + ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.c.o: + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.cc .cpp .cxx .C: + ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} + +.cc.o .cpp.o .cxx.o .C.o: + ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +.m.o: + ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.p.o: + ${PC} ${PFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.e .r .F .f: + ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \ + -o ${.TARGET} + +.e.o .r.o .F.o .f.o: + ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +.S.o: + ${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.asm.o: + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ + -o ${.TARGET} + ${CTFCONVERT_CMD} + +.s.o: + ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} + ${CTFCONVERT_CMD} + +# XXX not -j safe +.y.o: + ${YACC} ${YFLAGS} ${.IMPSRC} + ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET} + rm -f y.tab.c + ${CTFCONVERT_CMD} + +.l.o: + ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c + ${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET} + rm -f ${.PREFIX}.tmp.c + ${CTFCONVERT_CMD} + +# XXX not -j safe +.y.c: + ${YACC} ${YFLAGS} ${.IMPSRC} + mv y.tab.c ${.TARGET} + +.l.c: + ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET} + +.s.out .c.out .o.out: + ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} + ${CTFCONVERT_CMD} + +.f.out .F.out .r.out .e.out: + ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \ + ${LDLIBS} -o ${.TARGET} + rm -f ${.PREFIX}.o + ${CTFCONVERT_CMD} + +# XXX not -j safe +.y.out: + ${YACC} ${YFLAGS} ${.IMPSRC} + ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET} + rm -f y.tab.c + ${CTFCONVERT_CMD} + +.l.out: + ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c + ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET} + rm -f ${.PREFIX}.tmp.c + ${CTFCONVERT_CMD} Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Tue Oct 11 22:54:29 2016 (r307074) +++ head/share/mk/sys.mk Wed Oct 12 00:42:46 2016 (r307075) @@ -259,162 +259,12 @@ YFLAGS ?= -d .if defined(%POSIX) -# Posix 1003.2 mandated rules -# -# Quoted directly from the Posix 1003.2 draft, only the macros -# $@, $< and $* have been replaced by ${.TARGET}, ${.IMPSRC}, and -# ${.PREFIX}, resp. - -# SINGLE SUFFIX RULES -.c: - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} - -.f: - ${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} - -.sh: - cp -f ${.IMPSRC} ${.TARGET} - chmod a+x ${.TARGET} - -# DOUBLE SUFFIX RULES - -.c.o: - ${CC} ${CFLAGS} -c ${.IMPSRC} - -.f.o: - ${FC} ${FFLAGS} -c ${.IMPSRC} - -.y.o: - ${YACC} ${YFLAGS} ${.IMPSRC} - ${CC} ${CFLAGS} -c y.tab.c - rm -f y.tab.c - mv y.tab.o ${.TARGET} - -.l.o: - ${LEX} ${LFLAGS} ${.IMPSRC} - ${CC} ${CFLAGS} -c lex.yy.c - rm -f lex.yy.c - mv lex.yy.o ${.TARGET} - -.y.c: - ${YACC} ${YFLAGS} ${.IMPSRC} - mv y.tab.c ${.TARGET} - -.l.c: - ${LEX} ${LFLAGS} ${.IMPSRC} - mv lex.yy.c ${.TARGET} - -.c.a: - ${CC} ${CFLAGS} -c ${.IMPSRC} - ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o - rm -f ${.PREFIX}.o - -.f.a: - ${FC} ${FFLAGS} -c ${.IMPSRC} - ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o - rm -f ${.PREFIX}.o +.include "bsd.suffixes-posix.mk" .else # non-Posix rule set - -.sh: - cp -f ${.IMPSRC} ${.TARGET} - chmod a+x ${.TARGET} - -.c.ln: - ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \ - touch ${.TARGET} - -.cc.ln .C.ln .cpp.ln .cxx.ln: - ${LINT} ${LINTOBJFLAGS} ${CXXFLAGS:M-[DIU]*} ${.IMPSRC} || \ - touch ${.TARGET} - -.c: - ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.c.o: - ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.cc .cpp .cxx .C: - ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} - -.cc.o .cpp.o .cxx.o .C.o: - ${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} - -.m.o: - ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.p.o: - ${PC} ${PFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.e .r .F .f: - ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \ - -o ${.TARGET} - -.e.o .r.o .F.o .f.o: - ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET} - -.S.o: - ${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.asm.o: - ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ - -o ${.TARGET} - ${CTFCONVERT_CMD} - -.s.o: - ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} - ${CTFCONVERT_CMD} - -# XXX not -j safe -.y.o: - ${YACC} ${YFLAGS} ${.IMPSRC} - ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET} - rm -f y.tab.c - ${CTFCONVERT_CMD} - -.l.o: - ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c - ${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET} - rm -f ${.PREFIX}.tmp.c - ${CTFCONVERT_CMD} - -# XXX not -j safe -.y.c: - ${YACC} ${YFLAGS} ${.IMPSRC} - mv y.tab.c ${.TARGET} - -.l.c: - ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET} - -.s.out .c.out .o.out: - ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} - ${CTFCONVERT_CMD} - -.f.out .F.out .r.out .e.out: - ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \ - ${LDLIBS} -o ${.TARGET} - rm -f ${.PREFIX}.o - ${CTFCONVERT_CMD} - -# XXX not -j safe -.y.out: - ${YACC} ${YFLAGS} ${.IMPSRC} - ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET} - rm -f y.tab.c - ${CTFCONVERT_CMD} - -.l.out: - ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c - ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET} - rm -f ${.PREFIX}.tmp.c - ${CTFCONVERT_CMD} +.include "bsd.suffixes.mk" # Pull in global settings. __MAKE_CONF?=/etc/make.conf From owner-svn-src-head@freebsd.org Wed Oct 12 00:56:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4BEC0EEAA; Wed, 12 Oct 2016 00:56:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8525E908; Wed, 12 Oct 2016 00:56:50 +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 u9C0unst010860; Wed, 12 Oct 2016 00:56:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C0unQT010859; Wed, 12 Oct 2016 00:56:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610120056.u9C0unQT010859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 12 Oct 2016 00:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307076 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 00:56:50 -0000 Author: emaste Date: Wed Oct 12 00:56:49 2016 New Revision: 307076 URL: https://svnweb.freebsd.org/changeset/base/307076 Log: Use correct size type in do_setopt_accept_filter Submitted by: ecturt@gmail.com Modified: head/sys/kern/uipc_accf.c Modified: head/sys/kern/uipc_accf.c ============================================================================== --- head/sys/kern/uipc_accf.c Wed Oct 12 00:42:46 2016 (r307075) +++ head/sys/kern/uipc_accf.c Wed Oct 12 00:56:49 2016 (r307076) @@ -250,7 +250,7 @@ do_setopt_accept_filter(struct socket *s newaf = malloc(sizeof(*newaf), M_ACCF, M_WAITOK | M_ZERO); if (afp->accf_create != NULL && afap->af_name[0] != '\0') { - int len = strlen(afap->af_name) + 1; + size_t len = strlen(afap->af_name) + 1; newaf->so_accept_filter_str = malloc(len, M_ACCF, M_WAITOK); strcpy(newaf->so_accept_filter_str, afap->af_name); From owner-svn-src-head@freebsd.org Wed Oct 12 01:52:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4964BC0CE11; Wed, 12 Oct 2016 01:52:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E1528F5; Wed, 12 Oct 2016 01:52:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C1qTNH033898; Wed, 12 Oct 2016 01:52:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C1qT1M033897; Wed, 12 Oct 2016 01:52:29 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610120152.u9C1qT1M033897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 12 Oct 2016 01:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307078 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 01:52:30 -0000 Author: sephe Date: Wed Oct 12 01:52:29 2016 New Revision: 307078 URL: https://svnweb.freebsd.org/changeset/base/307078 Log: ifnet: Use if_link_state snapshot to invoke ifnet_link_event So that everyone in this task have consistent view of link state. Reviewed by: ae MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8214 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Oct 12 01:21:18 2016 (r307077) +++ head/sys/net/if.c Wed Oct 12 01:52:29 2016 (r307078) @@ -2206,7 +2206,7 @@ do_link_state_change(void *arg, int pend if (log_link_state_change) log(LOG_NOTICE, "%s: link state changed to %s\n", ifp->if_xname, (link_state == LINK_STATE_UP) ? "UP" : "DOWN" ); - EVENTHANDLER_INVOKE(ifnet_link_event, ifp, ifp->if_link_state); + EVENTHANDLER_INVOKE(ifnet_link_event, ifp, link_state); CURVNET_RESTORE(); } From owner-svn-src-head@freebsd.org Wed Oct 12 02:16:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CE20C0D80C; Wed, 12 Oct 2016 02:16:51 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36E2F19B9; Wed, 12 Oct 2016 02:16:51 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C2GoGg041898; Wed, 12 Oct 2016 02:16:50 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C2Gga8041814; Wed, 12 Oct 2016 02:16:42 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201610120216.u9C2Gga8041814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Wed, 12 Oct 2016 02:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307082 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/cc sys/modules/khelp sys/netinet sys/netinet/tcp_stacks sys/pc98/conf sy... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 02:16:51 -0000 Author: jtl Date: Wed Oct 12 02:16:42 2016 New Revision: 307082 URL: https://svnweb.freebsd.org/changeset/base/307082 Log: In the TCP stack, the hhook(9) framework provides hooks for kernel modules to add actions that run when a TCP frame is sent or received on a TCP session in the ESTABLISHED state. In the base tree, this functionality is only used for the h_ertt module, which is used by the cc_cdg, cc_chd, cc_hd, and cc_vegas congestion control modules. Presently, we incur overhead to check for hooks each time a TCP frame is sent or received on an ESTABLISHED TCP session. This change adds a new compile-time option (TCP_HHOOK) to determine whether to include the hhook(9) framework for TCP. To retain backwards compatibility, I added the TCP_HHOOK option to every configuration file that already defined "options INET". (Therefore, this patch introduces no functional change. In order to see a functional difference, you need to compile a custom kernel without the TCP_HHOOK option.) This change will allow users to easily exclude this functionality from their kernel, should they wish to do so. Note that any users who use a custom kernel configuration and use one of the congestion control modules listed above will need to add the TCP_HHOOK option to their kernel configuration. Reviewed by: rrs, lstewart, hiren (previous version), sjg (makefiles only) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D8185 Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/KB920X head/sys/arm/conf/NSLU head/sys/arm/conf/QILA9G20 head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/TS7800 head/sys/arm/conf/std.armv6 head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/mips/conf/ADM5120 head/sys/mips/conf/ALCHEMY head/sys/mips/conf/AR71XX_BASE head/sys/mips/conf/AR724X_BASE head/sys/mips/conf/BCM head/sys/mips/conf/BERI_TEMPLATE head/sys/mips/conf/ERL head/sys/mips/conf/GXEMUL head/sys/mips/conf/GXEMUL32 head/sys/mips/conf/IDT head/sys/mips/conf/MT7620 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/PB92 head/sys/mips/conf/QCA953X_BASE head/sys/mips/conf/QEMU head/sys/mips/conf/RT305X head/sys/mips/conf/RT5350 head/sys/mips/conf/SENTRY5 head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 head/sys/mips/conf/std.AR5312 head/sys/mips/conf/std.AR5315 head/sys/mips/conf/std.AR91XX head/sys/mips/conf/std.AR933X head/sys/mips/conf/std.AR934X head/sys/mips/conf/std.MALTA head/sys/mips/conf/std.QCA955X head/sys/mips/conf/std.SWARM head/sys/mips/conf/std.XLP head/sys/modules/cc/Makefile head/sys/modules/khelp/Makefile head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/riscv/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 12 02:15:06 2016 (r307081) +++ head/UPDATING Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20161008: + Use of the cc_cdg, cc_chd, cc_hd, or cc_vegas congestion control + modules now requires that the kernel configuration contain the + TCP_HHOOK option. (This option is included in the GENERIC kernel.) + 20161003: The WITHOUT_ELFCOPY_AS_OBJCOPY src.conf(5) knob has been retired. ELF Tool Chain's elfcopy is always installed as /usr/bin/objcopy. Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/amd64/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -30,6 +30,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security options TCP_OFFLOAD # TCP offload +options TCP_HHOOK # hhook(9) framework for TCP options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/ATMEL Wed Oct 12 02:16:42 2016 (r307082) @@ -35,6 +35,7 @@ options SCHED_4BSD # 4BSD scheduler #options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/AVILA Wed Oct 12 02:16:42 2016 (r307082) @@ -36,6 +36,7 @@ options DEVICE_POLLING options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/BWCT Wed Oct 12 02:16:42 2016 (r307082) @@ -33,6 +33,7 @@ makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/CAMBRIA Wed Oct 12 02:16:42 2016 (r307082) @@ -37,6 +37,7 @@ options DEVICE_POLLING options SCHED_4BSD # 4BSD scheduler #options PREEMPTION options INET # InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/CNS11XXNAS Wed Oct 12 02:16:42 2016 (r307082) @@ -46,6 +46,7 @@ options GEOM_LABEL # Provides labeliza options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/CRB Wed Oct 12 02:16:42 2016 (r307082) @@ -34,6 +34,7 @@ options HZ=100 options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DB-78XXX Wed Oct 12 02:16:42 2016 (r307082) @@ -15,6 +15,7 @@ makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DB-88F5XXX Wed Oct 12 02:16:42 2016 (r307082) @@ -15,6 +15,7 @@ makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DB-88F6XXX Wed Oct 12 02:16:42 2016 (r307082) @@ -15,6 +15,7 @@ makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options NANDFS # NAND Filesystem options NFSCL # Network Filesystem Client Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DOCKSTAR Wed Oct 12 02:16:42 2016 (r307082) @@ -29,6 +29,7 @@ options SOC_MV_KIRKWOOD options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options NFSCL # Network Filesystem Client Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DREAMPLUG-1001 Wed Oct 12 02:16:42 2016 (r307082) @@ -32,6 +32,7 @@ options SOC_MV_KIRKWOOD options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options NFSCL # Network Filesystem Client Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/EA3250 Wed Oct 12 02:16:42 2016 (r307082) @@ -16,6 +16,7 @@ makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options NFSCL # Network Filesystem Client options NFSLOCKD # Network Lock Manager Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/EB9200 Wed Oct 12 02:16:42 2016 (r307082) @@ -26,6 +26,7 @@ makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/ETHERNUT5 Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,7 @@ options SCHED_4BSD # 4BSD scheduler #options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP #options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/EXYNOS5.common Wed Oct 12 02:16:42 2016 (r307082) @@ -25,6 +25,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/GUMSTIX Wed Oct 12 02:16:42 2016 (r307082) @@ -39,6 +39,7 @@ options HZ=100 options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/HL200 Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,7 @@ makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/HL201 Wed Oct 12 02:16:42 2016 (r307082) @@ -29,6 +29,7 @@ makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/KB920X Wed Oct 12 02:16:42 2016 (r307082) @@ -32,6 +32,7 @@ makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/NSLU Wed Oct 12 02:16:42 2016 (r307082) @@ -43,6 +43,7 @@ options DEVICE_POLLING options SCHED_ULE # ULE scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/QILA9G20 Wed Oct 12 02:16:42 2016 (r307082) @@ -32,6 +32,7 @@ makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SAM9260EK Wed Oct 12 02:16:42 2016 (r307082) @@ -42,6 +42,7 @@ options SCHED_4BSD # 4BSD scheduler #options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP #options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SAM9G20EK Wed Oct 12 02:16:42 2016 (r307082) @@ -38,6 +38,7 @@ makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SAM9X25EK Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,7 @@ makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SHEEVAPLUG Wed Oct 12 02:16:42 2016 (r307082) @@ -17,6 +17,7 @@ options HZ=1000 options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options NANDFS # NAND Filesystem options NFSCL # Network Filesystem Client Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SN9G45 Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,7 @@ makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/TS7800 Wed Oct 12 02:16:42 2016 (r307082) @@ -15,6 +15,7 @@ makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options NFSCL # Network Filesystem Client Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/std.armv6 Wed Oct 12 02:16:42 2016 (r307082) @@ -7,6 +7,7 @@ options ARM_L2_PIPT # Only L2 PIPT is options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options IPSEC # IP (v4/v6) security options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm64/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -29,6 +29,7 @@ options PREEMPTION # Enable kernel thr options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security +options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/conf/NOTES Wed Oct 12 02:16:42 2016 (r307082) @@ -982,6 +982,8 @@ device lagg # TCPPCAP enables code which keeps the last n packets sent and received # on a TCP socket. # +# TCP_HHOOK enables the hhook(9) framework hooks for the TCP stack. +# # RADIX_MPATH provides support for equal-cost multi-path routing. # options MROUTING # Multicast routing @@ -1001,6 +1003,7 @@ options IPSTEALTH #support for stealth options PF_DEFAULT_TO_DROP #drop everything by default options TCPDEBUG options TCPPCAP +options TCP_HHOOK options RADIX_MPATH # The MBUF_STRESS_TEST option enables options which create Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/conf/options Wed Oct 12 02:16:42 2016 (r307082) @@ -443,6 +443,7 @@ SLIP_IFF_OPTS opt_slip.h TCPDEBUG TCPPCAP opt_global.h SIFTR +TCP_HHOOK opt_inet.h TCP_OFFLOAD opt_inet.h # Enable code to dispatch TCP offloading TCP_RFC7413 opt_inet.h TCP_RFC7413_MAX_KEYS opt_inet.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/i386/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,7 @@ options PREEMPTION # Enable kernel thr options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security +options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/ADM5120 Wed Oct 12 02:16:42 2016 (r307082) @@ -33,6 +33,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/ALCHEMY ============================================================================== --- head/sys/mips/conf/ALCHEMY Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/ALCHEMY Wed Oct 12 02:16:42 2016 (r307082) @@ -33,6 +33,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/AR71XX_BASE ============================================================================== --- head/sys/mips/conf/AR71XX_BASE Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/AR71XX_BASE Wed Oct 12 02:16:42 2016 (r307082) @@ -35,6 +35,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 # IPv6 +options TCP_HHOOK # hhook(9) framework for TCP # options NFSCL #Network Filesystem Client Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/AR724X_BASE Wed Oct 12 02:16:42 2016 (r307082) @@ -36,6 +36,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking #options INET6 # IPv6 +options TCP_HHOOK # hhook(9) framework for TCP #options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/BCM ============================================================================== --- head/sys/mips/conf/BCM Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/BCM Wed Oct 12 02:16:42 2016 (r307082) @@ -28,6 +28,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client #options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/BERI_TEMPLATE ============================================================================== --- head/sys/mips/conf/BERI_TEMPLATE Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/BERI_TEMPLATE Wed Oct 12 02:16:42 2016 (r307082) @@ -39,6 +39,7 @@ options FFS #Berkeley Fast Filesystem options INET options INET6 +options TCP_HHOOK # hhook(9) framework for TCP options KGSSAPI options NFSCL options NFSLOCKD Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/ERL Wed Oct 12 02:16:42 2016 (r307082) @@ -55,6 +55,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/mips/conf/GXEMUL ============================================================================== --- head/sys/mips/conf/GXEMUL Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/GXEMUL Wed Oct 12 02:16:42 2016 (r307082) @@ -32,6 +32,7 @@ options SMP # Symmetric MultiProcesso options SCHED_ULE options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS #Berkeley Fast Filesystem Modified: head/sys/mips/conf/GXEMUL32 ============================================================================== --- head/sys/mips/conf/GXEMUL32 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/GXEMUL32 Wed Oct 12 02:16:42 2016 (r307082) @@ -30,6 +30,7 @@ options SMP # Symmetric MultiProcesso options SCHED_ULE options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS #Berkeley Fast Filesystem Modified: head/sys/mips/conf/IDT ============================================================================== --- head/sys/mips/conf/IDT Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/IDT Wed Oct 12 02:16:42 2016 (r307082) @@ -16,6 +16,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/MT7620 ============================================================================== --- head/sys/mips/conf/MT7620 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/MT7620 Wed Oct 12 02:16:42 2016 (r307082) @@ -54,6 +54,7 @@ options SCHED_ULE #options SCHED_4BSD #4BSD scheduler #options COMPAT_43 options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/OCTEON1 Wed Oct 12 02:16:42 2016 (r307082) @@ -54,6 +54,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/PB92 Wed Oct 12 02:16:42 2016 (r307082) @@ -37,6 +37,7 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking # Can't do IPv6 - it just doesn't fit. # options INET6 +options TCP_HHOOK # hhook(9) framework for TCP # options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/QCA953X_BASE ============================================================================== --- head/sys/mips/conf/QCA953X_BASE Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/QCA953X_BASE Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,7 @@ options ALT_BREAK_TO_DEBUGGER options SCHED_4BSD #4BSD scheduler options INET #InterNETworking #options INET6 #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP #options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/QEMU ============================================================================== --- head/sys/mips/conf/QEMU Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/QEMU Wed Oct 12 02:16:42 2016 (r307082) @@ -32,6 +32,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/RT305X ============================================================================== --- head/sys/mips/conf/RT305X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/RT305X Wed Oct 12 02:16:42 2016 (r307082) @@ -53,6 +53,7 @@ options SCHED_ULE #options SCHED_4BSD #4BSD scheduler #options COMPAT_43 options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/RT5350 ============================================================================== --- head/sys/mips/conf/RT5350 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/RT5350 Wed Oct 12 02:16:42 2016 (r307082) @@ -51,6 +51,7 @@ options KDB options SCHED_ULE options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP #options NFSCL #Network Filesystem Client #options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/SENTRY5 Wed Oct 12 02:16:42 2016 (r307082) @@ -44,6 +44,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/XLR Wed Oct 12 02:16:42 2016 (r307082) @@ -62,6 +62,7 @@ options PREEMPTION # Enable kernel thr #options FULL_PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/XLR64 Wed Oct 12 02:16:42 2016 (r307082) @@ -36,6 +36,7 @@ options SMP #options FULL_PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: head/sys/mips/conf/XLRN32 ============================================================================== --- head/sys/mips/conf/XLRN32 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/XLRN32 Wed Oct 12 02:16:42 2016 (r307082) @@ -36,6 +36,7 @@ options PREEMPTION # Enable kernel thr #options FULL_PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: head/sys/mips/conf/std.AR5312 ============================================================================== --- head/sys/mips/conf/std.AR5312 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR5312 Wed Oct 12 02:16:42 2016 (r307082) @@ -34,6 +34,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 # IPv6 +options TCP_HHOOK # hhook(9) framework for TCP # options NFSCL #Network Filesystem Client Modified: head/sys/mips/conf/std.AR5315 ============================================================================== --- head/sys/mips/conf/std.AR5315 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR5315 Wed Oct 12 02:16:42 2016 (r307082) @@ -33,6 +33,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 # IPv6 +options TCP_HHOOK # hhook(9) framework for TCP # options NFSCL #Network Filesystem Client Modified: head/sys/mips/conf/std.AR91XX ============================================================================== --- head/sys/mips/conf/std.AR91XX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR91XX Wed Oct 12 02:16:42 2016 (r307082) @@ -32,6 +32,7 @@ options VM_KMEM_SIZE_SCALE=1 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP #options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/std.AR933X ============================================================================== --- head/sys/mips/conf/std.AR933X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR933X Wed Oct 12 02:16:42 2016 (r307082) @@ -30,6 +30,7 @@ options ALT_BREAK_TO_DEBUGGER options SCHED_4BSD #4BSD scheduler options INET #InterNETworking #options INET6 #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP #options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/std.AR934X ============================================================================== --- head/sys/mips/conf/std.AR934X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR934X Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,7 @@ options ALQ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking #options INET6 #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP #options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/std.MALTA ============================================================================== --- head/sys/mips/conf/std.MALTA Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.MALTA Wed Oct 12 02:16:42 2016 (r307082) @@ -21,6 +21,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/std.QCA955X ============================================================================== --- head/sys/mips/conf/std.QCA955X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.QCA955X Wed Oct 12 02:16:42 2016 (r307082) @@ -35,6 +35,7 @@ options ALQ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking #options INET6 #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP #options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/std.SWARM ============================================================================== --- head/sys/mips/conf/std.SWARM Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.SWARM Wed Oct 12 02:16:42 2016 (r307082) @@ -20,6 +20,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/mips/conf/std.XLP ============================================================================== --- head/sys/mips/conf/std.XLP Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.XLP Wed Oct 12 02:16:42 2016 (r307082) @@ -15,6 +15,7 @@ options PREEMPTION # Enable kernel thr #options FULL_PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: head/sys/modules/cc/Makefile ============================================================================== --- head/sys/modules/cc/Makefile Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/modules/cc/Makefile Wed Oct 12 02:16:42 2016 (r307082) @@ -1,11 +1,20 @@ # $FreeBSD$ -SUBDIR= cc_cdg \ - cc_chd \ - cc_cubic \ +SUBDIR= cc_cubic \ cc_dctcp \ + cc_htcp + + +# Do we have the TCP_HHOOK symbol defined? If not, there is no point in +# building these modules by default. +# We will default to building these modules unless $OPT_INET is defined +# and does not contain the TCP_HHOOK option. +.if defined(ALL_MODULES) || ${OPT_INET:UTCP_HHOOK:MTCP_HHOOK} != "" +SUBDIR+= \ + cc_cdg \ + cc_chd \ cc_hd \ - cc_htcp \ cc_vegas +.endif .include Modified: head/sys/modules/khelp/Makefile ============================================================================== --- head/sys/modules/khelp/Makefile Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/modules/khelp/Makefile Wed Oct 12 02:16:42 2016 (r307082) @@ -1,5 +1,13 @@ # $FreeBSD$ -SUBDIR= h_ertt +SUBDIR= + +# Do we have the TCP_HHOOK symbol defined? If not, there is no point in +# building this modules by default. +# We will default to building this module unless $OPT_INET is defined +# and does not contain the TCP_HHOOK option. +.if defined(ALL_MODULES) || ${OPT_INET:UTCP_HHOOK:MTCP_HHOOK} != "" +SUBDIR+= h_ertt +.endif .include Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_input.c Wed Oct 12 02:16:42 2016 (r307082) @@ -57,7 +57,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef TCP_HHOOK #include +#endif #include #include #include /* for proc0 declaration */ @@ -278,6 +280,7 @@ kmod_tcpstat_inc(int statnum) counter_u64_add(VNET(tcpstat)[statnum], 1); } +#ifdef TCP_HHOOK /* * Wrapper for the TCP established input helper hook. */ @@ -295,6 +298,7 @@ hhook_run_tcp_est_in(struct tcpcb *tp, s tp->osd); } } +#endif /* * CC wrapper hook functions @@ -1753,8 +1757,10 @@ tcp_do_segment(struct mbuf *m, struct tc } acked = BYTES_THIS_ACK(tp, th); +#ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ hhook_run_tcp_est_in(tp, th, &to); +#endif TCPSTAT_ADD(tcps_rcvackpack, nsegs); TCPSTAT_ADD(tcps_rcvackbyte, acked); @@ -2499,8 +2505,10 @@ tcp_do_segment(struct mbuf *m, struct tc */ tp->sackhint.sacked_bytes = 0; +#ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ hhook_run_tcp_est_in(tp, th, &to); +#endif if (SEQ_LEQ(th->th_ack, tp->snd_una)) { u_int maxseg; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_output.c Wed Oct 12 02:16:42 2016 (r307082) @@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef TCP_HHOOK #include +#endif #include #include #include @@ -140,11 +142,14 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, send tcp_timer_active((tp), TT_PERSIST), \ ("neither rexmt nor persist timer is set")) +#ifdef TCP_HHOOK static void inline hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, uint32_t len, int tso); +#endif static void inline cc_after_idle(struct tcpcb *tp); +#ifdef TCP_HHOOK /* * Wrapper for the TCP established output helper hook. */ @@ -165,6 +170,7 @@ hhook_run_tcp_est_out(struct tcpcb *tp, tp->osd); } } +#endif /* * CC wrapper hook functions @@ -1306,8 +1312,10 @@ send: __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); #endif +#ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */ hhook_run_tcp_est_out(tp, th, &to, len, tso); +#endif #ifdef TCPDEBUG /* Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_stacks/fastpath.c Wed Oct 12 02:16:42 2016 (r307082) @@ -62,7 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef TCP_HHOOK #include +#endif #include #include #include /* for proc0 declaration */ @@ -266,8 +268,10 @@ tcp_do_fastack(struct mbuf *m, struct tc if (winup_only == 0) { acked = BYTES_THIS_ACK(tp, th); +#ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ hhook_run_tcp_est_in(tp, th, to); +#endif TCPSTAT_ADD(tcps_rcvackbyte, acked); sbdrop(&so->so_snd, acked); @@ -1040,8 +1044,10 @@ tcp_do_slowpath(struct mbuf *m, struct t */ tp->sackhint.sacked_bytes = 0; +#ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ hhook_run_tcp_est_in(tp, th, to); +#endif if (SEQ_LEQ(th->th_ack, tp->snd_una)) { if (tlen == 0 && tiwin == tp->snd_wnd) { @@ -2127,8 +2133,10 @@ tcp_fastack(struct mbuf *m, struct tcphd if (winup_only == 0) { acked = BYTES_THIS_ACK(tp, th); +#ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ hhook_run_tcp_est_in(tp, th, to); +#endif TCPSTAT_ADD(tcps_rcvackbyte, acked); sbdrop(&so->so_snd, acked); Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_subr.c Wed Oct 12 02:16:42 2016 (r307082) @@ -42,9 +42,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef TCP_HHOOK #include +#endif #include +#ifdef TCP_HHOOK #include +#endif #include #include #include @@ -238,7 +242,9 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sign VNET_DEFINE(uma_zone_t, sack_hole_zone); #define V_sack_hole_zone VNET(sack_hole_zone) +#ifdef TCP_HHOOK VNET_DEFINE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]); +#endif static struct inpcb *tcp_notify(struct inpcb *, int); static struct inpcb *tcp_mtudisc_notify(struct inpcb *, int); @@ -449,7 +455,9 @@ struct tcpcb_mem { struct tcpcb tcb; struct tcp_timer tt; struct cc_var ccv; +#ifdef TCP_HHOOK struct osd osd; +#endif }; static VNET_DEFINE(uma_zone_t, tcpcb_zone); @@ -605,12 +613,14 @@ tcp_init(void) tcbhash_tuneable = "net.inet.tcp.tcbhashsize"; +#ifdef TCP_HHOOK if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_IN, &V_tcp_hhh[HHOOK_TCP_EST_IN], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) printf("%s: WARNING: unable to register helper hook\n", __func__); if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT, &V_tcp_hhh[HHOOK_TCP_EST_OUT], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) printf("%s: WARNING: unable to register helper hook\n", __func__); +#endif hashsize = TCBHASHSIZE; TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize); if (hashsize == 0) { @@ -763,6 +773,7 @@ tcp_destroy(void *unused __unused) tcp_fastopen_destroy(); #endif +#ifdef TCP_HHOOK error = hhook_head_deregister(V_tcp_hhh[HHOOK_TCP_EST_IN]); if (error != 0) { printf("%s: WARNING: unable to deregister helper hook " @@ -775,6 +786,7 @@ tcp_destroy(void *unused __unused) "type=%d, id=%d: error %d returned\n", __func__, HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT, error); } +#endif } VNET_SYSUNINIT(tcp, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, tcp_destroy, NULL); #endif @@ -1204,6 +1216,7 @@ tcp_newtcpcb(struct inpcb *inp) return (NULL); } +#ifdef TCP_HHOOK tp->osd = &tm->osd; if (khelp_init_osd(HELPER_CLASS_TCP, tp->osd)) { if (tp->t_fb->tfb_tcp_fb_fini) @@ -1212,6 +1225,7 @@ tcp_newtcpcb(struct inpcb *inp) uma_zfree(V_tcpcb_zone, tm); return (NULL); } +#endif #ifdef VIMAGE tp->t_vnet = inp->inp_vnet; @@ -1477,7 +1491,9 @@ tcp_discardcb(struct tcpcb *tp) if (CC_ALGO(tp)->cb_destroy != NULL) CC_ALGO(tp)->cb_destroy(tp->ccv); +#ifdef TCP_HHOOK khelp_destroy_osd(tp->osd); +#endif CC_ALGO(tp) = NULL; inp->inp_ppcb = NULL; Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_var.h Wed Oct 12 02:16:42 2016 (r307082) @@ -749,8 +749,10 @@ VNET_DECLARE(int, tcp_ecn_maxretries); #define V_tcp_do_ecn VNET(tcp_do_ecn) #define V_tcp_ecn_maxretries VNET(tcp_ecn_maxretries) +#ifdef TCP_HHOOK VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]); #define V_tcp_hhh VNET(tcp_hhh) +#endif VNET_DECLARE(int, tcp_do_rfc6675_pipe); #define V_tcp_do_rfc6675_pipe VNET(tcp_do_rfc6675_pipe) @@ -788,8 +790,10 @@ void cc_ack_received(struct tcpcb *tp, s void cc_conn_init(struct tcpcb *tp); void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); +#ifdef TCP_HHOOK void hhook_run_tcp_est_in(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to); +#endif int tcp_input(struct mbuf **, int *, int); void tcp_do_segment(struct mbuf *, struct tcphdr *, Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/pc98/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -30,6 +30,7 @@ options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security +options TCP_HHOOK # hhook(9) framework for TCP options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/powerpc/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -38,6 +38,7 @@ options PREEMPTION #Enable kernel thre options INET #InterNETworking options INET6 #IPv6 communications protocols options IPSEC # IP (v4/v6) security +options TCP_HHOOK # hhook(9) framework for TCP options SCTP #Stream Control Transmission Protocol options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/powerpc/conf/GENERIC64 Wed Oct 12 02:16:42 2016 (r307082) @@ -37,6 +37,7 @@ options SCHED_ULE #ULE scheduler options PREEMPTION #Enable kernel thread preemption options INET #InterNETworking options INET6 #IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options SCTP #Stream Control Transmission Protocol options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/powerpc/conf/MPC85XX Wed Oct 12 02:16:42 2016 (r307082) @@ -36,6 +36,7 @@ options GDB options GEOM_PART_GPT options INET options INET6 +options TCP_HHOOK # hhook(9) framework for TCP options INVARIANTS options INVARIANT_SUPPORT options KDB Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/riscv/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -32,6 +32,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Oct 12 02:30:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 398DBC0DAA1; Wed, 12 Oct 2016 02:30:35 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09BEC1F2F; Wed, 12 Oct 2016 02:30:34 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C2UYYI046691; Wed, 12 Oct 2016 02:30:34 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C2UYHf046690; Wed, 12 Oct 2016 02:30:34 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201610120230.u9C2UYHf046690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Wed, 12 Oct 2016 02:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307083 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 02:30:35 -0000 Author: jtl Date: Wed Oct 12 02:30:33 2016 New Revision: 307083 URL: https://svnweb.freebsd.org/changeset/base/307083 Log: Currently, when tcp_input() receives a packet on a session that matches a TCPCB, it checks (so->so_options & SO_ACCEPTCONN) to determine whether or not the socket is a listening socket. However, this causes the code to access a different cacheline. If we first check if the socket is in the LISTEN state, we can avoid accessing so->so_options when processing packets received for ESTABLISHED sessions. If INVARIANTS is defined, the code still needs to access both variables to check that so->so_options is consistent with the state. Reviewed by: gallatin MFC after: 1 week Sponsored by: Netflix Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Oct 12 02:16:42 2016 (r307082) +++ head/sys/netinet/tcp_input.c Wed Oct 12 02:30:33 2016 (r307083) @@ -1071,11 +1071,11 @@ relocked: * state) we look into the SYN cache if this is a new connection * attempt or the completion of a previous one. */ - if (so->so_options & SO_ACCEPTCONN) { + KASSERT(tp->t_state == TCPS_LISTEN || !(so->so_options & SO_ACCEPTCONN), + ("%s: so accepting but tp %p not listening", __func__, tp)); + if (tp->t_state == TCPS_LISTEN && (so->so_options & SO_ACCEPTCONN)) { struct in_conninfo inc; - KASSERT(tp->t_state == TCPS_LISTEN, ("%s: so accepting but " - "tp not listening", __func__)); bzero(&inc, sizeof(inc)); #ifdef INET6 if (isipv6) { From owner-svn-src-head@freebsd.org Wed Oct 12 02:32:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2828C0DB1D; Wed, 12 Oct 2016 02:32:25 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-qk0-x22a.google.com (mail-qk0-x22a.google.com [IPv6:2607:f8b0:400d:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1A0535A; Wed, 12 Oct 2016 02:32:25 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-qk0-x22a.google.com with SMTP id f128so13548514qkb.1; Tue, 11 Oct 2016 19:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=wLoVJiAgIyXW+alBLBhB/jYl69f2IENiyY2YSbNIf/g=; b=uuas3bbN2g3DKdRLyusP4L9PG5X7WNX9KZeU0p4CxxXIlWgMNsDGFMUUddGo2vJ6oG 2Mjc1A6/PDljCsKU+Z4876YiplXz1GahUMiGqQ3pVt8BdTJfD+1WiQcu6nkD10sePQpU f3o01fNDd3eN6US9UiyMqTOEvddoSlxHxtN1IhC52ByG+DBBJscIQX/0Kw334DYcEgw/ P0VbKa3WTHtyZysXmfiF76v6TIyD1fi9+971CJD/Akwda01fLPERsodjAEnseFkAvVu3 KBTtVOtTkLiKBPJToMtuOs5JJS/T+Z4W2h4l+LrZtmPt354LDeybI/36oA911UKk8+ph 9WxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=wLoVJiAgIyXW+alBLBhB/jYl69f2IENiyY2YSbNIf/g=; b=MeMbibH4+7nQpSu9F6aQgnL1SvKGDmnkjSMTX9sByFTED1JIYodbtGg0jOeupgAoxY 3Rh69h1nZsZsDUM7u6x8JQ6O2ch2Po4DK4Hct7Svmf8+g3e9WfUXPWjmgn4RbunVYaIs x+9svf80gbnHYXzWMQ5QlawLO0uYaV9ykCyxZaQtCxzviqSoJQFSDATYrefGIZHYsu3d qfRJNROS/IIOFRkk5RyQD49a12scH37hAOQ3BDbLkgCGr7YxfopccTRE+MFg9eUmacAa jC8V6Pfvpdbd9tbu0Dodx1DaxbM0Zky9MlVPKB8R0bLI5UExhre9y34sRkZgj5Sq8DQg 9Mlw== X-Gm-Message-State: AA6/9Rn7h6emRmiAtY72zJDtYsctVUxymLrD9HtVtVQCxelzGquyjcLv9ROJ+DM7a+XJqz7G+EIJGL0f6ymPSQ== X-Received: by 10.55.149.67 with SMTP id x64mr7136784qkd.135.1476239544652; Tue, 11 Oct 2016 19:32:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.53.208 with HTTP; Tue, 11 Oct 2016 19:32:24 -0700 (PDT) In-Reply-To: <201610120230.u9C2UYHf046690@repo.freebsd.org> References: <201610120230.u9C2UYHf046690@repo.freebsd.org> From: Jonathan Looney Date: Tue, 11 Oct 2016 22:32:24 -0400 Message-ID: Subject: Re: svn commit: r307083 - head/sys/netinet To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 02:32:26 -0000 On Tue, Oct 11, 2016 at 10:30 PM, Jonathan T. Looney wrote: > Author: jtl > Date: Wed Oct 12 02:30:33 2016 > New Revision: 307083 > URL: https://svnweb.freebsd.org/changeset/base/307083 > > Log: > Currently, when tcp_input() receives a packet on a session that matches a > TCPCB, it checks (so->so_options & SO_ACCEPTCONN) to determine whether or > not the socket is a listening socket. However, this causes the code to > access a different cacheline. If we first check if the socket is in the > LISTEN state, we can avoid accessing so->so_options when processing > packets > received for ESTABLISHED sessions. > > If INVARIANTS is defined, the code still needs to access both variables > to > check that so->so_options is consistent with the state. > > Reviewed by: gallatin > MFC after: 1 week > Sponsored by: Netflix > This should have also noted: Differential Revision: https://reviews.freebsd.org/D8221 Sorry for the omission! Jonathan From owner-svn-src-head@freebsd.org Wed Oct 12 02:52:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C5BEC0E007 for ; Wed, 12 Oct 2016 02:52:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4436FB0 for ; Wed, 12 Oct 2016 02:52:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id e203so72328982itc.0 for ; Tue, 11 Oct 2016 19:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=viMUXSvsdHDxpjJvDTEXoMwuWSsE2uQ1IyIaFbGwMiU=; b=Omr5nZPugXfmLauIQvx0z5pyxq055MaZEM3Xg3UILk5Ygp4XuXdcgaht7TD1zoh0u0 cnBVznnfusE9mJ+LWbcagQmnqv3L1gr5huPn+hAR7VBce8mMM7NzPRyORceCx4yFnEQE K2ZFYbyl1gDRVT+MGN20eGf5XHZOm9HooRyH7MzymgyTtze0Ke6lCiOmtwDwmSevkfLG nvQfkYBBKOUfdh+tNeE76rZ7OaqBjZvulR2X2VHqEGwNya2oHUUdVX41gYxcpnjuB8b+ gJw4e3ZetLCWuGrOstTKHb19gqOszHlHsXEN38knpThGFr7wRKqWAmGXAQS3WD1yXFu4 b5jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=viMUXSvsdHDxpjJvDTEXoMwuWSsE2uQ1IyIaFbGwMiU=; b=ONHG2wvpP/yOmHxRysCLUqRHQkOfE1yfTZjisiMYGvV+9w+QDEXoxh4DSvwxatiXa4 KuG7gf9x7aUoYrVfVhF0xHTw35Nwei/6nJx1OEytTsopVZk7EQFh3kyPRihUwvViBS78 xShzIsXaHrt6x7vOjfEOkw1k0G/3ZAqpk0utXtl7WbPk1aeDahVWzYpQCJN9wOT2lZw1 f7hs/KutJt/U9uZ439WM9DOyHoIxz09jdCjmK8GqWZ/EmRaRm9lVZaku1rBbRaFqb9wQ DaPhxsvh/FUox3ep4JNjASrwvvq33nhjiPvcmISowiVwdNan0LOeVW9Y92SfEHIKJhLK gM4A== X-Gm-Message-State: AA6/9RnWX1U3QFLNBhh6WPqaccrCPSN9dk3bK3oQx/abLF5n083NBp0nm+stnwzGJkk/w35VNGWS7SO1cW7b6A== X-Received: by 10.107.139.79 with SMTP id n76mr1147794iod.166.1476240776803; Tue, 11 Oct 2016 19:52:56 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Tue, 11 Oct 2016 19:52:56 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <20161011231900.GC55764@mutt-hardenedbsd> References: <201610112231.u9BMVk8K056208@repo.freebsd.org> <20161011231153.GB55764@mutt-hardenedbsd> <20161011231900.GC55764@mutt-hardenedbsd> From: Warner Losh Date: Tue, 11 Oct 2016 20:52:56 -0600 X-Google-Sender-Auth: fot4HuhzSDrHtDa6PcmOzHl3s60 Message-ID: Subject: Re: svn commit: r307072 - in head/usr.sbin: . efivar To: Shawn Webb Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 02:52:57 -0000 On Tue, Oct 11, 2016 at 5:19 PM, Shawn Webb wrote: > On Tue, Oct 11, 2016 at 05:13:24PM -0600, Warner Losh wrote: >> On Tue, Oct 11, 2016 at 5:11 PM, Shawn Webb wrote: >> > On Tue, Oct 11, 2016 at 10:31:46PM +0000, Warner Losh wrote: >> >> Author: imp >> >> Date: Tue Oct 11 22:31:45 2016 >> >> New Revision: 307072 >> >> URL: https://svnweb.freebsd.org/changeset/base/307072 >> >> >> >> Log: >> >> Add efivar(1) to manipulate EFI variables. It uses a similar command >> >> line interface to the Linux program, as well as adding a number of >> >> useful features to make using it in shell scripts easier (since we >> >> don't have a filesystem to fall back on interacting with). >> >> >> >> Differential Revision: https://reviews.freebsd.org/D8128 >> >> Reviewed by: kib@, wblock@, Ganael Laplanche >> >> >> >> Added: >> >> head/usr.sbin/efivar/ >> >> head/usr.sbin/efivar/Makefile (contents, props changed) >> >> head/usr.sbin/efivar/efivar.8 (contents, props changed) >> >> head/usr.sbin/efivar/efivar.c (contents, props changed) >> >> Modified: >> >> head/usr.sbin/Makefile >> > >> > The commit log says efivar(1), but the manpage is efivar(8). Maybe 1 is >> > a typo? >> >> (1) is a typo :( > > No worries. Thanks for the quick response. I just wanted to make sure > that it was supposed to be 8 versus the 1 in the log. > > Good to see a program like this in base. Good work. Next up: corrected EFI variable support in the boot loader, and efibootmgr from Linux in ports... Warner From owner-svn-src-head@freebsd.org Wed Oct 12 02:58:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A5EEC0E31A; Wed, 12 Oct 2016 02:58:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 299897A9; Wed, 12 Oct 2016 02:58:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C2wRaq057214; Wed, 12 Oct 2016 02:58:27 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C2wRXC057213; Wed, 12 Oct 2016 02:58:27 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610120258.u9C2wRXC057213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 02:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307087 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 02:58:28 -0000 Author: gonzo Date: Wed Oct 12 02:58:27 2016 New Revision: 307087 URL: https://svnweb.freebsd.org/changeset/base/307087 Log: Make sure intc is attached before interrupt consumers If pass order is not specified devices are attached in the order they are defined in dts. Some interrupt consumers may be defined before intc. Also make sure intc interrupt-parent local_intc is attached before intc itself. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed Oct 12 02:55:24 2016 (r307086) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Wed Oct 12 02:58:27 2016 (r307087) @@ -468,7 +468,8 @@ static driver_t bcm_intc_driver = { static devclass_t bcm_intc_devclass; -DRIVER_MODULE(intc, simplebus, bcm_intc_driver, bcm_intc_devclass, 0, 0); +EARLY_DRIVER_MODULE(intc, simplebus, bcm_intc_driver, bcm_intc_devclass, + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); #ifndef INTRNG int From owner-svn-src-head@freebsd.org Wed Oct 12 03:00:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99530C0E44F; Wed, 12 Oct 2016 03:00:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70B36A58; Wed, 12 Oct 2016 03:00:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C30hbF057974; Wed, 12 Oct 2016 03:00:43 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C30hLG057970; Wed, 12 Oct 2016 03:00:43 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610120300.u9C30hLG057970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 03:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307088 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 03:00:44 -0000 Author: gonzo Date: Wed Oct 12 03:00:42 2016 New Revision: 307088 URL: https://svnweb.freebsd.org/changeset/base/307088 Log: Add compatible strings used in upstream dts files Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/broadcom/bcm2835/bcm2835_dma.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Wed Oct 12 02:58:27 2016 (r307087) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Wed Oct 12 03:00:42 2016 (r307088) @@ -52,6 +52,12 @@ __FBSDID("$FreeBSD$"); #include "iicbus_if.h" +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-bsc", 1}, + {"brcm,bcm2708-i2c", 1}, + {NULL, 0} +}; + static void bcm_bsc_intr(void *); static int bcm_bsc_detach(device_t); @@ -214,7 +220,7 @@ bcm_bsc_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-bsc")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "BCM2708/2835 BSC controller"); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Wed Oct 12 02:58:27 2016 (r307087) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Wed Oct 12 03:00:42 2016 (r307088) @@ -152,6 +152,12 @@ struct bcm_dma_softc { static struct bcm_dma_softc *bcm_dma_sc = NULL; static uint32_t bcm_dma_channel_mask; +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-dma", 1}, + {"brcm,bcm2835-dma", 1}, + {NULL, 0} +}; + static void bcm_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) @@ -656,7 +662,7 @@ bcm_dma_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-dma")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "BCM2835 DMA Controller"); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Oct 12 02:58:27 2016 (r307087) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Oct 12 03:00:42 2016 (r307088) @@ -71,6 +71,12 @@ __FBSDID("$FreeBSD$"); static int bcm2835_sdhci_hs = 1; static int bcm2835_sdhci_pio_mode = 0; +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-sdhci", 1}, + {"brcm,bcm2835-mmc", 1}, + {NULL, 0} +}; + TUNABLE_INT("hw.bcm2835.sdhci.hs", &bcm2835_sdhci_hs); TUNABLE_INT("hw.bcm2835.sdhci.pio_mode", &bcm2835_sdhci_pio_mode); @@ -126,10 +132,11 @@ bcm_sdhci_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-sdhci")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Broadcom 2708 SDHCI controller"); + return (BUS_PROBE_DEFAULT); } Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Wed Oct 12 02:58:27 2016 (r307087) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Wed Oct 12 03:00:42 2016 (r307088) @@ -56,6 +56,12 @@ __FBSDID("$FreeBSD$"); #include "spibus_if.h" +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-spi", 1}, + {"brcm,bcm2835-spi", 1}, + {NULL, 0} +}; + static void bcm_spi_intr(void *); #ifdef BCM_SPI_DEBUG @@ -231,7 +237,7 @@ bcm_spi_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-spi")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "BCM2708/2835 SPI controller"); From owner-svn-src-head@freebsd.org Wed Oct 12 03:03:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02835C0E63E; Wed, 12 Oct 2016 03:03:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFCAC1262; Wed, 12 Oct 2016 03:03:06 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C3358E061559; Wed, 12 Oct 2016 03:03:05 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C335Pm061557; Wed, 12 Oct 2016 03:03:05 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610120303.u9C335Pm061557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 03:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307089 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 03:03:07 -0000 Author: gonzo Date: Wed Oct 12 03:03:05 2016 New Revision: 307089 URL: https://svnweb.freebsd.org/changeset/base/307089 Log: Make framebuffer driver compatible with upstream DT - Add compatibility string - Add simplebus as possible parent bus Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Oct 12 03:00:42 2016 (r307088) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed Oct 12 03:03:05 2016 (r307089) @@ -111,6 +111,12 @@ struct bcmsc_softc { static struct bcmsc_softc bcmsc; +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-fb", 1}, + {"brcm,bcm2708-fb", 1}, + {NULL, 0} +}; + static int bcm_fb_probe(device_t); static int bcm_fb_attach(device_t); static void bcmfb_update_margins(video_adapter_t *adp); @@ -121,8 +127,9 @@ bcm_fb_probe(device_t dev) { int error; - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); + device_set_desc(dev, "BCM2835 framebuffer device"); error = sc_probe_unit(device_get_unit(dev), device_get_flags(dev) | SC_AUTODETECT_KBD); @@ -196,6 +203,7 @@ static driver_t bcm_fb_driver = { }; DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, bcm_fb_devclass, 0, 0); +DRIVER_MODULE(bcm2835fb, simplebus, bcm_fb_driver, bcm_fb_devclass, 0, 0); /* * Video driver routines and glue. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Oct 12 03:00:42 2016 (r307088) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed Oct 12 03:03:05 2016 (r307089) @@ -65,6 +65,12 @@ struct bcmsc_softc { device_t dev; }; +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-fb", 1}, + {"brcm,bcm2708-fb", 1}, + {NULL, 0} +}; + static int bcm_fb_probe(device_t); static int bcm_fb_attach(device_t); @@ -191,7 +197,8 @@ bcm_fb_sysctl_init(struct bcmsc_softc *s static int bcm_fb_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb")) + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "BCM2835 VT framebuffer driver"); @@ -265,3 +272,4 @@ static driver_t bcm_fb_driver = { }; DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, bcm_fb_devclass, 0, 0); +DRIVER_MODULE(bcm2835fb, simplebus, bcm_fb_driver, bcm_fb_devclass, 0, 0); From owner-svn-src-head@freebsd.org Wed Oct 12 03:03:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65D4EC0E6B0; Wed, 12 Oct 2016 03:03:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5701589; Wed, 12 Oct 2016 03:03:57 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C33uD4061676; Wed, 12 Oct 2016 03:03:56 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C33ue7061675; Wed, 12 Oct 2016 03:03:56 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610120303.u9C33ue7061675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 03:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307091 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 03:03:58 -0000 Author: gonzo Date: Wed Oct 12 03:03:55 2016 New Revision: 307091 URL: https://svnweb.freebsd.org/changeset/base/307091 Log: Add compatibility string from upstream DT Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Wed Oct 12 03:03:43 2016 (r307090) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Wed Oct 12 03:03:55 2016 (r307091) @@ -92,6 +92,12 @@ struct bcm_mbox_softc { #define mbox_write_4(sc, reg, val) \ bus_space_write_4((sc)->bst, (sc)->bsh, reg, val) +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-mbox", 1}, + {"brcm,bcm2835-mbox", 1}, + {NULL, 0} +}; + static int bcm_mbox_read_msg(struct bcm_mbox_softc *sc, int *ochan) { @@ -138,12 +144,12 @@ bcm_mbox_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-mbox")) { - device_set_desc(dev, "BCM2835 VideoCore Mailbox"); - return(BUS_PROBE_DEFAULT); - } + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "BCM2835 VideoCore Mailbox"); - return (ENXIO); + return (BUS_PROBE_DEFAULT); } static int From owner-svn-src-head@freebsd.org Wed Oct 12 03:06:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43845C0E742; Wed, 12 Oct 2016 03:06:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDF6E173C; Wed, 12 Oct 2016 03:06:06 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C3664D061817; Wed, 12 Oct 2016 03:06:06 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C366HP061816; Wed, 12 Oct 2016 03:06:06 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610120306.u9C366HP061816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 03:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307092 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 03:06:07 -0000 Author: gonzo Date: Wed Oct 12 03:06:05 2016 New Revision: 307092 URL: https://svnweb.freebsd.org/changeset/base/307092 Log: Make BCM2835 GPIO driver compatible with upstream DT - Add compatibility string - Make reserverd and read-only properties optional Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed Oct 12 03:03:55 2016 (r307091) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed Oct 12 03:06:05 2016 (r307092) @@ -82,8 +82,6 @@ static struct resource_spec bcm_gpio_res { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, /* bank 0 interrupt */ { SYS_RES_IRQ, 1, RF_ACTIVE }, /* bank 1 interrupt */ - { SYS_RES_IRQ, 2, RF_ACTIVE }, /* bank 1 interrupt (mirrored) */ - { SYS_RES_IRQ, 3, RF_ACTIVE }, /* bank 0-1 interrupt (united) */ { -1, 0, 0 } }; @@ -159,6 +157,12 @@ enum bcm_gpio_pud { #define BCM_GPIO_GPPUD(_bank) (0x94) /* Pin Pull up/down */ #define BCM_GPIO_GPPUDCLK(_bank) (0x98 + _bank * 4) /* Pin Pull up clock */ +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-gpio", 1}, + {"brcm,bcm2835-gpio", 1}, + {NULL, 0} +}; + static struct bcm_gpio_softc *bcm_gpio_sc = NULL; #ifdef INTRNG @@ -672,11 +676,11 @@ bcm_gpio_get_reserved_pins(struct bcm_gp phandle_t gpio, node, reserved; ssize_t len; - /* Get read-only pins. */ + /* Get read-only pins if they're porvided */ gpio = ofw_bus_get_node(sc->sc_dev); if (bcm_gpio_get_ro_pins(sc, gpio, "broadcom,read-only", "read-only") != 0) - return (-1); + return (0); /* Traverse the GPIO subnodes to find the reserved pins node. */ reserved = 0; node = OF_child(gpio); @@ -742,7 +746,7 @@ bcm_gpio_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-gpio")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "BCM2708/2835 GPIO controller"); From owner-svn-src-head@freebsd.org Wed Oct 12 03:07:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E427C0E7B3; Wed, 12 Oct 2016 03:07:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3037218E4; Wed, 12 Oct 2016 03:07:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C37nlN061951; Wed, 12 Oct 2016 03:07:49 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C37nVU061950; Wed, 12 Oct 2016 03:07:49 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610120307.u9C37nVU061950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 03:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307093 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 03:07:50 -0000 Author: gonzo Date: Wed Oct 12 03:07:49 2016 New Revision: 307093 URL: https://svnweb.freebsd.org/changeset/base/307093 Log: Make BCM283x USB driver compatible with upstream DT - Make resource allocation logic depend on compatibility string to check what format of DTS node should be used - FreeBSD's or upstream Modified: head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c Modified: head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c Wed Oct 12 03:06:05 2016 (r307092) +++ head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c Wed Oct 12 03:07:49 2016 (r307093) @@ -51,6 +51,12 @@ __FBSDID("$FreeBSD$"); #include +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-usb", 1}, + {"brcm,bcm2708-usb", 1}, + {NULL, 0} +}; + static device_probe_t bcm283x_dwc_otg_probe; static device_attach_t bcm283x_dwc_otg_attach; @@ -61,7 +67,7 @@ bcm283x_dwc_otg_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)"); From owner-svn-src-head@freebsd.org Wed Oct 12 03:09:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35039C0E8C2; Wed, 12 Oct 2016 03:09:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E136E1C3D; Wed, 12 Oct 2016 03:08:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C38x0k062114; Wed, 12 Oct 2016 03:08:59 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C38xVf062113; Wed, 12 Oct 2016 03:08:59 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610120308.u9C38xVf062113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 03:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307095 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 03:09:00 -0000 Author: gonzo Date: Wed Oct 12 03:08:58 2016 New Revision: 307095 URL: https://svnweb.freebsd.org/changeset/base/307095 Log: Make VCHI driver compatible with upstream DT - Add compatibility string - Compensate difference in base address between our custom DTB and upstream one Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Wed Oct 12 03:08:11 2016 (r307094) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c Wed Oct 12 03:08:58 2016 (r307095) @@ -73,14 +73,25 @@ struct bcm_vchiq_softc { void* intr_hl; bus_space_tag_t bst; bus_space_handle_t bsh; + int regs_offset; }; static struct bcm_vchiq_softc *bcm_vchiq_sc = NULL; +#define BSD_DTB 1 +#define UPSTREAM_DTB 2 +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-vchiq", BSD_DTB}, + {"brcm,bcm2835-vchiq", UPSTREAM_DTB}, + {NULL, 0} +}; + #define vchiq_read_4(reg) \ - bus_space_read_4(bcm_vchiq_sc->bst, bcm_vchiq_sc->bsh, reg) + bus_space_read_4(bcm_vchiq_sc->bst, bcm_vchiq_sc->bsh, (reg) + \ + bcm_vchiq_sc->regs_offset) #define vchiq_write_4(reg, val) \ - bus_space_write_4(bcm_vchiq_sc->bst, bcm_vchiq_sc->bsh, reg, val) + bus_space_write_4(bcm_vchiq_sc->bst, bcm_vchiq_sc->bsh, (reg) + \ + bcm_vchiq_sc->regs_offset, val) /* * Extern functions */ @@ -122,12 +133,11 @@ static int bcm_vchiq_probe(device_t dev) { - if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-vchiq")) { - device_set_desc(dev, "BCM2835 VCHIQ"); - return(BUS_PROBE_DEFAULT); - } + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); - return (ENXIO); + device_set_desc(dev, "BCM2835 VCHIQ"); + return (BUS_PROBE_DEFAULT); } static int @@ -157,6 +167,9 @@ bcm_vchiq_attach(device_t dev) return (ENXIO); } + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == UPSTREAM_DTB) + sc->regs_offset = -0x40; + node = ofw_bus_get_node(dev); if ((OF_getencprop(node, "cache-line-size", &cell, sizeof(cell))) > 0) g_cache_line_size = cell; From owner-svn-src-head@freebsd.org Wed Oct 12 03:36:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B4EAC0EDC0; Wed, 12 Oct 2016 03:36:48 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE971BE6; Wed, 12 Oct 2016 03:36:47 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C3akRR073332; Wed, 12 Oct 2016 03:36:46 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C3ak90073331; Wed, 12 Oct 2016 03:36:46 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610120336.u9C3ak90073331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 03:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307098 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 03:36:48 -0000 Author: gonzo Date: Wed Oct 12 03:36:46 2016 New Revision: 307098 URL: https://svnweb.freebsd.org/changeset/base/307098 Log: Make BCM28x USB driver compatible with upstream device tree This should have been committed in r307093: resource allocation depends on source of the device tree. upstream dts has extra interrupt that we can ignore Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_fdt.c Wed Oct 12 03:32:47 2016 (r307097) +++ head/sys/dev/usb/controller/dwc_otg_fdt.c Wed Oct 12 03:36:46 2016 (r307098) @@ -121,7 +121,12 @@ dwc_otg_attach(device_t dev) sc->sc_otg.sc_io_hdl = rman_get_bushandle(sc->sc_otg.sc_io_res); sc->sc_otg.sc_io_size = rman_get_size(sc->sc_otg.sc_io_res); - rid = 0; + + /* + * brcm,bcm2708-usb FDT provides two interrupts, + * we need only second one (VC_USB) + */ + rid = ofw_bus_is_compatible(dev, "brcm,bcm2708-usb") ? 1 : 0; sc->sc_otg.sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_otg.sc_irq_res == NULL) From owner-svn-src-head@freebsd.org Wed Oct 12 05:35:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9034C0E401; Wed, 12 Oct 2016 05:35:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9C55117; Wed, 12 Oct 2016 05:35:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C5ZvNf021080; Wed, 12 Oct 2016 05:35:57 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C5Zv03021079; Wed, 12 Oct 2016 05:35:57 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610120535.u9C5Zv03021079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 05:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307115 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 05:35:59 -0000 Author: gonzo Date: Wed Oct 12 05:35:57 2016 New Revision: 307115 URL: https://svnweb.freebsd.org/changeset/base/307115 Log: Fix typo in comment Spotted by: loos Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed Oct 12 05:28:24 2016 (r307114) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed Oct 12 05:35:57 2016 (r307115) @@ -676,7 +676,7 @@ bcm_gpio_get_reserved_pins(struct bcm_gp phandle_t gpio, node, reserved; ssize_t len; - /* Get read-only pins if they're porvided */ + /* Get read-only pins if they're provided */ gpio = ofw_bus_get_node(sc->sc_dev); if (bcm_gpio_get_ro_pins(sc, gpio, "broadcom,read-only", "read-only") != 0) From owner-svn-src-head@freebsd.org Wed Oct 12 06:58:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E3CCC0EC73; Wed, 12 Oct 2016 06:58:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF1302B5; Wed, 12 Oct 2016 06:58:02 +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 u9C6w2de052006; Wed, 12 Oct 2016 06:58:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C6w2Af052004; Wed, 12 Oct 2016 06:58:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610120658.u9C6w2Af052004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 12 Oct 2016 06:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307130 - head/sys/dev/smbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 06:58:03 -0000 Author: avg Date: Wed Oct 12 06:58:01 2016 New Revision: 307130 URL: https://svnweb.freebsd.org/changeset/base/307130 Log: smbus: allow child devices to be added via hints This will allow to add slave drivers in the same fashion as for iicbus. Also, allow other code to add a child device and set its 'addr' ivar. The ivar can only be set if it's unset, it can not be changed. That could be used, for example, by a platform driver that has a precise description of the hardware and, thus, knows what drivers can handle what slaves. The slave auto-probing code is unsafe and broken because it uses 7-bit slave addresses. It's going to be removed. Note: internally the driver uses address of zero as an unset address while smbus_get_addr() returns it as -1 for compatibility reasons. The address is expected to be unset only for children that do not work with slaves like, for example, smb(4). Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D8173 Modified: head/sys/dev/smbus/smbconf.h head/sys/dev/smbus/smbus.c Modified: head/sys/dev/smbus/smbconf.h ============================================================================== --- head/sys/dev/smbus/smbconf.h Wed Oct 12 05:50:47 2016 (r307129) +++ head/sys/dev/smbus/smbconf.h Wed Oct 12 06:58:01 2016 (r307130) @@ -34,6 +34,10 @@ #define n(flags) (~(flags) & (flags)) +/* Order constants for smbus children. */ +#define SMBUS_ORDER_HINTED 20 +#define SMBUS_ORDER_PNP 40 + /* * How tsleep() is called in smb_request_bus(). */ Modified: head/sys/dev/smbus/smbus.c ============================================================================== --- head/sys/dev/smbus/smbus.c Wed Oct 12 05:50:47 2016 (r307129) +++ head/sys/dev/smbus/smbus.c Wed Oct 12 06:58:01 2016 (r307130) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -41,54 +42,16 @@ __FBSDID("$FreeBSD$"); #include "smbus_if.h" #include "bus_if.h" +struct smbus_ivar +{ + uint8_t addr; +}; /* * Autoconfiguration and support routines for System Management bus */ +static void smbus_probe_device(device_t dev, u_char addr); -/* - * Device methods - */ -static int smbus_probe(device_t); -static int smbus_attach(device_t); -static int smbus_detach(device_t); - -static int smbus_child_location_str(device_t parent, device_t child, - char *buf, size_t buflen); -static int smbus_print_child(device_t parent, device_t child); -static void smbus_probe_device(device_t dev, u_char* addr); -static int smbus_read_ivar(device_t parent, device_t child, int which, - uintptr_t *result); - -static device_method_t smbus_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, smbus_probe), - DEVMETHOD(device_attach, smbus_attach), - DEVMETHOD(device_detach, smbus_detach), - - /* bus interface */ - DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_child_location_str, smbus_child_location_str), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - DEVMETHOD(bus_print_child, smbus_print_child), - DEVMETHOD(bus_read_ivar, smbus_read_ivar), - - DEVMETHOD_END -}; - -driver_t smbus_driver = { - "smbus", - smbus_methods, - sizeof(struct smbus_softc), -}; - -devclass_t smbus_devclass; - -/* - * At 'probe' time, we add all the devices which we know about to the - * bus. The generic attach routine will probe and attach them if they - * are alive. - */ static int smbus_probe(device_t dev) { @@ -107,9 +70,9 @@ smbus_attach(device_t dev) mtx_init(&sc->lock, device_get_nameunit(dev), "smbus", MTX_DEF); bus_generic_probe(dev); for (addr = SMBUS_ADDR_MIN; addr < SMBUS_ADDR_MAX; ++addr) { - sc->addrs[addr] = addr; - smbus_probe_device(dev, &sc->addrs[addr]); + smbus_probe_device(dev, addr); } + bus_enumerate_hinted_children(dev); bus_generic_attach(dev); return (0); @@ -124,6 +87,7 @@ smbus_detach(device_t dev) error = bus_generic_detach(dev); if (error) return (error); + device_delete_children(dev); mtx_destroy(&sc->lock); return (0); @@ -135,34 +99,78 @@ smbus_generic_intr(device_t dev, u_char } static void -smbus_probe_device(device_t dev, u_char* addr) +smbus_probe_device(device_t dev, u_char addr) { device_t child; int error; u_char cmd; u_char buf[2]; + struct smbus_ivar *devi; cmd = 0x01; - error = smbus_trans(dev, *addr, cmd, + error = smbus_trans(dev, addr, cmd, SMB_TRANS_NOCNT | SMB_TRANS_NOREPORT, NULL, 0, buf, 1, NULL); if (error == 0) { if (bootverbose) - device_printf(dev, "Probed address 0x%02x\n", *addr); - child = device_add_child(dev, NULL, -1); - device_set_ivars(child, addr); + device_printf(dev, "Probed address 0x%02x\n", addr); + child = BUS_ADD_CHILD(dev, SMBUS_ORDER_PNP, NULL, -1); + if (child == NULL) + return; + devi = device_get_ivars(child); + devi->addr = addr; + } +} + +static device_t +smbus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + struct smbus_ivar *devi; + device_t child; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (child); + devi = malloc(sizeof(struct smbus_ivar), M_DEVBUF, M_NOWAIT | M_ZERO); + if (devi == NULL) { + device_delete_child(dev, child); + return (NULL); + } + device_set_ivars(child, devi); + return (child); +} + +static void +smbus_hinted_child(device_t bus, const char *dname, int dunit) +{ + struct smbus_ivar *devi; + device_t child; + int addr; + + addr = 0; + resource_int_value(dname, dunit, "addr", &addr); + if (addr > UINT8_MAX) { + device_printf(bus, "ignored incorrect slave address hint 0x%x" + " for %s%d\n", addr, dname, dunit); + return; } + child = BUS_ADD_CHILD(bus, SMBUS_ORDER_HINTED, dname, dunit); + if (child == NULL) + return; + devi = device_get_ivars(child); + devi->addr = addr; } + static int smbus_child_location_str(device_t parent, device_t child, char *buf, size_t buflen) { - unsigned char *addr; + struct smbus_ivar *devi; - addr = device_get_ivars(child); - if (addr) - snprintf(buf, buflen, "addr=0x%x", *addr); + devi = device_get_ivars(child); + if (devi->addr != 0) + snprintf(buf, buflen, "addr=0x%x", devi->addr); else if (buflen) buf[0] = 0; return (0); @@ -171,28 +179,49 @@ smbus_child_location_str(device_t parent static int smbus_print_child(device_t parent, device_t child) { - unsigned char *addr; + struct smbus_ivar *devi; int retval; - addr = device_get_ivars(child); + devi = device_get_ivars(child); retval = bus_print_child_header(parent, child); - if (addr) - retval += printf(" at addr 0x%x", *addr); + if (devi->addr != 0) + retval += printf(" at addr 0x%x", devi->addr); retval += bus_print_child_footer(parent, child); return (retval); } static int -smbus_read_ivar(device_t parent, device_t child, int which, - uintptr_t *result) +smbus_read_ivar(device_t parent, device_t child, int which, uintptr_t *result) +{ + struct smbus_ivar *devi; + + devi = device_get_ivars(child); + switch (which) { + case SMBUS_IVAR_ADDR: + if (devi->addr != 0) + *result = devi->addr; + else + *result = -1; + break; + default: + return (ENOENT); + } + return (0); +} + +static int +smbus_write_ivar(device_t parent, device_t child, int which, uintptr_t value) { - unsigned char *addr; + struct smbus_ivar *devi; - addr = device_get_ivars(child); + devi = device_get_ivars(child); switch (which) { case SMBUS_IVAR_ADDR: - *result = (addr == NULL) ? -1 : *addr; + /* Allow to set but no change the slave address. */ + if (devi->addr != 0) + return (EINVAL); + devi->addr = value; break; default: return (ENOENT); @@ -200,4 +229,47 @@ smbus_read_ivar(device_t parent, device_ return (0); } +static void +smbus_probe_nomatch(device_t bus, device_t child) +{ + struct smbus_ivar *devi = device_get_ivars(child); + + /* + * Ignore (self-identified) devices without a slave address set. + * For example, smb(4). + */ + if (devi->addr != 0) + device_printf(bus, " at addr %#x\n", + devi->addr); +} + +/* + * Device methods + */ +static device_method_t smbus_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, smbus_probe), + DEVMETHOD(device_attach, smbus_attach), + DEVMETHOD(device_detach, smbus_detach), + + /* bus interface */ + DEVMETHOD(bus_add_child, smbus_add_child), + DEVMETHOD(bus_hinted_child, smbus_hinted_child), + DEVMETHOD(bus_probe_nomatch, smbus_probe_nomatch), + DEVMETHOD(bus_child_location_str, smbus_child_location_str), + DEVMETHOD(bus_print_child, smbus_print_child), + DEVMETHOD(bus_read_ivar, smbus_read_ivar), + DEVMETHOD(bus_write_ivar, smbus_write_ivar), + + DEVMETHOD_END +}; + +driver_t smbus_driver = { + "smbus", + smbus_methods, + sizeof(struct smbus_softc), +}; + +devclass_t smbus_devclass; + MODULE_VERSION(smbus, SMBUS_MODVER); From owner-svn-src-head@freebsd.org Wed Oct 12 07:08:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A33DEC0EEA1; Wed, 12 Oct 2016 07:08:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 755DEA99; Wed, 12 Oct 2016 07:08:33 +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 u9C78WYw055833; Wed, 12 Oct 2016 07:08:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C78WCw055832; Wed, 12 Oct 2016 07:08:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610120708.u9C78WCw055832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 12 Oct 2016 07:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307131 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 07:08:33 -0000 Author: avg Date: Wed Oct 12 07:08:32 2016 New Revision: 307131 URL: https://svnweb.freebsd.org/changeset/base/307131 Log: install header files required development with libzfs_core libzfs_core provides a rather limited but committed (stable) interface for working with ZFS. We install libzfs_core shared library but we do not install header files required for developing programs that use the library. This change is to install the required header files libzfs_core.h, libnvpair.h and sys/nvpair.h. The headers are installed into the same locations as on illumos. Reviewed by: mav, markj Differential Revision: https://reviews.freebsd.org/D8005 Modified: head/include/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Wed Oct 12 06:58:01 2016 (r307130) +++ head/include/Makefile Wed Oct 12 07:08:32 2016 (r307131) @@ -237,6 +237,17 @@ copies: .PHONY .META cd ${.CURDIR}/../sys/teken; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \ ${DESTDIR}${INCLUDEDIR}/teken +.if ${MK_CDDL} != "no" + cd ${.CURDIR}/../cddl/contrib/opensolaris/lib/libzfs_core/common; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libzfs_core.h \ + ${DESTDIR}${INCLUDEDIR} + cd ${.CURDIR}/../cddl/contrib/opensolaris/lib/libnvpair; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libnvpair.h \ + ${DESTDIR}${INCLUDEDIR} + cd ${.CURDIR}/../sys/cddl/contrib/opensolaris/uts/common/sys; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nvpair.h \ + ${DESTDIR}${INCLUDEDIR}/sys +.endif symlinks: .PHONY .META @${ECHO} "Setting up symlinks to kernel source tree..." From owner-svn-src-head@freebsd.org Wed Oct 12 08:25:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D5C0C0D778; Wed, 12 Oct 2016 08:25:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BA19199; Wed, 12 Oct 2016 08:25:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9C8PDAa085316; Wed, 12 Oct 2016 08:25:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9C8PD1U085315; Wed, 12 Oct 2016 08:25:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610120825.u9C8PD1U085315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 12 Oct 2016 08:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307132 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 08:25:14 -0000 Author: mav Date: Wed Oct 12 08:25:13 2016 New Revision: 307132 URL: https://svnweb.freebsd.org/changeset/base/307132 Log: Use copyout() instead of pointing sbuf to user-space buffer. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Wed Oct 12 07:08:32 2016 (r307131) +++ head/sys/cam/scsi/scsi_enc_ses.c Wed Oct 12 08:25:13 2016 (r307132) @@ -2672,13 +2672,13 @@ ses_get_elm_devnames(enc_softc_t *enc, e if (len < 0) return (EINVAL); - sbuf_new(&sb, elmdn->elm_devnames, len, 0); - cam_periph_unlock(enc->periph); + sbuf_new(&sb, NULL, len, SBUF_FIXEDLEN); ses_paths_iter(enc, &enc->enc_cache.elm_map[elmdn->elm_idx], ses_elmdevname_callback, &sb); sbuf_finish(&sb); elmdn->elm_names_len = sbuf_len(&sb); + copyout(sbuf_data(&sb), elmdn->elm_devnames, elmdn->elm_names_len + 1); cam_periph_lock(enc->periph); return (elmdn->elm_names_len > 0 ? 0 : ENODEV); } From owner-svn-src-head@freebsd.org Wed Oct 12 09:44:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6F29C0C401; Wed, 12 Oct 2016 09:44:06 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 884CD7B7; Wed, 12 Oct 2016 09:44:06 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1buG4x-000ISl-DV; Wed, 12 Oct 2016 12:44:03 +0300 Date: Wed, 12 Oct 2016 12:44:03 +0300 From: Slawa Olhovchenkov To: "Jonathan T. Looney" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307082 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/cc sys/modules/khelp sys/netinet sys/netinet/tcp_stacks sys/pc98/conf sy... Message-ID: <20161012094403.GA57876@zxy.spb.ru> References: <201610120216.u9C2Gga8041814@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201610120216.u9C2Gga8041814@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 09:44:06 -0000 On Wed, Oct 12, 2016 at 02:16:42AM +0000, Jonathan T. Looney wrote: > Author: jtl > Date: Wed Oct 12 02:16:42 2016 > New Revision: 307082 > URL: https://svnweb.freebsd.org/changeset/base/307082 > > Log: > In the TCP stack, the hhook(9) framework provides hooks for kernel modules > to add actions that run when a TCP frame is sent or received on a TCP > session in the ESTABLISHED state. In the base tree, this functionality is > only used for the h_ertt module, which is used by the cc_cdg, cc_chd, cc_hd, > and cc_vegas congestion control modules. > > Presently, we incur overhead to check for hooks each time a TCP frame is > sent or received on an ESTABLISHED TCP session. Do you perform estimate of performane impact of this overhead? From owner-svn-src-head@freebsd.org Wed Oct 12 11:12:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CCCAC0E782; Wed, 12 Oct 2016 11:12:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C563FC3; Wed, 12 Oct 2016 11:12:32 +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 u9CBCVOK053128; Wed, 12 Oct 2016 11:12:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CBCVex053127; Wed, 12 Oct 2016 11:12:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610121112.u9CBCVex053127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 12 Oct 2016 11:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307140 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 11:12:32 -0000 Author: avg Date: Wed Oct 12 11:12:31 2016 New Revision: 307140 URL: https://svnweb.freebsd.org/changeset/base/307140 Log: bump __FreeBSD_version for libzfs_core.h Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Oct 12 10:28:54 2016 (r307139) +++ head/sys/sys/param.h Wed Oct 12 11:12:31 2016 (r307140) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200012 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200013 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed Oct 12 11:17:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6A2BC0E87A; Wed, 12 Oct 2016 11:17:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 783CE302; Wed, 12 Oct 2016 11:17:11 +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 u9CBHAY7053323; Wed, 12 Oct 2016 11:17:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CBHAUm053322; Wed, 12 Oct 2016 11:17:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610121117.u9CBHAUm053322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 12 Oct 2016 11:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307141 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 11:17:11 -0000 Author: avg Date: Wed Oct 12 11:17:10 2016 New Revision: 307141 URL: https://svnweb.freebsd.org/changeset/base/307141 Log: remove a few stray spaces from sys/param.h Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Oct 12 11:12:31 2016 (r307140) +++ head/sys/sys/param.h Wed Oct 12 11:17:10 2016 (r307141) @@ -44,7 +44,7 @@ #define BSD4_3 1 #define BSD4_4 1 -/* +/* * __FreeBSD_version numbers are documented in the Porter's Handbook. * If you bump the version for any reason, you should update the documentation * there. @@ -241,7 +241,7 @@ * * BKVASIZE - Nominal buffer space per buffer, in bytes. BKVASIZE is the * minimum KVM memory reservation the kernel is willing to make. - * Filesystems can of course request smaller chunks. Actual + * Filesystems can of course request smaller chunks. Actual * backing memory uses a chunk size of a page (PAGE_SIZE). * The default value here can be overridden on a per-architecture * basis by defining it in . This should @@ -250,8 +250,8 @@ * * If you make BKVASIZE too small you risk seriously fragmenting * the buffer KVM map which may slow things down a bit. If you - * make it too big the kernel will not be able to optimally use - * the KVM memory reserved for the buffer cache and will wind + * make it too big the kernel will not be able to optimally use + * the KVM memory reserved for the buffer cache and will wind * up with too-few buffers. * * The default is 16384, roughly 2x the block size used by a @@ -344,7 +344,7 @@ __END_DECLS #define dbtoc(db) /* calculates devblks to pages */ \ ((db + (ctodb(1) - 1)) >> (PAGE_SHIFT - DEV_BSHIFT)) - + #define ctodb(db) /* calculates pages to devblks */ \ ((db) << (PAGE_SHIFT - DEV_BSHIFT)) From owner-svn-src-head@freebsd.org Wed Oct 12 11:49:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC7D3C0EEEA; Wed, 12 Oct 2016 11:49:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35A137BD; Wed, 12 Oct 2016 11:49:29 +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 u9CBnLKT031669 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 12 Oct 2016 14:49:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u9CBnLKT031669 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u9CBnKKI031668; Wed, 12 Oct 2016 14:49:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 12 Oct 2016 14:49:20 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307070 - in head/sys: amd64/amd64 conf dev/efidev i386/include modules/efirt sys Message-ID: <20161012114920.GU68202@kib.kiev.ua> References: <201610112224.u9BMOUlp053188@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201610112224.u9BMOUlp053188@repo.freebsd.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 11:49:29 -0000 On Tue, Oct 11, 2016 at 10:24:30PM +0000, Warner Losh wrote: > Added: head/sys/dev/efidev/efidev.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/efidev/efidev.c Tue Oct 11 22:24:30 2016 (r307070) > @@ -0,0 +1,199 @@ > +/*- > + * Copyright (c) 2016 Netflix, Inc. > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer > + * in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include As I asked in review, please use , not > +#include > + > +static d_ioctl_t efidev_ioctl; > + > +static struct cdevsw efi_cdevsw = { > + .d_name = "efi", > + .d_version = D_VERSION, > + .d_ioctl = efidev_ioctl, > +}; > + > +/* ARGSUSED */ > +static int > +efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, > + int flags __unused, struct thread *td __unused) > +{ > + int error; > + > + switch (cmd) { > + case EFIIOC_GET_TABLE: > + { > + struct efi_get_table_ioc *egtioc = > + (struct efi_get_table_ioc *)addr; > + > + error = efi_get_table(&egtioc->uuid, &egtioc->ptr); > + break; > + } > + case EFIIOC_GET_TIME: > + { > + struct efi_tm *tm = (struct efi_tm *)addr; > + > + error = efi_get_time(tm); > + break; > + } > + case EFIIOC_SET_TIME: > + { > + struct efi_tm *tm = (struct efi_tm *)addr; > + > + error = efi_set_time(tm); > + break; > + } > + case EFIIOC_VAR_GET: > + { > + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; > + void *data; > + efi_char *name; > + > + data = malloc(ev->datasize, M_TEMP, M_WAITOK); > + name = malloc(ev->namesize, M_TEMP, M_WAITOK); > + error = copyin(ev->name, name, ev->namesize); > + if (error) > + goto vg_out; > + if (name[ev->namesize / sizeof(efi_char) - 1] != 0) { > + error = EINVAL; > + goto vg_out; > + } > + > + error = efi_var_get(name, &ev->vendor, &ev->attrib, > + &ev->datasize, data); > + > + if (error == 0) { > + error = copyout(data, ev->data, ev->datasize); > + } else if (error == EOVERFLOW) { > + /* > + * Pass back the size we really need, but > + * convert the error to 0 so the copyout > + * happens. datasize was updated in the > + * efi_var_get call. > + */ > + ev->data = NULL; > + error = 0; > + } > +vg_out: > + free(data, M_TEMP); > + free(name, M_TEMP); > + break; > + } > + case EFIIOC_VAR_NEXT: > + { > + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; > + efi_char *name; > + > + name = malloc(ev->namesize, M_TEMP, M_WAITOK); > + if (name == NULL) { The check is for impossible condition. > + error = ENOMEM; > + goto vn_out; > + } > + error = copyin(ev->name, name, ev->namesize); > + if (error) > + goto vn_out; > + /* Note: namesize is the buffer size, not the string lenght */ > + > + error = efi_var_nextname(&ev->namesize, name, &ev->vendor); > + if (error == 0) { > + error = copyout(name, ev->name, ev->namesize); > + } else if (error == EOVERFLOW) { > + ev->name = NULL; > + error = 0; > + } > + vn_out: > + if (name != NULL) The check is redundand. > + free(name, M_TEMP); > + break; > + } > + case EFIIOC_VAR_SET: > + { > + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; > + void *data = NULL; > + efi_char *name; > + > + /* datasize == 0 -> delete (more or less) */ > + if (ev->datasize > 0) > + data = malloc(ev->datasize, M_TEMP, M_WAITOK); > + name = malloc(ev->namesize, M_TEMP, M_WAITOK); > + if (ev->datasize) { > + error = copyin(ev->data, data, ev->datasize); > + if (error) > + goto vs_out; > + } > + error = copyin(ev->name, name, ev->namesize); > + if (error) > + goto vs_out; > + if (name[ev->namesize / sizeof(efi_char) - 1] != 0) { > + error = EINVAL; > + goto vs_out; > + } > + > + error = efi_var_set(name, &ev->vendor, ev->attrib, ev->datasize, > + data); > +vs_out: > + if (data != NULL) The check is redundand. > + free(data, M_TEMP); > + free(name, M_TEMP); > + break; > + } > + default: > + error = ENOTTY; > + break; > + } > + > + return (error); > +} > + > +int > +efidev_init(struct cdev **cdev) > +{ > + > + *cdev = make_dev(&efi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0700, > + "efidev"); It is still "/dev/efidev". Please rename as discussed. > + > + return (0); > +} > + > +int > +efidev_uninit(struct cdev *cdev) > +{ > + > + destroy_dev(cdev); > + > + return (0); > +} > > Added: head/sys/i386/include/efi.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/i386/include/efi.h Tue Oct 11 22:24:30 2016 (r307070) > @@ -0,0 +1,39 @@ > +/*- > + * Copyright (c) 2016 The FreeBSD Foundation > + * All rights reserved. > + * > + * This software was developed by Konstantin Belousov > + * under sponsorship from the FreeBSD Foundation. It was not. > + * > + * 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 __I386_INCLUDE_EFI_H_ > +#define __I386_INCLUDE_EFI_H_ > + > +#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ > + > +/* Note: we don't actually support this on i386 yet */ > + > +#endif /* __I386_INCLUDE_EFI_H_ */ From owner-svn-src-head@freebsd.org Wed Oct 12 12:56:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88F14C0DFC0; Wed, 12 Oct 2016 12:56:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 584849FB; Wed, 12 Oct 2016 12:56:19 +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 u9CCuINC090463; Wed, 12 Oct 2016 12:56:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CCuITP090462; Wed, 12 Oct 2016 12:56:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610121256.u9CCuITP090462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 12 Oct 2016 12:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307145 - head/sys/dev/kbd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 12:56:19 -0000 Author: emaste Date: Wed Oct 12 12:56:18 2016 New Revision: 307145 URL: https://svnweb.freebsd.org/changeset/base/307145 Log: Use M_WAITOK in PIO_KEYMAP ioctl The malloc return value is not checked. Submitted by: CTurt MFC after: 1 week Modified: head/sys/dev/kbd/kbd.c Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Wed Oct 12 12:17:41 2016 (r307144) +++ head/sys/dev/kbd/kbd.c Wed Oct 12 12:56:18 2016 (r307145) @@ -888,7 +888,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo case PIO_KEYMAP: /* set keyboard translation table */ case OPIO_KEYMAP: /* set keyboard translation table (compat) */ #ifndef KBD_DISABLE_KEYMAP_LOAD - mapp = malloc(sizeof *mapp, M_TEMP, M_NOWAIT); + mapp = malloc(sizeof *mapp, M_TEMP, M_WAITOK); if (cmd == OPIO_KEYMAP) { omapp = (okeymap_t *)arg; mapp->n_keys = omapp->n_keys; From owner-svn-src-head@freebsd.org Wed Oct 12 13:19:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBE02C0E89B; Wed, 12 Oct 2016 13:19:22 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A91B3EE1; Wed, 12 Oct 2016 13:19:22 +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 u9CDJL5X098702; Wed, 12 Oct 2016 13:19:21 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CDJLju098700; Wed, 12 Oct 2016 13:19:21 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610121319.u9CDJLju098700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 12 Oct 2016 13:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307146 - head/lib/libc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 13:19:23 -0000 Author: br Date: Wed Oct 12 13:19:21 2016 New Revision: 307146 URL: https://svnweb.freebsd.org/changeset/base/307146 Log: Add different libc ldscript: the one without libssp -- we don't have it when MK_SSP==no. This fixes compilation on MIPS. Reviewed by: imp Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8212 Added: head/lib/libc/libc_nossp.ldscript (contents, props changed) Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Wed Oct 12 12:56:18 2016 (r307145) +++ head/lib/libc/Makefile Wed Oct 12 13:19:21 2016 (r307146) @@ -29,7 +29,11 @@ LIBC_ARCH=${MACHINE_CPUARCH} # to CFLAGS below. -DSYSLIBC_SCCS affects just the system call stubs. LIB=c SHLIB_MAJOR= 7 +.if ${MK_SSP} != "no" SHLIB_LDSCRIPT=libc.ldscript +.else +SHLIB_LDSCRIPT=libc_nossp.ldscript +.endif SHLIB_LDSCRIPT_LINKS=libxnet.so WARNS?= 2 CFLAGS+=-I${LIBC_SRCTOP}/include -I${LIBC_SRCTOP}/../../include Added: head/lib/libc/libc_nossp.ldscript ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/libc_nossp.ldscript Wed Oct 12 13:19:21 2016 (r307146) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +GROUP ( @@SHLIB@@ @@LIBDIR@@/libc_nonshared.a ) From owner-svn-src-head@freebsd.org Wed Oct 12 13:25:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDB1BC0EA41; Wed, 12 Oct 2016 13:25:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA36651; Wed, 12 Oct 2016 13:25:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA01302; Wed, 12 Oct 2016 16:25:37 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1buJXN-000I8s-4V; Wed, 12 Oct 2016 16:25:37 +0300 Subject: Re: svn commit: r306680 - in head/sys: amd64/amd64 amd64/include i386/include x86/include x86/x86 To: Konstantin Belousov , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201610041701.u94H1OK3061119@repo.freebsd.org> From: Andriy Gapon Message-ID: <425655dd-ba13-8944-0f31-b1ad6666d90a@FreeBSD.org> Date: Wed, 12 Oct 2016 16:25:00 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201610041701.u94H1OK3061119@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 13:25:46 -0000 On 04/10/2016 20:01, Konstantin Belousov wrote: > Author: kib > Date: Tue Oct 4 17:01:24 2016 > New Revision: 306680 > URL: https://svnweb.freebsd.org/changeset/base/306680 > > Log: > Re-apply r306516 (by cem): > > Reduce the cost of TLB invalidation on x86 by using per-CPU completion flags > > Reduce contention during TLB invalidation operations by using a per-CPU > completion flag, rather than a single atomically-updated variable. Kostik, could this commit cause a problem reported in the below links? https://bz-attachments.freebsd.org/attachment.cgi?id=175614 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213371 > On a Westmere system (2 sockets x 4 cores x 1 threads), dtrace measurements > show that smp_tlb_shootdown is about 50% faster with this patch; observations > with VTune show that the percentage of time spent in invlrng_single_page on an > interrupt (actually doing invalidation, rather than synchronization) increases > from 31% with the old mechanism to 71% with the new one. (Running a basic file > server workload.) > > Submitted by: Anton Rang > Reviewed by: cem (earlier version) > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D8041 -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Oct 12 13:45:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8B28C0EFBE; Wed, 12 Oct 2016 13:45:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 319DE14C; Wed, 12 Oct 2016 13:45:57 +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 u9CDjoVp067507 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 12 Oct 2016 16:45:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u9CDjoVp067507 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u9CDjo22067506; Wed, 12 Oct 2016 16:45:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 12 Oct 2016 16:45:50 +0300 From: Konstantin Belousov To: Andriy Gapon Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r306680 - in head/sys: amd64/amd64 amd64/include i386/include x86/include x86/x86 Message-ID: <20161012134550.GX68202@kib.kiev.ua> References: <201610041701.u94H1OK3061119@repo.freebsd.org> <425655dd-ba13-8944-0f31-b1ad6666d90a@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <425655dd-ba13-8944-0f31-b1ad6666d90a@FreeBSD.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 13:45:57 -0000 On Wed, Oct 12, 2016 at 04:25:00PM +0300, Andriy Gapon wrote: > On 04/10/2016 20:01, Konstantin Belousov wrote: > > Author: kib > > Date: Tue Oct 4 17:01:24 2016 > > New Revision: 306680 > > URL: https://svnweb.freebsd.org/changeset/base/306680 > > > > Log: > > Re-apply r306516 (by cem): > > > > Reduce the cost of TLB invalidation on x86 by using per-CPU completion flags > > > > Reduce contention during TLB invalidation operations by using a per-CPU > > completion flag, rather than a single atomically-updated variable. > > Kostik, > > could this commit cause a problem reported in the below links? > https://bz-attachments.freebsd.org/attachment.cgi?id=175614 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213371 If I am reading the report right, the problem appears on the 11.0-RELEASE system. The patch you reference was only applied to HEAD a week ago and was not merged even to stable/11. The examination must start with backtracing the thread which owns the smp_ipi_mtx (shown on the screenshot). From owner-svn-src-head@freebsd.org Wed Oct 12 13:51:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D72A5C0E189; Wed, 12 Oct 2016 13:51:42 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A92547E0; Wed, 12 Oct 2016 13:51:42 +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 u9CDpfsA012067; Wed, 12 Oct 2016 13:51:41 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CDpfuF012066; Wed, 12 Oct 2016 13:51:41 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610121351.u9CDpfuF012066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 12 Oct 2016 13:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307147 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 13:51:42 -0000 Author: br Date: Wed Oct 12 13:51:41 2016 New Revision: 307147 URL: https://svnweb.freebsd.org/changeset/base/307147 Log: Keep in-sync MK_SSP=no option both with kernel and userspace. Pointed out by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Wed Oct 12 13:19:21 2016 (r307146) +++ head/sys/conf/kern.opts.mk Wed Oct 12 13:51:41 2016 (r307147) @@ -65,7 +65,7 @@ BROKEN_OPTIONS+= CDDL ZFS .endif .if ${MACHINE_CPUARCH} == "mips" -BROKEN_OPTIONS+= CDDL ZFS +BROKEN_OPTIONS+= CDDL ZFS SSP .endif .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} == "powerpc" From owner-svn-src-head@freebsd.org Wed Oct 12 13:56:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3758EC0E31B; Wed, 12 Oct 2016 13:56:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06F0BBFF; Wed, 12 Oct 2016 13:56:15 +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 u9CDuFFN013533; Wed, 12 Oct 2016 13:56:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CDuF1q013531; Wed, 12 Oct 2016 13:56:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610121356.u9CDuF1q013531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 12 Oct 2016 13:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307148 - in head/lib/libc: gen stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 13:56:16 -0000 Author: emaste Date: Wed Oct 12 13:56:14 2016 New Revision: 307148 URL: https://svnweb.freebsd.org/changeset/base/307148 Log: Add comment on use of abort() in libc Suggested by: jonathan (in review D8133) Modified: head/lib/libc/gen/arc4random.c head/lib/libc/stdlib/random.c Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Wed Oct 12 13:51:41 2016 (r307147) +++ head/lib/libc/gen/arc4random.c Wed Oct 12 13:56:14 2016 (r307148) @@ -144,8 +144,15 @@ arc4_stir(void) arc4_init(); rs_initialized = 1; } - if (arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) - abort(); /* Random sysctl cannot fail. */ + if (arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) { + /* + * The sysctl cannot fail. If it does fail on some FreeBSD + * derivative or after some future change, just abort so that + * the problem will be found and fixed. abort is not normally + * suitable for a library but makes sense here. + */ + abort(); + } arc4_addrandom(rdat, KEYSIZE); Modified: head/lib/libc/stdlib/random.c ============================================================================== --- head/lib/libc/stdlib/random.c Wed Oct 12 13:51:41 2016 (r307147) +++ head/lib/libc/stdlib/random.c Wed Oct 12 13:56:14 2016 (r307148) @@ -279,8 +279,15 @@ srandomdev(void) mib[0] = CTL_KERN; mib[1] = KERN_ARND; - if (sysctl(mib, 2, state, &len, NULL, 0) == -1 || len != expected) + if (sysctl(mib, 2, state, &len, NULL, 0) == -1 || len != expected) { + /* + * The sysctl cannot fail. If it does fail on some FreeBSD + * derivative or after some future change, just abort so that + * the problem will be found and fixed. abort is not normally + * suitable for a library but makes sense here. + */ abort(); + } if (rand_type != TYPE_0) { fptr = &state[rand_sep]; From owner-svn-src-head@freebsd.org Wed Oct 12 13:57:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4236C0E3CE; Wed, 12 Oct 2016 13:57:05 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-41.csi.cam.ac.uk (ppsw-41.csi.cam.ac.uk [131.111.8.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC35D79; Wed, 12 Oct 2016 13:57:05 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from sc1.bsdpad.com ([163.172.212.18]:62006) by ppsw-41.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1buK1m-0001Ns-QG (Exim 4.86_36-e07b163) (return-path ); Wed, 12 Oct 2016 14:57:02 +0100 Date: Wed, 12 Oct 2016 13:56:46 +0000 From: Ruslan Bukin To: Ed Maste Cc: Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r306364 - in head: lib/libc/tests share/mk Message-ID: <20161012135646.GA63534@bsdpad.com> References: <201609270944.u8R9iUqi035006@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 12 Oct 2016 13:57:05 -0000 On Wed, Oct 05, 2016 at 08:44:39PM +0000, Ed Maste wrote: > On 27 September 2016 at 09:44, Ruslan Bukin wrote: > > Author: br > > Date: Tue Sep 27 09:44:30 2016 > > New Revision: 306364 > > URL: https://svnweb.freebsd.org/changeset/base/306364 > > > > Log: > > Mark SSP broken on MIPS. > > This needs an adjustment in sys/conf/kern.opts.mk as well it seems; > 'make showconfig' (as used by makeman to generate src.conf.5) now > reports SSP is both 'no' and 'yes' on mips: > > % make TARGET=mips TARGET_ARCH=mips showconfig | grep SSP > MK_SSP = no > MK_SSP = yes > I made a change, but for some reason it works from buildenv only: make TARGET=mips TARGET_ARCH=mips buildenv % make showconfig |grep SSP MK_SSP = no It looks like MACHINE_CPUARCH is not exported by showconfig. Ruslan From owner-svn-src-head@freebsd.org Wed Oct 12 14:46:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06FC0C0F2AD; Wed, 12 Oct 2016 14:46:01 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-qt0-f178.google.com (mail-qt0-f178.google.com [209.85.216.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1F5ECEC; Wed, 12 Oct 2016 14:46:00 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-qt0-f178.google.com with SMTP id q7so18108693qtq.1; Wed, 12 Oct 2016 07:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OY/35HCrP0/bGZwm5v3OtK0BvJsvrvLla9zhJu8QLc8=; b=dtttkcI2Ra3Uq2AeO/+SeVv03qJ8/W+9JDNfjtqPo4v9Bqo/AP+0Z7UnZAisHJFxx/ QwJFL6Ir9IfLXbHuJ7apDZKMRsESH4ysViz7gxs0cTwfQvK0jj06A9AXsWKqbffxaZp1 O2sfS317zGtK88GZuCd/xotIlqodZcBXSqifKu/aHzDLpgVAX2YM9pIpCdpv00TJZUHm o7zlmzVx3mOJCny29xe7cv1/BHj1b2WiXMrVR7mQdY54C++ixRcYI1S5Fo8lial9gJ3W CoW7NRx30RsPbzHLB/t2geZftd0xxUGfmzUm3BFO2Lo9oPsKuLEoOIzTXekgXJPECpO+ I0Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OY/35HCrP0/bGZwm5v3OtK0BvJsvrvLla9zhJu8QLc8=; b=hUK5BCRtBbLZYvNiyRW6yFhtBgYr5jsJeoMqvUlZXvKW/5QCjaNp3P93eIXTcOHLtr O4WP5C3dMnSOAW4QY4Tr9Q0PCOqbftpC1CwaYyLjQ7IjM/umDXYD984mgRyTtMVAkBfS fLEWRE463uloiZ4r3rWBMk+hLOp6AO4ZJV0MW+yOf+fBEJxmnmPaXqdJ7JcGxRZ6pLUc SRyjbi9P9+LTFjyP3gcfcisa3jJCnbBbcTGxljq5X2PB3secmkCMFFjNk5MQ50H4ocsk 4Lkc1hamv/I3sQaap66RsLwkP55S4L3wBMeb3bsC2YwRZJoEd2Hx3uQADItFMLO3FSoE gdpg== X-Gm-Message-State: AA6/9RmCQCh3KKmPXmIf6c2s5DIB75MdHJggwH9oiH2sC4CaX6KF8EkSuC9Cu7JIxr39dKOICWTbQpN3oVIPKg== X-Received: by 10.237.41.39 with SMTP id s36mr1524139qtd.156.1476283493414; Wed, 12 Oct 2016 07:44:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.53.208 with HTTP; Wed, 12 Oct 2016 07:44:52 -0700 (PDT) In-Reply-To: <20161012094403.GA57876@zxy.spb.ru> References: <201610120216.u9C2Gga8041814@repo.freebsd.org> <20161012094403.GA57876@zxy.spb.ru> From: Jonathan Looney Date: Wed, 12 Oct 2016 10:44:52 -0400 Message-ID: Subject: Re: svn commit: r307082 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/cc sys/modules/khelp sys/netinet sys/netinet/tcp_stacks sys/pc98/conf sy... To: Slawa Olhovchenkov Cc: "Jonathan T. Looney" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 14:46:01 -0000 On Wed, Oct 12, 2016 at 5:44 AM, Slawa Olhovchenkov wrote: > Do you perform estimate of performane impact of this overhead? > > Somewhat, but not precisely. It will depend on (at least) a few factors: a. The hardware * How fast is your CPU? Your L1/L2/L3 cache? * How many CPUs? * How smart is the hardware prefetching? * How fast is the memory bus? * etc. b. Whether VNET is enabled * If VNET is enabled, the hook lookup will require more instructions to find the correct list c. Which TCP stack you are using * The hook lookup is implemented as an external function in the non-default stacks, so that requires the overhead of a function call d. The probability that the number of hooks is in your CPU cache * This is a combination of the hardware and the exact workload on the device On a test system running a fairly heavy load of TCP traffic using the default TCP stack, without VNET, and without any TCP hooks installed, the input/output hhook functions accounted for approximately .075% of the "busy" CPU cycles during one of my measurements. That certainly is not a large number, but it is large enough to be measurable. And, I think the hardware I used for the measurement is tuned for high-performance, so this may be close to the "best case" measurement. I suspect that systems with a large number of short-lived sessions will see a larger improvement from the deletion of khelp_init_osd() from the session setup path. (I didn't measure this.) I also suspect that systems with VNET will see a larger improvement. I also suspect that systems with slower memory busses, smaller caches, etc. will see a larger improvement. But, this is very hard to measure precisely in a generic sense. The one concrete thing we *can* measure is that the functions add some number of instructions to the session setup, session teardown, input, and output code paths. If you need those instructions to achieve the desired functionality (in this case, probably a congestion-control algorithm), then you probably want those instructions. If not, then you may want to delete them. This was the impetus to add a kernel option to give you the ability to decide whether you want to include the functionality. I hope this answer helps explain some more about the change. Jonathan From owner-svn-src-head@freebsd.org Wed Oct 12 15:29:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65356C0FB9B; Wed, 12 Oct 2016 15:29:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DE09376; Wed, 12 Oct 2016 15:29:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9CFTNIj047009; Wed, 12 Oct 2016 15:29:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CFTN8Y047006; Wed, 12 Oct 2016 15:29:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201610121529.u9CFTN8Y047006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 12 Oct 2016 15:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307149 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 15:29:24 -0000 Author: andrew Date: Wed Oct 12 15:29:22 2016 New Revision: 307149 URL: https://svnweb.freebsd.org/changeset/base/307149 Log: Use the armv6 GENERIC kernel in the release images on hardware this kernel config supports. Approved by: gjb Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D8147 Modified: head/release/arm/BANANAPI.conf head/release/arm/CUBIEBOARD2.conf head/release/arm/RPI2.conf Modified: head/release/arm/BANANAPI.conf ============================================================================== --- head/release/arm/BANANAPI.conf Wed Oct 12 13:56:14 2016 (r307148) +++ head/release/arm/BANANAPI.conf Wed Oct 12 15:29:22 2016 (r307149) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-bananapi" -KERNEL="ALLWINNER" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" Modified: head/release/arm/CUBIEBOARD2.conf ============================================================================== --- head/release/arm/CUBIEBOARD2.conf Wed Oct 12 13:56:14 2016 (r307148) +++ head/release/arm/CUBIEBOARD2.conf Wed Oct 12 15:29:22 2016 (r307149) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" -KERNEL="ALLWINNER" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" Modified: head/release/arm/RPI2.conf ============================================================================== --- head/release/arm/RPI2.conf Wed Oct 12 13:56:14 2016 (r307148) +++ head/release/arm/RPI2.conf Wed Oct 12 15:29:22 2016 (r307149) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi2" -KERNEL="RPI2" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" IMAGE_SIZE="1G" PART_SCHEME="MBR" From owner-svn-src-head@freebsd.org Wed Oct 12 15:30:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEF12C0FCC4; Wed, 12 Oct 2016 15:30:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B69887A3; Wed, 12 Oct 2016 15:30:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA01556; Wed, 12 Oct 2016 18:30:45 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1buLUT-000IFW-F2; Wed, 12 Oct 2016 18:30:45 +0300 Subject: Re: svn commit: r306680 - in head/sys: amd64/amd64 amd64/include i386/include x86/include x86/x86 To: Konstantin Belousov References: <201610041701.u94H1OK3061119@repo.freebsd.org> <425655dd-ba13-8944-0f31-b1ad6666d90a@FreeBSD.org> <20161012134550.GX68202@kib.kiev.ua> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Andriy Gapon Message-ID: Date: Wed, 12 Oct 2016 18:30:09 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161012134550.GX68202@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 15:30:48 -0000 On 12/10/2016 16:45, Konstantin Belousov wrote: > On Wed, Oct 12, 2016 at 04:25:00PM +0300, Andriy Gapon wrote: >> On 04/10/2016 20:01, Konstantin Belousov wrote: >>> Author: kib >>> Date: Tue Oct 4 17:01:24 2016 >>> New Revision: 306680 >>> URL: https://svnweb.freebsd.org/changeset/base/306680 >>> >>> Log: >>> Re-apply r306516 (by cem): >>> >>> Reduce the cost of TLB invalidation on x86 by using per-CPU completion flags >>> >>> Reduce contention during TLB invalidation operations by using a per-CPU >>> completion flag, rather than a single atomically-updated variable. >> >> Kostik, >> >> could this commit cause a problem reported in the below links? >> https://bz-attachments.freebsd.org/attachment.cgi?id=175614 >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213371 > > If I am reading the report right, the problem appears on the > 11.0-RELEASE system. The patch you reference was only applied to HEAD a > week ago and was not merged even to stable/11. Sorry for the noise, then. Somehow I thought that this went into the release branch, but obviously there was too little time for that. > The examination must start with backtracing the thread which owns the > smp_ipi_mtx (shown on the screenshot). It looks like DDB is not in GENERIC in 11.0? Not sure if the reporter would be able to configure a dump device and then save the dump given that the panic happens in the installer. If anyone could provide them with instructions that would be great. -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Oct 12 15:49:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DF78C0E332; Wed, 12 Oct 2016 15:49:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1F9B7B9; Wed, 12 Oct 2016 15:49:21 +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 u9CFnLXB054946; Wed, 12 Oct 2016 15:49:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CFnL2n054945; Wed, 12 Oct 2016 15:49:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610121549.u9CFnL2n054945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 12 Oct 2016 15:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307150 - head/gnu/usr.bin/groff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 15:49:22 -0000 Author: emaste Date: Wed Oct 12 15:49:20 2016 New Revision: 307150 URL: https://svnweb.freebsd.org/changeset/base/307150 Log: Avoid using 'head' in generating groff doc date It may not be available in certain cross build cases. Note that this is a slight change in functionality, in that now only the first line of the source ChangeLog file is processed. This is acceptable as groff will be retired and we won't encounter a possibly-different ChangeLog format. Reported by: jhibbits Tested by: jhibbits Modified: head/gnu/usr.bin/groff/mdate.sh Modified: head/gnu/usr.bin/groff/mdate.sh ============================================================================== --- head/gnu/usr.bin/groff/mdate.sh Wed Oct 12 15:29:22 2016 (r307149) +++ head/gnu/usr.bin/groff/mdate.sh Wed Oct 12 15:49:20 2016 (r307150) @@ -4,6 +4,5 @@ set -e test -r "$1" export LC_ALL=C -changelog_date=$(sed -E -n 's/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1" |\ - head -n 1) +changelog_date=$(sed -E -n '1s/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1") echo $(date -j -f %Y-%m-%d +"%e %B %Y" $changelog_date) From owner-svn-src-head@freebsd.org Wed Oct 12 16:03:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13976C0EA9E; Wed, 12 Oct 2016 16:03:47 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEA68204; Wed, 12 Oct 2016 16:03:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1buM0O-0002bE-FC; Wed, 12 Oct 2016 19:03:44 +0300 Date: Wed, 12 Oct 2016 19:03:44 +0300 From: Slawa Olhovchenkov To: Andriy Gapon Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r306680 - in head/sys: amd64/amd64 amd64/include i386/include x86/include x86/x86 Message-ID: <20161012160344.GD57876@zxy.spb.ru> References: <201610041701.u94H1OK3061119@repo.freebsd.org> <425655dd-ba13-8944-0f31-b1ad6666d90a@FreeBSD.org> <20161012134550.GX68202@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 16:03:47 -0000 On Wed, Oct 12, 2016 at 06:30:09PM +0300, Andriy Gapon wrote: > On 12/10/2016 16:45, Konstantin Belousov wrote: > > On Wed, Oct 12, 2016 at 04:25:00PM +0300, Andriy Gapon wrote: > >> On 04/10/2016 20:01, Konstantin Belousov wrote: > >>> Author: kib > >>> Date: Tue Oct 4 17:01:24 2016 > >>> New Revision: 306680 > >>> URL: https://svnweb.freebsd.org/changeset/base/306680 > >>> > >>> Log: > >>> Re-apply r306516 (by cem): > >>> > >>> Reduce the cost of TLB invalidation on x86 by using per-CPU completion flags > >>> > >>> Reduce contention during TLB invalidation operations by using a per-CPU > >>> completion flag, rather than a single atomically-updated variable. > >> > >> Kostik, > >> > >> could this commit cause a problem reported in the below links? > >> https://bz-attachments.freebsd.org/attachment.cgi?id=175614 > >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213371 > > > > If I am reading the report right, the problem appears on the > > 11.0-RELEASE system. The patch you reference was only applied to HEAD a > > week ago and was not merged even to stable/11. > > Sorry for the noise, then. Somehow I thought that this went into the release > branch, but obviously there was too little time for that. > > > The examination must start with backtracing the thread which owns the > > smp_ipi_mtx (shown on the screenshot). > > It looks like DDB is not in GENERIC in 11.0? Yes, DDB is absent in GENERIC 11.0 > Not sure if the reporter would be able to configure a dump device and then save > the dump given that the panic happens in the installer. > If anyone could provide them with instructions that would be great. > > -- > Andriy Gapon > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Wed Oct 12 16:56:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2396C0F882 for ; Wed, 12 Oct 2016 16:56:21 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEFCA2D8 for ; Wed, 12 Oct 2016 16:56:20 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x22b.google.com with SMTP id x79so87279615lff.0 for ; Wed, 12 Oct 2016 09:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oYfLO1RHIN1LxwvoTwHbIjFchTXthduZORBX/Fr1DLY=; b=RZvECUQjgFdR9kJKvJPYfJ21Q9/dX/g+WaFpNIdY3pm58xOi/3IPlRfR0Fe+ooZPHQ Mg6vi8a1D6BTc7Tl3bIdL/F0JqEFBARLwzb35bHReMtUs4Yp2Gu1BrAMqaIj9+cGm0yj sJPUnEXGro+SDSAcjXzM4nrjfv+PwThEFVGRoCcdA+4mqepLlJ3WlO0HQdPCoZF2BK+x 279ioNivT/Hx81KZDol/OS54Dfp7LH91D0yetdKoXBZYl0m+KGXBqiIawyCPvuFUv+VX /EJDGdXkCUkKspWyOGwQdnM4qGlEaGDcROhAWxLvDrv37BgiCVeLVtTzbq/Yvqe5LKtu OZkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oYfLO1RHIN1LxwvoTwHbIjFchTXthduZORBX/Fr1DLY=; b=jkN9dZBDLIOmXroakuS9t6JphphtqMMU0wfGe67BPrBQEy/mE7KVEuWR9Kr6bhsNm0 k4gwNVXLtbhF2Dwp7oo56dlyiXXoEdLznEtgaITCEhPLDlx2EqAHyAK6PYRszQLnWGuP y/7dmmlgvW2dUhMIHWAOPzvVCCAYPgaN8IJNF8dcH7zKOkSAFrtHSY7UEqMA075bRsfM QSK1ZLso3cEZlkyRYuQI11+qy9uDlP1TPQtqcfC96BG242xWqF3gYvOdUxAx2keLIleg EOMdE5Ii8NyWwORJolGDjDBqkxRxKmr7N8HTDGMSdmirsBZX3vn2gzTdGDw4jQpdpMOq jrvg== X-Gm-Message-State: AA6/9Rkmmc756F7T3EHNwXMkNmgN/gJcg8wMr+gRMxBMrdvq4t+VKzjqI3niyWCXDvkXq7K8XM+wB2kYuglnGQ== X-Received: by 10.25.217.82 with SMTP id q79mr2400623lfg.13.1476291378567; Wed, 12 Oct 2016 09:56:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.3.215 with HTTP; Wed, 12 Oct 2016 09:55:57 -0700 (PDT) In-Reply-To: <201610112231.u9BMVk8K056208@repo.freebsd.org> References: <201610112231.u9BMVk8K056208@repo.freebsd.org> From: Zbigniew Bodek Date: Wed, 12 Oct 2016 18:55:57 +0200 Message-ID: Subject: Re: svn commit: r307072 - in head/usr.sbin: . efivar To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 16:56:21 -0000 Hello Warner, Did you try to build world for ARMv6 on HEAD? I'm not able to do so and the issues seems to be related to this commit (missing efivar.h file). Kind regards zbb 2016-10-12 0:31 GMT+02:00 Warner Losh : > Author: imp > Date: Tue Oct 11 22:31:45 2016 > New Revision: 307072 > URL: https://svnweb.freebsd.org/changeset/base/307072 > > Log: > Add efivar(1) to manipulate EFI variables. It uses a similar command > line interface to the Linux program, as well as adding a number of > useful features to make using it in shell scripts easier (since we > don't have a filesystem to fall back on interacting with). > > Differential Revision: https://reviews.freebsd.org/D8128 > Reviewed by: kib@, wblock@, Ganael Laplanche > > Added: > head/usr.sbin/efivar/ > head/usr.sbin/efivar/Makefile (contents, props changed) > head/usr.sbin/efivar/efivar.8 (contents, props changed) > head/usr.sbin/efivar/efivar.c (contents, props changed) > Modified: > head/usr.sbin/Makefile > > Modified: head/usr.sbin/Makefile > ============================================================ > ================== > --- head/usr.sbin/Makefile Tue Oct 11 22:30:41 2016 (r307071) > +++ head/usr.sbin/Makefile Tue Oct 11 22:31:45 2016 (r307072) > @@ -123,6 +123,7 @@ SUBDIR.${MK_BSNMP}+= bsnmpd > SUBDIR.${MK_CTM}+= ctm > SUBDIR.${MK_DIALOG}+= tzsetup > SUBDIR.${MK_DIALOG}+= bsdconfig > +SUBDIR.${MK_EFI}+= efivar > SUBDIR.${MK_FLOPPY}+= fdcontrol > SUBDIR.${MK_FLOPPY}+= fdformat > SUBDIR.${MK_FLOPPY}+= fdread > > Added: head/usr.sbin/efivar/Makefile > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/efivar/Makefile Tue Oct 11 22:31:45 2016 > (r307072) > @@ -0,0 +1,8 @@ > +# $FreeBSD$ > + > +PROG= efivar > +MAN= efivar.8 > + > +LIBADD= efivar > + > +.include > > Added: head/usr.sbin/efivar/efivar.8 > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/efivar/efivar.8 Tue Oct 11 22:31:45 2016 > (r307072) > @@ -0,0 +1,164 @@ > +.\" Copyright (c) 2003 Netflix, Inc > +.\" All rights reserved. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the > distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE > LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE > GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd September 29, 2016 > +.Dt EFIVAR 8 > +.Os > +.Sh NAME > +.Nm efivar > +.Nd UEFI environemnt variable interaction > +.Sh SYNOPSIS > +.Nm > +.Op Fl abdDHlLNpRtw > +.Op Fl n Ar name > +.Op Fl f Ar file > +.Op Fl -append > +.Op Fl -ascii > +.Op Fl -attributes > +.Op Fl -binary > +.Op Fl -delete > +.Op Fl -fromfile Ar file > +.Op Fl -hex > +.Op Fl -list-guids > +.Op Fl -list > +.Op Fl -name Ar name > +.Op Fl -no-name > +.Op Fl -print > +.Op Fl -print-decimal > +.Op Fl -raw-guid > +.Op Fl -write > +.Ar name Ns Op = Ns Ar value > +.Sh DESCRIPTION > +This program manages > +.Dq Unified Extensible Firmware Interface > +.Pq UEFI > +environment variables. > +UEFI variables have three part: A namespace, a name and a value. > +The namespace is a GUID that's self assigned by the group defining the > +variables. > +The name is a Unicode name for the variable. > +The value is binary data. > +All Unicode data is presented to the user as UTF-8. > +.Pp > +The following options are available: > +.Bl -tag -width 20m > +.It Fl n Ar name Fl -name Ar name > +Specify the name of the variable to operate on. > +The > +.Ar name > +argument is the GUID of variable, followed by a dash, followed by the > +UEFI variable name. > +The GUID may be in numeric format, or may be one of the well known > +symbolic name (see > +.Fl -list-guids > +for a complete list). > +.It Fl f Ar file Fl -fromfile Ar file > +When writing or appending to a variable, take the data for the > +variable's value from > +.Ar file > +instead of from the command line. > +This flag implies > +.Fl -write > +unless the > +.Fl -append > +flag is given. > +This is not well understood and currently unimplemented. > +.It Fl a Fl -append > +Append the specified value to the UEFI variable rather than replacing > +it.p > +.It Fl t Ar attr Fl -attributes Ar attr > +Specify, in user hostile hexidecimal, the attributes for this > +variable. > +See section 7.2 (GetVariable subsection, Related Definitions) of the > +UEFI Specification for hex values to use. > +.It Fl A Fl -ascii > +Display the variable data as modified ascii: All printable characters > +are printed, while unprintable characters are rendered as a two-digit > +hexadecimal number preceeded by a % character. > +.It Fl A Fl -binary > +Display the variable data as binary data. > +Usually will be used with the > +.Fl N > +or > +.Fl -no-name > +flag. > +Useful in scripts. > +.It Fl D Fl -delete > +Delete the specified variable. > +May not be used with either the > +.Fl -write > +or the > +.Fl -append > +flags. > +No > +.Ar value > +may be specified. > +.It Fl H Fl -hex > +List variable data as a hex dump. > +.It Fl L Fl -list-guids > +Lists the well known GUIDs. > +The names listed here may be used in place of the numeric GUID values. > +These names will replace the numeric GUID values unless > +.Fl -raw-guid > +flag is specified. > +.It Fl l Fl -list > +List all the variables. > +If the > +.Fl -print > +flag is also listed, their values will be displayed. > +.It Fl N Fl -no-name > +Do not display the variable name. > +.It Fl p Fl -print > +Print the value of the variable. > +.It Fl d Fl -print-decimal > +Treat the value of the variable as a number and print it as a > +decimal. > +This is currently unimplemented. > +.It Fl R Fl -raw-guid > +Do not substitute well known names for GUID numeric values in output. > +.It Fl w Fl -write > +Write (replace) the variable specified with the value specified. > +.It Ar name > +Display the > +.Ar name > +environment variable. > +.It Ar name Ns = Ns Ar value > +Set the specified > +.Ar name > +to > +.Ar value . > +This is not yet implemented. > +.Sh COMPATIBILITY > +The > +.Nm > +program is intended to be compatible (strict superset) with a progam > +of the same name included in the Red Hat libefivar package. > +.Sh SEE ALSO > +Appendix A of the UEFI specification has the format for GUIDs. > +All GUIDs > +.Dq Globally Unique Identifiers > +have the format described in RFC 4122. > +.El > > Added: head/usr.sbin/efivar/efivar.c > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/efivar/efivar.c Tue Oct 11 22:31:45 2016 > (r307072) > @@ -0,0 +1,349 @@ > +/*- > + * Copyright (c) 2016 Netflix, Inc. > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE > LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +/* options descriptor */ > +static struct option longopts[] = { > + { "append", no_argument, NULL, 'a' }, > + { "ascii", no_argument, NULL, 'A' }, > + { "attributes", required_argument, NULL, 't' }, > + { "binary", no_argument, NULL, 'b' }, > + { "delete", no_argument, NULL, 'D' }, > + { "fromfile", required_argument, NULL, 'f' }, > + { "hex", no_argument, NULL, 'H' }, > + { "list-guids", no_argument, NULL, 'L' }, > + { "list", no_argument, NULL, 'l' }, > + { "name", required_argument, NULL, 'n' }, > + { "no-name", no_argument, NULL, 'N' }, > + { "print", no_argument, NULL, 'p' }, > + { "print-decimal", no_argument, NULL, 'd' }, > + { "raw-guid", no_argument, NULL, 'R' }, > + { "write", no_argument, NULL, 'w' }, > + { NULL, 0, NULL, 0 } > +}; > + > + > +static int aflag, Aflag, bflag, dflag, Dflag, Hflag, Nflag, > + lflag, Lflag, Rflag, wflag, pflag; > +static char *varname; > +static u_long attrib = 0x7; > + > +static void > +usage(void) > +{ > + > + errx(1, "efivar [-abdDHlLNpRtw] [-n name] [-f file] [--append] > [--ascii]\n" > + "\t[--attributes] [--binary] [--delete] [--fromfile file] > [--hex]\n" > + "\t[--list-guids] [--list] [--name name] [--no-name] > [--print]\n" > + "\t[--print-decimal] [--raw-guid] [--write] name[=value]"); > +} > + > +static void > +breakdown_name(char *name, efi_guid_t *guid, char **vname) > +{ > + char *cp; > + > + cp = strrchr(name, '-'); > + if (cp == NULL) > + errx(1, "Invalid name: %s", name); > + *vname = cp + 1; > + *cp = '\0'; > + if (efi_str_to_guid(name, guid) < 0) > + errx(1, "Invalid guid %s", name); > +} > + > +static uint8_t * > +get_value(char *val, size_t *datalen) > +{ > + static char buffer[16*1024]; > + > + if (val != NULL) { > + *datalen = strlen(val); > + return ((uint8_t *)val); > + } > + /* Read from stdin */ > + *datalen = sizeof(buffer); > + *datalen = read(0, buffer, *datalen); > + return ((uint8_t *)buffer); > +} > + > +static void > +append_variable(char *name, char *val) > +{ > + char *vname; > + efi_guid_t guid; > + size_t datalen; > + uint8_t *data; > + > + breakdown_name(name, &guid, &vname); > + data = get_value(val, &datalen); > + if (efi_append_variable(guid, vname, data, datalen, attrib) < 0) > + err(1, "efi_append_variable"); > +} > + > +static void > +delete_variable(char *name) > +{ > + char *vname; > + efi_guid_t guid; > + > + breakdown_name(name, &guid, &vname); > + if (efi_del_variable(guid, vname) < 0) > + err(1, "efi_del_variable"); > +} > + > +static void > +write_variable(char *name, char *val) > +{ > + char *vname; > + efi_guid_t guid; > + size_t datalen; > + uint8_t *data; > + > + breakdown_name(name, &guid, &vname); > + data = get_value(val, &datalen); > + if (efi_set_variable(guid, vname, data, datalen, attrib, 0) < 0) > + err(1, "efi_set_variable"); > +} > + > +static void > +asciidump(uint8_t *data, size_t datalen) > +{ > + size_t i; > + int len; > + > + len = 0; > + if (!Nflag) > + printf("\n"); > + for (i = 0; i < datalen; i++) { > + if (isprint(data[i])) { > + len++; > + if (len > 80) { > + len = 0; > + printf("\n"); > + } > + printf("%c", data[i]); > + } else { > + len +=3; > + if (len > 80) { > + len = 0; > + printf("\n"); > + } > + printf("%%%02x", data[i]); > + } > + } > + printf("\n"); > +} > + > +static void > +hexdump(uint8_t *data, size_t datalen) > +{ > + size_t i; > + > + if (!Nflag) > + printf("\n"); > + for (i = 0; i < datalen; i++) { > + if (i % 16 == 0) { > + if (i != 0) > + printf("\n"); > + printf("%04x: ", (int)i); > + } > + printf("%02x ", data[i]); > + } > + printf("\n"); > +} > + > +static void > +bindump(uint8_t *data, size_t datalen) > +{ > + write(1, data, datalen); > +} > + > +static void > +print_var(efi_guid_t *guid, char *name) > +{ > + uint32_t att; > + uint8_t *data; > + size_t datalen; > + char *gname; > + int rv; > + > + efi_guid_to_str(guid, &gname); > + if (!Nflag) > + printf("%s-%s", gname, name); > + if (pflag) { > + rv = efi_get_variable(*guid, name, &data, &datalen, &att); > + > + if (rv < 0) > + printf("\n --- Error getting value --- %d", errno); > + else { > + if (Aflag) > + asciidump(data, datalen); > + else if (bflag) > + bindump(data, datalen); > + else > + hexdump(data, datalen); > + } > + } > + free(gname); > + if (!Nflag) > + printf("\n"); > +} > + > +static void > +print_variable(char *name) > +{ > + char *vname; > + efi_guid_t guid; > + > + breakdown_name(name, &guid, &vname); > + print_var(&guid, vname); > +} > + > +static void > +print_variables(void) > +{ > + int rv; > + char *name = NULL; > + efi_guid_t *guid = NULL; > + > + while ((rv = efi_get_next_variable_name(&guid, &name)) > 0) > + print_var(guid, name); > + > + if (rv < 0) > + err(1, "Error listing names"); > +} > + > +static void > +parse_args(int argc, char **argv) > +{ > + int ch, i; > + > + while ((ch = getopt_long(argc, argv, "aAbdDf:HlLNn:pRt:w", > + longopts, NULL)) != -1) { > + switch (ch) { > + case 'a': > + aflag++; > + break; > + case 'A': > + Aflag++; > + break; > + case 'b': > + bflag++; > + break; > + case 'd': > + dflag++; > + break; > + case 'D': > + Dflag++; > + break; > + case 'H': > + Hflag++; > + break; > + case 'l': > + lflag++; > + break; > + case 'L': > + Lflag++; > + break; > + case 'n': > + varname = optarg; > + break; > + case 'N': > + Nflag++; > + break; > + case 'p': > + pflag++; > + break; > + case 'R': > + Rflag++; > + break; > + case 'w': > + wflag++; > + break; > + case 'f': > + case 't': > + case 0: > + errx(1, "unknown or unimplemented option\n"); > + break; > + default: > + usage(); > + } > + } > + argc -= optind; > + argv += optind; > + > + if (argc == 1) > + varname = argv[0]; > + > + if (aflag + Dflag + wflag > 1) { > + warnx("Can only use one of -a (--append), " > + "-D (--delete) and -w (--write)"); > + usage(); > + } > + > + if (aflag + Dflag + wflag > 0 && varname == NULL) { > + warnx("Must specify a variable for -a (--append), " > + "-D (--delete) or -w (--write)"); > + usage(); > + } > + > + if (aflag) > + append_variable(varname, NULL); > + else if (Dflag) > + delete_variable(varname); > + else if (wflag) > + write_variable(varname, NULL); > + else if (varname) { > + pflag++; > + print_variable(varname); > + } else if (argc > 0) { > + pflag++; > + for (i = 0; i < argc; i++) > + print_variable(argv[i]); > + } else > + print_variables(); > +} > + > +int > +main(int argc, char **argv) > +{ > + > + parse_args(argc, argv); > +} > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Wed Oct 12 17:11:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5237FC0FDD9; Wed, 12 Oct 2016 17:11:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A216D72; Wed, 12 Oct 2016 17:11:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9CHB0w4087628; Wed, 12 Oct 2016 17:11:00 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CHAx9c087600; Wed, 12 Oct 2016 17:10:59 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610121710.u9CHAx9c087600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 17:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307151 - in head/sys: arm/arm arm64/arm64 mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 17:11:01 -0000 Author: gonzo Date: Wed Oct 12 17:10:59 2016 New Revision: 307151 URL: https://svnweb.freebsd.org/changeset/base/307151 Log: INTRNG: Propagate IRQ activation error to API consumer Keep resource state consistent with INTRNG state - if intr_activate_irq fails - deactivate resource and propagate error to calling function Reviewed by: mmel Modified: head/sys/arm/arm/nexus.c head/sys/arm64/arm64/nexus.c head/sys/mips/mips/nexus.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Wed Oct 12 15:49:20 2016 (r307150) +++ head/sys/arm/arm/nexus.c Wed Oct 12 17:10:59 2016 (r307151) @@ -383,7 +383,11 @@ nexus_activate_resource(device_t bus, de return (0); } else if (type == SYS_RES_IRQ) { #ifdef INTRNG - intr_activate_irq(child, r); + err = intr_activate_irq(child, r); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } #endif } return (0); Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Wed Oct 12 15:49:20 2016 (r307150) +++ head/sys/arm64/arm64/nexus.c Wed Oct 12 17:10:59 2016 (r307151) @@ -347,7 +347,11 @@ nexus_activate_resource(device_t bus, de rman_set_virtual(r, (void *)vaddr); rman_set_bushandle(r, vaddr); } else if (type == SYS_RES_IRQ) { - intr_activate_irq(child, r); + err = intr_activate_irq(child, r); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } } return (0); } Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Wed Oct 12 15:49:20 2016 (r307150) +++ head/sys/mips/mips/nexus.c Wed Oct 12 17:10:59 2016 (r307151) @@ -433,7 +433,11 @@ nexus_activate_resource(device_t bus, de } else if (type == SYS_RES_IRQ) { #ifdef INTRNG #ifdef FDT - intr_activate_irq(child, r); + err = intr_activate_irq(child, r); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } #else /* * INTRNG without FDT needs to have the interrupt properly From owner-svn-src-head@freebsd.org Wed Oct 12 18:49:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3905CC0F14C; Wed, 12 Oct 2016 18:49:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B1D41AE; Wed, 12 Oct 2016 18:49:31 +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 u9CInVjS023211; Wed, 12 Oct 2016 18:49:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CInVpg023210; Wed, 12 Oct 2016 18:49:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610121849.u9CInVpg023210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 12 Oct 2016 18:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307152 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 18:49:32 -0000 Author: emaste Date: Wed Oct 12 18:49:30 2016 New Revision: 307152 URL: https://svnweb.freebsd.org/changeset/base/307152 Log: Add COMPAT_FREEBSD10 to the MIPS ERL kernel config As of r302092, pipe is a wrapper around pipe2 and the pipe syscall is no longer used. It is included only with the COMPAT_FREEBSD10 kernel option. Add the compat option to support upgrades from systems with an earlier userland. MFC after: 1 week Modified: head/sys/mips/conf/ERL Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Wed Oct 12 17:10:59 2016 (r307151) +++ head/sys/mips/conf/ERL Wed Oct 12 18:49:30 2016 (r307152) @@ -74,6 +74,7 @@ options PSEUDOFS # Pseudo-filesystem f options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD32 # Compatible with o32 binaries +options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support From owner-svn-src-head@freebsd.org Wed Oct 12 19:06:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 581A3C0F679; Wed, 12 Oct 2016 19:06:52 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FEA7231; Wed, 12 Oct 2016 19:06:52 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9CJ6pgB031274; Wed, 12 Oct 2016 19:06:51 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CJ6oDn031269; Wed, 12 Oct 2016 19:06:50 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201610121906.u9CJ6oDn031269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Wed, 12 Oct 2016 19:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307153 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 19:06:52 -0000 Author: jtl Date: Wed Oct 12 19:06:50 2016 New Revision: 307153 URL: https://svnweb.freebsd.org/changeset/base/307153 Log: The TFO server-side code contains some changes that are not conditioned on the TCP_RFC7413 kernel option. This change removes those few instructions from the packet processing path. While not strictly necessary, for the sake of consistency, I applied the new IS_FASTOPEN macro to all places in the packet processing path that used the (t_flags & TF_FASTOPEN) check. Reviewed by: hiren Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D8219 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Oct 12 18:49:30 2016 (r307152) +++ head/sys/netinet/tcp_input.c Wed Oct 12 19:06:50 2016 (r307153) @@ -1028,7 +1028,7 @@ relocked: #endif if (!((tp->t_state == TCPS_ESTABLISHED && (thflags & TH_SYN) == 0) || (tp->t_state == TCPS_LISTEN && (thflags & TH_SYN) && - !(tp->t_flags & TF_FASTOPEN)))) { + !IS_FASTOPEN(tp->t_flags)))) { if (ti_locked == TI_UNLOCKED) { if (INP_INFO_TRY_RLOCK(&V_tcbinfo) == 0) { in_pcbref(inp); @@ -1506,7 +1506,9 @@ tcp_do_segment(struct mbuf *m, struct tc struct in_conninfo *inc; struct mbuf *mfree; struct tcpopt to; +#ifdef TCP_RFC7413 int tfo_syn; +#endif #ifdef TCPDEBUG /* @@ -1964,7 +1966,7 @@ tcp_do_segment(struct mbuf *m, struct tc goto dropwithreset; } #ifdef TCP_RFC7413 - if (tp->t_flags & TF_FASTOPEN) { + if (IS_FASTOPEN(tp->t_flags)) { /* * When a TFO connection is in SYN_RECEIVED, the * only valid packets are the initial SYN, a @@ -2398,7 +2400,7 @@ tcp_do_segment(struct mbuf *m, struct tc (tp->t_flags & TF_NEEDSYN)) { #ifdef TCP_RFC7413 if (tp->t_state == TCPS_SYN_RECEIVED && - tp->t_flags & TF_FASTOPEN) { + IS_FASTOPEN(tp->t_flags)) { tp->snd_wnd = tiwin; cc_conn_init(tp); } @@ -2461,7 +2463,7 @@ tcp_do_segment(struct mbuf *m, struct tc * snd_cwnd reduction that occurs when a TFO SYN|ACK * is retransmitted. */ - if (!(tp->t_flags & TF_FASTOPEN)) + if (!IS_FASTOPEN(tp->t_flags)) #endif cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); @@ -3028,8 +3030,12 @@ dodata: /* XXX */ * case PRU_RCVD). If a FIN has already been received on this * connection then we just ignore the text. */ +#ifdef TCP_RFC7413 tfo_syn = ((tp->t_state == TCPS_SYN_RECEIVED) && - (tp->t_flags & TF_FASTOPEN)); + IS_FASTOPEN(tp->t_flags)); +#else +#define tfo_syn (false) +#endif if ((tlen || (thflags & TH_FIN) || tfo_syn) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { tcp_seq save_start = th->th_seq; @@ -3253,6 +3259,9 @@ drop: if (tp != NULL) INP_WUNLOCK(tp->t_inpcb); m_freem(m); +#ifndef TCP_RFC7413 +#undef tfo_syn +#endif } /* Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Oct 12 18:49:30 2016 (r307152) +++ head/sys/netinet/tcp_output.c Wed Oct 12 19:06:50 2016 (r307153) @@ -230,7 +230,7 @@ tcp_output(struct tcpcb *tp) * For TFO connections in SYN_RECEIVED, only allow the initial * SYN|ACK and those sent by the retransmit timer. */ - if ((tp->t_flags & TF_FASTOPEN) && + if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED) && SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN|ACK sent */ (tp->snd_nxt != tp->snd_una)) /* not a retransmit */ @@ -426,7 +426,7 @@ after_sack_rexmit: * When sending additional segments following a TFO SYN|ACK, * do not include the SYN bit. */ - if ((tp->t_flags & TF_FASTOPEN) && + if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED)) flags &= ~TH_SYN; #endif @@ -449,7 +449,7 @@ after_sack_rexmit: * don't include data, as the presence of data may have caused the * original SYN|ACK to have been dropped by a middlebox. */ - if ((tp->t_flags & TF_FASTOPEN) && + if (IS_FASTOPEN(tp->t_flags) && (((tp->t_state == TCPS_SYN_RECEIVED) && (tp->t_rxtshift > 0)) || (flags & TH_RST))) len = 0; @@ -786,7 +786,7 @@ send: * the TFO option may have caused the original * SYN|ACK to have been dropped by a middlebox. */ - if ((tp->t_flags & TF_FASTOPEN) && + if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED) && (tp->t_rxtshift == 0)) { to.to_tfo_len = TCP_FASTOPEN_COOKIE_LEN; Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Oct 12 18:49:30 2016 (r307152) +++ head/sys/netinet/tcp_syncache.c Wed Oct 12 19:06:50 2016 (r307153) @@ -1209,7 +1209,7 @@ syncache_add(struct in_conninfo *inc, st ltflags = (tp->t_flags & (TF_NOOPT | TF_SIGNATURE)); #ifdef TCP_RFC7413 - if (V_tcp_fastopen_enabled && (tp->t_flags & TF_FASTOPEN) && + if (V_tcp_fastopen_enabled && IS_FASTOPEN(tp->t_flags) && (tp->t_tfo_pending != NULL) && (to->to_flags & TOF_FASTOPEN)) { /* * Limit the number of pending TFO connections to Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Oct 12 18:49:30 2016 (r307152) +++ head/sys/netinet/tcp_usrreq.c Wed Oct 12 19:06:50 2016 (r307153) @@ -410,7 +410,7 @@ tcp_usr_listen(struct socket *so, int ba SOCK_UNLOCK(so); #ifdef TCP_RFC7413 - if (tp->t_flags & TF_FASTOPEN) + if (IS_FASTOPEN(tp->t_flags)) tp->t_tfo_pending = tcp_fastopen_alloc_counter(); #endif out: @@ -460,7 +460,7 @@ tcp6_usr_listen(struct socket *so, int b SOCK_UNLOCK(so); #ifdef TCP_RFC7413 - if (tp->t_flags & TF_FASTOPEN) + if (IS_FASTOPEN(tp->t_flags)) tp->t_tfo_pending = tcp_fastopen_alloc_counter(); #endif out: @@ -826,7 +826,7 @@ tcp_usr_rcvd(struct socket *so, int flag * application response data, or failing that, when the DELACK timer * expires. */ - if ((tp->t_flags & TF_FASTOPEN) && + if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED)) goto out; #endif Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Oct 12 18:49:30 2016 (r307152) +++ head/sys/netinet/tcp_var.h Wed Oct 12 19:06:50 2016 (r307153) @@ -349,6 +349,12 @@ struct tcpcb { #define ENTER_RECOVERY(t_flags) t_flags |= (TF_CONGRECOVERY | TF_FASTRECOVERY) #define EXIT_RECOVERY(t_flags) t_flags &= ~(TF_CONGRECOVERY | TF_FASTRECOVERY) +#if defined(_KERNEL) && !defined(TCP_RFC7413) +#define IS_FASTOPEN(t_flags) (false) +#else +#define IS_FASTOPEN(t_flags) (t_flags & TF_FASTOPEN) +#endif + #define BYTES_THIS_ACK(tp, th) (th->th_ack - tp->snd_una) /* From owner-svn-src-head@freebsd.org Wed Oct 12 19:53:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C386C0F509; Wed, 12 Oct 2016 19:53:12 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBBEA85F; Wed, 12 Oct 2016 19:53:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9CJrAjt051053; Wed, 12 Oct 2016 19:53:10 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CJrAXk051052; Wed, 12 Oct 2016 19:53:10 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610121953.u9CJrAXk051052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 12 Oct 2016 19:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307154 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 19:53:12 -0000 Author: gonzo Date: Wed Oct 12 19:53:10 2016 New Revision: 307154 URL: https://svnweb.freebsd.org/changeset/base/307154 Log: [fdt] Add one more heuristic to determine MAC address of the SMSC device - If check for net,ethernet/usb,device compatible node fails, try to find .../usb/hub/ethernet, where ... is bus path that can depend on actual HW. net,ethernet/usb,device compatibity strings are FreeBSD custom invention that is used only in RPi DTBs and since there is no other way to tie USB device to FDT node we just do our best effort here to work with upstream device tree - Use -1 value to indicate invalid phandle_t, 0 is valid phandle value and shouldn't be used as error signal Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Wed Oct 12 19:06:50 2016 (r307153) +++ head/sys/dev/usb/net/if_smsc.c Wed Oct 12 19:53:10 2016 (r307154) @@ -1556,6 +1556,9 @@ smsc_ioctl(struct ifnet *ifp, u_long cmd } #ifdef FDT +/* + * This is FreeBSD-specific compatibility strings for RPi/RPi2 + */ static phandle_t smsc_fdt_find_eth_node(phandle_t start) { @@ -1567,11 +1570,68 @@ smsc_fdt_find_eth_node(phandle_t start) fdt_is_compatible(node, "usb,device")) return (node); child = smsc_fdt_find_eth_node(node); - if (child != 0) + if (child != -1) return (child); } - return (0); + return (-1); +} + +/* + * Check if node's path is <*>/usb/hub/ethernet + */ +static int +smsc_fdt_is_usb_eth(phandle_t node) +{ + char name[16]; + int len; + + memset(name, 0, sizeof(name)); + len = OF_getprop(node, "name", name, sizeof(name)); + if (len <= 0) + return (0); + + if (strcmp(name, "ethernet")) + return (0); + + node = OF_parent(node); + if (node == -1) + return (0); + len = OF_getprop(node, "name", name, sizeof(name)); + if (len <= 0) + return (0); + + if (strcmp(name, "hub")) + return (0); + + node = OF_parent(node); + if (node == -1) + return (0); + len = OF_getprop(node, "name", name, sizeof(name)); + if (len <= 0) + return (0); + + if (strcmp(name, "usb")) + return (0); + + return (1); +} + +static phandle_t +smsc_fdt_find_eth_node_by_path(phandle_t start) +{ + phandle_t child, node; + + /* Traverse through entire tree to find usb ethernet nodes. */ + for (node = OF_child(start); node != 0; node = OF_peer(node)) { + if (smsc_fdt_is_usb_eth(node)) + return (node); + child = smsc_fdt_find_eth_node_by_path(node); + if (child != -1) + return (child); + } + + return (-1); } /** @@ -1587,8 +1647,14 @@ smsc_fdt_find_mac(unsigned char *mac) root = OF_finddevice("/"); node = smsc_fdt_find_eth_node(root); - if (node != 0) { + /* + * If it's not FreeBSD FDT blob for RPi, try more + * generic .../usb/hub/ethernet + */ + if (node == -1) + node = smsc_fdt_find_eth_node_by_path(root); + if (node != -1) { /* Check if there is property */ if ((len = OF_getproplen(node, "local-mac-address")) > 0) { if (len != ETHER_ADDR_LEN) From owner-svn-src-head@freebsd.org Wed Oct 12 20:24:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD579C0FB0A; Wed, 12 Oct 2016 20:24:34 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7415A95D; Wed, 12 Oct 2016 20:24:34 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9CKOXpp062212; Wed, 12 Oct 2016 20:24:33 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CKOXQR062211; Wed, 12 Oct 2016 20:24:33 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201610122024.u9CKOXQR062211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 12 Oct 2016 20:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307156 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 20:24:34 -0000 Author: cperciva Date: Wed Oct 12 20:24:33 2016 New Revision: 307156 URL: https://svnweb.freebsd.org/changeset/base/307156 Log: MFportsnap r264740: Use case insensitive match when parsing host(1) output. Some DNS caches turn "FreeBSD.org" into "freebsd.org", which was causing the printed SRV records to not match our regex. PR: 170503 MFC after: 2 weeks 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 Wed Oct 12 20:19:33 2016 (r307155) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Oct 12 20:24:33 2016 (r307156) @@ -953,7 +953,7 @@ fetch_pick_server_init () { # "$name server selection ..."; we allow either format. MLIST="_http._tcp.${SERVERNAME}" host -t srv "${MLIST}" | - sed -nE "s/${MLIST} (has SRV record|server selection) //p" | + sed -nE "s/${MLIST} (has SRV record|server selection) //Ip" | cut -f 1,2,4 -d ' ' | sed -e 's/\.$//' | sort > serverlist_full From owner-svn-src-head@freebsd.org Wed Oct 12 20:25:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFC1FC0FB5B; Wed, 12 Oct 2016 20:25:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1A7CAD8; Wed, 12 Oct 2016 20:25:04 +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 u9CKP303062295; Wed, 12 Oct 2016 20:25:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CKP3s1062294; Wed, 12 Oct 2016 20:25:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610122025.u9CKP3s1062294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 12 Oct 2016 20:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307157 - head/usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 20:25:05 -0000 Author: emaste Date: Wed Oct 12 20:25:03 2016 New Revision: 307157 URL: https://svnweb.freebsd.org/changeset/base/307157 Log: Temporarily disconnect efivar to fix arm and i386 builds Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Wed Oct 12 20:24:33 2016 (r307156) +++ head/usr.sbin/Makefile Wed Oct 12 20:25:03 2016 (r307157) @@ -123,7 +123,7 @@ SUBDIR.${MK_BSNMP}+= bsnmpd SUBDIR.${MK_CTM}+= ctm SUBDIR.${MK_DIALOG}+= tzsetup SUBDIR.${MK_DIALOG}+= bsdconfig -SUBDIR.${MK_EFI}+= efivar +#SUBDIR.${MK_EFI}+= efivar SUBDIR.${MK_FLOPPY}+= fdcontrol SUBDIR.${MK_FLOPPY}+= fdformat SUBDIR.${MK_FLOPPY}+= fdread From owner-svn-src-head@freebsd.org Wed Oct 12 20:27:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EA12C0FBBD; Wed, 12 Oct 2016 20:27:13 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57566C8F; Wed, 12 Oct 2016 20:27:13 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x243.google.com with SMTP id o19so4606151ito.3; Wed, 12 Oct 2016 13:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=aWQLI+3DSYijs5IeyGuAHXUSPAyMUS0VMwjVb5bwym4=; b=xmn/G8pvXNbjyLP5BjOXMirMYM0hRN9FMNjYEPOvVPFBvrCcGZxuVhpFdidDdy+VDA zp+SeMNLLKcMccpYiJOiNy1iKDyhGJ+iucpUARbCEzkajVncbW4mWQAt5oewv4QNIG9Q 7egMlWRV3zCXaTRE1ziqVIV/PGUc8DuxIQDpuRZNI5g6zUIWiBRVVw4wdWw8SYOYGRBC l5NJBLnlO8jNQwoZjfNSHxvJa1WsC5eJ0D/lmrzvdeWviSiEthNckLdSN404NWF1LYZ1 Z3whLca0xk3LEv0LTa4ZqaYbscJuGXZuQgymPv0AJ0YW2KM+ajRqBBj4lyKQeSS9qE5P KPjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=aWQLI+3DSYijs5IeyGuAHXUSPAyMUS0VMwjVb5bwym4=; b=JhJ8Gv5eBTuwPXwrj9OTltDepkCmMljfTG3XaHVWr70lI6+iI+/ZrJODqBbn49+8Vb G7PTABUMnjD3hVh86OdE/W7EMT7WbcNY4FSYASYLCv4wO12CZx3iSzb6AQKPzLthHdUn csJUKbonQLF60fLxQNwT4zDaN0Xep7jL1zSJ0C0BxSsbcJSxVWx3Sy/iQp2O0QgmyDZX SqrFtps718QkoWQ0BUOQlZV08vK/sDufRsqnojlYKvy0stlj/N+XHEB0iYH7elGRR5ud kb6Tn6w7iLNZ6Rv/JS9bX0fuPTUdlS8GpOv6dZin8DFglz3v1LJlXbpVAWludbNVz8mY IC+g== X-Gm-Message-State: AA6/9RmhKTN7ws9MWcWF1SGnOyVmdxZvOTBegQ9/v4ROQXV/F0Rqxnkz3U8yRp7LCe5CqCFR8y5M+e+qcKM+zQ== X-Received: by 10.36.142.196 with SMTP id h187mr3238042ite.108.1476304032689; Wed, 12 Oct 2016 13:27:12 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.180.211 with HTTP; Wed, 12 Oct 2016 13:26:52 -0700 (PDT) In-Reply-To: References: <201610112231.u9BMVk8K056208@repo.freebsd.org> From: Ed Maste Date: Wed, 12 Oct 2016 16:26:52 -0400 X-Google-Sender-Auth: WYPtPLfKUgGzwc7zPOgoM4QSkAg Message-ID: Subject: Re: svn commit: r307072 - in head/usr.sbin: . efivar To: Zbigniew Bodek Cc: Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 20:27:13 -0000 On 12 October 2016 at 12:55, Zbigniew Bodek wrote: > Hello Warner, > > Did you try to build world for ARMv6 on HEAD? I'm not able to do so and the > issues seems to be related to this commit (missing efivar.h file). Indeed, my tinderbox build failed for arm.arm, arm.armeb, arm.armv6, arm64.aarch64, pc98.i386, i386.i386 with /scratch/tmp/emaste/freebsd/usr.sbin/efivar/efivar.c:31:10: fatal error: 'efivar.h' file not found #include ^ I temporarily unhooked it from the build in r307157. From owner-svn-src-head@freebsd.org Wed Oct 12 20:50:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6631C0E235; Wed, 12 Oct 2016 20:50:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9133CAAB; Wed, 12 Oct 2016 20:50:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9CKoDoo070578; Wed, 12 Oct 2016 20:50:13 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CKoDb5070573; Wed, 12 Oct 2016 20:50:13 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201610122050.u9CKoDb5070573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 12 Oct 2016 20:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307158 - in head/sys: dev/iwm dev/otus dev/usb/wlan net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 20:50:14 -0000 Author: avos Date: Wed Oct 12 20:50:13 2016 New Revision: 307158 URL: https://svnweb.freebsd.org/changeset/base/307158 Log: net80211: convert all ieee80211_input_mimo*() consumers to ieee80211_add_rx_params() + drop last (ieee80211_rx_stats) parameter Note: there is an additional check for ieee80211_get_rx_params() return value (which does not exist in the original diff). Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D8207 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/otus/if_otus.c head/sys/dev/usb/wlan/if_rsu.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Oct 12 20:25:03 2016 (r307157) +++ head/sys/dev/iwm/if_iwm.c Wed Oct 12 20:50:13 2016 (r307158) @@ -2977,6 +2977,8 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, /* rssi is in 1/2db units */ rxs.c_rssi = rssi * 2; rxs.c_nf = sc->sc_noise; + if (ieee80211_add_rx_params(m, &rxs) == 0) + goto fail; if (ieee80211_radiotap_active_vap(vap)) { struct iwm_rx_radiotap_header *tap = &sc->sc_rxtap; @@ -3013,11 +3015,11 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, IWM_UNLOCK(sc); if (ni != NULL) { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "input m %p\n", m); - ieee80211_input_mimo(ni, m, &rxs); + ieee80211_input_mimo(ni, m); ieee80211_free_node(ni); } else { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "inputall m %p\n", m); - ieee80211_input_mimo_all(ic, m, &rxs); + ieee80211_input_mimo_all(ic, m); } IWM_LOCK(sc); Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Wed Oct 12 20:25:03 2016 (r307157) +++ head/sys/dev/otus/if_otus.c Wed Oct 12 20:50:13 2016 (r307158) @@ -1713,7 +1713,10 @@ otus_sub_rxeof(struct otus_softc *sc, ui rxs.c_nf = sc->sc_nf[0]; /* XXX chain 0 != combined rssi/nf */ rxs.c_rssi = tail->rssi; /* XXX TODO: add MIMO RSSI/NF as well */ - ieee80211_add_rx_params(m, &rxs); + if (ieee80211_add_rx_params(m, &rxs) == 0) { + counter_u64_add(ic->ic_ierrors, 1); + return; + } /* XXX make a method */ STAILQ_INSERT_TAIL(&rxq->mq_head, m, m_stailqpkt); @@ -1826,10 +1829,10 @@ tr_setup: if (ni != NULL) { if (ni->ni_flags & IEEE80211_NODE_HT) m->m_flags |= M_AMPDU; - (void)ieee80211_input_mimo(ni, m, NULL); + (void)ieee80211_input_mimo(ni, m); ieee80211_free_node(ni); } else - (void)ieee80211_input_mimo_all(ic, m, NULL); + (void)ieee80211_input_mimo_all(ic, m); } #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_ff_age_all(ic, 100); Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed Oct 12 20:25:03 2016 (r307157) +++ head/sys/dev/usb/wlan/if_rsu.c Wed Oct 12 20:50:13 2016 (r307158) @@ -1536,10 +1536,12 @@ rsu_event_survey(struct rsu_softc *sc, u /* This is a number from 0..100; so let's just divide it down a bit */ rxs.c_rssi = le32toh(bss->rssi) / 2; rxs.c_nf = -96; + if (ieee80211_add_rx_params(m, &rxs) == 0) + return; /* XXX avoid a LOR */ RSU_UNLOCK(sc); - ieee80211_input_mimo_all(ic, m, &rxs); + ieee80211_input_mimo_all(ic, m); RSU_LOCK(sc); } Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Wed Oct 12 20:25:03 2016 (r307157) +++ head/sys/net80211/ieee80211_input.c Wed Oct 12 20:50:13 2016 (r307158) @@ -83,18 +83,14 @@ ieee80211_process_mimo(struct ieee80211_ } int -ieee80211_input_mimo(struct ieee80211_node *ni, struct mbuf *m, - struct ieee80211_rx_stats *rx) +ieee80211_input_mimo(struct ieee80211_node *ni, struct mbuf *m) { struct ieee80211_rx_stats rxs; - if (rx) { - memcpy(&rxs, rx, sizeof(*rx)); - } else { - /* try to read from mbuf */ - bzero(&rxs, sizeof(rxs)); - ieee80211_get_rx_params(m, &rxs); - } + /* try to read stats from mbuf */ + bzero(&rxs, sizeof(rxs)); + if (ieee80211_get_rx_params(m, &rxs) != 0) + return (-1); /* XXX should assert IEEE80211_R_NF and IEEE80211_R_RSSI are set */ ieee80211_process_mimo(ni, &rxs); @@ -111,27 +107,21 @@ ieee80211_input_all(struct ieee80211com rx.r_flags = IEEE80211_R_NF | IEEE80211_R_RSSI; rx.c_nf = nf; rx.c_rssi = rssi; - return ieee80211_input_mimo_all(ic, m, &rx); + + if (!ieee80211_add_rx_params(m, &rx)) + return (-1); + + return ieee80211_input_mimo_all(ic, m); } int -ieee80211_input_mimo_all(struct ieee80211com *ic, struct mbuf *m, - struct ieee80211_rx_stats *rx) +ieee80211_input_mimo_all(struct ieee80211com *ic, struct mbuf *m) { - struct ieee80211_rx_stats rxs; struct ieee80211vap *vap; int type = -1; m->m_flags |= M_BCAST; /* NB: mark for bpf tap'ing */ - if (rx) { - memcpy(&rxs, rx, sizeof(*rx)); - } else { - /* try to read from mbuf */ - bzero(&rxs, sizeof(rxs)); - ieee80211_get_rx_params(m, &rxs); - } - /* XXX locking */ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { struct ieee80211_node *ni; @@ -152,6 +142,7 @@ ieee80211_input_mimo_all(struct ieee8021 /* * Packet contents are changed by ieee80211_decap * so do a deep copy of the packet. + * NB: tags are copied too. */ mcopy = m_dup(m, M_NOWAIT); if (mcopy == NULL) { @@ -163,7 +154,7 @@ ieee80211_input_mimo_all(struct ieee8021 m = NULL; } ni = ieee80211_ref_node(vap->iv_bss); - type = ieee80211_input_mimo(ni, mcopy, &rxs); + type = ieee80211_input_mimo(ni, mcopy); ieee80211_free_node(ni); } if (m != NULL) /* no vaps, reclaim mbuf */ Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Wed Oct 12 20:25:03 2016 (r307157) +++ head/sys/net80211/ieee80211_proto.h Wed Oct 12 20:50:13 2016 (r307158) @@ -83,10 +83,8 @@ void ieee80211_syncflag_ext(struct ieee8 ((ni)->ni_vap->iv_input(ni, m, NULL, rssi, nf)) int ieee80211_input_all(struct ieee80211com *, struct mbuf *, int, int); -int ieee80211_input_mimo(struct ieee80211_node *, struct mbuf *, - struct ieee80211_rx_stats *); -int ieee80211_input_mimo_all(struct ieee80211com *, struct mbuf *, - struct ieee80211_rx_stats *); +int ieee80211_input_mimo(struct ieee80211_node *, struct mbuf *); +int ieee80211_input_mimo_all(struct ieee80211com *, struct mbuf *); struct ieee80211_bpf_params; int ieee80211_mgmt_output(struct ieee80211_node *, struct mbuf *, int, From owner-svn-src-head@freebsd.org Wed Oct 12 20:50:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 307BEC0E25E; Wed, 12 Oct 2016 20:50:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4409AEF; Wed, 12 Oct 2016 20:50:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9CKoHgs070627; Wed, 12 Oct 2016 20:50:17 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9CKoHSu070624; Wed, 12 Oct 2016 20:50:17 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201610122050.u9CKoHSu070624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 12 Oct 2016 20:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307159 - in head/etc: defaults rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 20:50:19 -0000 Author: dteske Date: Wed Oct 12 20:50:17 2016 New Revision: 307159 URL: https://svnweb.freebsd.org/changeset/base/307159 Log: Many shops still prefer rc.conf(5) based jail configuration(s). In-part because they can use sysrc in conjunction with ssh and xargs to perform en-masse changes in a large distribution with lots of jails spread over many hosts on a LAN/WAN. Provide a mechanism for disabling the warning eschewed by /etc/rc.d/jail in said situation. If jail_confwarn="NO" is in rc.conf(5) (default "YES") skip the warning that per-jail configurations are obsolete and that the user should migrate to jail.conf(5). Reviewed by: jelischer MFC after: 3 days Sponsored by: FIS Global, Inc. Differential Revision: https://reviews.freebsd.org/D7465 Modified: head/etc/defaults/rc.conf head/etc/rc.d/jail Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Oct 12 20:50:13 2016 (r307158) +++ head/etc/defaults/rc.conf Wed Oct 12 20:50:17 2016 (r307159) @@ -695,6 +695,7 @@ iovctl_files="" # Config files for iovc ### Jail Configuration (see rc.conf(5) manual page) ########## ############################################################## jail_enable="NO" # Set to NO to disable starting of any jails +jail_confwarn="YES" # Prevent warning about obsolete per-jail configuration jail_parallel_start="NO" # Start jails in the background jail_list="" # Space separated list of names of jails jail_reverse_stop="NO" # Stop jails in reverse order Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Wed Oct 12 20:50:13 2016 (r307158) +++ head/etc/rc.d/jail Wed Oct 12 20:50:17 2016 (r307159) @@ -147,7 +147,8 @@ parse_options() # # To relieve confusion, show a warning message. # - _confwarn=1 + : ${jail_confwarn:=YES} + checkyesno jail_confwarn && _confwarn=1 if [ -r "$jail_conf" -o -r "$_jconf" ]; then if ! checkyesno jail_parallel_start; then warn "$_conf is created and used for jail $_j." From owner-svn-src-head@freebsd.org Wed Oct 12 23:41:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F617C0FC3E; Wed, 12 Oct 2016 23:41:31 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 34FC919B8; Wed, 12 Oct 2016 23:41:30 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id uT9GbeOHGFfiXuT9HbEhFI; Wed, 12 Oct 2016 17:41:24 -0600 X-Authority-Analysis: v=2.2 cv=Qb8khYTv c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=CH0kA5CcgfcA:10 a=oCJs8q-oAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=5liKsSN3vyoQSZ0aausA:9 a=CjuIK1q_8ugA:10 a=qUF70SbvcHBaGhGVny9j:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 7607899C; Wed, 12 Oct 2016 16:41:21 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u9CNf2qO056708; Wed, 12 Oct 2016 16:41:02 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201610122341.u9CNf2qO056708@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: Zbigniew Bodek , Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307072 - in head/usr.sbin: . efivar In-Reply-To: Message from Ed Maste of "Wed, 12 Oct 2016 16:26:52 -0400." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 12 Oct 2016 16:41:02 -0700 X-CMAE-Envelope: MS4wfF7k5Sa/Q8R2DFah8fOstN2nW5FzoHQ9pM2twMe71nTLIc3sizU1C64G2NQ6tW+c/dfjILIAVOsqyyJi39f4x/Zb6yyQFrE+DPbAtiY4x1dI4uwg6dke au6vhfEyv+005ZAytCz/vAVln2OhUx+CXUlwOchsOJ9ibGMa0WlhG+OzcSQWM+ByezZAZ9irqRFYsAtXUhpT2lf9lgyqFykTJO7QRowfWUtHLieN0MA4i3Y0 YPyHg/GzvSgJ/sAN2qWsrNjJK3pFGIWvmYmIuwUAT3C/vFxOkb+1rdPVB2cOZ4IYeOVu29TzeV3/PJSTNhTfwYEnMI1q793svPhejWCngeU= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 12 Oct 2016 23:41:31 -0000 In message , Ed Maste writes: > On 12 October 2016 at 12:55, Zbigniew Bodek wrote: > > Hello Warner, > > > > Did you try to build world for ARMv6 on HEAD? I'm not able to do so and the > > issues seems to be related to this commit (missing efivar.h file). > > Indeed, my tinderbox build failed for arm.arm, arm.armeb, arm.armv6, > arm64.aarch64, pc98.i386, i386.i386 with > > /scratch/tmp/emaste/freebsd/usr.sbin/efivar/efivar.c:31:10: fatal > error: 'efivar.h' file not found > #include > ^ > > I temporarily unhooked it from the build in r307157. > > I had the same on amd64. -- 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 Oct 13 00:22:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3289DC0D78C for ; Thu, 13 Oct 2016 00:22:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 032E5B27 for ; Thu, 13 Oct 2016 00:22:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id q192so68524667iod.0 for ; Wed, 12 Oct 2016 17:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=7+K+1Y+c4PSyq/8BnSYBiOVRwlLjI5im21eruxVSOW4=; b=JchJRXZQYWkpk3Q4bG3TWuShQxer6ne5U7Ac75V7P79lLnC2lOCwWJ4twjtvWR2Omu PpmDx4JF5EKKdrdEFQQEmV4O5GJ+P6f0tHw5vVRwM/dO/E2R+06EVwMJqYzKKOPNoUlq aqJVAryt7jyARo94euzExNKgpolf4fhWh/O5G/2gA5i3gJgfCms6U/PY0o6LUuPOQ9P0 CWwTKYP5VpPrLFFCblsq7j5Gri7+ZtpkU6f7CpVd4Cna4PZ212JfXLPY14JH+Vgh8CJZ qrQ9EZtoa3LxGh3aS4L9SvuKcWufXEs6Bi1wRZU0FzM2y5pJ7hjy4pqQMKq6EzyHfF+F R3WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=7+K+1Y+c4PSyq/8BnSYBiOVRwlLjI5im21eruxVSOW4=; b=d+WeYcWXNp6Xsw/UxvzhVeHwPuUHP8kfP62Qt6ypWD9oKUYDNAPPwVNhXOwl5/F25B Ouh+fpm3W7Y6wzk+pkIvC/xxubMDjaoSg05Iry7tfGCxGN3vEDWekK5bymHw/XHf99dj TuP1baCFf26rQAYKZVvJlab7I5iYLYpC7otqZTmdgHLIu/Fj1SQx90vVgip/Z/AQ+Hkl X/VBb4cR7D2afFGKKM4/eFWSh6aRYqpt6r17rmz/aKxABAPotBxRPeY8Zr9gua8HDamA EgqjdomzmxMwKCBG6SODauNjhGrM2fgEX6a7jBdWcYbiMttTdQe+pBi6OGNckR3quwpa lWNg== X-Gm-Message-State: AA6/9RlQ26MMGZG3DWYHh6zqn7pZ5X76povYxF5YY3edMnE8pkUDjJnKl8AjUlEeSGxflYB4NFXxnP2LVEitIg== X-Received: by 10.107.142.67 with SMTP id q64mr4227077iod.0.1476318123239; Wed, 12 Oct 2016 17:22:03 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Wed, 12 Oct 2016 17:22:02 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <201610122341.u9CNf2qO056708@slippy.cwsent.com> References: <201610122341.u9CNf2qO056708@slippy.cwsent.com> From: Warner Losh Date: Wed, 12 Oct 2016 18:22:02 -0600 X-Google-Sender-Auth: sEM25nBgXkOD4EdYi7u_m_-NSo0 Message-ID: Subject: Re: svn commit: r307072 - in head/usr.sbin: . efivar To: Cy Schubert Cc: Ed Maste , Zbigniew Bodek , Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 00:22:04 -0000 I'll look into it. It worked just fine for me for all the builds I did on many different machines. Ugg. Warner On Wed, Oct 12, 2016 at 5:41 PM, Cy Schubert wrote: > In message om> > , Ed Maste writes: >> On 12 October 2016 at 12:55, Zbigniew Bodek wrote: >> > Hello Warner, >> > >> > Did you try to build world for ARMv6 on HEAD? I'm not able to do so and the >> > issues seems to be related to this commit (missing efivar.h file). >> >> Indeed, my tinderbox build failed for arm.arm, arm.armeb, arm.armv6, >> arm64.aarch64, pc98.i386, i386.i386 with >> >> /scratch/tmp/emaste/freebsd/usr.sbin/efivar/efivar.c:31:10: fatal >> error: 'efivar.h' file not found >> #include >> ^ >> >> I temporarily unhooked it from the build in r307157. >> >> > > I had the same on amd64. > > > -- > 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 Oct 13 02:05:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4161C0EEF3; Thu, 13 Oct 2016 02:05:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 9526AAF5; Thu, 13 Oct 2016 02:05:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-78.carlnfd1.nsw.optusnet.com.au [110.21.100.78]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 38115D65FB2; Thu, 13 Oct 2016 13:05:17 +1100 (AEDT) Date: Thu, 13 Oct 2016 13:05:17 +1100 (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: r307148 - in head/lib/libc: gen stdlib In-Reply-To: <201610121356.u9CDuF1q013531@repo.freebsd.org> Message-ID: <20161013110013.W925@besplex.bde.org> References: <201610121356.u9CDuF1q013531@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.1 cv=RIxOZNW+ c=1 sm=1 tr=0 a=uGjuzT6u7JdBDS7kH8taPg==:117 a=uGjuzT6u7JdBDS7kH8taPg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=g0By5FnHFSSzutFJYmsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 02:05:28 -0000 On Wed, 12 Oct 2016, Ed Maste wrote: > Log: > Add comment on use of abort() in libc > > Suggested by: jonathan (in review D8133) It is almost easier to fix the bugs than add the comment. > Modified: head/lib/libc/gen/arc4random.c > ============================================================================== > --- head/lib/libc/gen/arc4random.c Wed Oct 12 13:51:41 2016 (r307147) > +++ head/lib/libc/gen/arc4random.c Wed Oct 12 13:56:14 2016 (r307148) > @@ -144,8 +144,15 @@ arc4_stir(void) > arc4_init(); > rs_initialized = 1; > } > - if (arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) > - abort(); /* Random sysctl cannot fail. */ > + if (arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) { > + /* > + * The sysctl cannot fail. If it does fail on some FreeBSD > + * derivative or after some future change, just abort so that > + * the problem will be found and fixed. abort is not normally > + * suitable for a library but makes sense here. > + */ > + abort(); > + } The comment starts by being just wrong: 1. "The" sysctl is not used here. Instead, a wrapper arc4_sysctl() is used. The wrapper handles some but not all errors. 2. The sysctl can and does fail. It fails on: - all old kernels mixed with new userlands - with new kernels, at boot time, before the random device is seeded. I couldn't get this to happen in practice, but it used to be a large problem ("Dance fandago on keyboard to unblock"), and source code still has large warnings about it. Apparently des's preseeding based on device attach times fixes it for me. I use the new kernels with 3. The sysctl can, or at least used to, return short reads with nonzero counts. The documentation for this is well hidden, but the arc4_sysctl() wrapper exists to support short reads, or perhaps just the special case of short reads of 0, which it handles poorly by possibly spinning forever. I couldn't get this to happen either. I think it takes O_NONBLOCK. With interrupts but without O_NONBLOCK, I just got nice denial of service attacks with simple dd tests like "dd bs=200m silently truncates to 256 bytes. Then the excuse is wrong. abort() never makes sense in library functions. Here it gives very confusing errors for the delicate boot-time fandago case. Style bugs: - sentence breaks are 2 spaces in KNF, and all old code in this file follows that rule. - 'abort' is not marked up > arc4_addrandom(rdat, KEYSIZE); > > > Modified: head/lib/libc/stdlib/random.c > ============================================================================== > --- head/lib/libc/stdlib/random.c Wed Oct 12 13:51:41 2016 (r307147) > +++ head/lib/libc/stdlib/random.c Wed Oct 12 13:56:14 2016 (r307148) > @@ -279,8 +279,15 @@ srandomdev(void) > > mib[0] = CTL_KERN; > mib[1] = KERN_ARND; > - if (sysctl(mib, 2, state, &len, NULL, 0) == -1 || len != expected) > + if (sysctl(mib, 2, state, &len, NULL, 0) == -1 || len != expected) { > + /* > + * The sysctl cannot fail. If it does fail on some FreeBSD This is even more broken, since it doesn't have the wrapper. All the old versions using [_]read() mishandled short reads, but this was less broken when there was a fallback. For some reason the sysctl wrapper in arc4random.c alone handled short reads. > + * derivative or after some future change, just abort so that > + * the problem will be found and fixed. abort is not normally > + * suitable for a library but makes sense here. > + */ > abort(); > + } > > if (rand_type != TYPE_0) { > fptr = &state[rand_sep]; There are also gratuitous namespace differences and bugs. arc4random() is less standard than random(), so it can use sysctl() without being technically broken by namespace pollution. But it uses __sysctl(), and has style bugs to declare this. OTOH, random() is now standard in POSIX, so it has a reason to use __sysctl(), but it just uses sysctl(). Both should use _sysctlbyname(), and this should be declared in namespace.h. Old code used _read() instead of read(), but that seems to be nonsense since read() is more standard than random(). The old code with the fallback to read() was not wrong (except for the missing short read heandling). It gave portability to old kernels. If the sysctl were documented, then I think its documentation would say that it acts like a special case of read (without O_NONBLOCK or EINTR handling), perhaps on a slightly different device than /dev/random, except for some technical differences for error reporting. So the read() is just as secure as the sysctl. But with no documentation, we can't tell what the differences are. Bruce From owner-svn-src-head@freebsd.org Thu Oct 13 02:06:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B316AC0EF8E; Thu, 13 Oct 2016 02:06:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76047C7E; Thu, 13 Oct 2016 02:06:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9D26Nik092465; Thu, 13 Oct 2016 02:06:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D26NV4092463; Thu, 13 Oct 2016 02:06:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201610130206.u9D26NV4092463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 13 Oct 2016 02:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307163 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 02:06:24 -0000 Author: cem Date: Thu Oct 13 02:06:23 2016 New Revision: 307163 URL: https://svnweb.freebsd.org/changeset/base/307163 Log: kern_linker: Handle module-loading failures in preloaded .ko files The runtime kernel loader, linker_load_file, unloads kernel files that failed to load all of their modules. For consistency, treat preloaded (loader.conf loaded) kernel files in the same way. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8200 Modified: head/sys/kern/kern_linker.c head/sys/sys/linker.h Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Oct 13 01:58:49 2016 (r307162) +++ head/sys/kern/kern_linker.c Thu Oct 13 02:06:23 2016 (r307163) @@ -1599,7 +1599,6 @@ restart: if (error) panic("cannot add dependency"); } - lf->userrefs++; /* so we can (try to) kldunload it */ error = linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, NULL); if (!error) { @@ -1637,6 +1636,8 @@ restart: goto fail; } linker_file_register_modules(lf); + if (!TAILQ_EMPTY(&lf->modules)) + lf->flags |= LINKER_FILE_MODULES; if (linker_file_lookup_set(lf, "sysinit_set", &si_start, &si_stop, NULL) == 0) sysinit_add(si_start, si_stop); @@ -1654,6 +1655,41 @@ fail: SYSINIT(preload, SI_SUB_KLD, SI_ORDER_MIDDLE, linker_preload, 0); /* + * Handle preload files that failed to load any modules. + */ +static void +linker_preload_finish(void *arg) +{ + linker_file_t lf, nlf; + + sx_xlock(&kld_sx); + TAILQ_FOREACH_SAFE(lf, &linker_files, link, nlf) { + /* + * If all of the modules in this file failed to load, unload + * the file and return an error of ENOEXEC. (Parity with + * linker_load_file.) + */ + if ((lf->flags & LINKER_FILE_MODULES) != 0 && + TAILQ_EMPTY(&lf->modules)) { + linker_file_unload(lf, LINKER_UNLOAD_FORCE); + continue; + } + + lf->flags &= ~LINKER_FILE_MODULES; + lf->userrefs++; /* so we can (try to) kldunload it */ + } + sx_xunlock(&kld_sx); +} + +/* + * Attempt to run after all DECLARE_MODULE SYSINITs. Unfortunately they can be + * scheduled at any subsystem and order, so run this as late as possible. init + * becomes runnable in SI_SUB_KTHREAD_INIT, so go slightly before that. + */ +SYSINIT(preload_finish, SI_SUB_KTHREAD_INIT - 100, SI_ORDER_MIDDLE, + linker_preload_finish, 0); + +/* * Search for a not-loaded module by name. * * Modules may be found in the following locations: Modified: head/sys/sys/linker.h ============================================================================== --- head/sys/sys/linker.h Thu Oct 13 01:58:49 2016 (r307162) +++ head/sys/sys/linker.h Thu Oct 13 02:06:23 2016 (r307163) @@ -73,6 +73,7 @@ struct linker_file { int userrefs; /* kldload(2) count */ int flags; #define LINKER_FILE_LINKED 0x1 /* file has been fully linked */ +#define LINKER_FILE_MODULES 0x2 /* file has >0 modules at preload */ TAILQ_ENTRY(linker_file) link; /* list of all loaded files */ char* filename; /* file which was loaded */ char* pathname; /* file name with full path */ From owner-svn-src-head@freebsd.org Thu Oct 13 03:22:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88F2C0E887 for ; Thu, 13 Oct 2016 03:22:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 707027C for ; Thu, 13 Oct 2016 03:22:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id o19so71807353ito.1 for ; Wed, 12 Oct 2016 20:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=kaGP9Vycd+ebFXtEJ4m+IdRISWdg7vnsKPEs/Dzvr5o=; b=LPczsdQXycZy1LM+zO8pdlEG815kR6j31gR1u3O4P5IbS7P01jrzXSZudS7AREapBA dkGNzVuCUBOUTYYNMfW+iwtgzWNJkdQ+PRYel5sMbqwv1T3oXOsWjEsY4Z+LEEQO4UuF txbrVlXtIHmZDLnItSJYTqktCl/pWL5wTCxCfy2LA/3/WRhx3nPbdQ5aTseuMU3DpZz2 TYiuFifvdMzbRoptXwAYBsoiWG6gBA8gOa0ZQTl+4K2Fvj5tqfvZizKCA5k/3BOKyh7f 4H+MZyy8/UgXKP0vVOm39Y2McmvNeU25Lje4/BRzoXI6NZkWpJBMPS0A543ofCoMmNFl wdmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=kaGP9Vycd+ebFXtEJ4m+IdRISWdg7vnsKPEs/Dzvr5o=; b=dc5BWOMuHAY+vH0dQN0M/qQfT+8jCOLzWTdjd6jFHa1nENyFamNqeGmSpBht2JyUYE pXbCxst958N4V9EcQ3X5Zkd9UYW82/te8Hj5tS2ZdTyHskKu3QIJkNg0VVg3HOVM/5yr x4zcNPfeCWSk5bNyyOI8ByB+EXtqA2qwPOXqTha/lasUrOo/K1ZHIBWGrZknsLAYXpJK qF3azNmjtC+CEuyFJNHiAp6vmUuS/Oqs3CKnGc767Vaqcfu+uPnr3pNBkReUFMS+8JMj XG61c1LVluBpmqAtG8yTAU04/FP9kOtTm+6pAQ+BH8BU/GlyQOJcPKd4x0Z87ESmmGwI mVtg== X-Gm-Message-State: AA6/9RnvT1XxKGwmpgeORi+7UngiXU+7tYO0w6j/cVcD8WNXkaCURnVOtGDYTg+1L5u/VbHFqCps4mclRgdsHw== X-Received: by 10.36.19.147 with SMTP id 141mr5567929itz.85.1476328928778; Wed, 12 Oct 2016 20:22:08 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Wed, 12 Oct 2016 20:22:08 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20161012114920.GU68202@kib.kiev.ua> References: <201610112224.u9BMOUlp053188@repo.freebsd.org> <20161012114920.GU68202@kib.kiev.ua> From: Warner Losh Date: Wed, 12 Oct 2016 21:22:08 -0600 X-Google-Sender-Auth: u6LAcOIQOUGx52tmafsOfAYTQMI Message-ID: Subject: Re: svn commit: r307070 - in head/sys: amd64/amd64 conf dev/efidev i386/include modules/efirt sys To: Konstantin Belousov , "svn-src-all@freebsd.org" Cc: Warner Losh , src-committers , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 03:22:09 -0000 Yea, I'd made most of those changes in git and lost them :( Warner On Wed, Oct 12, 2016 at 5:49 AM, Konstantin Belousov wrote: > On Tue, Oct 11, 2016 at 10:24:30PM +0000, Warner Losh wrote: > >> Added: head/sys/dev/efidev/efidev.c >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/dev/efidev/efidev.c Tue Oct 11 22:24:30 2016 (r307070) >> @@ -0,0 +1,199 @@ >> +/*- >> + * Copyright (c) 2016 Netflix, Inc. >> + * All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer >> + * in this position and unchanged. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in the >> + * documentation and/or other materials provided with the distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR >> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES >> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. >> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, >> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT >> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >> + */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include > As I asked in review, please use , not > >> +#include >> + >> +static d_ioctl_t efidev_ioctl; >> + >> +static struct cdevsw efi_cdevsw = { >> + .d_name = "efi", >> + .d_version = D_VERSION, >> + .d_ioctl = efidev_ioctl, >> +}; >> + >> +/* ARGSUSED */ >> +static int >> +efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, >> + int flags __unused, struct thread *td __unused) >> +{ >> + int error; >> + >> + switch (cmd) { >> + case EFIIOC_GET_TABLE: >> + { >> + struct efi_get_table_ioc *egtioc = >> + (struct efi_get_table_ioc *)addr; >> + >> + error = efi_get_table(&egtioc->uuid, &egtioc->ptr); >> + break; >> + } >> + case EFIIOC_GET_TIME: >> + { >> + struct efi_tm *tm = (struct efi_tm *)addr; >> + >> + error = efi_get_time(tm); >> + break; >> + } >> + case EFIIOC_SET_TIME: >> + { >> + struct efi_tm *tm = (struct efi_tm *)addr; >> + >> + error = efi_set_time(tm); >> + break; >> + } >> + case EFIIOC_VAR_GET: >> + { >> + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; >> + void *data; >> + efi_char *name; >> + >> + data = malloc(ev->datasize, M_TEMP, M_WAITOK); >> + name = malloc(ev->namesize, M_TEMP, M_WAITOK); >> + error = copyin(ev->name, name, ev->namesize); >> + if (error) >> + goto vg_out; >> + if (name[ev->namesize / sizeof(efi_char) - 1] != 0) { >> + error = EINVAL; >> + goto vg_out; >> + } >> + >> + error = efi_var_get(name, &ev->vendor, &ev->attrib, >> + &ev->datasize, data); >> + >> + if (error == 0) { >> + error = copyout(data, ev->data, ev->datasize); >> + } else if (error == EOVERFLOW) { >> + /* >> + * Pass back the size we really need, but >> + * convert the error to 0 so the copyout >> + * happens. datasize was updated in the >> + * efi_var_get call. >> + */ >> + ev->data = NULL; >> + error = 0; >> + } >> +vg_out: >> + free(data, M_TEMP); >> + free(name, M_TEMP); >> + break; >> + } >> + case EFIIOC_VAR_NEXT: >> + { >> + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; >> + efi_char *name; >> + >> + name = malloc(ev->namesize, M_TEMP, M_WAITOK); >> + if (name == NULL) { > The check is for impossible condition. > >> + error = ENOMEM; >> + goto vn_out; >> + } >> + error = copyin(ev->name, name, ev->namesize); >> + if (error) >> + goto vn_out; >> + /* Note: namesize is the buffer size, not the string lenght */ >> + >> + error = efi_var_nextname(&ev->namesize, name, &ev->vendor); >> + if (error == 0) { >> + error = copyout(name, ev->name, ev->namesize); >> + } else if (error == EOVERFLOW) { >> + ev->name = NULL; >> + error = 0; >> + } >> + vn_out: >> + if (name != NULL) > The check is redundand. > >> + free(name, M_TEMP); >> + break; >> + } >> + case EFIIOC_VAR_SET: >> + { >> + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; >> + void *data = NULL; >> + efi_char *name; >> + >> + /* datasize == 0 -> delete (more or less) */ >> + if (ev->datasize > 0) >> + data = malloc(ev->datasize, M_TEMP, M_WAITOK); >> + name = malloc(ev->namesize, M_TEMP, M_WAITOK); >> + if (ev->datasize) { >> + error = copyin(ev->data, data, ev->datasize); >> + if (error) >> + goto vs_out; >> + } >> + error = copyin(ev->name, name, ev->namesize); >> + if (error) >> + goto vs_out; >> + if (name[ev->namesize / sizeof(efi_char) - 1] != 0) { >> + error = EINVAL; >> + goto vs_out; >> + } >> + >> + error = efi_var_set(name, &ev->vendor, ev->attrib, ev->datasize, >> + data); >> +vs_out: >> + if (data != NULL) > The check is redundand. > >> + free(data, M_TEMP); >> + free(name, M_TEMP); >> + break; >> + } >> + default: >> + error = ENOTTY; >> + break; >> + } >> + >> + return (error); >> +} >> + >> +int >> +efidev_init(struct cdev **cdev) >> +{ >> + >> + *cdev = make_dev(&efi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0700, >> + "efidev"); > It is still "/dev/efidev". Please rename as discussed. > >> + >> + return (0); >> +} >> + >> +int >> +efidev_uninit(struct cdev *cdev) >> +{ >> + >> + destroy_dev(cdev); >> + >> + return (0); >> +} >> >> Added: head/sys/i386/include/efi.h >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/i386/include/efi.h Tue Oct 11 22:24:30 2016 (r307070) >> @@ -0,0 +1,39 @@ >> +/*- >> + * Copyright (c) 2016 The FreeBSD Foundation >> + * All rights reserved. >> + * >> + * This software was developed by Konstantin Belousov >> + * under sponsorship from the FreeBSD Foundation. > It was not. > >> + * >> + * 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 __I386_INCLUDE_EFI_H_ >> +#define __I386_INCLUDE_EFI_H_ >> + >> +#define EFIABI_ATTR /* __attribute__((ms_abi)) */ /* clang fails with this */ >> + >> +/* Note: we don't actually support this on i386 yet */ >> + >> +#endif /* __I386_INCLUDE_EFI_H_ */ From owner-svn-src-head@freebsd.org Thu Oct 13 06:19:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9845C0FE49; Thu, 13 Oct 2016 06:19:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A2E0FE2; Thu, 13 Oct 2016 06:19:55 +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 u9D6JsvV088688; Thu, 13 Oct 2016 06:19:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D6JsMd088686; Thu, 13 Oct 2016 06:19:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610130619.u9D6JsMd088686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 13 Oct 2016 06:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307182 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 06:19:55 -0000 Author: avg Date: Thu Oct 13 06:19:54 2016 New Revision: 307182 URL: https://svnweb.freebsd.org/changeset/base/307182 Log: rc.d/zfsbe: a new script designed for boot environment support Currently zfsbe ensures that subordinate filesystems are mounted at the right mount points. The script assumes that the subordinate filesystems of a boot environment have their canmount property set to noauto, so that they are not automatically mounted on boot. Whereas the root filesystem is mounted by the kernel, there was nothing to mount its subordinates. rc.d/zfsbe fills that gap. Discussed with: allanjude, will MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D7797 Added: head/etc/rc.d/zfsbe (contents, props changed) Modified: head/etc/rc.d/zfs Modified: head/etc/rc.d/zfs ============================================================================== --- head/etc/rc.d/zfs Thu Oct 13 06:17:33 2016 (r307181) +++ head/etc/rc.d/zfs Thu Oct 13 06:19:54 2016 (r307182) @@ -4,7 +4,7 @@ # # PROVIDE: zfs -# REQUIRE: mountcritlocal +# REQUIRE: zfsbe # BEFORE: FILESYSTEMS var . /etc/rc.subr Added: head/etc/rc.d/zfsbe ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/zfsbe Thu Oct 13 06:19:54 2016 (r307182) @@ -0,0 +1,71 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: zfsbe +# REQUIRE: mountcritlocal + +# Handle boot environment subordinate filesystems +# that may have canmount property set to noauto. +# For these filesystems mountpoint relative to / +# must be the same as their dataset name relative +# to BE root dataset. + +. /etc/rc.subr + +name="zfsbe" +rcvar="zfs_enable" +start_cmd="be_start" +stop_cmd="be_stop" +required_modules="zfs" + +mount_subordinate() +{ + local _be + + _be=$1 + zfs list -rH -o mountpoint,name,canmount,mounted -s mountpoint -t filesystem $_be | \ + while read _mp _name _canmount _mounted ; do + # skip filesystems that must not be mounted + [ "$_canmount" = "off" ] && continue + # skip filesystems that are already mounted + [ "$_mounted" = "yes" ] && continue + case "$_mp" in + "none" | "legacy" | "/" | "/$_be") + # do nothing for filesystems with unset or legacy mountpoint + # or those that would be mounted over / + ;; + "/$_be/"*) + # filesystems with mountpoint relative to BE + mount -t zfs $_name ${_mp#/$_be} + ;; + *) + # filesystems with mountpoint elsewhere + zfs mount $_name + ;; + esac + done +} + +be_start() +{ + if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + : + else + mount -p | while read _dev _mp _type _rest; do + [ $_mp = "/" ] || continue + if [ $_type = "zfs" ] ; then + mount_subordinate $_dev + fi + break + done + fi +} + +be_stop() +{ +} + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-head@freebsd.org Thu Oct 13 06:56:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A5F7C0FB70; Thu, 13 Oct 2016 06:56:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 671701C48; Thu, 13 Oct 2016 06:56:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9D6uOh7003978; Thu, 13 Oct 2016 06:56:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D6uNUa003963; Thu, 13 Oct 2016 06:56:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610130656.u9D6uNUa003963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 13 Oct 2016 06:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307189 - in head: lib lib/libefivar sys/arm/include sys/arm64/include sys/dev/efidev sys/i386/include sys/mips/include sys/pc98/include sys/powerpc/include sys/riscv/include sys/sparc6... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 06:56:25 -0000 Author: imp Date: Thu Oct 13 06:56:23 2016 New Revision: 307189 URL: https://svnweb.freebsd.org/changeset/base/307189 Log: Fix building on i386 and arm. But 'public domain' headers on the files with no creative content. Include "lost" changes from git: o Use /dev/efi instead of /dev/efidev o Remove redundant NULL checks. Submitted by: kib@, dim@, zbb@, emaste@ Modified: head/lib/Makefile head/lib/libefivar/efivar.c head/sys/arm/include/efi.h head/sys/arm64/include/efi.h head/sys/dev/efidev/efidev.c head/sys/i386/include/efi.h head/sys/mips/include/efi.h head/sys/pc98/include/efi.h head/sys/powerpc/include/efi.h head/sys/riscv/include/efi.h head/sys/sparc64/include/efi.h head/usr.sbin/Makefile head/usr.sbin/efivar/efivar.8 head/usr.sbin/efivar/efivar.c Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Oct 13 06:55:51 2016 (r307188) +++ head/lib/Makefile Thu Oct 13 06:56:23 2016 (r307189) @@ -241,7 +241,7 @@ _libcxxrt= libcxxrt _libcplusplus= libc++ .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MK_EFI} != "no" _libefivar= libefivar .endif Modified: head/lib/libefivar/efivar.c ============================================================================== --- head/lib/libefivar/efivar.c Thu Oct 13 06:55:51 2016 (r307188) +++ head/lib/libefivar/efivar.c Thu Oct 13 06:56:23 2016 (r307189) @@ -108,7 +108,7 @@ efi_open_dev(void) { if (efi_fd == -2) - efi_fd = open("/dev/efidev", O_RDWR); + efi_fd = open("/dev/efi", O_RDWR); if (efi_fd < 0) efi_fd = -1; else Modified: head/sys/arm/include/efi.h ============================================================================== --- head/sys/arm/include/efi.h Thu Oct 13 06:55:51 2016 (r307188) +++ head/sys/arm/include/efi.h Thu Oct 13 06:56:23 2016 (r307189) @@ -1,30 +1,5 @@ /*- - * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Konstantin Belousov - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain since it's just boilerplate. * * $FreeBSD$ */ Modified: head/sys/arm64/include/efi.h ============================================================================== --- head/sys/arm64/include/efi.h Thu Oct 13 06:55:51 2016 (r307188) +++ head/sys/arm64/include/efi.h Thu Oct 13 06:56:23 2016 (r307189) @@ -1,30 +1,5 @@ /*- - * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Konstantin Belousov - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain since it's just boilerplate. * * $FreeBSD$ */ Modified: head/sys/dev/efidev/efidev.c ============================================================================== --- head/sys/dev/efidev/efidev.c Thu Oct 13 06:55:51 2016 (r307188) +++ head/sys/dev/efidev/efidev.c Thu Oct 13 06:56:23 2016 (r307189) @@ -119,10 +119,6 @@ vg_out: efi_char *name; name = malloc(ev->namesize, M_TEMP, M_WAITOK); - if (name == NULL) { - error = ENOMEM; - goto vn_out; - } error = copyin(ev->name, name, ev->namesize); if (error) goto vn_out; @@ -136,8 +132,7 @@ vg_out: error = 0; } vn_out: - if (name != NULL) - free(name, M_TEMP); + free(name, M_TEMP); break; } case EFIIOC_VAR_SET: @@ -166,8 +161,7 @@ vg_out: error = efi_var_set(name, &ev->vendor, ev->attrib, ev->datasize, data); vs_out: - if (data != NULL) - free(data, M_TEMP); + free(data, M_TEMP); free(name, M_TEMP); break; } @@ -184,7 +178,7 @@ efidev_init(struct cdev **cdev) { *cdev = make_dev(&efi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0700, - "efidev"); + "efi"); return (0); } Modified: head/sys/i386/include/efi.h ============================================================================== --- head/sys/i386/include/efi.h Thu Oct 13 06:55:51 2016 (r307188) +++ head/sys/i386/include/efi.h Thu Oct 13 06:56:23 2016 (r307189) @@ -1,30 +1,5 @@ /*- - * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Konstantin Belousov - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain since it's just boilerplate. * * $FreeBSD$ */ Modified: head/sys/mips/include/efi.h ============================================================================== --- head/sys/mips/include/efi.h Thu Oct 13 06:55:51 2016 (r307188) +++ head/sys/mips/include/efi.h Thu Oct 13 06:56:23 2016 (r307189) @@ -1,30 +1,5 @@ /*- - * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Konstantin Belousov - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain since it's just boilerplate. * * $FreeBSD$ */ Modified: head/sys/pc98/include/efi.h ============================================================================== --- head/sys/pc98/include/efi.h Thu Oct 13 06:55:51 2016 (r307188) +++ head/sys/pc98/include/efi.h Thu Oct 13 06:56:23 2016 (r307189) @@ -1,30 +1,5 @@ /*- - * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Konstantin Belousov - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain since it's just boilerplate. * * $FreeBSD$ */ Modified: head/sys/powerpc/include/efi.h ============================================================================== --- head/sys/powerpc/include/efi.h Thu Oct 13 06:55:51 2016 (r307188) +++ head/sys/powerpc/include/efi.h Thu Oct 13 06:56:23 2016 (r307189) @@ -1,30 +1,5 @@ /*- - * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Konstantin Belousov - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain since it's just boilerplate. * * $FreeBSD$ */ Modified: head/sys/riscv/include/efi.h ============================================================================== --- head/sys/riscv/include/efi.h Thu Oct 13 06:55:51 2016 (r307188) +++ head/sys/riscv/include/efi.h Thu Oct 13 06:56:23 2016 (r307189) @@ -1,30 +1,5 @@ /*- - * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Konstantin Belousov - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain since it's just boilerplate. * * $FreeBSD$ */ Modified: head/sys/sparc64/include/efi.h ============================================================================== --- head/sys/sparc64/include/efi.h Thu Oct 13 06:55:51 2016 (r307188) +++ head/sys/sparc64/include/efi.h Thu Oct 13 06:56:23 2016 (r307189) @@ -1,30 +1,5 @@ /*- - * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Konstantin Belousov - * under sponsorship from the FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain since it's just boilerplate. * * $FreeBSD$ */ Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Oct 13 06:55:51 2016 (r307188) +++ head/usr.sbin/Makefile Thu Oct 13 06:56:23 2016 (r307189) @@ -123,7 +123,7 @@ SUBDIR.${MK_BSNMP}+= bsnmpd SUBDIR.${MK_CTM}+= ctm SUBDIR.${MK_DIALOG}+= tzsetup SUBDIR.${MK_DIALOG}+= bsdconfig -#SUBDIR.${MK_EFI}+= efivar +SUBDIR.${MK_EFI}+= efivar SUBDIR.${MK_FLOPPY}+= fdcontrol SUBDIR.${MK_FLOPPY}+= fdformat SUBDIR.${MK_FLOPPY}+= fdread Modified: head/usr.sbin/efivar/efivar.8 ============================================================================== --- head/usr.sbin/efivar/efivar.8 Thu Oct 13 06:55:51 2016 (r307188) +++ head/usr.sbin/efivar/efivar.8 Thu Oct 13 06:56:23 2016 (r307189) @@ -10,10 +10,10 @@ .\" 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" 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 REGENTS OR CONTRIBUTORS BE LIABLE +.\" 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) Modified: head/usr.sbin/efivar/efivar.c ============================================================================== --- head/usr.sbin/efivar/efivar.c Thu Oct 13 06:55:51 2016 (r307188) +++ head/usr.sbin/efivar/efivar.c Thu Oct 13 06:56:23 2016 (r307189) @@ -11,10 +11,10 @@ * 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 NETAPP, INC ``AS IS'' AND + * 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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * 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) From owner-svn-src-head@freebsd.org Thu Oct 13 07:02:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB212C0FD04; Thu, 13 Oct 2016 07:02:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 750F0AE; Thu, 13 Oct 2016 07:02:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9D72srF007581; Thu, 13 Oct 2016 07:02:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D72sgd007580; Thu, 13 Oct 2016 07:02:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610130702.u9D72sgd007580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 13 Oct 2016 07:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307190 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:02:55 -0000 Author: ngie Date: Thu Oct 13 07:02:54 2016 New Revision: 307190 URL: https://svnweb.freebsd.org/changeset/base/307190 Log: Skip :uchg on FreeBSD Unfortunately removing files with uchg set always succeeds with root on FreeBSD. Unfortunately running the test as an unprivileged user isn't doable because mounting tmpfs requires root PR: 212861 Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 06:56:23 2016 (r307189) +++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 07:02:54 2016 (r307190) @@ -53,6 +53,10 @@ uchg_head() { atf_set "require.user" "root" } uchg_body() { + # Begin FreeBSD + atf_skip "this fails on FreeBSD with root - bug 212861" + # End FreeBSD + test_mount atf_check -s eq:0 -o empty -e empty touch a From owner-svn-src-head@freebsd.org Thu Oct 13 07:05:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5A35C0FE78 for ; Thu, 13 Oct 2016 07:05:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC119327 for ; Thu, 13 Oct 2016 07:05:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id l13so171777087itl.1 for ; Thu, 13 Oct 2016 00:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rOCsmo+Zk/z9Bvkk3FnpHDaoT/gUh6sxinDgCfZc5bw=; b=F/0TGoeE6Tc5mR0F8sq1bQpt9UGNAxQq4AUUwIcs978qux8wZiLwUMAv11A8sjFF2N SvZulj1OqvJByftNg6eBlfUJkzZ7nnlz3noyfKC+HFY9q9TyE3th+IYIW63cqFF55Vex GJEc9q5Jy+kvsCYD2hKazuRMb7F6k6o1PWqXaYFzGSb2DjxlIwiqXDGNHwdEvi/8DnkM biBL7uAHD+zKV7tQdNn7oAo/0zzp2Jj/bfzk4esJEJbvw8TcpfeAI5SxJ/lE5D0ISld8 cy7G3l9TBLs+Hlw4nvP1Q7IoFAPFcIBstvoq+jq3WpU+PmjtoeKL1LREIP8zmbScsJzs mJsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rOCsmo+Zk/z9Bvkk3FnpHDaoT/gUh6sxinDgCfZc5bw=; b=IIlm78p0hvOoXaaEzmOnQQInAP9+jljNFDjVq0HZAmWymKnER++JNC8d6T6CpNf7fG pVFQpNmloRKs14L5jGwRRVhHprs7tc7Y+1Cii/IDQ2QzZozdAmqmZlF6N6YLY721AGgW 0oF7txQdHNRvGF2VptuDDkh5ZB/KMX/7AV/nuk0hz8hA3wvZlx/QcpbA0nyfRqJ+k1ic gLku21pb/674NSkbqgjHxE8O4HhCqfP8nBBEdwEaLm27LhdHafkHb1DhMWRmBAUGhqfJ /CmB/ArfB76QudgXw7D7lXXEBEwo7or1rAHl5nKS3HkJoll2Dl9MUPyNmdJxDlQ2NOj3 oXFw== X-Gm-Message-State: AA6/9RkwNuOeFEYzHpIV9v5HVpp8ATi58m+G3N4mnI2G7HUQLDkLW1dZ5P8QmMMT95+Z/d+31iwwPH9mBu/Jsw== X-Received: by 10.36.53.214 with SMTP id k205mr5056945ita.85.1476342305076; Thu, 13 Oct 2016 00:05:05 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Thu, 13 Oct 2016 00:05:04 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201610122341.u9CNf2qO056708@slippy.cwsent.com> From: Warner Losh Date: Thu, 13 Oct 2016 01:05:04 -0600 X-Google-Sender-Auth: CuHy_nE4uMwrjHSvFjvjcsQ3C30 Message-ID: Subject: Re: svn commit: r307072 - in head/usr.sbin: . efivar To: Cy Schubert Cc: Ed Maste , Zbigniew Bodek , Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:05:06 -0000 All these issues should be fixed. Sorry for the mixup. I'm learning git and mis-merged trees from two different laptops :(. Warner On Wed, Oct 12, 2016 at 6:22 PM, Warner Losh wrote: > I'll look into it. It worked just fine for me for all the builds I did > on many different machines. Ugg. > > Warner > > On Wed, Oct 12, 2016 at 5:41 PM, Cy Schubert wrote: >> In message > om> >> , Ed Maste writes: >>> On 12 October 2016 at 12:55, Zbigniew Bodek wrote: >>> > Hello Warner, >>> > >>> > Did you try to build world for ARMv6 on HEAD? I'm not able to do so and the >>> > issues seems to be related to this commit (missing efivar.h file). >>> >>> Indeed, my tinderbox build failed for arm.arm, arm.armeb, arm.armv6, >>> arm64.aarch64, pc98.i386, i386.i386 with >>> >>> /scratch/tmp/emaste/freebsd/usr.sbin/efivar/efivar.c:31:10: fatal >>> error: 'efivar.h' file not found >>> #include >>> ^ >>> >>> I temporarily unhooked it from the build in r307157. >>> >>> >> >> I had the same on amd64. >> >> >> -- >> 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 Oct 13 07:10:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7291FC0FEFF; Thu, 13 Oct 2016 07:10:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42637777; Thu, 13 Oct 2016 07:10:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9D7ARPp007927; Thu, 13 Oct 2016 07:10:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D7ARZa007926; Thu, 13 Oct 2016 07:10:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610130710.u9D7ARZa007926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 13 Oct 2016 07:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307191 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:10:28 -0000 Author: ngie Date: Thu Oct 13 07:10:27 2016 New Revision: 307191 URL: https://svnweb.freebsd.org/changeset/base/307191 Log: Install etc/rc.d/zfsbe when MK_ZFS != no X-MFC with: r307182 Sponsored by: Dell EMC Isilon Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Thu Oct 13 07:02:54 2016 (r307190) +++ head/etc/rc.d/Makefile Thu Oct 13 07:10:27 2016 (r307191) @@ -314,6 +314,7 @@ FILES+= wpa_supplicant .if ${MK_ZFS} != "no" FILESGROUPS+= ZFS ZFS+= zfs +ZFS+= zfsbe ZFS+= zfsd ZFS+= zvol ZFSPACKAGE= zfs From owner-svn-src-head@freebsd.org Thu Oct 13 07:12:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19944C0F0A1; Thu, 13 Oct 2016 07:12:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC787A35; Thu, 13 Oct 2016 07:12:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9D7CK8w011335; Thu, 13 Oct 2016 07:12:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D7CKvt011334; Thu, 13 Oct 2016 07:12:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610130712.u9D7CKvt011334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 13 Oct 2016 07:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307192 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:12:22 -0000 Author: ngie Date: Thu Oct 13 07:12:20 2016 New Revision: 307192 URL: https://svnweb.freebsd.org/changeset/base/307192 Log: Also, remove etc/rc.d/zfsbe when MK_ZFS == no X-MFC with: r307182, r307191 Sponsored by: Dell EMC Isilon Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Oct 13 07:10:27 2016 (r307191) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Oct 13 07:12:20 2016 (r307192) @@ -1089,6 +1089,7 @@ OLD_FILES+=boot/gptzfsboot OLD_FILES+=boot/zfsboot OLD_FILES+=boot/zfsloader OLD_FILES+=etc/rc.d/zfs +OLD_FILES+=etc/rc.d/zfsbe OLD_FILES+=etc/rc.d/zvol OLD_FILES+=etc/devd/zfs.conf OLD_FILES+=etc/periodic/daily/404.status-zfs From owner-svn-src-head@freebsd.org Thu Oct 13 07:12:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53ACEC0F0FE; Thu, 13 Oct 2016 07:12:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x243.google.com (mail-pa0-x243.google.com [IPv6:2607:f8b0:400e:c03::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 267C4C7E; Thu, 13 Oct 2016 07:12:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x243.google.com with SMTP id qn10so4378703pac.2; Thu, 13 Oct 2016 00:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=O9YQUZ2b5M6bplzmbKyCU1qe+peGtc0crJxb/XoMal8=; b=hq6vSjRHx5xgQFTd8qdaPXhcpjZ++SKklG0bu10tVUZtUOAy5z5hXHTH3PNulvOia6 JcGLb8qWX+BYE4FMfdcK8aS3WmVzFzJ0ogUvBGZ74EFGlAVBV7qUqGdd54PsBA2Cy5x9 JoHVApaVKzAGSOLm9PCVaOyix0duS/C+FGrXvVUXdvF4iGwp2RFnZ6tgCXx5mtNx4oII WJ1ow9w+ApXH03w3lXNmDZGmN6OCddnBwnmoDu9429aIs0I1uSRCZjqf5EzaNZf7/Sg9 BmC3hRPOAmWTvFcbHzsE+7qmKGHdO9HTmv6AStokX2NvLWyjPpJP7FGKzXMKi0arqKFJ GfKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=O9YQUZ2b5M6bplzmbKyCU1qe+peGtc0crJxb/XoMal8=; b=Bj1VqCwDh5LHQh7rQaBk59R/3etknyJuMpHPZ2sR/NrI2nAMEZ2dIgrPTBu+JYPEXm 6+dqLAt2YNgk2yK7cj9ZGRCBsFKiRQMF0+bcKMAOWvFcgUxJmL5QHYSaNMN8TkWDhvlm Z1OCW4/iGz9X0kjrVLoF3CqKfqKVx6dqASpWr0dr9UNg17IsKTCeialdPflfVkivL1UO g6dgkIlfL5MbGfF7E1H9cOdHyBHGJ+gCmcnk3nMBcC4rE/G0PivKd0z/j5kaVx5lweE1 9kFDcr0+0jWyie6p+8P78xppuERA3IGVyT6TIuwLSvrNLE9ihfgrwfgdhVgd25CBUnMm ouzg== X-Gm-Message-State: AA6/9Rkb8fGWcFdHEkx0sSAG0P94MHSrYRmSiyC5P33yvXtaFHHttIBizf0ND+Cml61Avw== X-Received: by 10.66.15.134 with SMTP id x6mr6609674pac.171.1476342771558; Thu, 13 Oct 2016 00:12:51 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s6sm16739840pfg.46.2016.10.13.00.12.50 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Oct 2016 00:12:50 -0700 (PDT) Subject: Re: svn commit: r307182 - head/etc/rc.d Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_54297E1D-3029-4543-A475-1E9B91393B50"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201610130619.u9D6JsMd088686@repo.freebsd.org> Date: Thu, 13 Oct 2016 00:12:49 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <27A78442-3CB6-4245-892B-EFACB3860B38@gmail.com> References: <201610130619.u9D6JsMd088686@repo.freebsd.org> To: Andriy Gapon X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:12:52 -0000 --Apple-Mail=_54297E1D-3029-4543-A475-1E9B91393B50 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Oct 12, 2016, at 23:19, Andriy Gapon wrote: > > Author: avg > Date: Thu Oct 13 06:19:54 2016 > New Revision: 307182 > URL: https://svnweb.freebsd.org/changeset/base/307182 > > Log: > rc.d/zfsbe: a new script designed for boot environment support > > Currently zfsbe ensures that subordinate filesystems are mounted at the > right mount points. > The script assumes that the subordinate filesystems of a boot environment > have their canmount property set to noauto, so that they are not > automatically mounted on boot. Whereas the root filesystem is mounted > by the kernel, there was nothing to mount its subordinates. > rc.d/zfsbe fills that gap. > > Discussed with: allanjude, will > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D7797 I committed the Makefile changes in r307191/r307192. Cheers! -Ngie --Apple-Mail=_54297E1D-3029-4543-A475-1E9B91393B50 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJX/zPxAAoJEPWDqSZpMIYVJRAP+wW4UxwFb9pkVOEYCAoqfG3K XpfPv0+hP4CCJghZNxEMetzDM6NjzFvbtaaFNsDn8MkeOMmqkrY7NjW5CKjOiPK3 Aj2SzTzPb7LPAMv/E7T+PLRxuRJqWrZ3S1t0ou22ZSJtOcdvig8RkvxDfOIPMsMh srJrB7UBgeGOEeBa749/oSlGhKxsaxjoz4JsJ7obK+OF6SiBc1ukjRax/AcVDpZy Dan1CiHE2IxPJfUDFQ2B08lpTHHTVDP0aYC1H0EGBHVuru6M7XxHoU3WI0tv6Yw/ bILo8DE/8KZ0HHipwsXXBZ37YXkH1Wr6XxNGGuZ4WmV9s1LpbhSynEmquGILNTTg G4YWIEFDxbiLebLhHvA8dZAwX3RMQGUogcHbomWaxJFF4T6LqXsPryO2cjfxiTUi 5/C33OkYfNk+QNxQ8KkfekWS8LSqWTjf+3/oc8iynNtTndqQlySev2NSRHmpLmTU fnsEA3/x+pRmvXkgMOd1Ls+5bUzv+gqAscjB5vs6TSWjCWSgKCWK+PyUZ/ajpdYU WW9HcVhD5izN8qUNaQNAhBGHQkUhKI6NC4JnN15Sr8z6iVn/YXnRG/kEWkBF81+F 8B0cvZcyR3BSTOj4tiuDTxWo2zyH5E5Orjmq9EUELoMrZpklXOFAAGvzOQNptcCg w+3RibhkJ+3iN2T57fHZ =p5N8 -----END PGP SIGNATURE----- --Apple-Mail=_54297E1D-3029-4543-A475-1E9B91393B50-- From owner-svn-src-head@freebsd.org Thu Oct 13 07:21:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBB74C0F5AE for ; Thu, 13 Oct 2016 07:21:47 +0000 (UTC) (envelope-from julio@meroh.net) Received: from mail-qt0-f178.google.com (mail-qt0-f178.google.com [209.85.216.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FAAB3D1 for ; Thu, 13 Oct 2016 07:21:47 +0000 (UTC) (envelope-from julio@meroh.net) Received: by mail-qt0-f178.google.com with SMTP id f6so34647018qtd.2 for ; Thu, 13 Oct 2016 00:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meroh.net; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gzUAQOFOnkwVkWCkbjrJvbtja6F89WMimYPVqEobAZU=; b=BZr2WxGYHzO5e44WCDPFrRzFphjb+Ju3sJcFFHrm1gi4UMCz6yN9QRk+OBt9muARvi 8C70CHZLp+l6F5t0L27VlBm7gLFgmE037qghexQmYlTMafdx3teFNzuNmPR+XrHXr8o/ y2a6G28Lsewn5taVo7i6dzG0HQo0Is4ZGnc1dyAZeRMqOADb4ID6SMkseLf+YqfeI3bO iM1xrNpEjUEmAhrSHdpGGFm8ZWY51unZKdfmJCdt7T4j21gLhpjod81nDcUTRk0XTuwz jbxwhH9Xdp7g97zWapZ4IA7JOa8sFyQK0tu8lQBTiqaJTNiOvjuB441y0oFci8bDw5ZO iFUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gzUAQOFOnkwVkWCkbjrJvbtja6F89WMimYPVqEobAZU=; b=Qq3/YNzA5J/cDVxpu/ee3/EZm0q2nXh/mi3pvFYUiXBHiALXIlIDUqNKBUzFgeYdXp WiGCMDIgKdr+i9tJ0mJ22k/VhQ+gud5C5z0uwBY9+bwstgZvoh8pSePTVhKoPalbi8Td T6SOaRb/2IfAi5khUuhAKFlLmpIL3j1JzVwBaWvTZsxwC0PxPZNDvyBtUT4CdNtBr5w3 B6Rlj5h/WAj3wpd9q9e/QS0FtEXbjxclv6wyIEgb8vdligW6W93TM/w+f+vGOQgdCKhr JhPW7h4PRJqwnsgIGAe65AoEtL+ujvj0RD5oL7QYVT13aueRLekF2s3MMhBcjG4/iSxu 8Pvg== X-Gm-Message-State: AA6/9RkTtjsCNHvfnquRoqdOg07D94sxJsRZd89TF4KrAUe2pc9nRBOnI2FD0RGSTrjGOEOguNcqSX0a6MHtQQ== X-Received: by 10.200.53.54 with SMTP id y51mr5284482qtb.132.1476343246155; Thu, 13 Oct 2016 00:20:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.56.93 with HTTP; Thu, 13 Oct 2016 00:20:25 -0700 (PDT) X-Originating-IP: [172.26.42.46] In-Reply-To: <201610130702.u9D72sgd007580@repo.freebsd.org> References: <201610130702.u9D72sgd007580@repo.freebsd.org> From: Julio Merino Date: Thu, 13 Oct 2016 03:20:25 -0400 Message-ID: Subject: Re: svn commit: r307190 - head/contrib/netbsd-tests/fs/tmpfs To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:21:47 -0000 On Thu, Oct 13, 2016 at 3:02 AM, Ngie Cooper wrote: > Author: ngie > Date: Thu Oct 13 07:02:54 2016 > New Revision: 307190 > URL: https://svnweb.freebsd.org/changeset/base/307190 > > Log: > Skip :uchg on FreeBSD > > Unfortunately removing files with uchg set always succeeds with root on > FreeBSD. Unfortunately running the test as an unprivileged user isn't > doable > because mounting tmpfs requires root > > PR: 212861 > Sponsored by: Dell EMC Isilon > > Modified: > head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh > > Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh > ============================================================ > ================== > --- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 > 06:56:23 2016 (r307189) > +++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 > 07:02:54 2016 (r307190) > @@ -53,6 +53,10 @@ uchg_head() { > atf_set "require.user" "root" > } > uchg_body() { > + # Begin FreeBSD > + atf_skip "this fails on FreeBSD with root - bug 212861" > + # End FreeBSD > This is a bad way of disabling a test due to a known bug because, when the bug is resolved, the test won't notice. You should be using the "expected failures" functionality if possible, and based on the change description, I think you can do this here easily. Try: atf_expect_fail "FreeBSD bug 213861 blah blah" right before the line that triggers the test failure. -- Julio Merino -- http://julio.meroh.net/ From owner-svn-src-head@freebsd.org Thu Oct 13 07:25:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D151DC0F718; Thu, 13 Oct 2016 07:25:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F5AA98A; Thu, 13 Oct 2016 07:25:19 +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 u9D7PIL9015271; Thu, 13 Oct 2016 07:25:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D7PIA0015270; Thu, 13 Oct 2016 07:25:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610130725.u9D7PIA0015270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 13 Oct 2016 07:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307195 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:25:19 -0000 Author: avg Date: Thu Oct 13 07:25:18 2016 New Revision: 307195 URL: https://svnweb.freebsd.org/changeset/base/307195 Log: convert iicsmb to use iicbus_transfer for all operations Previously the driver used more low level operations like iicbus_start and iicbus_write. The problem is that those operations are not implemented by iicbus(4) and the calls were effectively routed to a driver to which the bus is attached. But not all of the controllers implement such low level operations while all of the drivers are expected to have iicbus_transfer. While there fix incorrect implementation of iicsmb_bwrite and iicsmb_bread. The former should send a byte count before the actual bytes, while the latter should first receive the byte count and then receive the bytes. I have tested only these commands: - quick (r/w) - send byte - receive byte - read byte - write byte MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8170 Modified: head/sys/dev/iicbus/iicsmb.c Modified: head/sys/dev/iicbus/iicsmb.c ============================================================================== --- head/sys/dev/iicbus/iicsmb.c Thu Oct 13 07:22:13 2016 (r307194) +++ head/sys/dev/iicbus/iicsmb.c Thu Oct 13 07:25:18 2016 (r307195) @@ -131,8 +131,6 @@ static driver_t iicsmb_driver = { sizeof(struct iicsmb_softc), }; -#define IICBUS_TIMEOUT 100 /* us */ - static void iicsmb_identify(driver_t *driver, device_t parent) { @@ -276,237 +274,213 @@ iicsmb_callback(device_t dev, int index, } static int +iic2smb_error(int error) +{ + switch (error) { + case IIC_NOERR: + return (SMB_ENOERR); + case IIC_EBUSERR: + return (SMB_EBUSERR); + case IIC_ENOACK: + return (SMB_ENOACK); + case IIC_ETIMEOUT: + return (SMB_ETIMEOUT); + case IIC_EBUSBSY: + return (SMB_EBUSY); + case IIC_ESTATUS: + return (SMB_EBUSERR); + case IIC_EUNDERFLOW: + return (SMB_EBUSERR); + case IIC_EOVERFLOW: + return (SMB_EBUSERR); + case IIC_ENOTSUPP: + return (SMB_ENOTSUPP); + case IIC_ENOADDR: + return (SMB_EBUSERR); + case IIC_ERESOURCE: + return (SMB_EBUSERR); + default: + return (SMB_EBUSERR); + } +} + +#define TRANSFER_MSGS(dev, msgs) iicbus_transfer(dev, msgs, nitems(msgs)) + +static int iicsmb_quick(device_t dev, u_char slave, int how) { - device_t parent = device_get_parent(dev); + struct iic_msg msgs[] = { + { slave, how == SMB_QWRITE ? IIC_M_WR : IIC_M_RD, 0, NULL }, + }; int error; switch (how) { case SMB_QWRITE: - error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT); - break; - case SMB_QREAD: - error = iicbus_start(parent, slave | LSB, IICBUS_TIMEOUT); break; - default: - error = EINVAL; - break; + return (SMB_EINVAL); } - if (!error) - error = iicbus_stop(parent); - - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_sendb(device_t dev, u_char slave, char byte) { - device_t parent = device_get_parent(dev); - int error, sent; - - error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT); - - if (!error) { - error = iicbus_write(parent, &byte, 1, &sent, IICBUS_TIMEOUT); - - iicbus_stop(parent); - } + struct iic_msg msgs[] = { + { slave, IIC_M_WR, 1, &byte }, + }; + int error; - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_recvb(device_t dev, u_char slave, char *byte) { - device_t parent = device_get_parent(dev); - int error, read; - - error = iicbus_start(parent, slave | LSB, 0); - - if (!error) { - error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, IICBUS_TIMEOUT); - - iicbus_stop(parent); - } + struct iic_msg msgs[] = { + { slave, IIC_M_RD, 1, byte }, + }; + int error; - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_writeb(device_t dev, u_char slave, char cmd, char byte) { - device_t parent = device_get_parent(dev); - int error, sent; - - error = iicbus_start(parent, slave & ~LSB, 0); - - if (!error) { - if (!(error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - error = iicbus_write(parent, &byte, 1, &sent, IICBUS_TIMEOUT); - - iicbus_stop(parent); - } + uint8_t bytes[] = { cmd, byte }; + struct iic_msg msgs[] = { + { slave, IIC_M_WR, nitems(bytes), bytes }, + }; + int error; - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_writew(device_t dev, u_char slave, char cmd, short word) { - device_t parent = device_get_parent(dev); - int error, sent; - - char low = (char)(word & 0xff); - char high = (char)((word & 0xff00) >> 8); - - error = iicbus_start(parent, slave & ~LSB, 0); - - if (!error) { - if (!(error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - if (!(error = iicbus_write(parent, &low, 1, &sent, IICBUS_TIMEOUT))) - error = iicbus_write(parent, &high, 1, &sent, IICBUS_TIMEOUT); - - iicbus_stop(parent); - } + uint8_t bytes[] = { cmd, word & 0xff, word >> 8 }; + struct iic_msg msgs[] = { + { slave, IIC_M_WR, nitems(bytes), bytes }, + }; + int error; - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_readb(device_t dev, u_char slave, char cmd, char *byte) { - device_t parent = device_get_parent(dev); - int error, sent, read; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - return (error); - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) - goto error; + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, 1, &cmd }, + { slave, IIC_M_RD, 1, byte }, + }; + int error; -error: - iicbus_stop(parent); - return (error); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } -#define BUF2SHORT(low,high) \ - ((short)(((high) & 0xff) << 8) | (short)((low) & 0xff)) - static int iicsmb_readw(device_t dev, u_char slave, char cmd, short *word) { - device_t parent = device_get_parent(dev); - int error, sent, read; - char buf[2]; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - return (error); - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) - goto error; - - /* first, receive low, then high byte */ - *word = BUF2SHORT(buf[0], buf[1]); + uint8_t buf[2]; + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, 1, &cmd }, + { slave, IIC_M_RD, nitems(buf), buf }, + }; + int error; -error: - iicbus_stop(parent); - return (error); + error = TRANSFER_MSGS(dev, msgs); + if (error == 0) + *word = ((uint16_t)buf[1] << 8) | buf[0]; + return (iic2smb_error(error)); } static int iicsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata) { - device_t parent = device_get_parent(dev); - int error, sent, read; - char buf[2]; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - return (error); - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - /* first, send low, then high byte */ - buf[0] = (char)(sdata & 0xff); - buf[1] = (char)((sdata & 0xff00) >> 8); - - if ((error = iicbus_write(parent, buf, 2, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) - goto error; - - /* first, receive low, then high byte */ - *rdata = BUF2SHORT(buf[0], buf[1]); + uint8_t in[3] = { cmd, sdata & 0xff, sdata >> 8 }; + uint8_t out[2]; + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, nitems(in), in }, + { slave, IIC_M_RD, nitems(out), out }, + }; + int error; -error: - iicbus_stop(parent); - return (error); + error = TRANSFER_MSGS(dev, msgs); + if (error == 0) + *rdata = ((uint16_t)out[1] << 8) | out[0]; + return (iic2smb_error(error)); } static int iicsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf) { - device_t parent = device_get_parent(dev); - int error, sent; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_write(parent, buf, (int)count, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_stop(parent))) - goto error; + uint8_t bytes[2] = { cmd, count }; + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, nitems(bytes), bytes }, + { slave, IIC_M_WR | IIC_M_NOSTART, count, buf }, + }; + int error; -error: - return (error); + if (count > 32 || count == 0) + return (SMB_EINVAL); + error = TRANSFER_MSGS(dev, msgs); + return (iic2smb_error(error)); } static int iicsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) { + struct iic_msg msgs[] = { + { slave, IIC_M_WR | IIC_M_NOSTOP, 1, &cmd }, + { slave, IIC_M_RD | IIC_M_NOSTOP, 1, count }, + }; + struct iic_msg block_msg[] = { + { slave, IIC_M_RD | IIC_M_NOSTART, 0, buf }, + }; device_t parent = device_get_parent(dev); - int error, sent, read; - - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) - return (error); - - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) - goto error; - - if ((error = iicbus_read(parent, buf, (int)*count, &read, - IIC_LAST_READ, IICBUS_TIMEOUT))) - goto error; - *count = read; + int error; + u_char bufsz; -error: - iicbus_stop(parent); - return (error); + /* Stash output buffer size before overwriting it. */ + bufsz = *count; + if (bufsz == 0) + return (SMB_EINVAL); + + /* Have to do this because the command is split in two transfers. */ + error = iicbus_request_bus(parent, dev, IIC_WAIT); + if (error == 0) + error = TRANSFER_MSGS(dev, msgs); + if (error == 0) { + /* + * If the slave offers an empty or a too long reply, + * read one byte to generate the stop or abort. + * XXX 32 is hardcoded until SMB_MAXBLOCKSIZE is restored + * to sanity. + */ + if (*count > 32 || *count == 0) + block_msg[0].len = 1; + /* If longer than the buffer, then clamp at the buffer size. */ + if (*count > bufsz) + block_msg[0].len = bufsz; + else + block_msg[0].len = *count; + error = TRANSFER_MSGS(dev, block_msg); + if (*count > 32 || *count == 0) + error = SMB_EINVAL; + } + (void)iicbus_release_bus(parent, dev); + return (iic2smb_error(error)); } DRIVER_MODULE(iicsmb, iicbus, iicsmb_driver, iicsmb_devclass, 0, 0); From owner-svn-src-head@freebsd.org Thu Oct 13 07:29:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68CAAC0F866; Thu, 13 Oct 2016 07:29:07 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34F78C8E; Thu, 13 Oct 2016 07:29:07 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id 128so4472277pfz.1; Thu, 13 Oct 2016 00:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Q9Pc48UgwyFtzRPfU8aHXLV5E9WGw/wZ9Dgy5cRYQ6A=; b=Ro8tdM9RyMP0OR/3TGHccVHZY+8FDstOAfQTjtBAQ4YaPOClg3MfagPGWso2+ywtef 9tYl1ruTs/0ROs7RVXXMDV4VmYxJbc96VZXR82vkHifHYlN84Lu2ObO6ePFUTRN0jn8x BvwFFCtS7XXyjL2CwDItk4RZbyr7YXl1CIKjZ1tAx9YeOdKqqN4iGn6JbGDwpF0c99bT hp1K2G+XEsyAWJ8Yho0QLCp/reHD5srYXxF3htRqNJWvNLjfsygiuuf9y7hC9XwQz6xL 06wsSrGkTYks3PsuVIB1S2q6VmgTBTiaMUxy3nHAe40acQn2LM4LrbIcBDXNFJv/48KQ eBYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Q9Pc48UgwyFtzRPfU8aHXLV5E9WGw/wZ9Dgy5cRYQ6A=; b=bE0dhirJrOC7Pmw6ug/c4H20t9Ii1kGXo3Fpma2kBnCfm20q0uh0B5jzX5rXDDpIm0 3Gjj44KLh9gIO5Qgh6Ez/Jrr6WtbikzNhyFvd+9Ravuvzw5sq3QJEIic+pVkuWnCwmzv tRg6g52d52JgdZ6XZCt2jDDvqkcUEizpbr3yPe7e2J+wLHB3yZh4HWgoztPVP9H7Rg2A BvcBSzHXkhBmwaAGd/em6+NBdXOl4LQal38wGWhhYQ/vKTJafoCc2RyyjNGZn+XZROlz LbHLmCxfoxhyaIDVESirUABVo1jV87Nj0ypSljLiVds7tyrW+6jGwRBANLabzuI4TAcv a9aA== X-Gm-Message-State: AA6/9Rn/VcJm5vj4V3ltjilkGxyRB1yJu54kqIl6Ikyfrjs1ch1WzfA8KzM5/9we/Mq25A== X-Received: by 10.98.158.143 with SMTP id f15mr7934784pfk.133.1476343746842; Thu, 13 Oct 2016 00:29:06 -0700 (PDT) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id j63sm16888055pfj.70.2016.10.13.00.29.05 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Oct 2016 00:29:06 -0700 (PDT) Subject: Re: svn commit: r307190 - head/contrib/netbsd-tests/fs/tmpfs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A0114B37-B420-4886-AA83-5E15D9B6FAB4"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Thu, 13 Oct 2016 00:29:04 -0700 Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201610130702.u9D72sgd007580@repo.freebsd.org> To: Julio Merino X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:29:07 -0000 --Apple-Mail=_A0114B37-B420-4886-AA83-5E15D9B6FAB4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 13, 2016, at 00:20, Julio Merino wrote: >=20 > On Thu, Oct 13, 2016 at 3:02 AM, Ngie Cooper wrote: > Author: ngie > Date: Thu Oct 13 07:02:54 2016 > New Revision: 307190 > URL: https://svnweb.freebsd.org/changeset/base/307190 >=20 > Log: > Skip :uchg on FreeBSD >=20 > Unfortunately removing files with uchg set always succeeds with root = on > FreeBSD. Unfortunately running the test as an unprivileged user = isn't doable > because mounting tmpfs requires root >=20 > PR: 212861 > Sponsored by: Dell EMC Isilon >=20 > Modified: > head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh >=20 > Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 = 06:56:23 2016 (r307189) > +++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 = 07:02:54 2016 (r307190) > @@ -53,6 +53,10 @@ uchg_head() { > atf_set "require.user" "root" > } > uchg_body() { > + # Begin FreeBSD > + atf_skip "this fails on FreeBSD with root - bug 212861" > + # End FreeBSD >=20 > This is a bad way of disabling a test due to a known bug because, when = the bug is resolved, the test won't notice. You should be using the = "expected failures" functionality if possible, and based on the change = description, I think you can do this here easily. Try: >=20 > atf_expect_fail "FreeBSD bug 213861 blah blah" >=20 > right before the line that triggers the test failure. The problem is that this leaves tmpfs mounts lying around, which atf = won=E2=80=99t cleanup. Otherwise, I would totally agree with you. Thanks, -Ngie --Apple-Mail=_A0114B37-B420-4886-AA83-5E15D9B6FAB4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJX/zfBAAoJEPWDqSZpMIYVs64P/0JR4ZNY5nhp66HcTDMWrc+y QK5SSjmLK1AGcguGs54Yt6RWR12zEozYaC6Aq8AojvEAe4oE6wCpUqeFSTChlZ6a NWS2gsZ658+MVyOeyQp2CnryeTWF9/QmUnEi7Z6YtDwLHfOauqzgihwsIkZ2zR47 WCqTuyXX5u/aQqWvmflFc02u6mfkeDDylFbcHEtSJJgoSqpc5VjKrB5WMg8rWw+r FgbK/jRgxmEW5dR+6lVsgVaeSNtTs5nju7QHFEwwwK4FNaAsXb0z4RcSi2ZKwl0R G/a/XhOn6WyuJyBgFWJLh6PRtfv5a2ZphO7NDC4Rwmb3N/ee1hHuJ726GPrKcmdm uniRWHOBgvGPnD78SVyA/z0L4WE7HmqXXxofxz25pNccpzIzAhCQnuEHiPa3FdHg en7r50w6pTEtctlRBWP7vv+7yOdvBtCHoIz2YGJxckF2V/Y6G9rHTeDFYZMLvhim UdXfGHUJfIvRCqMKpjC8OHGPco80mDPwB/prO0uyHdis/u70Wc6I58JD8KDd7t75 VyM8sHtwPEa7i92hWLAsKI/0kiYUd62TiWHi51rjnGyvr84vRAQvRY2VbwHNxfzI 9RbP2rcewIDnwqm2ly9KAqjDEIBa3NekdwRzIMnUOCoJCITO1GYhkGY8MB2dHdB3 fR2x+WzDUl1X3eF6wfFv =lAg2 -----END PGP SIGNATURE----- --Apple-Mail=_A0114B37-B420-4886-AA83-5E15D9B6FAB4-- From owner-svn-src-head@freebsd.org Thu Oct 13 07:32:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66D8BC0FA7D; Thu, 13 Oct 2016 07:32:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 369FDC9; Thu, 13 Oct 2016 07:32:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9D7WPdG018875; Thu, 13 Oct 2016 07:32:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D7WPBN018874; Thu, 13 Oct 2016 07:32:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610130732.u9D7WPBN018874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 13 Oct 2016 07:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307196 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:32:26 -0000 Author: ngie Date: Thu Oct 13 07:32:25 2016 New Revision: 307196 URL: https://svnweb.freebsd.org/changeset/base/307196 Log: Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD - Add inttypes.h #include for PRId64 macro - Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter. Use sizeof(fhandle_t) instead as the size of fhp is always fixed as fhandle_t, unlike NetBSD's copy of fhp, which is void*. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/fs/tmpfs/h_tools.c Modified: head/contrib/netbsd-tests/fs/tmpfs/h_tools.c ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/h_tools.c Thu Oct 13 07:25:18 2016 (r307195) +++ head/contrib/netbsd-tests/fs/tmpfs/h_tools.c Thu Oct 13 07:32:25 2016 (r307196) @@ -50,6 +50,10 @@ #include #include +#ifdef __FreeBSD__ +#include +#endif + /* --------------------------------------------------------------------- */ static int getfh_main(int, char **); @@ -70,7 +74,12 @@ getfh_main(int argc, char **argv) if (argc < 2) return EXIT_FAILURE; +#ifdef __FreeBSD__ + fh_size = sizeof(fhandle_t); +#else fh_size = 0; +#endif + fh = NULL; for (;;) { if (fh_size) { @@ -85,7 +94,11 @@ getfh_main(int argc, char **argv) * but it may change if someone moves things around, * so retry untill we have enough memory. */ +#ifdef __FreeBSD__ + error = getfh(argv[1], fh); +#else error = getfh(argv[1], fh, &fh_size); +#endif if (error == 0) { break; } else { From owner-svn-src-head@freebsd.org Thu Oct 13 07:39:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64793C0FE82 for ; Thu, 13 Oct 2016 07:39:07 +0000 (UTC) (envelope-from julio@meroh.net) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 189209AD for ; Thu, 13 Oct 2016 07:39:07 +0000 (UTC) (envelope-from julio@meroh.net) Received: by mail-yw0-x22b.google.com with SMTP id t193so47911146ywc.2 for ; Thu, 13 Oct 2016 00:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meroh.net; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9hJZ3YFwxU+q+af1MKtsqGdkC29+yV1JFAd6nJzT6Yw=; b=drw26ohdxBPmnchN7a/tGlvH4wRkSxnKy8xqFE7tG0VZvx3alEjkvz/xdwsf3DR2J0 4MGuQrM5NO4q2FfjyLkx05X9zyKkBP7tLKCA+TPcV7RjIjpHPhpZpbZ/DF/6aU9i6K4i dUeWK/+HwHvx6Rr7ARr/qXv9Yfuutn8Uu3CuCJMv70/ehXl3pEpX1xgTWOm7m+CEBBG5 V4Jd4JEAaW3aDOu2mZGzHlKAZy2rSwdV74+yu0jEMu5vjlU1q5Ggh+hcPSs65F6X34Fa 9PmgdYN2qu+xhUyhNE4wtoADrecohM5EubDb3Ier1KS5AIFLUxHYXo1gWmWGb5f55PQH 6yQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9hJZ3YFwxU+q+af1MKtsqGdkC29+yV1JFAd6nJzT6Yw=; b=UyCE0KcsNAJyifdaA3lhjn48gjpZ1z/V8e5tZV9/D1qNNs6/QZC1eSAqFnN3imJ/za 2wptq3EgoFukaYo12lAme81tvxZxHQdLV06R4kTDFkxO8qg0/HGYurP/ttSw9yfiw0v+ pE1hAjX84vBfN/xUIsh1ESOoeZ+QH0ZqLWuq6/mQqoRcz574BcDQngq/w9IuN+Tc0l48 QBQ0apFDpDRbvG/LfnccPY5F7aQGlPUboj2qFXBvScVfAGEMhTdL81OUXxqPB5Fh8Fgy YkmVTFaHA9hPC30E0Eupau0gZEryhc1Q9lRWlvqmbao9mS8Mex4OQyLZKhSgiqNSkF0y VY9g== X-Gm-Message-State: AA6/9RnqAvyTo/VKYmsLvjEqeBY/avTh+R/W3fhCRdx8AtVTSFN74KcSsPvSvjCiH8FCEIk6ZHQsgnVlFZn4Pg== X-Received: by 10.13.219.146 with SMTP id d140mr4423301ywe.61.1476344346347; Thu, 13 Oct 2016 00:39:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.170.108 with HTTP; Thu, 13 Oct 2016 00:38:44 -0700 (PDT) X-Originating-IP: [172.26.42.46] In-Reply-To: References: <201610130702.u9D72sgd007580@repo.freebsd.org> From: Julio Merino Date: Thu, 13 Oct 2016 03:38:44 -0400 Message-ID: Subject: Re: svn commit: r307190 - head/contrib/netbsd-tests/fs/tmpfs To: "Ngie Cooper (yaneurabeya)" Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:39:07 -0000 On Thu, Oct 13, 2016 at 3:29 AM, Ngie Cooper (yaneurabeya) < yaneurabeya@gmail.com> wrote: > > > On Oct 13, 2016, at 00:20, Julio Merino wrote: > > > > On Thu, Oct 13, 2016 at 3:02 AM, Ngie Cooper wrote: > > Author: ngie > > Date: Thu Oct 13 07:02:54 2016 > > New Revision: 307190 > > URL: https://svnweb.freebsd.org/changeset/base/307190 > > > > Log: > > Skip :uchg on FreeBSD > > > > Unfortunately removing files with uchg set always succeeds with root = on > > FreeBSD. Unfortunately running the test as an unprivileged user isn't > doable > > because mounting tmpfs requires root > > > > PR: 212861 > > Sponsored by: Dell EMC Isilon > > > > Modified: > > head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh > > > > Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 > 06:56:23 2016 (r307189) > > +++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 > 07:02:54 2016 (r307190) > > @@ -53,6 +53,10 @@ uchg_head() { > > atf_set "require.user" "root" > > } > > uchg_body() { > > + # Begin FreeBSD > > + atf_skip "this fails on FreeBSD with root - bug 212861" > > + # End FreeBSD > > > > This is a bad way of disabling a test due to a known bug because, when > the bug is resolved, the test won't notice. You should be using the > "expected failures" functionality if possible, and based on the change > description, I think you can do this here easily. Try: > > > > atf_expect_fail "FreeBSD bug 213861 blah blah" > > > > right before the line that triggers the test failure. > > The problem is that this leaves tmpfs mounts lying around, which atf won= =E2=80=99t > cleanup. Otherwise, I would totally agree with you. > Replace: atf_test_case uchg with: atf_test_case uchg cleanup and then add: uchg_cleanup() { umount foo/bar 2>/dev/null || true } This is actually *necessary* regardless of how you skip the test to ensure the mount point is cleaned up on any failure of the test. If the tests are not doing that yet, they are bogus. --=20 Julio Merino -- http://julio.meroh.net/ From owner-svn-src-head@freebsd.org Thu Oct 13 07:42:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E1F0C0F20D; Thu, 13 Oct 2016 07:42:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6DFAEFCC; Thu, 13 Oct 2016 07:42:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA03757; Thu, 13 Oct 2016 10:42:42 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1buaf4-000J9M-Gs; Thu, 13 Oct 2016 10:42:42 +0300 Subject: Re: svn commit: r307191 - head/etc/rc.d To: Ngie Cooper , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201610130710.u9D7ARZa007926@repo.freebsd.org> From: Andriy Gapon Message-ID: <875b3413-c8d6-8c48-3829-af0c3a587167@FreeBSD.org> Date: Thu, 13 Oct 2016 10:41:46 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201610130710.u9D7ARZa007926@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:42:45 -0000 On 13/10/2016 10:10, Ngie Cooper wrote: > Author: ngie > Date: Thu Oct 13 07:10:27 2016 > New Revision: 307191 > URL: https://svnweb.freebsd.org/changeset/base/307191 > > Log: > Install etc/rc.d/zfsbe when MK_ZFS != no > > X-MFC with: r307182 > Sponsored by: Dell EMC Isilon Oh! Thank you! > Modified: > head/etc/rc.d/Makefile > > Modified: head/etc/rc.d/Makefile > ============================================================================== > --- head/etc/rc.d/Makefile Thu Oct 13 07:02:54 2016 (r307190) > +++ head/etc/rc.d/Makefile Thu Oct 13 07:10:27 2016 (r307191) > @@ -314,6 +314,7 @@ FILES+= wpa_supplicant > .if ${MK_ZFS} != "no" > FILESGROUPS+= ZFS > ZFS+= zfs > +ZFS+= zfsbe > ZFS+= zfsd > ZFS+= zvol > ZFSPACKAGE= zfs > -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Oct 13 07:44:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70E91C0F30F; Thu, 13 Oct 2016 07:44:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6191F355; Thu, 13 Oct 2016 07:44:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA03769; Thu, 13 Oct 2016 10:44:14 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1buagY-000J9d-IY; Thu, 13 Oct 2016 10:44:14 +0300 Subject: Re: svn commit: r307182 - head/etc/rc.d To: "Ngie Cooper (yaneurabeya)" References: <201610130619.u9D6JsMd088686@repo.freebsd.org> <27A78442-3CB6-4245-892B-EFACB3860B38@gmail.com> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Andriy Gapon Message-ID: Date: Thu, 13 Oct 2016 10:43:18 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <27A78442-3CB6-4245-892B-EFACB3860B38@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:44:17 -0000 On 13/10/2016 10:12, Ngie Cooper (yaneurabeya) wrote: > >> On Oct 12, 2016, at 23:19, Andriy Gapon wrote: >> >> Author: avg >> Date: Thu Oct 13 06:19:54 2016 >> New Revision: 307182 >> URL: https://svnweb.freebsd.org/changeset/base/307182 >> >> Log: >> rc.d/zfsbe: a new script designed for boot environment support >> >> Currently zfsbe ensures that subordinate filesystems are mounted at the >> right mount points. >> The script assumes that the subordinate filesystems of a boot environment >> have their canmount property set to noauto, so that they are not >> automatically mounted on boot. Whereas the root filesystem is mounted >> by the kernel, there was nothing to mount its subordinates. >> rc.d/zfsbe fills that gap. >> >> Discussed with: allanjude, will >> MFC after: 3 weeks >> Differential Revision: https://reviews.freebsd.org/D7797 > > I committed the Makefile changes in r307191/r307192. > Cheers! Thank you! Next time I make a change like this I'll make sure to add you as a reviewer :-) -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Oct 13 07:50:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95EB0C0F6F9; Thu, 13 Oct 2016 07:50:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 580C7962; Thu, 13 Oct 2016 07:49:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA03802; Thu, 13 Oct 2016 10:49:58 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1buam5-000JA7-Oo; Thu, 13 Oct 2016 10:49:58 +0300 Subject: Re: svn commit: r307195 - head/sys/dev/iicbus To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201610130725.u9D7PIA0015270@repo.freebsd.org> From: Andriy Gapon Message-ID: Date: Thu, 13 Oct 2016 10:49:21 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201610130725.u9D7PIA0015270@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 07:50:01 -0000 On 13/10/2016 10:25, Andriy Gapon wrote: > Author: avg > Date: Thu Oct 13 07:25:18 2016 > New Revision: 307195 > URL: https://svnweb.freebsd.org/changeset/base/307195 > > Log: > convert iicsmb to use iicbus_transfer for all operations > > Previously the driver used more low level operations like iicbus_start > and iicbus_write. The problem is that those operations are not > implemented by iicbus(4) and the calls were effectively routed to > a driver to which the bus is attached. > But not all of the controllers implement such low level operations > while all of the drivers are expected to have iicbus_transfer. > > While there fix incorrect implementation of iicsmb_bwrite and iicsmb_bread. > The former should send a byte count before the actual bytes, while the > latter should first receive the byte count and then receive the bytes. Just a thought. It would be much easier to implement iicsmb_bread() if we had a flag like I2C_M_RECV_LEN in Linux. The flag signals that the first byte received from slave is a count of how many more bytes we should read from that slave. But adding support for a new flag to all controller drivers is not fun. > I have tested only these commands: > - quick (r/w) > - send byte > - receive byte > - read byte > - write byte > > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D8170 > > Modified: > head/sys/dev/iicbus/iicsmb.c > > Modified: head/sys/dev/iicbus/iicsmb.c > ============================================================================== > --- head/sys/dev/iicbus/iicsmb.c Thu Oct 13 07:22:13 2016 (r307194) > +++ head/sys/dev/iicbus/iicsmb.c Thu Oct 13 07:25:18 2016 (r307195) > @@ -131,8 +131,6 @@ static driver_t iicsmb_driver = { > sizeof(struct iicsmb_softc), > }; > > -#define IICBUS_TIMEOUT 100 /* us */ > - > static void > iicsmb_identify(driver_t *driver, device_t parent) > { > @@ -276,237 +274,213 @@ iicsmb_callback(device_t dev, int index, > } > > static int > +iic2smb_error(int error) > +{ > + switch (error) { > + case IIC_NOERR: > + return (SMB_ENOERR); > + case IIC_EBUSERR: > + return (SMB_EBUSERR); > + case IIC_ENOACK: > + return (SMB_ENOACK); > + case IIC_ETIMEOUT: > + return (SMB_ETIMEOUT); > + case IIC_EBUSBSY: > + return (SMB_EBUSY); > + case IIC_ESTATUS: > + return (SMB_EBUSERR); > + case IIC_EUNDERFLOW: > + return (SMB_EBUSERR); > + case IIC_EOVERFLOW: > + return (SMB_EBUSERR); > + case IIC_ENOTSUPP: > + return (SMB_ENOTSUPP); > + case IIC_ENOADDR: > + return (SMB_EBUSERR); > + case IIC_ERESOURCE: > + return (SMB_EBUSERR); > + default: > + return (SMB_EBUSERR); > + } > +} > + > +#define TRANSFER_MSGS(dev, msgs) iicbus_transfer(dev, msgs, nitems(msgs)) > + > +static int > iicsmb_quick(device_t dev, u_char slave, int how) > { > - device_t parent = device_get_parent(dev); > + struct iic_msg msgs[] = { > + { slave, how == SMB_QWRITE ? IIC_M_WR : IIC_M_RD, 0, NULL }, > + }; > int error; > > switch (how) { > case SMB_QWRITE: > - error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT); > - break; > - > case SMB_QREAD: > - error = iicbus_start(parent, slave | LSB, IICBUS_TIMEOUT); > break; > - > default: > - error = EINVAL; > - break; > + return (SMB_EINVAL); > } > > - if (!error) > - error = iicbus_stop(parent); > - > - return (error); > + error = TRANSFER_MSGS(dev, msgs); > + return (iic2smb_error(error)); > } > > static int > iicsmb_sendb(device_t dev, u_char slave, char byte) > { > - device_t parent = device_get_parent(dev); > - int error, sent; > - > - error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT); > - > - if (!error) { > - error = iicbus_write(parent, &byte, 1, &sent, IICBUS_TIMEOUT); > - > - iicbus_stop(parent); > - } > + struct iic_msg msgs[] = { > + { slave, IIC_M_WR, 1, &byte }, > + }; > + int error; > > - return (error); > + error = TRANSFER_MSGS(dev, msgs); > + return (iic2smb_error(error)); > } > > static int > iicsmb_recvb(device_t dev, u_char slave, char *byte) > { > - device_t parent = device_get_parent(dev); > - int error, read; > - > - error = iicbus_start(parent, slave | LSB, 0); > - > - if (!error) { > - error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, IICBUS_TIMEOUT); > - > - iicbus_stop(parent); > - } > + struct iic_msg msgs[] = { > + { slave, IIC_M_RD, 1, byte }, > + }; > + int error; > > - return (error); > + error = TRANSFER_MSGS(dev, msgs); > + return (iic2smb_error(error)); > } > > static int > iicsmb_writeb(device_t dev, u_char slave, char cmd, char byte) > { > - device_t parent = device_get_parent(dev); > - int error, sent; > - > - error = iicbus_start(parent, slave & ~LSB, 0); > - > - if (!error) { > - if (!(error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) > - error = iicbus_write(parent, &byte, 1, &sent, IICBUS_TIMEOUT); > - > - iicbus_stop(parent); > - } > + uint8_t bytes[] = { cmd, byte }; > + struct iic_msg msgs[] = { > + { slave, IIC_M_WR, nitems(bytes), bytes }, > + }; > + int error; > > - return (error); > + error = TRANSFER_MSGS(dev, msgs); > + return (iic2smb_error(error)); > } > > static int > iicsmb_writew(device_t dev, u_char slave, char cmd, short word) > { > - device_t parent = device_get_parent(dev); > - int error, sent; > - > - char low = (char)(word & 0xff); > - char high = (char)((word & 0xff00) >> 8); > - > - error = iicbus_start(parent, slave & ~LSB, 0); > - > - if (!error) { > - if (!(error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) > - if (!(error = iicbus_write(parent, &low, 1, &sent, IICBUS_TIMEOUT))) > - error = iicbus_write(parent, &high, 1, &sent, IICBUS_TIMEOUT); > - > - iicbus_stop(parent); > - } > + uint8_t bytes[] = { cmd, word & 0xff, word >> 8 }; > + struct iic_msg msgs[] = { > + { slave, IIC_M_WR, nitems(bytes), bytes }, > + }; > + int error; > > - return (error); > + error = TRANSFER_MSGS(dev, msgs); > + return (iic2smb_error(error)); > } > > static int > iicsmb_readb(device_t dev, u_char slave, char cmd, char *byte) > { > - device_t parent = device_get_parent(dev); > - int error, sent, read; > - > - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) > - return (error); > - > - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) > - goto error; > + struct iic_msg msgs[] = { > + { slave, IIC_M_WR | IIC_M_NOSTOP, 1, &cmd }, > + { slave, IIC_M_RD, 1, byte }, > + }; > + int error; > > -error: > - iicbus_stop(parent); > - return (error); > + error = TRANSFER_MSGS(dev, msgs); > + return (iic2smb_error(error)); > } > > -#define BUF2SHORT(low,high) \ > - ((short)(((high) & 0xff) << 8) | (short)((low) & 0xff)) > - > static int > iicsmb_readw(device_t dev, u_char slave, char cmd, short *word) > { > - device_t parent = device_get_parent(dev); > - int error, sent, read; > - char buf[2]; > - > - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) > - return (error); > - > - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) > - goto error; > - > - /* first, receive low, then high byte */ > - *word = BUF2SHORT(buf[0], buf[1]); > + uint8_t buf[2]; > + struct iic_msg msgs[] = { > + { slave, IIC_M_WR | IIC_M_NOSTOP, 1, &cmd }, > + { slave, IIC_M_RD, nitems(buf), buf }, > + }; > + int error; > > -error: > - iicbus_stop(parent); > - return (error); > + error = TRANSFER_MSGS(dev, msgs); > + if (error == 0) > + *word = ((uint16_t)buf[1] << 8) | buf[0]; > + return (iic2smb_error(error)); > } > > static int > iicsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata) > { > - device_t parent = device_get_parent(dev); > - int error, sent, read; > - char buf[2]; > - > - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) > - return (error); > - > - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) > - goto error; > - > - /* first, send low, then high byte */ > - buf[0] = (char)(sdata & 0xff); > - buf[1] = (char)((sdata & 0xff00) >> 8); > - > - if ((error = iicbus_write(parent, buf, 2, &sent, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) > - goto error; > - > - /* first, receive low, then high byte */ > - *rdata = BUF2SHORT(buf[0], buf[1]); > + uint8_t in[3] = { cmd, sdata & 0xff, sdata >> 8 }; > + uint8_t out[2]; > + struct iic_msg msgs[] = { > + { slave, IIC_M_WR | IIC_M_NOSTOP, nitems(in), in }, > + { slave, IIC_M_RD, nitems(out), out }, > + }; > + int error; > > -error: > - iicbus_stop(parent); > - return (error); > + error = TRANSFER_MSGS(dev, msgs); > + if (error == 0) > + *rdata = ((uint16_t)out[1] << 8) | out[0]; > + return (iic2smb_error(error)); > } > > static int > iicsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf) > { > - device_t parent = device_get_parent(dev); > - int error, sent; > - > - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_write(parent, buf, (int)count, &sent, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_stop(parent))) > - goto error; > + uint8_t bytes[2] = { cmd, count }; > + struct iic_msg msgs[] = { > + { slave, IIC_M_WR | IIC_M_NOSTOP, nitems(bytes), bytes }, > + { slave, IIC_M_WR | IIC_M_NOSTART, count, buf }, > + }; > + int error; > > -error: > - return (error); > + if (count > 32 || count == 0) > + return (SMB_EINVAL); > + error = TRANSFER_MSGS(dev, msgs); > + return (iic2smb_error(error)); > } > > static int > iicsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) > { > + struct iic_msg msgs[] = { > + { slave, IIC_M_WR | IIC_M_NOSTOP, 1, &cmd }, > + { slave, IIC_M_RD | IIC_M_NOSTOP, 1, count }, > + }; > + struct iic_msg block_msg[] = { > + { slave, IIC_M_RD | IIC_M_NOSTART, 0, buf }, > + }; > device_t parent = device_get_parent(dev); > - int error, sent, read; > - > - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) > - return (error); > - > - if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) > - goto error; > - > - if ((error = iicbus_read(parent, buf, (int)*count, &read, > - IIC_LAST_READ, IICBUS_TIMEOUT))) > - goto error; > - *count = read; > + int error; > + u_char bufsz; > > -error: > - iicbus_stop(parent); > - return (error); > + /* Stash output buffer size before overwriting it. */ > + bufsz = *count; > + if (bufsz == 0) > + return (SMB_EINVAL); > + > + /* Have to do this because the command is split in two transfers. */ > + error = iicbus_request_bus(parent, dev, IIC_WAIT); > + if (error == 0) > + error = TRANSFER_MSGS(dev, msgs); > + if (error == 0) { > + /* > + * If the slave offers an empty or a too long reply, > + * read one byte to generate the stop or abort. > + * XXX 32 is hardcoded until SMB_MAXBLOCKSIZE is restored > + * to sanity. > + */ > + if (*count > 32 || *count == 0) > + block_msg[0].len = 1; > + /* If longer than the buffer, then clamp at the buffer size. */ > + if (*count > bufsz) > + block_msg[0].len = bufsz; > + else > + block_msg[0].len = *count; > + error = TRANSFER_MSGS(dev, block_msg); > + if (*count > 32 || *count == 0) > + error = SMB_EINVAL; > + } > + (void)iicbus_release_bus(parent, dev); > + return (iic2smb_error(error)); > } > > DRIVER_MODULE(iicsmb, iicbus, iicsmb_driver, iicsmb_devclass, 0, 0); > -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Oct 13 08:27:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DEDAC0FA57; Thu, 13 Oct 2016 08:27:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 124ED953; Thu, 13 Oct 2016 08:27:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9D8RKGs038895; Thu, 13 Oct 2016 08:27:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D8RK8L038894; Thu, 13 Oct 2016 08:27:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610130827.u9D8RK8L038894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 13 Oct 2016 08:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307204 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 08:27:21 -0000 Author: ngie Date: Thu Oct 13 08:27:19 2016 New Revision: 307204 URL: https://svnweb.freebsd.org/changeset/base/307204 Log: Expect :large to fail on FreeBSD FreeBSD doesn't appear to validate large -o size values like NetBSD does MFC after: 2 weeks PR: 212862 Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Modified: head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Thu Oct 13 08:09:40 2016 (r307203) +++ head/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Thu Oct 13 08:27:19 2016 (r307204) @@ -93,7 +93,18 @@ negative_body() { test_unmount } +# Begin FreeBSD +if true; then +atf_test_case large cleanup +large_cleanup() { + umount -f tmp 2>/dev/null +} +else +# End FreeBSD atf_test_case large +# Begin FreeBSD +fi +# End FreeBSD large_head() { atf_set "descr" "Tests that extremely long values passed to -s" \ "are handled correctly" @@ -103,6 +114,10 @@ large_body() { test_mount -o -s9223372036854775807 test_unmount + # Begin FreeBSD + atf_expect_fail "-o -s succeeds unexpectedly on FreeBSD - bug 212862" + # End FreeBSD + mkdir tmp atf_check -s eq:1 -o empty -e ignore \ mount -t tmpfs -o -s9223372036854775808 tmpfs tmp From owner-svn-src-head@freebsd.org Thu Oct 13 08:35:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05EC5C0FC49; Thu, 13 Oct 2016 08:35:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBE06DA2; Thu, 13 Oct 2016 08:35:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9D8Z801042695; Thu, 13 Oct 2016 08:35:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D8Z8bS042694; Thu, 13 Oct 2016 08:35:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201610130835.u9D8Z8bS042694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 13 Oct 2016 08:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307205 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 08:35:10 -0000 Author: ngie Date: Thu Oct 13 08:35:08 2016 New Revision: 307205 URL: https://svnweb.freebsd.org/changeset/base/307205 Log: Change atf_skip call to atf_expect_fail to make it clear that a failure is expected MFC after: 2 weeks PR: 212861 Suggested by: jmmv Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Modified: head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 08:27:19 2016 (r307204) +++ head/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Thu Oct 13 08:35:08 2016 (r307205) @@ -46,7 +46,18 @@ single_body() { test_unmount } +# Begin FreeBSD +if true; then +atf_test_case uchg cleanup +uchg_cleanup() { + Mount_Point=$(pwd)/mntpt test_unmount || : +} +else +# End FreeBSD atf_test_case uchg +# Begin FreeBSD +fi +# End FreeBSD uchg_head() { atf_set "descr" "Checks that files with the uchg flag set cannot" \ "be removed" @@ -54,7 +65,7 @@ uchg_head() { } uchg_body() { # Begin FreeBSD - atf_skip "this fails on FreeBSD with root - bug 212861" + atf_expect_fail "this fails on FreeBSD with root - bug 212861" # End FreeBSD test_mount From owner-svn-src-head@freebsd.org Thu Oct 13 09:06:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1690FC109ED; Thu, 13 Oct 2016 09:06:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC877A73; Thu, 13 Oct 2016 09:06:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9D96TJk054235; Thu, 13 Oct 2016 09:06:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9D96T5I054233; Thu, 13 Oct 2016 09:06:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201610130906.u9D96T5I054233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 13 Oct 2016 09:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307210 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 09:06:31 -0000 Author: andrew Date: Thu Oct 13 09:06:29 2016 New Revision: 307210 URL: https://svnweb.freebsd.org/changeset/base/307210 Log: Move printing the AArch64 ID registers to a new SYSINIT, the previous location only prints them when booting on SMP with multiple cores. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Oct 13 09:00:44 2016 (r307209) +++ head/sys/arm64/arm64/identcpu.c Thu Oct 13 09:06:29 2016 (r307210) @@ -33,7 +33,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include #include #include @@ -151,6 +153,17 @@ const struct cpu_implementers cpu_implem CPU_IMPLEMENTER_NONE, }; +static void +identify_cpu_sysinit(void *dummy __unused) +{ + int cpu; + + CPU_FOREACH(cpu) { + print_cpu_features(cpu); + } +} +SYSINIT(idenrity_cpu, SI_SUB_SMP, SI_ORDER_ANY, identify_cpu_sysinit, NULL); + void print_cpu_features(u_int cpu) { Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Thu Oct 13 09:00:44 2016 (r307209) +++ head/sys/arm64/arm64/mp_machdep.c Thu Oct 13 09:06:29 2016 (r307210) @@ -201,7 +201,7 @@ arm64_cpu_attach(device_t dev) static void release_aps(void *dummy __unused) { - int cpu, i; + int i; intr_pic_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); intr_pic_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); @@ -217,14 +217,8 @@ release_aps(void *dummy __unused) printf("Release APs\n"); for (i = 0; i < 2000; i++) { - if (smp_started) { - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (CPU_ABSENT(cpu)) - continue; - print_cpu_features(cpu); - } + if (smp_started) return; - } DELAY(1000); } From owner-svn-src-head@freebsd.org Thu Oct 13 11:40:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B8E5C0EC70; Thu, 13 Oct 2016 11:40:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C92AC3D2; Thu, 13 Oct 2016 11:40:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DBeaEQ010855; Thu, 13 Oct 2016 11:40:36 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DBeZ4o010845; Thu, 13 Oct 2016 11:40:35 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201610131140.u9DBeZ4o010845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 13 Oct 2016 11:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307215 - in head/contrib/libarchive: cpio/test libarchive libarchive/test tar/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 11:40:37 -0000 Author: mm Date: Thu Oct 13 11:40:34 2016 New Revision: 307215 URL: https://svnweb.freebsd.org/changeset/base/307215 Log: MFV r307214: Sync libarchive with vendor. Style and tests fixes. Important vendor bugfixes (relevant to FreeBSD): #801: FreeBSD Coverity report: resource leak in libarchive/tar/test/main.c MFC after: 1 week Modified: head/contrib/libarchive/cpio/test/main.c head/contrib/libarchive/cpio/test/test.h head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c head/contrib/libarchive/libarchive/test/main.c head/contrib/libarchive/libarchive/test/test.h head/contrib/libarchive/libarchive/test/test_read_set_format.c head/contrib/libarchive/tar/test/main.c head/contrib/libarchive/tar/test/test.h head/contrib/libarchive/tar/test/test_missing_file.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/cpio/test/main.c ============================================================================== --- head/contrib/libarchive/cpio/test/main.c Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/cpio/test/main.c Thu Oct 13 11:40:34 2016 (r307215) @@ -130,6 +130,13 @@ __FBSDID("$FreeBSD$"); # include #endif +mode_t umasked(mode_t expected_mode) +{ + mode_t mode = umask(0); + umask(mode); + return expected_mode & ~mode; +} + /* Path to working directory for current test */ const char *testworkdir; #ifdef PROGRAM @@ -1294,6 +1301,11 @@ assertion_file_time(const char *file, in switch (type) { case 'a': filet_nsec = st.st_atimespec.tv_nsec; break; case 'b': filet = st.st_birthtime; + /* FreeBSD filesystems that don't support birthtime + * (e.g., UFS1) always return -1 here. */ + if (filet == -1) { + return (1); + } filet_nsec = st.st_birthtimespec.tv_nsec; break; case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break; default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type); @@ -1425,7 +1437,7 @@ assertion_file_nlinks(const char *file, assertion_count(file, line); r = lstat(pathname, &st); if (r == 0 && (int)st.st_nlink == nlinks) - return (1); + return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); failure_finish(NULL); @@ -1661,6 +1673,7 @@ assertion_make_file(const char *file, in if (0 != chmod(path, mode)) { failure_start(file, line, "Could not chmod %s", path); failure_finish(NULL); + close(fd); return (0); } if (contents != NULL) { @@ -1675,6 +1688,7 @@ assertion_make_file(const char *file, in failure_start(file, line, "Could not write to %s", path); failure_finish(NULL); + close(fd); return (0); } } Modified: head/contrib/libarchive/cpio/test/test.h ============================================================================== --- head/contrib/libarchive/cpio/test/test.h Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/cpio/test/test.h Thu Oct 13 11:40:34 2016 (r307215) @@ -182,6 +182,8 @@ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks) #define assertFileSize(pathname, size) \ assertion_file_size(__FILE__, __LINE__, pathname, size) +#define assertFileMode(pathname, mode) \ + assertion_file_mode(__FILE__, __LINE__, pathname, mode) #define assertTextFileContents(text, pathname) \ assertion_text_file_contents(__FILE__, __LINE__, text, pathname) #define assertFileContainsLinesAnyOrder(pathname, lines) \ @@ -327,6 +329,9 @@ void copy_reference_file(const char *); */ void extract_reference_files(const char **); +/* Subtract umask from mode */ +mode_t umasked(mode_t expected_mode); + /* Path to working directory for current test */ extern const char *testworkdir; Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Thu Oct 13 11:40:34 2016 (r307215) @@ -627,7 +627,6 @@ translate_acl(struct archive_read_disk * archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Unknown ACL brand"); return (ARCHIVE_WARN); - break; } #endif Modified: head/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c Thu Oct 13 11:40:34 2016 (r307215) @@ -232,6 +232,7 @@ static const char * lookup_uname_helper(struct name_cache *cache, id_t id) { struct passwd *result; + (void)cache; /* UNUSED */ result = getpwuid((uid_t)id); @@ -298,6 +299,7 @@ static const char * lookup_gname_helper(struct name_cache *cache, id_t id) { struct group *result; + (void)cache; /* UNUSED */ result = getgrgid((gid_t)id); Modified: head/contrib/libarchive/libarchive/test/main.c ============================================================================== --- head/contrib/libarchive/libarchive/test/main.c Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/libarchive/test/main.c Thu Oct 13 11:40:34 2016 (r307215) @@ -128,6 +128,13 @@ __FBSDID("$FreeBSD$"); # include #endif +mode_t umasked(mode_t expected_mode) +{ + mode_t mode = umask(0); + umask(mode); + return expected_mode & ~mode; +} + /* Path to working directory for current test */ const char *testworkdir; #ifdef PROGRAM @@ -1364,6 +1371,31 @@ assertion_file_birthtime_recent(const ch return assertion_file_time(file, line, pathname, 0, 0, 'b', 1); } +/* Verify mode of 'pathname'. */ +int +assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode) +{ + int mode; + int r; + + assertion_count(file, line); +#if defined(_WIN32) && !defined(__CYGWIN__) + failure_start(file, line, "assertFileMode not yet implemented for Windows"); +#else + { + struct stat st; + r = lstat(pathname, &st); + mode = (int)(st.st_mode & 0777); + } + if (r == 0 && mode == expected_mode) + return (1); + failure_start(file, line, "File %s has mode %o, expected %o", + pathname, mode, expected_mode); +#endif + failure_finish(NULL); + return (0); +} + /* Verify mtime of 'pathname'. */ int assertion_file_mtime(const char *file, int line, @@ -1403,7 +1435,7 @@ assertion_file_nlinks(const char *file, assertion_count(file, line); r = lstat(pathname, &st); if (r == 0 && (int)st.st_nlink == nlinks) - return (1); + return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); failure_finish(NULL); @@ -1440,31 +1472,6 @@ assertion_file_size(const char *file, in return (0); } -/* Verify mode of 'pathname'. */ -int -assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode) -{ - int mode; - int r; - - assertion_count(file, line); -#if defined(_WIN32) && !defined(__CYGWIN__) - failure_start(file, line, "assertFileMode not yet implemented for Windows"); -#else - { - struct stat st; - r = lstat(pathname, &st); - mode = (int)(st.st_mode & 0777); - } - if (r == 0 && mode == expected_mode) - return (1); - failure_start(file, line, "File %s has mode %o, expected %o", - pathname, mode, expected_mode); -#endif - failure_finish(NULL); - return (0); -} - /* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */ int assertion_is_dir(const char *file, int line, const char *pathname, int mode) @@ -1664,6 +1671,7 @@ assertion_make_file(const char *file, in if (0 != chmod(path, mode)) { failure_start(file, line, "Could not chmod %s", path); failure_finish(NULL); + close(fd); return (0); } if (contents != NULL) { @@ -1678,6 +1686,7 @@ assertion_make_file(const char *file, in failure_start(file, line, "Could not write to %s", path); failure_finish(NULL); + close(fd); return (0); } } Modified: head/contrib/libarchive/libarchive/test/test.h ============================================================================== --- head/contrib/libarchive/libarchive/test/test.h Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/libarchive/test/test.h Thu Oct 13 11:40:34 2016 (r307215) @@ -243,12 +243,12 @@ int assertion_file_birthtime_recent(cons int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **); int assertion_file_contents(const char *, int, const void *, int, const char *); int assertion_file_exists(const char *, int, const char *); +int assertion_file_mode(const char *, int, const char *, int); int assertion_file_mtime(const char *, int, const char *, long, long); int assertion_file_mtime_recent(const char *, int, const char *); int assertion_file_nlinks(const char *, int, const char *, int); int assertion_file_not_exists(const char *, int, const char *); int assertion_file_size(const char *, int, const char *, long); -int assertion_file_mode(const char *, int, const char *, int); int assertion_is_dir(const char *, int, const char *, int); int assertion_is_hardlink(const char *, int, const char *, const char *); int assertion_is_not_hardlink(const char *, int, const char *, const char *); @@ -329,6 +329,9 @@ void copy_reference_file(const char *); */ void extract_reference_files(const char **); +/* Subtract umask from mode */ +mode_t umasked(mode_t expected_mode); + /* Path to working directory for current test */ extern const char *testworkdir; Modified: head/contrib/libarchive/libarchive/test/test_read_set_format.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_set_format.c Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/libarchive/test/test_read_set_format.c Thu Oct 13 11:40:34 2016 (r307215) @@ -200,6 +200,8 @@ DEFINE_TEST(test_read_append_filter_wron { struct archive_entry *ae; struct archive *a; + int fd; + fpos_t pos; /* * If we have "bunzip2 -q", try using that. @@ -208,6 +210,13 @@ DEFINE_TEST(test_read_append_filter_wron skipping("Can't run bunzip2 program on this platform"); return; } + + /* bunzip2 will write to stderr, redirect it to a file */ + fflush(stderr); + fgetpos(stderr, &pos); + fd = dup(fileno(stderr)); + freopen("stderr1", "w", stderr); + assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR)); assertEqualIntA(a, ARCHIVE_OK, @@ -217,4 +226,13 @@ DEFINE_TEST(test_read_append_filter_wron assertA(archive_read_next_header(a, &ae) < (ARCHIVE_WARN)); assertEqualIntA(a, ARCHIVE_WARN, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* restore stderr */ + fflush(stderr); + dup2(fd, fileno(stderr)); + close(fd); + clearerr(stderr); + fsetpos(stderr, &pos); + + assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1"); } Modified: head/contrib/libarchive/tar/test/main.c ============================================================================== --- head/contrib/libarchive/tar/test/main.c Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/tar/test/main.c Thu Oct 13 11:40:34 2016 (r307215) @@ -1164,6 +1164,35 @@ assertion_file_contains_lines_any_order( return (0); } +/* Verify that a text file does not contains the specified strings */ +int +assertion_file_contains_no_invalid_strings(const char *file, int line, + const char *pathname, const char *strings[]) +{ + char *buff; + int i; + + buff = slurpfile(NULL, "%s", pathname); + if (buff == NULL) { + failure_start(file, line, "Can't read file: %s", pathname); + failure_finish(NULL); + return (0); + } + + for (i = 0; strings[i] != NULL; ++i) { + if (strstr(buff, strings[i]) != NULL) { + failure_start(file, line, "Invalid string in %s: %s", pathname, + strings[i]); + failure_finish(NULL); + free(buff); + return(0); + } + } + + free(buff); + return (0); +} + /* Test that two paths point to the same file. */ /* As a side-effect, asserts that both files exist. */ static int @@ -1301,6 +1330,11 @@ assertion_file_time(const char *file, in switch (type) { case 'a': filet_nsec = st.st_atimespec.tv_nsec; break; case 'b': filet = st.st_birthtime; + /* FreeBSD filesystems that don't support birthtime + * (e.g., UFS1) always return -1 here. */ + if (filet == -1) { + return (1); + } filet_nsec = st.st_birthtimespec.tv_nsec; break; case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break; default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type); @@ -1432,7 +1466,7 @@ assertion_file_nlinks(const char *file, assertion_count(file, line); r = lstat(pathname, &st); if (r == 0 && (int)st.st_nlink == nlinks) - return (1); + return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); failure_finish(NULL); @@ -1668,6 +1702,7 @@ assertion_make_file(const char *file, in if (0 != chmod(path, mode)) { failure_start(file, line, "Could not chmod %s", path); failure_finish(NULL); + close(fd); return (0); } if (contents != NULL) { @@ -1682,6 +1717,7 @@ assertion_make_file(const char *file, in failure_start(file, line, "Could not write to %s", path); failure_finish(NULL); + close(fd); return (0); } } Modified: head/contrib/libarchive/tar/test/test.h ============================================================================== --- head/contrib/libarchive/tar/test/test.h Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/tar/test/test.h Thu Oct 13 11:40:34 2016 (r307215) @@ -174,6 +174,9 @@ /* Assert that file contents match a string. */ #define assertFileContents(data, data_size, pathname) \ assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname) +/* Verify that a file does not contain invalid strings */ +#define assertFileContainsNoInvalidStrings(pathname, strings) \ + assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings) #define assertFileMtime(pathname, sec, nsec) \ assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec) #define assertFileMtimeRecent(pathname) \ @@ -182,6 +185,8 @@ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks) #define assertFileSize(pathname, size) \ assertion_file_size(__FILE__, __LINE__, pathname, size) +#define assertFileMode(pathname, mode) \ + assertion_file_mode(__FILE__, __LINE__, pathname, mode) #define assertTextFileContents(text, pathname) \ assertion_text_file_contents(__FILE__, __LINE__, text, pathname) #define assertFileContainsLinesAnyOrder(pathname, lines) \ @@ -239,6 +244,7 @@ int assertion_file_atime_recent(const ch int assertion_file_birthtime(const char *, int, const char *, long, long); int assertion_file_birthtime_recent(const char *, int, const char *); int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **); +int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **); int assertion_file_contents(const char *, int, const void *, int, const char *); int assertion_file_exists(const char *, int, const char *); int assertion_file_mode(const char *, int, const char *, int); Modified: head/contrib/libarchive/tar/test/test_missing_file.c ============================================================================== --- head/contrib/libarchive/tar/test/test_missing_file.c Thu Oct 13 11:34:23 2016 (r307214) +++ head/contrib/libarchive/tar/test/test_missing_file.c Thu Oct 13 11:40:34 2016 (r307215) @@ -27,11 +27,15 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_missing_file) { + const char * invalid_stderr[] = { "INTERNAL ERROR", NULL }; assertMakeFile("file1", 0644, "file1"); assertMakeFile("file2", 0644, "file2"); assert(0 == systemf("%s -cf archive.tar file1 file2 2>stderr1", testprog)); assertEmptyFile("stderr1"); assert(0 != systemf("%s -cf archive.tar file1 file2 file3 2>stderr2", testprog)); + assertFileContainsNoInvalidStrings("stderr2", invalid_stderr); assert(0 != systemf("%s -cf archive.tar 2>stderr3", testprog)); - assert(0 != systemf("%s -cf archive.tar file3 2>stderr4", testprog)); + assertFileContainsNoInvalidStrings("stderr3", invalid_stderr); + assert(0 != systemf("%s -cf archive.tar file3 file4 2>stderr4", testprog)); + assertFileContainsNoInvalidStrings("stderr4", invalid_stderr); } From owner-svn-src-head@freebsd.org Thu Oct 13 13:06:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D401FC1016D; Thu, 13 Oct 2016 13:06:35 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DAF0A3D; Thu, 13 Oct 2016 13:06:35 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x244.google.com with SMTP id o19so5787277ito.3; Thu, 13 Oct 2016 06:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/YjwrfpmfG12F7YMKy7TDAmqy43cb4AhDnVs3ixAyKM=; b=udoO7PPq4v0sY1Mbx6zUPsxKsem6KxefIgCp8eSunspf9aHGL8FQoR7/SohS0eVTXQ D3p/Rkt8suUpebt/IMId+u566e2rczg2uFV6doBoJrmAkCHqJgv4gSQna9h08M5yEQOw cEKGW2/mpjemueM8gLrTsSLFSl+7IFhG0PhqX4Z2eWDfGWbLW+C0saYi0YX4k9OkHjPg QDtRQLNk8glcLJs0OdMV4TknqffSRQOGqKFitRIAHJ5yazirheW4KMojggW0kxuTdEcw b4xYkTsJ4Z08aFDn4Tdt3NVKRdPREvcatnTR4XxLdRPMMfLQlpq4TttXe4wGUvjMuMJp 4zHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=/YjwrfpmfG12F7YMKy7TDAmqy43cb4AhDnVs3ixAyKM=; b=f/Cn72P4KUYA3yu6sOwYiXVeURd/2BVAoomLU1omkKst/np5yyYdlbbHhsTpmKOvD8 cUbnpHbXmVr/VjxlYuHjmKWsLopnmM9MofMTRBLYUVn2dKEM4bpcGuiFEV8m4DMXE52U WL79s+lPqNrv6KhGlWa+mEddOZXmeOODf15/ALXh0YNB1oVQpvKLC3daXBEPfyAL9XQG wdqrN717+ZwCfDzdhPoxRf+erD2+pnJaNwbtZP/wRMZlfaGgDXnrdlcQPfPncDrvtxBP daab9vN788VCBSCFtOABVT4BkDwbWkmZDpmjqyJqd2MlvER+72mSH1vipHLN1moqyuiU c8aA== X-Gm-Message-State: AA6/9RmD+rsCDyaRatjTijnnQ7/+z9FnzuWxhEj+C1oDwgIguddtlFOq5NecrGtcLrBLll2t26PX0z7nh/Su0A== X-Received: by 10.36.108.8 with SMTP id w8mr7740375itb.83.1476363994722; Thu, 13 Oct 2016 06:06:34 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.180.211 with HTTP; Thu, 13 Oct 2016 06:06:14 -0700 (PDT) In-Reply-To: <20161013110013.W925@besplex.bde.org> References: <201610121356.u9CDuF1q013531@repo.freebsd.org> <20161013110013.W925@besplex.bde.org> From: Ed Maste Date: Thu, 13 Oct 2016 13:06:14 +0000 X-Google-Sender-Auth: goFlwxKYw2g47otjol7CJAXm7ps Message-ID: Subject: Re: svn commit: r307148 - in head/lib/libc: gen stdlib To: Bruce Evans Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 13:06:35 -0000 On 13 October 2016 at 02:05, Bruce Evans wrote: > On Wed, 12 Oct 2016, Ed Maste wrote: > > The comment starts by being just wrong: > > 1. "The" sysctl is not used here. Instead, a wrapper arc4_sysctl() is used. > The wrapper handles some but not all errors. Fixed in my WIP tree. > 2. The sysctl can and does fail. It fails on: > - all old kernels mixed with new userlands We don't support new userlands on very old kernels, and I think there are many other things in libc that will fail on kernels old enough to lack kern.arandom. > - with new kernels, at boot time, before the random device is seeded. If that is indeed still possible it's a bug we need to fix before 12.0. > 3. The sysctl can, or at least used to, return short reads with nonzero > counts. That was addressed in markm's 2015 random work, I think. Presumably random() was silently broken for the rand_type != TYPE_0 case prior to that. > The documentation for this is well hidden, but the > arc4_sysctl() wrapper exists to support short reads, or perhaps just > the special case of short reads of 0, which it handles poorly by > possibly spinning forever. I suspect we can just remove the arc4_sysctl wrapper too. > Then the excuse is wrong. abort() never makes sense in library functions. arc4random must not return without good quality random data. The other option would be for it to loop indefinitely. > Here it gives very confusing errors for the delicate boot-time fandago > case. The "delicate boot-time fandango case" was a bug. > Style bugs: > - sentence breaks are 2 spaces in KNF, and all old code in this file follows > that rule. Fixed in my WIP tree. > - 'abort' is not marked up Fixed in my WIP tree. > This is even more broken, since it doesn't have the wrapper. This and the other issues predate my changes; I'll take a look at the history soon. From owner-svn-src-head@freebsd.org Thu Oct 13 13:38:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4CF9C10D42; Thu, 13 Oct 2016 13:38:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1534378; Thu, 13 Oct 2016 13:38:15 +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 u9DDcEoa056705; Thu, 13 Oct 2016 13:38:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DDcE8X056704; Thu, 13 Oct 2016 13:38:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201610131338.u9DDcE8X056704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 13 Oct 2016 13:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307216 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 13:38:16 -0000 Author: tuexen Date: Thu Oct 13 13:38:14 2016 New Revision: 307216 URL: https://svnweb.freebsd.org/changeset/base/307216 Log: Whitespace changes. MFC after: 1 month Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Thu Oct 13 11:40:34 2016 (r307215) +++ head/sys/netinet/sctp_pcb.c Thu Oct 13 13:38:14 2016 (r307216) @@ -77,7 +77,6 @@ SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 } return (IN6_ARE_ADDR_EQUAL(&tmp_a.sin6_addr, &tmp_b.sin6_addr)); } - #endif void @@ -837,14 +836,11 @@ static int sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) { int loopback_scope; - #if defined(INET) int ipv4_local_scope, ipv4_addr_legal; - #endif #if defined(INET6) int local_scope, site_scope, ipv6_addr_legal; - #endif struct sctp_vrf *vrf; struct sctp_ifn *sctp_ifn; @@ -1216,10 +1212,8 @@ sctp_tcb_special_locate(struct sctp_inpc if (netp != NULL) { *netp = net; } - /* - * Update the endpoint - * pointer - */ + /* Update the endpoint + * pointer */ *inp_p = inp; SCTP_INP_RUNLOCK(inp); return (stcb); @@ -1240,10 +1234,8 @@ sctp_tcb_special_locate(struct sctp_inpc if (netp != NULL) { *netp = net; } - /* - * Update the endpoint - * pointer - */ + /* Update the endpoint + * pointer */ *inp_p = inp; SCTP_INP_RUNLOCK(inp); return (stcb); @@ -1622,15 +1614,12 @@ sctp_endpoint_probe(struct sockaddr *nam { struct sctp_inpcb *inp; struct sctp_laddr *laddr; - #ifdef INET struct sockaddr_in *sin; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sockaddr_in6 *intf_addr6; - #endif int fnd; @@ -1673,10 +1662,8 @@ sctp_endpoint_probe(struct sockaddr *nam case AF_INET: if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && SCTP_IPV6_V6ONLY(inp)) { - /* - * IPv4 on a IPv6 socket with ONLY - * IPv6 set - */ + /* IPv4 on a IPv6 socket with ONLY + * IPv6 set */ SCTP_INP_RUNLOCK(inp); continue; } @@ -1689,10 +1676,8 @@ sctp_endpoint_probe(struct sockaddr *nam #endif #ifdef INET6 case AF_INET6: - /* - * A V6 address and the endpoint is NOT - * bound V6 - */ + /* A V6 address and the endpoint is NOT + * bound V6 */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) { SCTP_INP_RUNLOCK(inp); continue; @@ -1926,14 +1911,11 @@ sctp_pcb_findep(struct sockaddr *nam, in struct sctppcbhead *head; int lport; unsigned int i; - #ifdef INET struct sockaddr_in *sin; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; - #endif switch (nam->sa_family) { @@ -2057,21 +2039,16 @@ sctp_findassociation_special_addr(struct struct sockaddr *dst) { struct sctp_paramhdr *phdr, parm_buf; - #if defined(INET) || defined(INET6) struct sctp_tcb *stcb; uint16_t ptype; - #endif uint16_t plen; - #ifdef INET struct sockaddr_in sin4; - #endif #ifdef INET6 struct sockaddr_in6 sin6; - #endif #ifdef INET @@ -2198,10 +2175,8 @@ sctp_findassoc_by_vtag(struct sockaddr * continue; } if (remote_tag) { - /* - * If we have both vtags that's all we match - * on - */ + /* If we have both vtags that's all we match + * on */ if (stcb->asoc.peer_vtag == remote_tag) { /* * If both tags match we consider it @@ -2319,14 +2294,11 @@ sctp_findassociation_ep_asconf(struct mb struct sctp_paramhdr parm_buf, *phdr; int ptype; int zero_address = 0; - #ifdef INET struct sockaddr_in *sin; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; - #endif memset(&remote_store, 0, sizeof(remote_store)); @@ -2897,10 +2869,8 @@ sctp_inpcb_bind(struct socket *so, struc #ifdef INET6 case AF_INET6: { - /* - * Only for pure IPv6 Address. (No IPv4 - * Mapped!) - */ + /* Only for pure IPv6 Address. (No IPv4 + * Mapped!) */ struct sockaddr_in6 *sin6; sin6 = (struct sockaddr_in6 *)addr; @@ -2977,10 +2947,8 @@ sctp_inpcb_bind(struct socket *so, struc /* unlock info */ if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && (sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) { - /* - * Ok, must be one-2-one and - * allowing port re-use - */ + /* Ok, must be one-2-one and + * allowing port re-use */ port_reuse_active = 1; goto continue_anyway; } @@ -3003,10 +2971,8 @@ sctp_inpcb_bind(struct socket *so, struc /* unlock info */ if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && (sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) { - /* - * Ok, must be one-2-one and - * allowing port re-use - */ + /* Ok, must be one-2-one and + * allowing port re-use */ port_reuse_active = 1; goto continue_anyway; } @@ -3146,11 +3112,11 @@ continue_anyway: * bind specific, make sure flags is off and add a new * address structure to the sctp_addr_list inside the ep * structure. - * - * We will need to allocate one and insert it at the head. The - * socketopt call can just insert new addresses in there as - * well. It will also have to do the embed scope kame hack - * too (before adding). + * + * We will need to allocate one and insert it at the head. + * The socketopt call can just insert new addresses in there + * as well. It will also have to do the embed scope kame + * hack too (before adding). */ struct sctp_ifa *ifa; union sctp_sockstore store; @@ -3268,11 +3234,11 @@ sctp_iterator_inp_being_freed(struct sct * from happening. But of course the iterator has a * reference on the stcb and inp. We can mark it and it will * stop. - * - * If its a single iterator situation, we set the end iterator - * flag. Otherwise we set the iterator to go to the next - * inp. - * + * + * If its a single iterator situation, we set the end + * iterator flag. Otherwise we set the iterator to go to the + * next inp. + * */ if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT; @@ -3305,10 +3271,8 @@ sctp_iterator_inp_being_freed(struct sct SCTP_INP_INCR_REF(it->inp); } } - /* - * When its put in the refcnt is incremented so decr - * it - */ + /* When its put in the refcnt is incremented so decr + * it */ SCTP_INP_DECR_REF(inp); } } @@ -3991,10 +3955,8 @@ sctp_add_remote_addr(struct sctp_tcb *st rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt); if (rmtu == 0) { - /* - * Start things off to match mtu of - * interface please. - */ + /* Start things off to match mtu of + * interface please. */ SCTP_SET_MTU_OF_ROUTE(&net->ro._l_addr.sa, net->ro.ro_rt, net->mtu); } else { @@ -5484,10 +5446,8 @@ sctp_del_local_addr_ep(struct sctp_inpcb if (stcb->asoc.last_used_address == laddr) /* delete this address */ stcb->asoc.last_used_address = NULL; - /* - * Now spin through all the nets and purge any ref - * to laddr - */ + /* Now spin through all the nets and purge any ref + * to laddr */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (net->ro._s_addr == laddr->ifa) { /* Yep, purge src address selected */ @@ -5755,7 +5715,6 @@ sctp_startup_mcore_threads(void) } } - #endif void @@ -6097,14 +6056,11 @@ sctp_load_addresses_from_init(struct sct uint8_t peer_supports_nrsack; uint8_t peer_supports_pktdrop; uint8_t peer_supports_idata; - #ifdef INET struct sockaddr_in sin; - #endif #ifdef INET6 struct sockaddr_in6 sin6; - #endif /* First get the destination address setup too. */ @@ -6267,10 +6223,8 @@ sctp_load_addresses_from_init(struct sct struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - /* - * in setup state we - * abort this guy - */ + /* in setup state we + * abort this guy */ snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), @@ -6312,10 +6266,8 @@ sctp_load_addresses_from_init(struct sct goto next_param; } if (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr)) { - /* - * Link local make no sense without - * scope - */ + /* Link local make no sense without + * scope */ goto next_param; } sa = (struct sockaddr *)&sin6; @@ -6366,10 +6318,8 @@ sctp_load_addresses_from_init(struct sct struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - /* - * in setup state we - * abort this guy - */ + /* in setup state we + * abort this guy */ snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), @@ -6409,10 +6359,8 @@ sctp_load_addresses_from_init(struct sct struct sctp_asconf_addr_param lstore, *fee; int lptype; struct sockaddr *lsa = NULL; - #ifdef INET struct sctp_asconf_addrv4_param *fii; - #endif if (stcb->asoc.asconf_supported == 0) { From owner-svn-src-head@freebsd.org Thu Oct 13 13:53:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E657C1012C; Thu, 13 Oct 2016 13:53:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2947AEB5; Thu, 13 Oct 2016 13:53:02 +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 u9DDr1oG064044; Thu, 13 Oct 2016 13:53:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DDr1Le064043; Thu, 13 Oct 2016 13:53:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201610131353.u9DDr1Le064043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 13 Oct 2016 13:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307217 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 13:53:02 -0000 Author: tuexen Date: Thu Oct 13 13:53:01 2016 New Revision: 307217 URL: https://svnweb.freebsd.org/changeset/base/307217 Log: Mark the socket as un-writable when it is 1-to-1 and the SCTP association is freed. MFC after: 1 month Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Thu Oct 13 13:38:14 2016 (r307216) +++ head/sys/netinet/sctp_pcb.c Thu Oct 13 13:53:01 2016 (r307217) @@ -4870,6 +4870,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, SS_ISCONNECTED); } socantrcvmore_locked(so); + socantsendmore(so); sctp_sowwakeup(inp, so); sctp_sorwakeup(inp, so); SCTP_SOWAKEUP(so); From owner-svn-src-head@freebsd.org Thu Oct 13 14:41:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B98C10EAA; Thu, 13 Oct 2016 14:41:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3965ACF; Thu, 13 Oct 2016 14:41:06 +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 u9DEf5jY079962; Thu, 13 Oct 2016 14:41:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DEf5Gg079955; Thu, 13 Oct 2016 14:41:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201610131441.u9DEf5Gg079955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Oct 2016 14:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307218 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/drm2/i915 dev/drm2/ttm kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 14:41:07 -0000 Author: kib Date: Thu Oct 13 14:41:05 2016 New Revision: 307218 URL: https://svnweb.freebsd.org/changeset/base/307218 Log: Fix a race in vm_page_busy_sleep(9). Suppose that we have an exclusively busy page, and a thread which can accept shared-busy page. In this case, typical code waiting for the page xbusy state to pass is again: VM_OBJECT_WLOCK(object); ... if (vm_page_xbusied(m)) { vm_page_lock(m); VM_OBJECT_WUNLOCK(object); <---1 vm_page_busy_sleep(p, "vmopax"); goto again; } Suppose that the xbusy state owner locked the object, unbusied the page and unlocked the object after we are at the line [1], but before we executed the load of the busy_lock word in vm_page_busy_sleep(). If it happens that there is still no waiters recorded for the busy state, the xbusy owner did not acquired the page lock, so it proceeded. More, suppose that some other thread happen to share-busy the page after xbusy state was relinquished but before the m->busy_lock is read in vm_page_busy_sleep(). Again, that thread only needs vm_object lock to proceed. Then, vm_page_busy_sleep() reads busy_lock value equal to the VPB_SHARERS_WORD(1). In this case, all tests in vm_page_busy_sleep(9) pass and we are going to sleep, despite the page being share-busied. Update check for m->busy_lock == VPB_UNBUSIED in vm_page_busy_sleep(9) to also accept shared-busy state if we only wait for the xbusy state to pass. Merge sequential if()s with the same 'then' clause in vm_page_busy_sleep(). Note that the current code does not share-busy pages from parallel threads, the only way to have more that one sbusy owner is right now is to recurse. Reported and tested by: pho (previous version) Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D8196 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/ttm/ttm_bo_vm.c head/sys/kern/vfs_bio.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h 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 Thu Oct 13 13:53:01 2016 (r307217) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Oct 13 14:41:05 2016 (r307218) @@ -421,7 +421,7 @@ page_busy(vnode_t *vp, int64_t start, in vm_page_reference(pp); vm_page_lock(pp); zfs_vmobject_wunlock(obj); - vm_page_busy_sleep(pp, "zfsmwb"); + vm_page_busy_sleep(pp, "zfsmwb", true); zfs_vmobject_wlock(obj); continue; } @@ -476,7 +476,7 @@ page_hold(vnode_t *vp, int64_t start) vm_page_reference(pp); vm_page_lock(pp); zfs_vmobject_wunlock(obj); - vm_page_busy_sleep(pp, "zfsmwb"); + vm_page_busy_sleep(pp, "zfsmwb", true); zfs_vmobject_wlock(obj); continue; } Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Thu Oct 13 13:53:01 2016 (r307217) +++ head/sys/dev/drm2/i915/i915_gem.c Thu Oct 13 14:41:05 2016 (r307218) @@ -1533,7 +1533,7 @@ retry: DRM_UNLOCK(dev); vm_page_lock(page); VM_OBJECT_WUNLOCK(vm_obj); - vm_page_busy_sleep(page, "915pee"); + vm_page_busy_sleep(page, "915pee", false); goto retry; } goto have_page; @@ -1575,7 +1575,7 @@ retry: DRM_UNLOCK(dev); vm_page_lock(page); VM_OBJECT_WUNLOCK(vm_obj); - vm_page_busy_sleep(page, "915pbs"); + vm_page_busy_sleep(page, "915pbs", false); goto retry; } if (vm_page_insert(page, vm_obj, OFF_TO_IDX(offset))) { Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Oct 13 13:53:01 2016 (r307217) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Oct 13 14:41:05 2016 (r307218) @@ -236,7 +236,7 @@ reserve: if (vm_page_busied(m)) { vm_page_lock(m); VM_OBJECT_WUNLOCK(vm_obj); - vm_page_busy_sleep(m, "ttmpbs"); + vm_page_busy_sleep(m, "ttmpbs", false); VM_OBJECT_WLOCK(vm_obj); ttm_mem_io_unlock(man); ttm_bo_unreserve(bo); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Oct 13 13:53:01 2016 (r307217) +++ head/sys/kern/vfs_bio.c Thu Oct 13 14:41:05 2016 (r307218) @@ -2633,7 +2633,7 @@ vfs_vmio_invalidate(struct buf *bp) while (vm_page_xbusied(m)) { vm_page_lock(m); VM_OBJECT_WUNLOCK(obj); - vm_page_busy_sleep(m, "mbncsh"); + vm_page_busy_sleep(m, "mbncsh", true); VM_OBJECT_WLOCK(obj); } if (pmap_page_wired_mappings(m) == 0) @@ -4182,7 +4182,7 @@ vfs_drain_busy_pages(struct buf *bp) while (vm_page_xbusied(m)) { vm_page_lock(m); VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object); - vm_page_busy_sleep(m, "vbpage"); + vm_page_busy_sleep(m, "vbpage", true); VM_OBJECT_WLOCK(bp->b_bufobj->bo_object); } } Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Oct 13 13:53:01 2016 (r307217) +++ head/sys/vm/vm_object.c Thu Oct 13 14:41:05 2016 (r307218) @@ -1186,7 +1186,7 @@ shadowlookup: if (object != tobject) VM_OBJECT_WUNLOCK(object); VM_OBJECT_WUNLOCK(tobject); - vm_page_busy_sleep(m, "madvpo"); + vm_page_busy_sleep(m, "madvpo", false); VM_OBJECT_WLOCK(object); goto relookup; } @@ -1365,7 +1365,7 @@ retry: VM_OBJECT_WUNLOCK(new_object); vm_page_lock(m); VM_OBJECT_WUNLOCK(orig_object); - vm_page_busy_sleep(m, "spltwt"); + vm_page_busy_sleep(m, "spltwt", false); VM_OBJECT_WLOCK(orig_object); VM_OBJECT_WLOCK(new_object); goto retry; @@ -1453,7 +1453,7 @@ vm_object_collapse_scan_wait(vm_object_t if (p == NULL) VM_WAIT; else - vm_page_busy_sleep(p, "vmocol"); + vm_page_busy_sleep(p, "vmocol", false); VM_OBJECT_WLOCK(object); VM_OBJECT_WLOCK(backing_object); return (TAILQ_FIRST(&backing_object->memq)); @@ -1912,7 +1912,7 @@ again: vm_page_lock(p); if (vm_page_xbusied(p)) { VM_OBJECT_WUNLOCK(object); - vm_page_busy_sleep(p, "vmopax"); + vm_page_busy_sleep(p, "vmopax", true); VM_OBJECT_WLOCK(object); goto again; } @@ -1927,7 +1927,7 @@ again: } if (vm_page_busied(p)) { VM_OBJECT_WUNLOCK(object); - vm_page_busy_sleep(p, "vmopar"); + vm_page_busy_sleep(p, "vmopar", false); VM_OBJECT_WLOCK(object); goto again; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Oct 13 13:53:01 2016 (r307217) +++ head/sys/vm/vm_page.c Thu Oct 13 14:41:05 2016 (r307218) @@ -741,21 +741,20 @@ vm_page_sunbusy(vm_page_t m) * This is used to implement the hard-path of busying mechanism. * * The given page must be locked. + * + * If nonshared is true, sleep only if the page is xbusy. */ void -vm_page_busy_sleep(vm_page_t m, const char *wmesg) +vm_page_busy_sleep(vm_page_t m, const char *wmesg, bool nonshared) { u_int x; - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); x = m->busy_lock; - if (x == VPB_UNBUSIED) { - vm_page_unlock(m); - return; - } - if ((x & VPB_BIT_WAITERS) == 0 && - !atomic_cmpset_int(&m->busy_lock, x, x | VPB_BIT_WAITERS)) { + if (x == VPB_UNBUSIED || (nonshared && (x & VPB_BIT_SHARED) != 0) || + ((x & VPB_BIT_WAITERS) == 0 && + !atomic_cmpset_int(&m->busy_lock, x, x | VPB_BIT_WAITERS))) { vm_page_unlock(m); return; } @@ -1092,7 +1091,7 @@ vm_page_sleep_if_busy(vm_page_t m, const obj = m->object; vm_page_lock(m); VM_OBJECT_WUNLOCK(obj); - vm_page_busy_sleep(m, msg); + vm_page_busy_sleep(m, msg, false); VM_OBJECT_WLOCK(obj); return (TRUE); } @@ -3455,7 +3454,8 @@ retrylookup: vm_page_aflag_set(m, PGA_REFERENCED); vm_page_lock(m); VM_OBJECT_WUNLOCK(object); - vm_page_busy_sleep(m, "pgrbwt"); + vm_page_busy_sleep(m, "pgrbwt", (allocflags & + VM_ALLOC_IGN_SBUSY) != 0); VM_OBJECT_WLOCK(object); goto retrylookup; } else { Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Oct 13 13:53:01 2016 (r307217) +++ head/sys/vm/vm_page.h Thu Oct 13 14:41:05 2016 (r307218) @@ -436,7 +436,7 @@ malloc2vm_flags(int malloc_flags) #endif void vm_page_busy_downgrade(vm_page_t m); -void vm_page_busy_sleep(vm_page_t m, const char *msg); +void vm_page_busy_sleep(vm_page_t m, const char *msg, bool nonshared); void vm_page_flash(vm_page_t m); void vm_page_hold(vm_page_t mem); void vm_page_unhold(vm_page_t mem); From owner-svn-src-head@freebsd.org Thu Oct 13 15:23:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7355EC0C6F2; Thu, 13 Oct 2016 15:23:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4296BCD2; Thu, 13 Oct 2016 15:23:54 +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 u9DFNrH2098528; Thu, 13 Oct 2016 15:23:53 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DFNr8N098526; Thu, 13 Oct 2016 15:23:53 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610131523.u9DFNr8N098526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 13 Oct 2016 15:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307219 - head/lib/libc/mips/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 15:23:54 -0000 Author: br Date: Thu Oct 13 15:23:53 2016 New Revision: 307219 URL: https://svnweb.freebsd.org/changeset/base/307219 Log: Fix strchr, strrchr implementation: convert c to char (according to standard). Discussed with: andrew Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8239 Modified: head/lib/libc/mips/string/strchr.S head/lib/libc/mips/string/strrchr.S Modified: head/lib/libc/mips/string/strchr.S ============================================================================== --- head/lib/libc/mips/string/strchr.S Thu Oct 13 14:41:05 2016 (r307218) +++ head/lib/libc/mips/string/strchr.S Thu Oct 13 15:23:53 2016 (r307219) @@ -44,7 +44,12 @@ __FBSDID("$FreeBSD$"); .abicalls #endif +/* + * char * + * strchr(const char *s, int c); + */ LEAF(strchr) + and a1, a1, 0xff 1: lbu a2, 0(a0) # get a byte PTR_ADDU a0, a0, 1 Modified: head/lib/libc/mips/string/strrchr.S ============================================================================== --- head/lib/libc/mips/string/strrchr.S Thu Oct 13 14:41:05 2016 (r307218) +++ head/lib/libc/mips/string/strrchr.S Thu Oct 13 15:23:53 2016 (r307219) @@ -44,8 +44,13 @@ __FBSDID("$FreeBSD$"); .abicalls #endif +/* + * char * + * strrchr(const char *s, int c); + */ LEAF(strrchr) move v0, zero # default if not found + and a1, a1, 0xff 1: lbu a3, 0(a0) # get a byte PTR_ADDU a0, a0, 1 From owner-svn-src-head@freebsd.org Thu Oct 13 15:26:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF8F0C0C902; Thu, 13 Oct 2016 15:26:52 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE334F93; Thu, 13 Oct 2016 15:26:52 +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 u9DFQpu4098669; Thu, 13 Oct 2016 15:26:51 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DFQp1Q098668; Thu, 13 Oct 2016 15:26:51 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610131526.u9DFQp1Q098668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 13 Oct 2016 15:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307220 - head/lib/libc/tests/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 15:26:53 -0000 Author: br Date: Thu Oct 13 15:26:51 2016 New Revision: 307220 URL: https://svnweb.freebsd.org/changeset/base/307220 Log: Fix typos: use correct string format and value to compare. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8226 Modified: head/lib/libc/tests/stdio/printbasic_test.c Modified: head/lib/libc/tests/stdio/printbasic_test.c ============================================================================== --- head/lib/libc/tests/stdio/printbasic_test.c Thu Oct 13 15:23:53 2016 (r307219) +++ head/lib/libc/tests/stdio/printbasic_test.c Thu Oct 13 15:26:51 2016 (r307220) @@ -124,10 +124,10 @@ ATF_TC_BODY(int_within_limits, tc) testfmt(S_ULONGMAX, "%lu", ULONG_MAX); testfmt("-1", "%lld", (long long)-1); - testfmt(S_ULONGMAX, "%lu", ULLONG_MAX); + testfmt(S_ULLONGMAX, "%llu", ULLONG_MAX); testfmt("-1", "%d", -1); - testfmt(S_UINT32MAX, "%lu", UINT32_MAX); + testfmt(S_UINT32MAX, "%u", UINT32_MAX); testfmt("-1", "%hd", -1); testfmt("65535", "%hu", USHRT_MAX); From owner-svn-src-head@freebsd.org Thu Oct 13 16:41:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43E07C10AA0; Thu, 13 Oct 2016 16:41:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15E1684B; Thu, 13 Oct 2016 16:41:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DGfYBL027946; Thu, 13 Oct 2016 16:41:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DGfYXZ027945; Thu, 13 Oct 2016 16:41:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201610131641.u9DGfYXZ027945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 13 Oct 2016 16:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307221 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 16:41:35 -0000 Author: adrian Date: Thu Oct 13 16:41:34 2016 New Revision: 307221 URL: https://svnweb.freebsd.org/changeset/base/307221 Log: [net80211] add some more QoS frame subtypes. Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Thu Oct 13 15:26:51 2016 (r307220) +++ head/sys/net80211/ieee80211.h Thu Oct 13 16:41:34 2016 (r307221) @@ -157,8 +157,17 @@ struct ieee80211_qosframe_addr4 { #define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60 #define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70 #define IEEE80211_FC0_SUBTYPE_QOS 0x80 +#define IEEE80211_FC0_SUBTYPE_QOS_CFACK 0x90 +#define IEEE80211_FC0_SUBTYPE_QOS_CFPOLL 0xa0 +#define IEEE80211_FC0_SUBTYPE_QOS_CFACKPOLL 0xb0 #define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0 +#define IEEE80211_FC0_QOSDATA \ + (IEEE80211_FC0_TYPE_DATA|IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_VERSION_0) + +#define IEEE80211_IS_QOSDATA(wh) \ + ((wh)->i_fc[0] == IEEE80211_FC0_QOSDATA) + #define IEEE80211_FC1_DIR_MASK 0x03 #define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */ #define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */ @@ -199,6 +208,8 @@ struct ieee80211_qosframe_addr4 { #define IEEE80211_NWID_LEN 32 #define IEEE80211_MESHID_LEN 32 +#define IEEE80211_QOS_CTL_LEN 2 + #define IEEE80211_QOS_TXOP 0x00ff /* bit 8 is reserved */ #define IEEE80211_QOS_AMSDU 0x80 From owner-svn-src-head@freebsd.org Thu Oct 13 16:45:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E3C1C10B72; Thu, 13 Oct 2016 16:45:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF4B9BA0; Thu, 13 Oct 2016 16:45:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DGj1xq028926; Thu, 13 Oct 2016 16:45:01 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DGj1rS028925; Thu, 13 Oct 2016 16:45:01 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201610131645.u9DGj1rS028925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 13 Oct 2016 16:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307222 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 16:45:03 -0000 Author: adrian Date: Thu Oct 13 16:45:01 2016 New Revision: 307222 URL: https://svnweb.freebsd.org/changeset/base/307222 Log: [net80211] remove now duplicate copy of the QOSDATA check macro. Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Thu Oct 13 16:41:34 2016 (r307221) +++ head/sys/net80211/ieee80211_ht.c Thu Oct 13 16:45:01 2016 (r307222) @@ -779,8 +779,6 @@ ampdu_rx_flush_upto(struct ieee80211_nod int ieee80211_ampdu_reorder(struct ieee80211_node *ni, struct mbuf *m) { -#define IEEE80211_FC0_QOSDATA \ - (IEEE80211_FC0_TYPE_DATA|IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_VERSION_0) #define PROCESS 0 /* caller should process frame */ #define CONSUMED 1 /* frame consumed, caller does nothing */ struct ieee80211vap *vap = ni->ni_vap; @@ -966,7 +964,6 @@ again: } #undef CONSUMED #undef PROCESS -#undef IEEE80211_FC0_QOSDATA } /* From owner-svn-src-head@freebsd.org Thu Oct 13 16:57:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD839C10E88; Thu, 13 Oct 2016 16:57:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7954C15F; Thu, 13 Oct 2016 16:57:20 +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 u9DGvJhC032667; Thu, 13 Oct 2016 16:57:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DGvJFA032663; Thu, 13 Oct 2016 16:57:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610131657.u9DGvJFA032663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 13 Oct 2016 16:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307223 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 16:57:20 -0000 Author: emaste Date: Thu Oct 13 16:57:19 2016 New Revision: 307223 URL: https://svnweb.freebsd.org/changeset/base/307223 Log: Convert ­ U+00AD soft hyphen to - in Cavium Octeon SDK Linux's copy of the Cavium SDK does not have these non-ASCII characters and this reduces noise in diffs when comparing the two. Sponsored by: The FreeBSD Foundation Modified: head/sys/contrib/octeon-sdk/cvmx-dma-engine.h head/sys/contrib/octeon-sdk/cvmx-higig.h head/sys/contrib/octeon-sdk/cvmx-pcie.c head/sys/contrib/octeon-sdk/cvmx-raid.h Modified: head/sys/contrib/octeon-sdk/cvmx-dma-engine.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-dma-engine.h Thu Oct 13 16:45:01 2016 (r307222) +++ head/sys/contrib/octeon-sdk/cvmx-dma-engine.h Thu Oct 13 16:57:19 2016 (r307223) @@ -87,7 +87,7 @@ typedef union PCIe memory space pointers in the LAST POINTERS block in the OUTBOUND, INBOUND, and EXTERNAL-ONLY cases. Must be zero in the INTERNAL-ONLY case. Must be zero on chips with PCI */ - cvmx_dma_engine_transfer_t type : 2; /**< Type ­ A given PCI DMA transfer is either OUTBOUND (read from L2/DRAM, + cvmx_dma_engine_transfer_t type : 2; /**< Type - A given PCI DMA transfer is either OUTBOUND (read from L2/DRAM, write into PCI / PCIe memory space), INBOUND (read from PCI / PCIe memory space, write into L2/DRAM), INTERNAL-ONLY (read from L2/DRAM, write into L2/DRAM), or EXTERNAL-ONLY (read from PCIe memory space, write into PCIe memory space). */ @@ -95,14 +95,14 @@ typedef union work-queue entry that is submitted by the hardware after completing the DMA; when WQP = 0, PTR (if non-zero) is a pointer to a byte in local memory that is written to 0 by the hardware after completing the DMA. */ - uint64_t c : 1; /**< C ­ Counter. 1 = use counter 1, 0 = use counter 0. + uint64_t c : 1; /**< C - Counter. 1 = use counter 1, 0 = use counter 0. The C bit selects between the two counters (NPEI_DMA_CNTS[DMA0,DMA1]) that can optionally be updated after an OUTBOUND or EXTERNAL-ONLY transfer, and also selects between the two forced-interrupt bits (NPEI_INT_SUMn[DMA0_FI, DMA1_FI]) that can optionally be set after an OUTBOUND or EXTERNAL-ONLY transfer. C must be zero for INBOUND or INTERNAL-ONLY transfers. */ - uint64_t ca : 1; /**< CA ­ Counter add. + uint64_t ca : 1; /**< CA - Counter add. When CA = 1, the hardware updates the selected counter after it completes the PCI DMA OUTBOUND or EXTERNAL-ONLY Instruction. - If C = 0, PCIE_DMA_CNT0 is updated @@ -117,13 +117,13 @@ typedef union When CA = 0, the hardware does not update any counters. For an INBOUND or INTERNAL-ONLY PCI DMA transfer, CA must never be set, and the hardware never adds to the counters. */ - uint64_t fi : 1; /**< FI ­ Force interrupt. + uint64_t fi : 1; /**< FI - Force interrupt. When FI is set for an OUTBOUND or EXTERNAL-ONLY transfer, the hardware sets a forced interrupt bit after it completes the PCI DMA Instruction. If C = 0, NPEI_INT_SUMn[DMA0_FI] is set, else NPEI_INT_SUMn[DMA1_FI] is set. For an INBOUND or INTERNAL-ONLY PCI DMA operation, FI must never be set, and the hardware never generates interrupts. */ - uint64_t ii : 1; /**< II­ Ignore the I bit (i.e. the I bit of the PCI DMA instruction local pointer). + uint64_t ii : 1; /**< II- Ignore the I bit (i.e. the I bit of the PCI DMA instruction local pointer). For OUTBOUND transfers when II = 1, ignore the I bit and the FL bit in the DMA HDR alone determines whether the hardware frees any/all of the local buffers in the FIRST POINTERS area: @@ -134,7 +134,7 @@ typedef union - when (FL I) is true, the hardware frees the local buffer when II=0. For INBOUND, INTERNAL-ONLY, and EXTERNAL-ONLY PCI DMA transfers, II must never be set, and local buffers are never freed. */ - uint64_t fl : 1; /**< FL ­ Free local buffer. + uint64_t fl : 1; /**< FL - Free local buffer. When FL = 1, for an OUTBOUND operation, it indicates that the local buffers in the FIRST BUFFERS area should be freed. If II = 1, the FL bit alone indicates whether the local buffer should be freed: @@ -145,7 +145,7 @@ typedef union - when (FL I) is true, the hardware frees the local buffer when II=0. For an INBOUND, INTERNAL-ONLY, or EXTERNAL-ONLY PCI DMA transfer, FL must never be set, and local buffers are never freed. */ - uint64_t nlst : 4; /**< NLST ­ Number Last pointers. + uint64_t nlst : 4; /**< NLST - Number Last pointers. The number of pointers in the LAST POINTERS area. In the INBOUND, OUTBOUND, and EXTERNAL-ONLY cases, the LAST POINTERS area contains PCI components, and the number of 64-bit words @@ -156,7 +156,7 @@ typedef union - HDR.NLST Note that the sum of the number of 64-bit words in the LAST POINTERS and FIRST POINTERS area must never exceed 31. */ - uint64_t nfst : 4; /**< NFST ­ Number First pointers. + uint64_t nfst : 4; /**< NFST - Number First pointers. The number of pointers in the FIRST POINTERS area. In the INBOUND, OUTBOUND, and INTERNAL-ONLY cases, the FIRST POINTERS area contains local pointers, and the number of 64-bit words required @@ -166,7 +166,7 @@ typedef union components, and the number of 64-bit words required in the FIRST POINTERS area is: - HDR.NFST + ((HDR.NFST + 3)/4) where the division removes the fraction. */ - uint64_t addr : 40; /**< PTR ­ Pointer, either a work-queue-entry pointer (when WQP = 1) or a local + uint64_t addr : 40; /**< PTR - Pointer, either a work-queue-entry pointer (when WQP = 1) or a local memory pointer (WQP = 0). When WQP = 1 and PTR 0x0, the hardware inserts the work-queue entry indicated by PTR into a POW input queue after the PCI DMA operation is @@ -186,12 +186,12 @@ typedef union uint64_t u64; struct { - uint64_t i : 1; /**< I ­ Invert free. + uint64_t i : 1; /**< I - Invert free. This bit gives the software the ability to free buffers independently for an OUTBOUND PCI DMA transfer. I is not used by the hardware when II is set. I must not be set, and buffers are never freed, for INBOUND, INTERNAL-ONLY, and EXTERNAL-ONLY PCI DMA transfers. */ - uint64_t back : 4; /**< Back ­ Backup amount. + uint64_t back : 4; /**< Back - Backup amount. Allows the start of a buffer that is to be freed during an OUTBOUND transfer to be different from the ptr value. Back specifies the amount to subtract from the pointer to reach the start when freeing a buffer. @@ -200,13 +200,13 @@ typedef union Back is only used by the hardware when the buffer corresponding to ptr is freed. Back must be 0x0, and buffers are never freed, for INBOUND, INTERNAL-ONLY, and EXTERNAL-ONLY PCI DMA transfers. */ - uint64_t pool : 3; /**< Pool ­ Free pool. + uint64_t pool : 3; /**< Pool - Free pool. Specifies which pool (of the eight hardware-managed FPA free pools) receives the buffer associated with ptr when freed during an OUTBOUND transfer. Pool is only used when the buffer corresponding to ptr is freed. Pool must be 0x0, and buffers are never freed, for INBOUND, INTERNAL-ONLY, and EXTERNAL-ONLY PCI DMA transfers. */ - uint64_t f : 1; /**< F ­ Full-block writes are allowed. + uint64_t f : 1; /**< F - Full-block writes are allowed. When set, the hardware is permitted to write all the bytes in the cache blocks covered by ptr, ptr + Size - 1. This can improve memory system performance when the write misses in the L2 cache. @@ -218,12 +218,12 @@ typedef union F must not be set for local pointers that are not written to: - The local pointers in the FIRST POINTERS area for OUTBOUND and INTERNAL-ONLY transfers. */ - uint64_t a : 1; /**< A ­ Allocate L2. + uint64_t a : 1; /**< A - Allocate L2. This is a hint to the hardware that the cache blocks should be allocated in the L2 cache (if they were not already). */ - uint64_t l : 1; /**< L ­ Little-endian. + uint64_t l : 1; /**< L - Little-endian. When L is set, the data at ptr is in little-endian format rather than big-endian. */ - uint64_t size : 13; /**< Size ­ Size in bytes of the contiguous space specified by ptr. A Size value of 0 is + uint64_t size : 13; /**< Size - Size in bytes of the contiguous space specified by ptr. A Size value of 0 is illegal. Note that the sum of the sizes in the FIRST POINTERS area must always exactly equal the sum of the sizes/lengths in the LAST POINTERS area: - In the OUTBOUND and INBOUND cases, the HDR.NFST size fields in the Modified: head/sys/contrib/octeon-sdk/cvmx-higig.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-higig.h Thu Oct 13 16:45:01 2016 (r307222) +++ head/sys/contrib/octeon-sdk/cvmx-higig.h Thu Oct 13 16:57:19 2016 (r307223) @@ -120,11 +120,11 @@ typedef struct multicast (unknown L2 multicast and IPMC) packets. This field is used when OPCODE is 011 or 100 Semantics of PFM bits are as follows; For registered L2 multicast packets: - PFM= 0 ­ Flood to VLAN - PFM= 1 or 2 ­ Send to group members in the L2MC table + PFM= 0 - Flood to VLAN + PFM= 1 or 2 - Send to group members in the L2MC table For unregistered L2 multicast packets: - PFM= 0 or 1 ­ Flood to VLAN - PFM= 2 ­ Drop the packet */ + PFM= 0 or 1 - Flood to VLAN + PFM= 2 - Drop the packet */ uint32_t src_port_tgid : 6; /**< If the MSB of this field is set, then it indicates the LAG the packet ingressed on, else it represents the physical port the packet ingressed on. */ uint32_t dst_port : 5; /**< Port number of destination port on which the packet needs to egress. */ @@ -138,10 +138,10 @@ typedef struct uint32_t cng_low : 1; /**< Semantics of CNG_HIGH and CNG_LOW are as follows: The following encodings are to make it backward compatible: [CNG_HIGH, CNG_LOW] - COLOR - [0, 0] ­ Packet is green - [0, 1] ­ Packet is red - [1, 1] ­ Packet is yellow - [1, 0] ­ Undefined */ + [0, 0] - Packet is green + [0, 1] - Packet is red + [1, 1] - Packet is yellow + [1, 0] - Undefined */ uint32_t dst_modid_low : 5; /**< Bits [4-: 0] of Module ID of the destination port on which the packet needs to egress. */ } s; } dw1; @@ -273,11 +273,11 @@ typedef struct multicast (unknown L2 multicast and IPMC) packets. This field is used when OPCODE is 011 or 100 Semantics of PFM bits are as follows; For registered L2 multicast packets: - PFM= 0 ­ Flood to VLAN - PFM= 1 or 2 ­ Send to group members in the L2MC table + PFM= 0 - Flood to VLAN + PFM= 1 or 2 - Send to group members in the L2MC table For unregistered L2 multicast packets: - PFM= 0 or 1 ­ Flood to VLAN - PFM= 2 ­ Drop the packet */ + PFM= 0 or 1 - Flood to VLAN + PFM= 2 - Drop the packet */ uint32_t src_t : 1; /**< If the MSB of this field is set, then it indicates the LAG the packet ingressed on, else it represents the physical port the packet ingressed on. */ uint32_t reserved_11_12 : 2; Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Oct 13 16:45:01 2016 (r307222) +++ head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Oct 13 16:57:19 2016 (r307223) @@ -722,8 +722,8 @@ retry: /* Setup BAR2 attributes */ /* Relaxed Ordering (NPEI_CTL_PORTn[PTLP_RO,CTLP_RO, WAIT_COM]) */ - /* ­ PTLP_RO,CTLP_RO should normally be set (except for debug). */ - /* ­ WAIT_COM=0 will likely work for all applications. */ + /* - PTLP_RO,CTLP_RO should normally be set (except for debug). */ + /* - WAIT_COM=0 will likely work for all applications. */ /* Load completion relaxed ordering (NPEI_CTL_PORTn[WAITL_COM]) */ if (pcie_port) { @@ -1139,8 +1139,8 @@ static int __cvmx_pcie_rc_initialize_gen /* Setup BAR2 attributes */ /* Relaxed Ordering (NPEI_CTL_PORTn[PTLP_RO,CTLP_RO, WAIT_COM]) */ - /* ­ PTLP_RO,CTLP_RO should normally be set (except for debug). */ - /* ­ WAIT_COM=0 will likely work for all applications. */ + /* - PTLP_RO,CTLP_RO should normally be set (except for debug). */ + /* - WAIT_COM=0 will likely work for all applications. */ /* Load completion relaxed ordering (NPEI_CTL_PORTn[WAITL_COM]) */ pemx_bar_ctl.u64 = cvmx_read_csr(CVMX_PEMX_BAR_CTL(pcie_port)); pemx_bar_ctl.s.bar1_siz = 3; /* 256MB BAR1*/ Modified: head/sys/contrib/octeon-sdk/cvmx-raid.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-raid.h Thu Oct 13 16:45:01 2016 (r307222) +++ head/sys/contrib/octeon-sdk/cvmx-raid.h Thu Oct 13 16:57:19 2016 (r307223) @@ -125,7 +125,7 @@ typedef union { uint64_t reserved_58_63 : 6; /**< Must be zero */ uint64_t fw : 1; /**< When set, indicates that RAD can modify any byte in any (128B) cache line touched - by L2/DRAM addresses OWORD[PTR] through OWORD[PTR]+CWORD[SIZE]­1. + by L2/DRAM addresses OWORD[PTR] through OWORD[PTR]+CWORD[SIZE]-1. Setting OWORD[FW] can improve hardware performance, as some DRAM loads can be avoided on L2 cache misses. The Q OWORD[FW] must not be set when CWORD[Q_CMP] is set, and the P OWORD[FW] must not be set when From owner-svn-src-head@freebsd.org Thu Oct 13 17:03:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CC71C1037A; Thu, 13 Oct 2016 17:03:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1160A17; Thu, 13 Oct 2016 17:03:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DH3sP8036275; Thu, 13 Oct 2016 17:03:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DH3smi036274; Thu, 13 Oct 2016 17:03:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610131703.u9DH3smi036274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 13 Oct 2016 17:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307224 - head/usr.sbin/efivar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 17:03:56 -0000 Author: imp Date: Thu Oct 13 17:03:54 2016 New Revision: 307224 URL: https://svnweb.freebsd.org/changeset/base/307224 Log: 'b' is short for --binary, it isn't 'a'. PR: 213437 Submitted by: Ganael LAPLANCHE Modified: head/usr.sbin/efivar/efivar.8 Modified: head/usr.sbin/efivar/efivar.8 ============================================================================== --- head/usr.sbin/efivar/efivar.8 Thu Oct 13 16:57:19 2016 (r307223) +++ head/usr.sbin/efivar/efivar.8 Thu Oct 13 17:03:54 2016 (r307224) @@ -98,7 +98,7 @@ UEFI Specification for hex values to use Display the variable data as modified ascii: All printable characters are printed, while unprintable characters are rendered as a two-digit hexadecimal number preceeded by a % character. -.It Fl A Fl -binary +.It Fl b Fl -binary Display the variable data as binary data. Usually will be used with the .Fl N From owner-svn-src-head@freebsd.org Thu Oct 13 17:16:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52FA6C106BC; Thu, 13 Oct 2016 17:16:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 248D1FFC; Thu, 13 Oct 2016 17:16:33 +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 u9DHGWKK040074; Thu, 13 Oct 2016 17:16:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DHGWKi040073; Thu, 13 Oct 2016 17:16:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610131716.u9DHGWKi040073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 13 Oct 2016 17:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307225 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 17:16:33 -0000 Author: emaste Date: Thu Oct 13 17:16:32 2016 New Revision: 307225 URL: https://svnweb.freebsd.org/changeset/base/307225 Log: Fix octeon model comparison in Cavium SDK buildkernel failed with GCC 5.3 with error: comparison of constant '852736' with boolean expression is always true Sponsored by: The FreeBSD Foundation Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Oct 13 17:03:54 2016 (r307224) +++ head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Oct 13 17:16:32 2016 (r307225) @@ -981,7 +981,7 @@ static int __cvmx_pcie_rc_initialize_gen /* Make sure we aren't trying to setup a target mode interface in host mode */ mio_rst_ctl.u64 = cvmx_read_csr(CVMX_MIO_RST_CTLX(pcie_port)); - ep_mode = (OCTEON_IS_MODEL(OCTEON_CN61XX || OCTEON_IS_MODEL(OCTEON_CNF71XX)) ? (mio_rst_ctl.s.prtmode != 1) : (!mio_rst_ctl.s.host_mode)); + ep_mode = ((OCTEON_IS_MODEL(OCTEON_CN61XX) || OCTEON_IS_MODEL(OCTEON_CNF71XX)) ? (mio_rst_ctl.s.prtmode != 1) : (!mio_rst_ctl.s.host_mode)); if (ep_mode) { cvmx_dprintf("PCIe: Port %d in endpoint mode.\n", pcie_port); From owner-svn-src-head@freebsd.org Thu Oct 13 18:02:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F4DCC1010F; Thu, 13 Oct 2016 18:02:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A904AA6; Thu, 13 Oct 2016 18:02:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DI2U8U058840; Thu, 13 Oct 2016 18:02:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DI2UQi058839; Thu, 13 Oct 2016 18:02:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201610131802.u9DI2UQi058839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 13 Oct 2016 18:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307226 - head/sys/netinet/tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 18:02:31 -0000 Author: glebius Date: Thu Oct 13 18:02:29 2016 New Revision: 307226 URL: https://svnweb.freebsd.org/changeset/base/307226 Log: With build without TCP_HHOOK and with INVARIANTS. Before mutex.h came via sys/hhook.h -> sys/rmlock.h -> sys/mutex.h. Modified: head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Thu Oct 13 17:16:32 2016 (r307225) +++ head/sys/netinet/tcp_stacks/fastpath.c Thu Oct 13 18:02:29 2016 (r307226) @@ -60,7 +60,9 @@ __FBSDID("$FreeBSD$"); #include "opt_tcpdebug.h" #include +#include #include +#include #include #ifdef TCP_HHOOK #include From owner-svn-src-head@freebsd.org Thu Oct 13 18:25:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0110C10809; Thu, 13 Oct 2016 18:25:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E570820; Thu, 13 Oct 2016 18:25:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DIPfgW066710; Thu, 13 Oct 2016 18:25:41 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DIPeXH066703; Thu, 13 Oct 2016 18:25:40 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201610131825.u9DIPeXH066703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 13 Oct 2016 18:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307227 - in head: include lib/libc/stdlib lib/libc/tests/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 18:25:42 -0000 Author: ed Date: Thu Oct 13 18:25:40 2016 New Revision: 307227 URL: https://svnweb.freebsd.org/changeset/base/307227 Log: Improve typing of POSIX search tree functions. Back in 2015 when I reimplemented these functions to use an AVL tree, I was annoyed by the weakness of the typing of these functions. Both tree nodes and keys are represented by 'void *', meaning that things like the documentation for these functions are an absolute train wreck. To make things worse, users of these functions need to cast the return value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to access the key. Technically speaking such casts violate aliasing rules. I've observed actual breakages as a result of this by enabling features like LTO. I've filed a bug report at the Austin Group. Looking at the way the bug got resolved, they made a pretty good step in the right direction. A new type 'posix_tnode' has been added to correspond to tree nodes. It is still defined as 'void' for source-level compatibility, but in the very far future it could be replaced by a proper structure type containing a key pointer. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8205 Modified: head/include/search.h head/lib/libc/stdlib/tdelete.c head/lib/libc/stdlib/tfind.c head/lib/libc/stdlib/tsearch.3 head/lib/libc/stdlib/tsearch.c head/lib/libc/stdlib/twalk.c head/lib/libc/tests/stdlib/tsearch_test.c Modified: head/include/search.h ============================================================================== --- head/include/search.h Thu Oct 13 18:02:29 2016 (r307226) +++ head/include/search.h Thu Oct 13 18:25:40 2016 (r307227) @@ -34,16 +34,18 @@ typedef enum { } VISIT; #ifdef _SEARCH_PRIVATE -typedef struct node { - void *key; - struct node *llink, *rlink; - signed char balance; -} node_t; +typedef struct __posix_tnode { + void *key; + struct __posix_tnode *llink, *rlink; + signed char balance; +} posix_tnode; struct que_elem { struct que_elem *next; struct que_elem *prev; }; +#else +typedef void posix_tnode; #endif #if __BSD_VISIBLE @@ -62,12 +64,15 @@ void *lfind(const void *, const void *, void *lsearch(const void *, void *, size_t *, size_t, int (*)(const void *, const void *)); void remque(void *); -void *tdelete(const void * __restrict, void ** __restrict, +void *tdelete(const void * __restrict, posix_tnode ** __restrict, int (*)(const void *, const void *)); -void *tfind(const void *, void * const *, +posix_tnode * + tfind(const void *, posix_tnode * const *, int (*)(const void *, const void *)); -void *tsearch(const void *, void **, int (*)(const void *, const void *)); -void twalk(const void *, void (*)(const void *, VISIT, int)); +posix_tnode * + tsearch(const void *, posix_tnode **, + int (*)(const void *, const void *)); +void twalk(const posix_tnode *, void (*)(const posix_tnode *, VISIT, int)); #if __BSD_VISIBLE int hcreate_r(size_t, struct hsearch_data *); Modified: head/lib/libc/stdlib/tdelete.c ============================================================================== --- head/lib/libc/stdlib/tdelete.c Thu Oct 13 18:02:29 2016 (r307226) +++ head/lib/libc/stdlib/tdelete.c Thu Oct 13 18:25:40 2016 (r307227) @@ -46,9 +46,9 @@ __FBSDID("$FreeBSD$"); * that we won't need to perform any rotations above \ * this point. In this case rotations are always \ * capable of keeping the subtree in balance. Make \ - * this the base node and reset the path. \ + * this the root node and reset the path. \ */ \ - base = leaf; \ + rootp = leaf; \ path_init(&path); \ } \ path_taking_left(&path); \ @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #define GO_RIGHT() do { \ if ((*leaf)->balance == 0 || \ ((*leaf)->balance > 0 && (*leaf)->llink->balance == 0)) { \ - base = leaf; \ + rootp = leaf; \ path_init(&path); \ } \ path_taking_right(&path); \ @@ -67,18 +67,16 @@ __FBSDID("$FreeBSD$"); } while (0) void * -tdelete(const void *restrict key, void **restrict rootp, +tdelete(const void *restrict key, posix_tnode **restrict rootp, int (*compar)(const void *, const void *)) { struct path path; - node_t *root, **base, **leaf, *old, **n, *x, *y, *z; - void *result; + posix_tnode **leaf, *old, **n, *x, *y, *z, *result; int cmp; /* POSIX requires that tdelete() returns NULL if rootp is NULL. */ if (rootp == NULL) return (NULL); - root = *rootp; /* * Find the leaf that needs to be removed. Return if we cannot @@ -86,19 +84,18 @@ tdelete(const void *restrict key, void * * to get to the node, as we will need it to adjust the * balances. */ - result = (void *)1; + result = (posix_tnode *)1; path_init(&path); - base = &root; - leaf = &root; + leaf = rootp; for (;;) { if (*leaf == NULL) return (NULL); cmp = compar(key, (*leaf)->key); if (cmp < 0) { - result = &(*leaf)->key; + result = *leaf; GO_LEFT(); } else if (cmp > 0) { - result = &(*leaf)->key; + result = *leaf; GO_RIGHT(); } else { break; @@ -134,7 +131,7 @@ tdelete(const void *restrict key, void * * and left-left case that only exists when deleting. Hence the * duplication of code. */ - for (n = base; n != leaf;) { + for (n = rootp; n != leaf;) { if (path_took_left(&path)) { x = *n; if (x->balance < 0) { @@ -207,6 +204,5 @@ tdelete(const void *restrict key, void * } /* Return the parent of the old entry. */ - *rootp = root; return (result); } Modified: head/lib/libc/stdlib/tfind.c ============================================================================== --- head/lib/libc/stdlib/tfind.c Thu Oct 13 18:02:29 2016 (r307226) +++ head/lib/libc/stdlib/tfind.c Thu Oct 13 18:25:40 2016 (r307227) @@ -4,8 +4,6 @@ * Tree search generalized from Knuth (6.2.2) Algorithm T just like * the AT&T man page says. * - * The node_t structure is for internal use only, lint doesn't grok it. - * * Written by reading the System V Interface Definition, not the code. * * Totally public domain. @@ -29,11 +27,10 @@ __FBSDID("$FreeBSD$"); * vkey - key to be found * vrootp - address of the tree root */ -void * -tfind(const void *vkey, void * const *vrootp, +posix_tnode * +tfind(const void *vkey, posix_tnode * const *rootp, int (*compar)(const void *, const void *)) { - node_t **rootp = (node_t **)vrootp; if (rootp == NULL) return NULL; Modified: head/lib/libc/stdlib/tsearch.3 ============================================================================== --- head/lib/libc/stdlib/tsearch.3 Thu Oct 13 18:02:29 2016 (r307226) +++ head/lib/libc/stdlib/tsearch.3 Thu Oct 13 18:25:40 2016 (r307227) @@ -27,7 +27,7 @@ .\" OpenBSD: tsearch.3,v 1.2 1998/06/21 22:13:49 millert Exp .\" $FreeBSD$ .\" -.Dd December 6, 2015 +.Dd October 9, 2016 .Dt TSEARCH 3 .Os .Sh NAME @@ -36,13 +36,13 @@ .Sh SYNOPSIS .In search.h .Ft void * -.Fn tdelete "const void * restrict key" "void ** restrict rootp" "int (*compar) (const void *, const void *)" -.Ft void * -.Fn tfind "const void *key" "void * const *rootp" "int (*compar) (const void *, const void *)" -.Ft void * -.Fn tsearch "const void *key" "void **rootp" "int (*compar) (const void *, const void *)" +.Fn tdelete "const void * restrict key" "posix_tnode ** restrict rootp" "int (*compar) (const void *, const void *)" +.Ft posix_tnode * +.Fn tfind "const void *key" "posix_tnode * const *rootp" "int (*compar) (const void *, const void *)" +.Ft posix_tnode * +.Fn tsearch "const void *key" "posix_tnode **rootp" "int (*compar) (const void *, const void *)" .Ft void -.Fn twalk "const void *root" "void (*action) (const void *, VISIT, int)" +.Fn twalk "const posix_tnode *root" "void (*action) (const posix_tnode *, VISIT, int)" .Sh DESCRIPTION The .Fn tdelete , @@ -134,3 +134,18 @@ function returns no value. .Xr bsearch 3 , .Xr hsearch 3 , .Xr lsearch 3 +.Sh STANDARDS +These functions conform to +.St -p1003.1-2008 . +.Pp +The +.Fa posix_tnode +type is not part of +.St -p1003.1-2008 , +but it is expected to be standardized by future versions of the standard. +It is defined as +.Fa void +for source-level compatibility. +Using +.Fa posix_tnode +makes it easier to distinguish between nodes and keys. Modified: head/lib/libc/stdlib/tsearch.c ============================================================================== --- head/lib/libc/stdlib/tsearch.c Thu Oct 13 18:02:29 2016 (r307226) +++ head/lib/libc/stdlib/tsearch.c Thu Oct 13 18:25:40 2016 (r307227) @@ -32,18 +32,17 @@ __FBSDID("$FreeBSD$"); #include "tsearch_path.h" -void * -tsearch(const void *key, void **rootp, +posix_tnode * +tsearch(const void *key, posix_tnode **rootp, int (*compar)(const void *, const void *)) { struct path path; - node_t *root, **base, **leaf, *result, *n, *x, *y, *z; + posix_tnode **leaf, *result, *n, *x, *y, *z; int cmp; /* POSIX requires that tsearch() returns NULL if rootp is NULL. */ if (rootp == NULL) - return (NULL); - root = *rootp; + return (NULL); /* * Find the leaf where the new key needs to be inserted. Return @@ -52,8 +51,7 @@ tsearch(const void *key, void **rootp, * balances. */ path_init(&path); - base = &root; - leaf = &root; + leaf = rootp; while (*leaf != NULL) { if ((*leaf)->balance != 0) { /* @@ -62,9 +60,9 @@ tsearch(const void *key, void **rootp, * need to perform any rotations above this * point. In this case rotations are always * capable of keeping the subtree in balance. - * Make this the base node and reset the path. + * Make this the root node and reset the path. */ - base = leaf; + rootp = leaf; path_init(&path); } cmp = compar(key, (*leaf)->key); @@ -75,7 +73,7 @@ tsearch(const void *key, void **rootp, path_taking_right(&path); leaf = &(*leaf)->rlink; } else { - return (&(*leaf)->key); + return (*leaf); } } @@ -94,7 +92,7 @@ tsearch(const void *key, void **rootp, * have a balance of zero, meaning that these nodes will not get * out of balance. */ - for (n = *base; n != *leaf;) { + for (n = *rootp; n != *leaf;) { if (path_took_left(&path)) { n->balance += 1; n = n->llink; @@ -106,10 +104,10 @@ tsearch(const void *key, void **rootp, /* * Adjusting the balances may have pushed the balance of the - * base node out of range. Perform a rotation to bring the + * root node out of range. Perform a rotation to bring the * balance back in range. */ - x = *base; + x = *rootp; if (x->balance > 1) { y = x->llink; if (y->balance < 0) { @@ -129,7 +127,7 @@ tsearch(const void *key, void **rootp, z->llink = y; x->llink = z->rlink; z->rlink = x; - *base = z; + *rootp = z; x->balance = z->balance > 0 ? -1 : 0; y->balance = z->balance < 0 ? 1 : 0; @@ -146,7 +144,7 @@ tsearch(const void *key, void **rootp, */ x->llink = y->rlink; y->rlink = x; - *base = y; + *rootp = y; x->balance = 0; y->balance = 0; @@ -165,12 +163,12 @@ tsearch(const void *key, void **rootp, * / \ A B C D * B C */ - node_t *z = y->llink; + posix_tnode *z = y->llink; x->rlink = z->llink; z->llink = x; y->llink = z->rlink; z->rlink = y; - *base = z; + *rootp = z; x->balance = z->balance < 0 ? 1 : 0; y->balance = z->balance > 0 ? -1 : 0; @@ -187,7 +185,7 @@ tsearch(const void *key, void **rootp, */ x->rlink = y->llink; y->llink = x; - *base = y; + *rootp = y; x->balance = 0; y->balance = 0; @@ -195,6 +193,5 @@ tsearch(const void *key, void **rootp, } /* Return the new entry. */ - *rootp = root; - return (&result->key); + return (result); } Modified: head/lib/libc/stdlib/twalk.c ============================================================================== --- head/lib/libc/stdlib/twalk.c Thu Oct 13 18:02:29 2016 (r307226) +++ head/lib/libc/stdlib/twalk.c Thu Oct 13 18:25:40 2016 (r307227) @@ -4,8 +4,6 @@ * Tree search generalized from Knuth (6.2.2) Algorithm T just like * the AT&T man page says. * - * The node_t structure is for internal use only, lint doesn't grok it. - * * Written by reading the System V Interface Definition, not the code. * * Totally public domain. @@ -23,12 +21,11 @@ __FBSDID("$FreeBSD$"); #include #include -typedef void (*cmp_fn_t)(const void *, VISIT, int); +typedef void (*cmp_fn_t)(const posix_tnode *, VISIT, int); /* Walk the nodes of a tree */ static void -trecurse(const node_t *root, /* Root of the tree to be walked */ - cmp_fn_t action, int level) +trecurse(const posix_tnode *root, cmp_fn_t action, int level) { if (root->llink == NULL && root->rlink == NULL) @@ -46,7 +43,7 @@ trecurse(const node_t *root, /* Root of /* Walk the nodes of a tree */ void -twalk(const void *vroot, cmp_fn_t action) /* Root of the tree to be walked */ +twalk(const posix_tnode *vroot, cmp_fn_t action) { if (vroot != NULL && action != NULL) trecurse(vroot, action, 0); Modified: head/lib/libc/tests/stdlib/tsearch_test.c ============================================================================== --- head/lib/libc/tests/stdlib/tsearch_test.c Thu Oct 13 18:02:29 2016 (r307226) +++ head/lib/libc/tests/stdlib/tsearch_test.c Thu Oct 13 18:25:40 2016 (r307227) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); /* Validates the integrity of an AVL tree. */ static inline unsigned int -tnode_assert(const node_t *n) +tnode_assert(const posix_tnode *n) { unsigned int height_left, height_right; int balance; @@ -79,7 +79,7 @@ ATF_TC_BODY(tsearch_test, tc) keys[i] = i; /* Apply random operations on a binary tree and check the results. */ - void *root = NULL; + posix_tnode *root = NULL; bool present[NKEYS] = {}; for (int i = 0; i < NKEYS * 10; ++i) { int key = nrand48(random_state) % NKEYS; From owner-svn-src-head@freebsd.org Thu Oct 13 18:57:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F8C6C10FAC; Thu, 13 Oct 2016 18:57:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6C8319D8; Thu, 13 Oct 2016 18:57:19 +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 u9DIvJwW078084; Thu, 13 Oct 2016 18:57:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DIvIQa078080; Thu, 13 Oct 2016 18:57:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610131857.u9DIvIQa078080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 13 Oct 2016 18:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307230 - in head/lib: libgcc_eh libgcc_s X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 18:57:20 -0000 Author: emaste Date: Thu Oct 13 18:57:18 2016 New Revision: 307230 URL: https://svnweb.freebsd.org/changeset/base/307230 Log: Introduce lib/libgcc_eh and lib/libgcc_s for LLVM's implementation They are not yet connected to the build, but I am adding them to allow for easier testing, ports exp-runs, etc. Reviewed by: ed Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8188 Added: head/lib/libgcc_eh/ head/lib/libgcc_eh/Makefile (contents, props changed) head/lib/libgcc_eh/Makefile.inc (contents, props changed) head/lib/libgcc_s/ head/lib/libgcc_s/Makefile (contents, props changed) head/lib/libgcc_s/Version.map (contents, props changed) Added: head/lib/libgcc_eh/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libgcc_eh/Makefile Thu Oct 13 18:57:18 2016 (r307230) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.include + +PACKAGE= clibs +LIB= gcc_eh +NO_PIC= +WARNS?= 2 + +.include "Makefile.inc" + +.include Added: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libgcc_eh/Makefile.inc Thu Oct 13 18:57:18 2016 (r307230) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +COMPILERRTDIR= ${SRCTOP}/contrib/compiler-rt +UNWINDINCDIR= ${SRCTOP}/contrib/llvm/projects/libunwind/include +UNWINDSRCDIR= ${SRCTOP}/contrib/llvm/projects/libunwind/src + +CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN + +.PATH: ${COMPILERRTDIR}/lib/builtins +.PATH: ${UNWINDSRCDIR} +SRCS+= gcc_personality_v0.c +SRCS+= int_util.c +SRCS+= Unwind-EHABI.cpp +SRCS+= Unwind-sjlj.c +SRCS+= UnwindLevel1-gcc-ext.c +SRCS+= UnwindLevel1.c +SRCS+= UnwindRegistersRestore.S +SRCS+= UnwindRegistersSave.S +SRCS+= libunwind.cpp + +CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif +CXXFLAGS+= -fno-rtti +STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC +.if ${MK_DIRDEPS_BUILD} == "yes" +# Avoid dependency on lib/libc++ +CFLAGS+= -I${SRCTOP}/contrib/libc++/include +.endif Added: head/lib/libgcc_s/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libgcc_s/Makefile Thu Oct 13 18:57:18 2016 (r307230) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +PKG= clibs +SHLIB_NAME= libgcc_s.so.1 + +WARNS?= 2 + +LDFLAGS+= -nodefaultlibs +VERSION_MAP= ${.CURDIR}/Version.map + +.include "../libcompiler_rt/Makefile.inc" +.include "../libgcc_eh/Makefile.inc" + +.include Added: head/lib/libgcc_s/Version.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libgcc_s/Version.map Thu Oct 13 18:57:18 2016 (r307230) @@ -0,0 +1,123 @@ +/* + * $FreeBSD$ + */ + +GCC_3.0 { + __absvdi2; + __absvsi2; + __addvdi3; + __addvsi3; + __ashlti3; + __ashrti3; + __clear_cache; + __cmpti2; + __deregister_frame; + __deregister_frame_info; + __deregister_frame_info_bases; + __divti3; + __ffsdi2; + __ffsti2; + __fixdfti; + __fixsfti; + __fixunsdfdi; + __fixunsdfti; + __fixunssfdi; + __fixunssfti; + __fixunsxfdi; + __fixunsxfti; + __fixxfti; + __floattidf; + __floattisf; + __floattixf; + __lshrti3; + __modti3; + __mulvdi3; + __mulvsi3; + __multi3; + __negti2; + __negvdi2; + __negvsi2; + __register_frame; + __register_frame_info; + __register_frame_info_bases; + __register_frame_info_table; + __register_frame_info_table_bases; + __register_frame_table; + __subvdi3; + __subvsi3; + __ucmpti2; + __udivmodti4; + __udivti3; + __umodti3; + _Unwind_DeleteException; + _Unwind_Find_FDE; + _Unwind_ForcedUnwind; + _Unwind_GetDataRelBase; + _Unwind_GetGR; + _Unwind_GetIP; + _Unwind_GetLanguageSpecificData; + _Unwind_GetRegionStart; + _Unwind_GetTextRelBase; + _Unwind_RaiseException; + _Unwind_Resume; + _Unwind_SetGR; + _Unwind_SetIP; +}; + +GCC_3.3 { + _Unwind_Backtrace; + _Unwind_FindEnclosingFunction; + _Unwind_GetCFA; + _Unwind_Resume_or_Rethrow; +} GCC_3.0; + +GCC_3.3.1 { + __gcc_personality_v0; +} GCC_3.3; + +GCC_3.4 { + __clzdi2; + __clzti2; + __ctzdi2; + __ctzti2; + __paritydi2; + __parityti2; + __popcountdi2; + __popcountti2; +} GCC_3.3.1; + +GCC_3.4.2 { + __enable_execute_stack; +} GCC_3.4; + +GCC_3.4.4 { + __absvti2; + __addvti3; + __mulvti3; + __negvti2; + __subvti3; +} GCC_3.4.2; + +GCC_4.0.0 { + __divdc3; + __divsc3; + __divxc3; + __muldc3; + __mulsc3; + __mulxc3; + __powidf2; + __powisf2; + __powixf2; +} GCC_3.4.4; + +GCC_4.2.0 { + __floatuntidf; + __floatuntisf; + __floatuntixf; + _Unwind_GetIPInfo; +} GCC_4.0.0; + +GCC_4.3.0 { + __bswapdi2; + __bswapsi2; +} GCC_4.2.0; From owner-svn-src-head@freebsd.org Thu Oct 13 19:18:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA981C1054B; Thu, 13 Oct 2016 19:18:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9EFD771; Thu, 13 Oct 2016 19:18:01 +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 u9DJI08d085696; Thu, 13 Oct 2016 19:18:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DJI0bX085695; Thu, 13 Oct 2016 19:18:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610131918.u9DJI0bX085695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 13 Oct 2016 19:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307231 - head/lib/libgcc_s X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 19:18:02 -0000 Author: emaste Date: Thu Oct 13 19:18:00 2016 New Revision: 307231 URL: https://svnweb.freebsd.org/changeset/base/307231 Log: libgcc_s: add libm dependencies from div{d,s,x}c3 compiler-rt's complex division support routines contain calls to compiler builtins such as `__builtin_scalbnl`. Unfortunately Clang turns these back into a call to `scalbnl`. For now link libm's C version of the required support routines. Reviewed by: ed Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8190 Modified: head/lib/libgcc_s/Makefile Modified: head/lib/libgcc_s/Makefile ============================================================================== --- head/lib/libgcc_s/Makefile Thu Oct 13 18:57:18 2016 (r307230) +++ head/lib/libgcc_s/Makefile Thu Oct 13 19:18:00 2016 (r307231) @@ -11,4 +11,22 @@ VERSION_MAP= ${.CURDIR}/Version.map .include "../libcompiler_rt/Makefile.inc" .include "../libgcc_eh/Makefile.inc" +LIBCSRCDIR= ${SRCTOP}/lib/libc +LIBMSRCDIR= ${SRCTOP}/lib/msun/src +CFLAGS+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}/${MACHINE_CPUARCH} +CFLAGS+= -I${LIBMSRCDIR} +.PATH: ${LIBMSRCDIR} +SRCS+= s_fabs.c +SRCS+= s_fabsf.c +SRCS+= s_fabsl.c +SRCS+= s_fmax.c +SRCS+= s_fmaxf.c +SRCS+= s_fmaxl.c +SRCS+= s_logb.c +SRCS+= s_logbf.c +SRCS+= s_logbl.c +SRCS+= s_scalbn.c +SRCS+= s_scalbnf.c +SRCS+= s_scalbnl.c + .include From owner-svn-src-head@freebsd.org Thu Oct 13 19:33:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16CDAC10CAC; Thu, 13 Oct 2016 19:33:09 +0000 (UTC) (envelope-from martymac@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCC0738A; Thu, 13 Oct 2016 19:33:08 +0000 (UTC) (envelope-from martymac@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DJX8iY093065; Thu, 13 Oct 2016 19:33:08 GMT (envelope-from martymac@FreeBSD.org) Received: (from martymac@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DJX8q8093064; Thu, 13 Oct 2016 19:33:08 GMT (envelope-from martymac@FreeBSD.org) Message-Id: <201610131933.u9DJX8q8093064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: martymac set sender to martymac@FreeBSD.org using -f From: Ganael LAPLANCHE Date: Thu, 13 Oct 2016 19:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307232 - head/sys/fs/nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 19:33:09 -0000 Author: martymac (ports committer) Date: Thu Oct 13 19:33:07 2016 New Revision: 307232 URL: https://svnweb.freebsd.org/changeset/base/307232 Log: Fix panic() message reporting ufs instead of nandfs PR: 213438 Approved by: kib Modified: head/sys/fs/nandfs/nandfs_vnops.c Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Thu Oct 13 19:18:00 2016 (r307231) +++ head/sys/fs/nandfs/nandfs_vnops.c Thu Oct 13 19:33:07 2016 (r307232) @@ -2211,7 +2211,7 @@ nandfs_whiteout(struct vop_whiteout_args /* Create a new directory whiteout */ #ifdef INVARIANTS if ((cnp->cn_flags & SAVENAME) == 0) - panic("ufs_whiteout: missing name"); + panic("nandfs_whiteout: missing name"); #endif error = nandfs_add_dirent(dvp, NANDFS_WHT_INO, cnp->cn_nameptr, cnp->cn_namelen, DT_WHT); From owner-svn-src-head@freebsd.org Thu Oct 13 19:40:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73AA7C10F6F; Thu, 13 Oct 2016 19:40:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43ED9A35; Thu, 13 Oct 2016 19:40:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DJeLCl093500; Thu, 13 Oct 2016 19:40:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DJeLNg093498; Thu, 13 Oct 2016 19:40:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <201610131940.u9DJeLNg093498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 13 Oct 2016 19:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307233 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 19:40:22 -0000 Author: np Date: Thu Oct 13 19:40:21 2016 New Revision: 307233 URL: https://svnweb.freebsd.org/changeset/base/307233 Log: cxgbe(4): Allow the interface MTU to be set as high as the actual hardware limit. Submitted by: jpaetzel@ Differential Revision: https://reviews.freebsd.org/D8237 Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Oct 13 19:33:07 2016 (r307232) +++ head/sys/dev/cxgbe/t4_main.c Thu Oct 13 19:40:21 2016 (r307233) @@ -1567,7 +1567,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned switch (cmd) { case SIOCSIFMTU: mtu = ifr->ifr_mtu; - if ((mtu < ETHERMIN) || (mtu > ETHERMTU_JUMBO)) + if (mtu < ETHERMIN || mtu > MAX_MTU) return (EINVAL); rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4mtu"); From owner-svn-src-head@freebsd.org Thu Oct 13 20:15:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B203EC107D1; Thu, 13 Oct 2016 20:15:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69C2BCFE; Thu, 13 Oct 2016 20:15:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DKFlB9008543; Thu, 13 Oct 2016 20:15:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DKFlhV008540; Thu, 13 Oct 2016 20:15:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201610132015.u9DKFlhV008540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 13 Oct 2016 20:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307234 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 20:15:48 -0000 Author: glebius Date: Thu Oct 13 20:15:47 2016 New Revision: 307234 URL: https://svnweb.freebsd.org/changeset/base/307234 Log: - Revert r300854, r303657 which tried to fix regression from r297225. - Fix the regression proper way using RO_RTFREE(). Submitted by: ae Modified: head/sys/netinet/in_pcb.c head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Oct 13 19:40:21 2016 (r307233) +++ head/sys/netinet/in_pcb.c Thu Oct 13 20:15:47 2016 (r307234) @@ -1299,10 +1299,7 @@ in_pcbfree(struct inpcb *inp) if (inp->inp_moptions != NULL) inp_freemoptions(inp->inp_moptions); #endif - if (inp->inp_route.ro_rt) { - RTFREE(inp->inp_route.ro_rt); - inp->inp_route.ro_rt = (struct rtentry *)NULL; - } + RO_RTFREE(&inp->inp_route); if (inp->inp_route.ro_lle) LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */ @@ -2242,10 +2239,7 @@ void in_losing(struct inpcb *inp) { - if (inp->inp_route.ro_rt) { - RTFREE(inp->inp_route.ro_rt); - inp->inp_route.ro_rt = (struct rtentry *)NULL; - } + RO_RTFREE(&inp->inp_route); if (inp->inp_route.ro_lle) LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */ return; Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Oct 13 19:40:21 2016 (r307233) +++ head/sys/netinet/ip_output.c Thu Oct 13 20:15:47 2016 (r307234) @@ -704,11 +704,7 @@ sendit: IPSTAT_INC(ips_fragmented); done: - /* - * Release the route if using our private route, or if - * (with flowtable) we don't have our own reference. - */ - if (ro == &iproute || ro->ro_flags & RT_NORTREF) + if (ro == &iproute) RO_RTFREE(ro); else if (rte == NULL) /* Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Oct 13 19:40:21 2016 (r307233) +++ head/sys/netinet6/ip6_output.c Thu Oct 13 20:15:47 2016 (r307234) @@ -1064,12 +1064,7 @@ sendorfree: IP6STAT_INC(ip6s_fragmented); done: - /* - * Release the route if using our private route, or if - * (with flowtable) we don't have our own reference. - */ - if (ro == &ip6route || - (ro != NULL && ro->ro_flags & RT_NORTREF)) + if (ro == &ip6route) RO_RTFREE(ro); return (error); From owner-svn-src-head@freebsd.org Thu Oct 13 20:34:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B705AC10E00; Thu, 13 Oct 2016 20:34:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A09B5D; Thu, 13 Oct 2016 20:34:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DKYiIK016280; Thu, 13 Oct 2016 20:34:44 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DKYi07016276; Thu, 13 Oct 2016 20:34:44 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201610132034.u9DKYi07016276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 13 Oct 2016 20:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307235 - in head: sbin/pfctl share/man/man5 sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 20:34:45 -0000 Author: kp Date: Thu Oct 13 20:34:44 2016 New Revision: 307235 URL: https://svnweb.freebsd.org/changeset/base/307235 Log: pf: port extended DSCP support from OpenBSD Ignore the ECN bits on 'tos' and 'set-tos' and allow to use DCSP names instead of having to embed their TOS equivalents as plain numbers. Obtained from: OpenBSD Sponsored by: OPNsense Differential Revision: https://reviews.freebsd.org/D8165 Modified: head/sbin/pfctl/parse.y head/share/man/man5/pf.conf.5 head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_norm.c Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Thu Oct 13 20:15:47 2016 (r307234) +++ head/sbin/pfctl/parse.y Thu Oct 13 20:34:44 2016 (r307235) @@ -351,6 +351,8 @@ void decide_address_family(struct node_ void remove_invalid_hosts(struct node_host **, sa_family_t *); int invalid_redirect(struct node_host *, sa_family_t); u_int16_t parseicmpspec(char *, sa_family_t); +int kw_casecmp(const void *, const void *); +int map_tos(char *string, int *); static TAILQ_HEAD(loadanchorshead, loadanchors) loadanchorshead = TAILQ_HEAD_INITIALIZER(loadanchorshead); @@ -3584,15 +3586,17 @@ icmp6type : STRING { ; tos : STRING { - if (!strcmp($1, "lowdelay")) - $$ = IPTOS_LOWDELAY; - else if (!strcmp($1, "throughput")) - $$ = IPTOS_THROUGHPUT; - else if (!strcmp($1, "reliability")) - $$ = IPTOS_RELIABILITY; - else if ($1[0] == '0' && $1[1] == 'x') - $$ = strtoul($1, NULL, 16); - else + int val; + char *end; + + if (map_tos($1, &val)) + $$ = val; + else if ($1[0] == '0' && $1[1] == 'x') { + errno = 0; + $$ = strtoul($1, &end, 16); + if (errno || *end != '\0') + $$ = 256; + } else $$ = 256; /* flag bad argument */ if ($$ < 0 || $$ > 255) { yyerror("illegal tos value %s", $1); @@ -6250,6 +6254,57 @@ pfctl_load_anchors(int dev, struct pfctl } int +kw_casecmp(const void *k, const void *e) +{ + return (strcasecmp(k, ((const struct keywords *)e)->k_name)); +} + +int +map_tos(char *s, int *val) +{ + /* DiffServ Codepoints and other TOS mappings */ + const struct keywords toswords[] = { + { "af11", IPTOS_DSCP_AF11 }, + { "af12", IPTOS_DSCP_AF12 }, + { "af13", IPTOS_DSCP_AF13 }, + { "af21", IPTOS_DSCP_AF21 }, + { "af22", IPTOS_DSCP_AF22 }, + { "af23", IPTOS_DSCP_AF23 }, + { "af31", IPTOS_DSCP_AF31 }, + { "af32", IPTOS_DSCP_AF32 }, + { "af33", IPTOS_DSCP_AF33 }, + { "af41", IPTOS_DSCP_AF41 }, + { "af42", IPTOS_DSCP_AF42 }, + { "af43", IPTOS_DSCP_AF43 }, + { "critical", IPTOS_PREC_CRITIC_ECP }, + { "cs0", IPTOS_DSCP_CS0 }, + { "cs1", IPTOS_DSCP_CS1 }, + { "cs2", IPTOS_DSCP_CS2 }, + { "cs3", IPTOS_DSCP_CS3 }, + { "cs4", IPTOS_DSCP_CS4 }, + { "cs5", IPTOS_DSCP_CS5 }, + { "cs6", IPTOS_DSCP_CS6 }, + { "cs7", IPTOS_DSCP_CS7 }, + { "ef", IPTOS_DSCP_EF }, + { "inetcontrol", IPTOS_PREC_INTERNETCONTROL }, + { "lowdelay", IPTOS_LOWDELAY }, + { "netcontrol", IPTOS_PREC_NETCONTROL }, + { "reliability", IPTOS_RELIABILITY }, + { "throughput", IPTOS_THROUGHPUT } + }; + const struct keywords *p; + + p = bsearch(s, toswords, sizeof(toswords)/sizeof(toswords[0]), + sizeof(toswords[0]), kw_casecmp); + + if (p) { + *val = p->k_val; + return (1); + } + return (0); +} + +int rt_tableid_max(void) { #ifdef __FreeBSD__ Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Thu Oct 13 20:15:47 2016 (r307234) +++ head/share/man/man5/pf.conf.5 Thu Oct 13 20:34:44 2016 (r307235) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd September 28, 2016 +.Dd October 6, 2016 .Dt PF.CONF 5 .Os .Sh NAME @@ -648,9 +648,16 @@ for matching IP packets. .Em TOS may be given as one of +.Ar critical , +.Ar inetcontrol , .Ar lowdelay , +.Ar netcontrol , .Ar throughput , .Ar reliability , +or one of the DiffServ Code Points: +.Ar ef , +.Ar af11 No ... Ar af43 , +.Ar cs0 No ... Ar cs7 ; or as either hex or decimal. .It Ar random-id Replaces the IP identification field with random values to compensate @@ -1697,9 +1704,16 @@ bits set. .Em TOS may be given as one of +.Ar critical , +.Ar inetcontrol , .Ar lowdelay , +.Ar netcontrol , .Ar throughput , .Ar reliability , +or one of the DiffServ Code Points: +.Ar ef , +.Ar af11 No ... Ar af43 , +.Ar cs0 No ... Ar cs7 ; or as either hex or decimal. .Pp For example, the following rules are identical: @@ -1803,7 +1817,6 @@ pass in proto tcp to port 25 set prio 2 pass in proto tcp to port 22 set prio (2, 5) .Ed .Pp - .It Ar tag Aq Ar string Packets matching this rule will be tagged with the specified string. Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Oct 13 20:15:47 2016 (r307234) +++ head/sys/netpfil/pf/pf.c Thu Oct 13 20:34:44 2016 (r307235) @@ -5893,7 +5893,7 @@ pf_test(int dir, struct ifnet *ifp, stru pd.sidx = (dir == PF_IN) ? 0 : 1; pd.didx = (dir == PF_IN) ? 1 : 0; pd.af = AF_INET; - pd.tos = h->ip_tos; + pd.tos = h->ip_tos & ~IPTOS_ECN_MASK; pd.tot_len = ntohs(h->ip_len); /* handle fragments that didn't get reassembled by normalization */ Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Thu Oct 13 20:15:47 2016 (r307234) +++ head/sys/netpfil/pf/pf_norm.c Thu Oct 13 20:34:44 2016 (r307235) @@ -1811,7 +1811,7 @@ pf_scrub_ip(struct mbuf **m0, u_int32_t u_int16_t ov, nv; ov = *(u_int16_t *)h; - h->ip_tos = tos; + h->ip_tos = tos | (h->ip_tos & IPTOS_ECN_MASK); nv = *(u_int16_t *)h; h->ip_sum = pf_cksum_fixup(h->ip_sum, ov, nv, 0); From owner-svn-src-head@freebsd.org Thu Oct 13 20:39:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDB92C10EE1; Thu, 13 Oct 2016 20:39:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFC1BD5C; Thu, 13 Oct 2016 20:39:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DKdYTj016481; Thu, 13 Oct 2016 20:39:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DKdY0u016480; Thu, 13 Oct 2016 20:39:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610132039.u9DKdY0u016480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 13 Oct 2016 20:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307236 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 20:39:36 -0000 Author: markj Date: Thu Oct 13 20:39:34 2016 New Revision: 307236 URL: https://svnweb.freebsd.org/changeset/base/307236 Log: Plug a potential vnode lock leak in vm_fault_hold(). Reviewed by: alc, kib MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8242 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Oct 13 20:34:44 2016 (r307235) +++ head/sys/vm/vm_fault.c Thu Oct 13 20:39:34 2016 (r307236) @@ -321,6 +321,8 @@ RetryFault:; growstack = FALSE; goto RetryFault; } + if (fs.vp != NULL) + vput(fs.vp); return (result); } From owner-svn-src-head@freebsd.org Thu Oct 13 20:55:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22587C10339; Thu, 13 Oct 2016 20:55:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAB509B9; Thu, 13 Oct 2016 20:55:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f175.google.com with SMTP id q192so99825372iod.0; Thu, 13 Oct 2016 13:55:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=nyr+sicDdkzm6xaJStm8+oKBG3ClxzT0iS/UlgAhNJA=; b=L2C7wLqDYOdQ1EufcV/ctUF1DeKjvHZiNyczPWupOc5G0UHQaI7VaDiViyLwbQAz3H p8E5NfT+HLFDphQVUiTWlKSj15nycMAvho/m7lxQltn2JaG0+LoBTA4Y0BJkmQH00SWp RV1cgARfYqzmro3MZ9LVjbigKshRfJvASwE0Hm58PfhIkBLF5+ImZ7UuPcgHY4VGWiK3 5vdWe3uvZY/ySS/s1G3yXBYG+4an+77DMYvqSwp0oFfF6VvJowaY/FUXaSjhX9kqOuVP SP6mwgOyDm3sTlnlTf3Q/TPtlxrB6jhBIIV4vWhl8RWbPqnE66bEMEZFBT6OFrk35zni bjug== X-Gm-Message-State: AA6/9Rlt58cb9ChyEI9KrX3hMn/+daf5ShrIhJl83XvanXV24ceTHYqbaMsn5HYDD3PZMA== X-Received: by 10.107.26.79 with SMTP id a76mr8771652ioa.54.1476391770015; Thu, 13 Oct 2016 13:49:30 -0700 (PDT) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com. [209.85.214.52]) by smtp.gmail.com with ESMTPSA id g11sm6447361ioi.12.2016.10.13.13.49.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 13:49:29 -0700 (PDT) Received: by mail-it0-f52.google.com with SMTP id e203so137504259itc.0; Thu, 13 Oct 2016 13:49:29 -0700 (PDT) X-Received: by 10.36.250.131 with SMTP id v125mr9447797ith.104.1476391769655; Thu, 13 Oct 2016 13:49:29 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.199 with HTTP; Thu, 13 Oct 2016 13:49:29 -0700 (PDT) In-Reply-To: <201610132039.u9DKdY0u016480@repo.freebsd.org> References: <201610132039.u9DKdY0u016480@repo.freebsd.org> From: Conrad Meyer Date: Thu, 13 Oct 2016 13:49:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r307236 - head/sys/vm To: Mark Johnston Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 20:55:42 -0000 On Thu, Oct 13, 2016 at 1:39 PM, Mark Johnston wrote: > Author: markj > Date: Thu Oct 13 20:39:34 2016 > New Revision: 307236 > URL: https://svnweb.freebsd.org/changeset/base/307236 > > Log: > Plug a potential vnode lock leak in vm_fault_hold(). This isn't just potential, right? I believe we hit this one empirically with an assert in place of this if/vput. Best, Conrad From owner-svn-src-head@freebsd.org Thu Oct 13 21:02:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7062C10623; Thu, 13 Oct 2016 21:02:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 864D7EAB; Thu, 13 Oct 2016 21:02:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pa0-x229.google.com with SMTP id qn10so41316558pac.2; Thu, 13 Oct 2016 14:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ucBigxgbI5wM/r2MEsptF6mwUMQzHQcPi892P84Ydwk=; b=0xmnyfx02fKuy7hUfuFiFC8yEzxAbsnMIFGmfVo5cCH1RT2ZVWic4lPwg/SNAlY17N o6Vly/Xl9GuHH9odXVuVLKPZ3NzbqVhhX2tcV8g2efFLKyirLmp+7d1jLnVKgJF8q1B9 vDVFYLurP+COkk1HPF+igeVSMW2VSXQTxy2FGgVCnFzgxuik4XiRVRX4ZhDEfqM46ezz zAtoLxY46w8wp64FyOeFMnuz7dIyLiNc4pna4bpgILJV7v7De1+NAjbxpZNyC7CzjPSN TuZZOiMsbvffk2IGO0Sue0170mNIie1E4SWvH0Lk+dRT2qgA3TIulvvNAcjCyDWfLQX+ eenA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ucBigxgbI5wM/r2MEsptF6mwUMQzHQcPi892P84Ydwk=; b=EAZvO2lye3RyRXHTdJj419CyxcC8urPF3TkzN1PvF+2rw0Dqbezy80JdgUIdYoXww3 nKINcb2WykfbwJXPvyCEEYIuu1XISKWb1CBh8fMsoRy8BLLGylOEHoAypa4792O+wUTx OeNE73Mk0/PCEgP23YXa/NgU5isaSrtELPjyTBwTAjwhhAo9h8iFCGVpTd1lsWpKW9wh Hfj9EA9RBPQrG4j6Npf1XjSZReCw+qt3yYuxX9U/vNE3if073UCShsieWIgiGNXYZXhj m1i+ZvAVYBpY6lnzoCQJHUZhbQV26rYPgIy00yr9MTl0kD25aBGLuiPuQiX3qvXE1hxM hALQ== X-Gm-Message-State: AA6/9Rl5B102hKVkH7h3SzT/mgXZhbaWcWtu4n1UXCZtR2cVpm/H/s005+6i3UTrF+8huQ== X-Received: by 10.66.254.10 with SMTP id ae10mr10824834pad.26.1476392564888; Thu, 13 Oct 2016 14:02:44 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id 3sm21767567pfo.31.2016.10.13.14.02.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 14:02:44 -0700 (PDT) Sender: Mark Johnston Date: Thu, 13 Oct 2016 14:08:41 -0700 From: Mark Johnston To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307236 - head/sys/vm Message-ID: <20161013210841.GB52539@wkstn-mjohnston.west.isilon.com> References: <201610132039.u9DKdY0u016480@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 21:02:45 -0000 On Thu, Oct 13, 2016 at 01:49:29PM -0700, Conrad Meyer wrote: > On Thu, Oct 13, 2016 at 1:39 PM, Mark Johnston wrote: > > Author: markj > > Date: Thu Oct 13 20:39:34 2016 > > New Revision: 307236 > > URL: https://svnweb.freebsd.org/changeset/base/307236 > > > > Log: > > Plug a potential vnode lock leak in vm_fault_hold(). > > This isn't just potential, right? I believe we hit this one > empirically with an assert in place of this if/vput. Sorry, right, that was bad wording. I meant that the lock is not always leaked in this error path - the map lookup needs to succeed initially, after which we need to block for the vnode lock, restart the fault handler, and then get an error from vm_map_lookup(). If the initial lookup fails, there's no leak. From owner-svn-src-head@freebsd.org Thu Oct 13 21:35:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29E72C10D12; Thu, 13 Oct 2016 21:35:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED97EE6D; Thu, 13 Oct 2016 21:35:49 +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 u9DLZnis038744; Thu, 13 Oct 2016 21:35:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DLZnmT038743; Thu, 13 Oct 2016 21:35:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610132135.u9DLZnmT038743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 13 Oct 2016 21:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307237 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 21:35:50 -0000 Author: emaste Date: Thu Oct 13 21:35:48 2016 New Revision: 307237 URL: https://svnweb.freebsd.org/changeset/base/307237 Log: garbage collect _libatm, missed in r179308 Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Oct 13 20:39:34 2016 (r307236) +++ head/lib/Makefile Thu Oct 13 21:35:48 2016 (r307237) @@ -26,7 +26,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ .WAIT \ libalias \ libarchive \ - ${_libatm} \ libauditd \ libbegemot \ ${_libblacklist} \ @@ -134,7 +133,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ # libraries, those libraries should be listed as build order dependencies here. SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd -SUBDIR_DEPEND_libatm= libmd SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} SUBDIR_DEPEND_libc++:= libcxxrt From owner-svn-src-head@freebsd.org Thu Oct 13 21:42:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD5F9C10F75; Thu, 13 Oct 2016 21:42:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3E4533D; Thu, 13 Oct 2016 21:42:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-qk0-x22c.google.com with SMTP id f128so110741020qkb.1; Thu, 13 Oct 2016 14:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=eqPNMl7awoy8ADNBfv6wfK42vX3Ji7yPHPvBfq5T4t8=; b=IFf47xw5j3HVFYqqsgimGXu69ahOmu4AV5lAZQVVnkSqOSplsplUGMUg0BRX0lXBPV tfCoGL7enPMPO23CR69kA6GKxdzzKMzxxXdnVAGU9w4FMM1WtOr+qVTKg4pBqs5Vmo58 dM7g/NICl4eHIrBRKddiYDLZ9V4AD1fZxc2GJpvrFT/47LkW/IrVjtoVBrviGm7WGhjp UeDERfoIUGmORqgmTolHTMbWHLR22Jaetqw2pYu+gVStV8zOpbbBhnr1PHEeCLwG/ING abZaD8bARdEJ8E2CaTo/gA8HslktWOKM6WYAUAxR7sFX/szEGTwu7qQ7D7CDa4RpzNZk Lvow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=eqPNMl7awoy8ADNBfv6wfK42vX3Ji7yPHPvBfq5T4t8=; b=lx/OYtAYk34bylQnsDtxl2GOqMUISCWT861UfZGDm+XB32o8fByJCFBMGu06dYc0/h RnC9voWLRIUe2NeYG5eFS9Nm8vdcXc5KxROWCQDlJUqsgD4FIbgJcIz8+oq14esGEy5T bocNywTy9U93blRqAClRj+8wk68YNeYIsi+lGDQozQqsIFR9f3nZj0txmgvjDsLjpJ4M dwCD4RwvdHDWqVlOhckACe6BDkeKL4kXHnrCXyECjTtD4oxPSEPlG3LqDbRTHGNYlMqd IkkI6Ped6PG3yacdecco/riYcNzrrCOD/VaIo7WdW2py+pkB7nKQPR0RwuXReoYx+09g GMDw== X-Gm-Message-State: AA6/9RmZg+NWOKv3HMrFFIUt1p/nYCz0dEKqW3GObDRS1qMdaGK3rskRZV7M9bfDNosocjbq5ZXHNm0qLQQhZw== X-Received: by 10.55.80.136 with SMTP id e130mr8396419qkb.119.1476394951700; Thu, 13 Oct 2016 14:42:31 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.12.138.251 with HTTP; Thu, 13 Oct 2016 14:42:31 -0700 (PDT) In-Reply-To: <201507021731.t62HV074085188@repo.freebsd.org> References: <201507021731.t62HV074085188@repo.freebsd.org> From: Alan Somers Date: Thu, 13 Oct 2016 15:42:31 -0600 X-Google-Sender-Auth: Zi29YmTRfK1BpHLcf0OjKwSW8iQ Message-ID: Subject: Re: svn commit: r285050 - in head: lib/libutil usr.sbin/pwd_mkdb To: Renato Botelho Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 21:42:33 -0000 On Thu, Jul 2, 2015 at 11:31 AM, Renato Botelho wrote: > Author: garga (ports committer) > Date: Thu Jul 2 17:30:59 2015 > New Revision: 285050 > URL: https://svnweb.freebsd.org/changeset/base/285050 > > Log: > When passwd or group information is changed (by pw, vipw, chpass, ...) > temporary file is created and then a rename() call move it to official file. > This operation didn't have any check to make sure data was written to disk > and if a power cycle happens system could end up with a 0 length passwd > or group database. > > There is a pfSense bug with more infor about it: > > https://redmine.pfsense.org/issues/4523 > > The following changes were made to protect passwd and group operations: > > * lib/libutil/gr_util.c: > - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file > - After rename(), fsync() call on directory for faster result > > * lib/libutil/pw_util.c > - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file > > * usr.sbin/pwd_mkdb/pwd_mkdb.c > - Added O_SYNC flag on dbopen() calls > - After rename(), fsync() call on directory for faster result > > * lib/libutil/pw_util.3 > - pw_lock() returns a file descriptor to master password file on success > > Differential Revision: https://reviews.freebsd.org/D2978 > Approved by: bapt > Sponsored by: Netgate > > Modified: > head/lib/libutil/gr_util.c > head/lib/libutil/pw_util.3 > head/lib/libutil/pw_util.c > head/usr.sbin/pwd_mkdb/pwd_mkdb.c This change is making certain pw operations very slow on ZFS root systems. The problem is that when you open a file with O_SYNC, every single write(2) call turns into a zil_commit on ZFS, which is fairly expensive. Did you consider using fsync(2) on the temporary files instead of opening them with O_SYNC? I just tried that now, and I see a considerable speedup when running the tests in /usr/tests/usr.sbin/pw: Using O_SYNC, as CURRENT does: 4 minutes 5.2 seconds No synchronous operations at all: 49.5 seconds Using fsync(2): 56.0 seconds -Alan From owner-svn-src-head@freebsd.org Thu Oct 13 22:43:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CED5C10B07; Thu, 13 Oct 2016 22:43:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17039EB5; Thu, 13 Oct 2016 22:43:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DMhoXE064830; Thu, 13 Oct 2016 22:43:50 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DMhnVH064823; Thu, 13 Oct 2016 22:43:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610132243.u9DMhnVH064823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 13 Oct 2016 22:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307238 - in head/sys/boot: arm/uboot common mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 sparc64/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 22:43:51 -0000 Author: bapt Date: Thu Oct 13 22:43:49 2016 New Revision: 307238 URL: https://svnweb.freebsd.org/changeset/base/307238 Log: Stop closing the network device when netbooting for loaders using the common dev_net.c code. The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour on some architectures (sparc64 and powerpc64) the default was left to always open and close the device for each open and close of a file by the loader because it was necessary for u-boot on arm. Since it has been added, the flag was turned on for every arches including the u-boot loader for arm. This also fixes netbooting on RPi3 (tested by gonzo@) For the loader.efi it greatly speeds up netbooting Reviewed by: emaste, gonzo, tsoome Approved by: gonzo MFC after: 1 month Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D8230 Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/common/dev_net.c head/sys/boot/mips/uboot/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/sparc64/loader/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Thu Oct 13 21:35:48 2016 (r307237) +++ head/sys/boot/arm/uboot/Makefile Thu Oct 13 22:43:49 2016 (r307238) @@ -77,8 +77,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE - .if ${MK_FORTH} != "no" # Enable BootForth BOOT_FORTH= yes Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Thu Oct 13 21:35:48 2016 (r307237) +++ head/sys/boot/common/dev_net.c Thu Oct 13 22:43:49 2016 (r307238) @@ -120,11 +120,9 @@ net_open(struct open_file *f, ...) devname = va_arg(args, char*); va_end(args); -#ifdef NETIF_OPEN_CLOSE_ONCE /* Before opening another interface, close the previous one first. */ if (netdev_sock >= 0 && strcmp(devname, netdev_name) != 0) net_cleanup(); -#endif /* On first open, do netif open, mount, etc. */ if (netdev_opens == 0) { @@ -198,21 +196,6 @@ net_close(struct open_file *f) f->f_devdata = NULL; -#ifndef NETIF_OPEN_CLOSE_ONCE - /* Extra close call? */ - if (netdev_opens <= 0) - return (0); - netdev_opens--; - /* Not last close? */ - if (netdev_opens > 0) - return (0); - /* On last close, do netif close, etc. */ -#ifdef NETIF_DEBUG - if (debug) - printf("net_close: calling net_cleanup()\n"); -#endif - net_cleanup(); -#endif return (0); } Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Thu Oct 13 21:35:48 2016 (r307237) +++ head/sys/boot/mips/uboot/Makefile Thu Oct 13 22:43:49 2016 (r307238) @@ -81,8 +81,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE - .if ${MK_FORTH} != "no" # Enable BootForth BOOT_FORTH= yes Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Thu Oct 13 21:35:48 2016 (r307237) +++ head/sys/boot/powerpc/kboot/Makefile Thu Oct 13 22:43:49 2016 (r307238) @@ -68,10 +68,7 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../.. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# Avoid the open-close-dance for every file access as some firmwares perform -# an auto-negotiation on every open of the network interface and thus causes -# netbooting to take horribly long. -CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE -mcpu=powerpc64 +CFLAGS+= -mcpu=powerpc64 # Always add MI sources .PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Thu Oct 13 21:35:48 2016 (r307237) +++ head/sys/boot/powerpc/ofw/Makefile Thu Oct 13 22:43:49 2016 (r307238) @@ -67,11 +67,6 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../.. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# Avoid the open-close-dance for every file access as some firmwares perform -# an auto-negotiation on every open of the network interface and thus causes -# netbooting to take horribly long. -CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE - # Always add MI sources .PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern .include "${.CURDIR}/../../common/Makefile.inc" Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Thu Oct 13 21:35:48 2016 (r307237) +++ head/sys/boot/powerpc/ps3/Makefile Thu Oct 13 22:43:49 2016 (r307238) @@ -68,10 +68,7 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../.. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# Avoid the open-close-dance for every file access as some firmwares perform -# an auto-negotiation on every open of the network interface and thus causes -# netbooting to take horribly long. -CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE -mcpu=powerpc64 +CFLAGS+= -mcpu=powerpc64 # Always add MI sources .PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Thu Oct 13 21:35:48 2016 (r307237) +++ head/sys/boot/sparc64/loader/Makefile Thu Oct 13 22:43:49 2016 (r307238) @@ -69,10 +69,6 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -# Avoid the open-close-dance for every file access as some firmwares perform -# an auto-negotiation on every open of the network interface and thus causes -# netbooting to take horribly long. -CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE CLEANFILES+= vers.c loader.help From owner-svn-src-head@freebsd.org Thu Oct 13 23:06:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EE5CC1014B; Thu, 13 Oct 2016 23:06:21 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D484F1890; Thu, 13 Oct 2016 23:06:20 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u9DN6Aod023917; Thu, 13 Oct 2016 16:06:14 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201610132306.u9DN6Aod023917@gw.catspoiler.org> Date: Thu, 13 Oct 2016 16:06:10 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r285050 - in head: lib/libutil usr.sbin/pwd_mkdb To: asomers@freebsd.org cc: garga@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 23:06:21 -0000 On 13 Oct, Alan Somers wrote: > On Thu, Jul 2, 2015 at 11:31 AM, Renato Botelho wrote: >> Author: garga (ports committer) >> Date: Thu Jul 2 17:30:59 2015 >> New Revision: 285050 >> URL: https://svnweb.freebsd.org/changeset/base/285050 >> >> Log: >> When passwd or group information is changed (by pw, vipw, chpass, ...) >> temporary file is created and then a rename() call move it to official file. >> This operation didn't have any check to make sure data was written to disk >> and if a power cycle happens system could end up with a 0 length passwd >> or group database. >> >> There is a pfSense bug with more infor about it: >> >> https://redmine.pfsense.org/issues/4523 >> >> The following changes were made to protect passwd and group operations: >> >> * lib/libutil/gr_util.c: >> - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file >> - After rename(), fsync() call on directory for faster result >> >> * lib/libutil/pw_util.c >> - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file >> >> * usr.sbin/pwd_mkdb/pwd_mkdb.c >> - Added O_SYNC flag on dbopen() calls >> - After rename(), fsync() call on directory for faster result >> >> * lib/libutil/pw_util.3 >> - pw_lock() returns a file descriptor to master password file on success >> >> Differential Revision: https://reviews.freebsd.org/D2978 >> Approved by: bapt >> Sponsored by: Netgate >> >> Modified: >> head/lib/libutil/gr_util.c >> head/lib/libutil/pw_util.3 >> head/lib/libutil/pw_util.c >> head/usr.sbin/pwd_mkdb/pwd_mkdb.c > > This change is making certain pw operations very slow on ZFS root > systems. The problem is that when you open a file with O_SYNC, every > single write(2) call turns into a zil_commit on ZFS, which is fairly > expensive. Did you consider using fsync(2) on the temporary files > instead of opening them with O_SYNC? I just tried that now, and I see > a considerable speedup when running the tests in > /usr/tests/usr.sbin/pw: > > Using O_SYNC, as CURRENT does: 4 minutes 5.2 seconds > No synchronous operations at all: 49.5 seconds > Using fsync(2): 56.0 seconds pwd_mkdb was fixed back in February with by switching to fsync() in r295925. It looks like libutil was not fixed, though. From owner-svn-src-head@freebsd.org Thu Oct 13 23:29:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46CF2C105B7; Thu, 13 Oct 2016 23:29:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5728AF; Thu, 13 Oct 2016 23:29:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9DNTPqK080084; Thu, 13 Oct 2016 23:29:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9DNTPtv080083; Thu, 13 Oct 2016 23:29:25 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610132329.u9DNTPtv080083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 13 Oct 2016 23:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307239 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 23:29:26 -0000 Author: gonzo Date: Thu Oct 13 23:29:24 2016 New Revision: 307239 URL: https://svnweb.freebsd.org/changeset/base/307239 Log: Fix BCM283x(Raspberry Pi) SDHCI driver for ARM64 build - Revert BUS_SPACE_PHYSADDR back to rman_get_start. BUS_SPACE_PHYSADDR was introduced in 2013 as temporary wrapper until proper solution appears. It's ARM only and since we need this file for ARM64 build and no proper API has been introduced - just revert the change and make sure it's going to appear when people grep for BUS_SPACE_PHYSADDR in sources. - Fix printf format for size_t variables Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Thu Oct 13 22:43:49 2016 (r307238) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Thu Oct 13 23:29:24 2016 (r307239) @@ -246,8 +246,9 @@ bcm_sdhci_attach(device_t dev) goto fail; } - sc->sc_sdhci_buffer_phys = BUS_SPACE_PHYSADDR(sc->sc_mem_res, - SDHCI_BUFFER); + /* FIXME: Fix along with other BUS_SPACE_PHYSADDR instances */ + sc->sc_sdhci_buffer_phys = rman_get_start(sc->sc_mem_res) + + SDHCI_BUFFER; bus_generic_probe(dev); bus_generic_attach(dev); @@ -552,7 +553,7 @@ bcm_sdhci_read_dma(device_t dev, struct slot->curcmd->data->len - slot->offset); KASSERT((left & 3) == 0, - ("%s: len = %d, not word-aligned", __func__, left)); + ("%s: len = %zu, not word-aligned", __func__, left)); if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, (uint8_t *)slot->curcmd->data->data + slot->offset, left, @@ -581,7 +582,7 @@ bcm_sdhci_write_dma(device_t dev, struct slot->curcmd->data->len - slot->offset); KASSERT((left & 3) == 0, - ("%s: len = %d, not word-aligned", __func__, left)); + ("%s: len = %zu, not word-aligned", __func__, left)); if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, (uint8_t *)slot->curcmd->data->data + slot->offset, left, From owner-svn-src-head@freebsd.org Fri Oct 14 00:42:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7D68AC699C; Fri, 14 Oct 2016 00:42:09 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF0B87B0; Fri, 14 Oct 2016 00:42:09 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9E0g81U009740; Fri, 14 Oct 2016 00:42:08 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9E0g8u9009739; Fri, 14 Oct 2016 00:42:08 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610140042.u9E0g8u9009739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 14 Oct 2016 00:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307240 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 00:42:10 -0000 Author: gonzo Date: Fri Oct 14 00:42:08 2016 New Revision: 307240 URL: https://svnweb.freebsd.org/changeset/base/307240 Log: Fix BCM238x framebuffer driver build for ARM64 VM_MEMATTR_WRITE_COMBINING can be undefined for some platforms, use it only if it's defined Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Thu Oct 13 23:29:24 2016 (r307239) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Fri Oct 14 00:42:08 2016 (r307240) @@ -120,7 +120,9 @@ bcm_fb_setup_fbd(struct bcmsc_softc *sc) sc->info.fb_width = fb.xres; sc->info.fb_height = fb.yres; sc->info.fb_flags = FB_FLAG_MEMATTR; +#ifdef VM_MEMATTR_WRITE_COMBINING sc->info.fb_memattr = VM_MEMATTR_WRITE_COMBINING; +#endif if (sc->fbswap) { switch (sc->info.fb_bpp) { From owner-svn-src-head@freebsd.org Fri Oct 14 01:23:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F7CFC10353; Fri, 14 Oct 2016 01:23:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21622B3F; Fri, 14 Oct 2016 01:23:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9E1NL3C025754; Fri, 14 Oct 2016 01:23:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9E1NLrp025753; Fri, 14 Oct 2016 01:23:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610140123.u9E1NLrp025753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 14 Oct 2016 01:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307241 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 01:23:22 -0000 Author: gonzo Date: Fri Oct 14 01:23:21 2016 New Revision: 307241 URL: https://svnweb.freebsd.org/changeset/base/307241 Log: Do not set FB_FLAG_MEMATTR if VM_MEMATTR_WRITE_COMBINING is not available Pintyhat to: gonzo Spotted by: jmallett Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Fri Oct 14 00:42:08 2016 (r307240) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Fri Oct 14 01:23:21 2016 (r307241) @@ -119,8 +119,8 @@ bcm_fb_setup_fbd(struct bcmsc_softc *sc) sc->info.fb_stride = fb.pitch; sc->info.fb_width = fb.xres; sc->info.fb_height = fb.yres; - sc->info.fb_flags = FB_FLAG_MEMATTR; #ifdef VM_MEMATTR_WRITE_COMBINING + sc->info.fb_flags = FB_FLAG_MEMATTR; sc->info.fb_memattr = VM_MEMATTR_WRITE_COMBINING; #endif From owner-svn-src-head@freebsd.org Fri Oct 14 01:53:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03AF6C109F1; Fri, 14 Oct 2016 01:53:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8C98A46; Fri, 14 Oct 2016 01:53:16 +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 u9E1rFjg037508; Fri, 14 Oct 2016 01:53:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9E1rFi6037507; Fri, 14 Oct 2016 01:53:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610140153.u9E1rFi6037507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 14 Oct 2016 01:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307243 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 01:53:17 -0000 Author: emaste Date: Fri Oct 14 01:53:15 2016 New Revision: 307243 URL: https://svnweb.freebsd.org/changeset/base/307243 Log: partially convert lib/Makefile to SUBDIR.${MK_FOO} style Cases other than MK_* (e.g. ${MACHINE_CPUARCH} == "i386") have been left as is. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8246 Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Oct 14 01:38:29 2016 (r307242) +++ head/lib/Makefile Fri Oct 14 01:53:15 2016 (r307243) @@ -28,106 +28,69 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libarchive \ libauditd \ libbegemot \ - ${_libblacklist} \ libblocksruntime \ - ${_libbluetooth} \ - ${_libbsnmp} \ libbsdstat \ libbsm \ libbz2 \ libcalendar \ libcam \ libcapsicum \ - ${_libcasper} \ - ${_libcom_err} \ libcompat \ libcrypt \ libdevctl \ - ${_libdevdctl} \ libdevinfo \ libdevstat \ libdwarf \ libedit \ - ${_libefivar} \ - ${_libelftc} \ libevent \ libexecinfo \ libexpat \ libfetch \ libfigpar \ libgeom \ - ${_libgpio} \ - ${_libgssapi} \ - ${_librpcsec_gss} \ - ${_libiconv_modules} \ libifconfig \ libipsec \ libjail \ libkiconv \ libkvm \ - ${_libldns} \ liblzma \ - ${_libmagic} \ libmemstat \ libmd \ - ${_libmilter} \ - ${_libmp} \ libmt \ - ${_libnandfs} \ lib80211 \ libnetbsd \ - ${_libnetgraph} \ - ${_libngatm} \ libnv \ libopenbsd \ libopie \ libpam \ libpcap \ - ${_libpe} \ libpjdlog \ - ${_libpmc} \ ${_libproc} \ libprocstat \ - ${_libradius} \ librpcsvc \ librss \ librt \ ${_librtld_db} \ libsbuf \ - ${_libsdp} \ - ${_libsm} \ libsmb \ - ${_libsmdb} \ - ${_libsmutil} \ libsqlite3 \ libstand \ libstdbuf \ libstdthreads \ libsysdecode \ libtacplus \ - ${_libtelnet} \ - ${_libthr} \ libthread_db \ libucl \ libufs \ libugidfw \ libulog \ - ${_libunbound} \ - ${_libusbhid} \ - ${_libusb} \ libutil \ ${_libvgl} \ - ${_libvmmapi} \ libwrap \ libxo \ liby \ - ${_libypclnt} \ libz \ - ncurses \ - ${_atf} \ - ${_clang} \ - ${_cuse} \ - ${_tests} + ncurses # Inter-library dependencies. When the makefile for a library contains LDADD # libraries, those libraries should be listed as build order dependencies here. @@ -159,70 +122,26 @@ SUBDIR_DEPEND_liblzma= ${_libthr} # NB: keep these sorted by MK_* knobs -.if ${MK_ATM} != "no" -_libngatm= libngatm -.endif - -.if ${MK_BLACKLIST} != "no" -_libblacklist= libblacklist -.endif - -.if ${MK_BLUETOOTH} != "no" -_libbluetooth= libbluetooth -_libsdp= libsdp -.endif - -.if ${MK_BSNMP} != "no" -_libbsnmp= libbsnmp -.endif - -.if ${MK_CASPER} != "no" -_libcasper= libcasper -.endif - -.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP) -_clang= clang -.endif - -.if ${MK_CUSE} != "no" -_cuse= libcuse -.endif - -.if ${MK_CXX} != "no" -_libdevdctl= libdevdctl -.endif - -.if ${MK_TOOLCHAIN} != "no" -_libelftc= libelftc -_libpe= libpe +SUBDIR.${MK_ATM}+= libngatm +SUBDIR.${MK_BLACKLIST}+=libblacklist +SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp +SUBDIR.${MK_BSNMP}+= libbsnmp +SUBDIR.${MK_CASPER}+= libcasper + +.if !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP) +SUBDIR.${MK_CLANG}+= clang .endif +SUBDIR.${MK_CUSE}+= libcuse +SUBDIR.${MK_CXX}+= libdevdctl +SUBDIR.${MK_TOOLCHAIN}+=libelftc libpe SUBDIR.${MK_DIALOG}+= libdpv - -.if ${MK_FILE} != "no" -_libmagic= libmagic -.endif - -.if ${MK_GPIO} != "no" -_libgpio= libgpio -.endif - -.if ${MK_GSSAPI} != "no" -_libgssapi= libgssapi -_librpcsec_gss= librpcsec_gss -.endif - -.if ${MK_ICONV} != "no" -_libiconv_modules= libiconv_modules -.endif - -.if ${MK_KERBEROS_SUPPORT} != "no" -_libcom_err= libcom_err -.endif - -.if ${MK_LDNS} != "no" -_libldns= libldns -.endif +SUBDIR.${MK_FILE}+= libmagic +SUBDIR.${MK_GPIO}+= libgpio +SUBDIR.${MK_GSSAPI}+= libgssapi librpcsec_gss +SUBDIR.${MK_ICONV}+= libiconv_modules +SUBDIR.${MK_KERBEROS_SUPPORT}+= libcom_err +SUBDIR.${MK_LDNS}+= libldns # The libraries under libclang_rt can only be built by clang, and only make # sense to build when clang is enabled at all. Furthermore, they can only be @@ -239,25 +158,11 @@ _libcxxrt= libcxxrt _libcplusplus= libc++ .endif -.if ${MK_EFI} != "no" -_libefivar= libefivar -.endif - -.if ${MK_LIBTHR} != "no" -_libthr= libthr -.endif - -.if ${MK_NAND} != "no" -_libnandfs= libnandfs -.endif - -.if ${MK_NETGRAPH} != "no" -_libnetgraph= libnetgraph -.endif - -.if ${MK_NIS} != "no" -_libypclnt= libypclnt -.endif +SUBDIR.${MK_EFI}+= libefivar +SUBDIR.${MK_LIBTHR}+= libthr +SUBDIR.${MK_NAND}+= libnandfs +SUBDIR.${MK_NETGRAPH}+= libnetgraph +SUBDIR.${MK_NIS}+= libypclnt .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _libvgl= libvgl @@ -266,9 +171,7 @@ _librtld_db= librtld_db .endif .if ${MACHINE_CPUARCH} == "amd64" -.if ${MK_BHYVE} != "no" -_libvmmapi= libvmmapi -.endif +SUBDIR.${MK_BHYVE}+= libvmmapi .endif .if ${MACHINE_CPUARCH} == "mips" @@ -287,44 +190,15 @@ _libproc= libproc _librtld_db= librtld_db .endif -.if ${MK_OPENSSL} != "no" -_libmp= libmp -.endif - -.if ${MK_PMC} != "no" -_libpmc= libpmc -.endif - -.if ${MK_RADIUS_SUPPORT} != "no" -_libradius= libradius -.endif - -.if ${MK_SENDMAIL} != "no" -_libmilter= libmilter -_libsm= libsm -_libsmdb= libsmdb -_libsmutil= libsmutil -.endif - -.if ${MK_TELNET} != "no" -_libtelnet= libtelnet -.endif - -.if ${MK_TESTS_SUPPORT} != "no" -_atf= atf -.endif -.if ${MK_TESTS} != "no" -_tests= tests -.endif - -.if ${MK_UNBOUND} != "no" -_libunbound= libunbound -.endif - -.if ${MK_USB} != "no" -_libusbhid= libusbhid -_libusb= libusb -.endif +SUBDIR.${MK_OPENSSL}+= libmp +SUBDIR.${MK_PMC}+= libpmc +SUBDIR.${MK_RADIUS_SUPPORT}+= libradius +SUBDIR.${MK_SENDMAIL}+= libmilter libsm libsmdb libsmutil +SUBDIR.${MK_TELNET}+= libtelnet +SUBDIR.${MK_TESTS_SUPPORT}+= atf +SUBDIR.${MK_TESTS}+= tests +SUBDIR.${MK_UNBOUND}+= libunbound +SUBDIR.${MK_USB}+= libusbhid libusb .if !make(install) SUBDIR_PARALLEL= From owner-svn-src-head@freebsd.org Fri Oct 14 01:53:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3313C10A43; Fri, 14 Oct 2016 01:53:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 6F597BBD; Fri, 14 Oct 2016 01:53:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-78.carlnfd1.nsw.optusnet.com.au [110.21.100.78]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id DCAF11A1B32; Fri, 14 Oct 2016 12:53:29 +1100 (AEDT) Date: Fri, 14 Oct 2016 12:53:25 +1100 (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: r307231 - head/lib/libgcc_s In-Reply-To: <201610131918.u9DJI0bX085695@repo.freebsd.org> Message-ID: <20161014113603.F1039@besplex.bde.org> References: <201610131918.u9DJI0bX085695@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.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=uGjuzT6u7JdBDS7kH8taPg==:117 a=uGjuzT6u7JdBDS7kH8taPg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=BuHqgrkV7Vy3e-t3-m8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 01:53:42 -0000 On Thu, 13 Oct 2016, Ed Maste wrote: > Log: > libgcc_s: add libm dependencies from div{d,s,x}c3 > > compiler-rt's complex division support routines contain calls to > compiler builtins such as `__builtin_scalbnl`. Unfortunately Clang > turns these back into a call to `scalbnl`. gcc-4.2 has the same bug. This causes problems in the implementation of libm (and other libraries). The implementation can never (but sometimes does) use __builtin_foo() to get a possibly-better optimized or MD or CFLAGS-dependent version, because when the compiler doesn't have a better version it usually has the bug if of calling the library version which calls just itself when it is misimplemented as the builtin. The __has_builtin() macro is worse than useless for determining if the builtin is better. First, it doesn't really exist so is a dummy version with value 0 on some compilers that have have some better builtins. clang has the opposite problem -- it has squillions of builtins, but most of them just call the standard function. Next, even if the compiler has a real builtin, there is no way except a benchmark to tell if it is worth using. The ones that are always worth using are usually used automatically, but -ffreestanding and -fno-builtin often turns this off. In libm, the most interesting builtin is __builtin_fma[fl](), but this is unusable and not used. fma*() even has a standard macro FP_FAST_FMA[FL] to tell you if it is any good. It is only any good if it is in pure hardware, but libm hard-codes FP_FAST_FMAF = true and has special a not-very-fast implementation for the float case. On x86, it takes later SSE and/or AVX to give fma*() in hardware, and unportable CFLGS to use this hardware, and a compiler that supports this and the __builtin_fma*() spelling to use the instruction (even clang is excessively IEEE/C conformant on x86 -- it never turns x*y+z into fma(x,y,z)). So *fma*() is unusuable for efficiency in practice. It gives extra accuracy in some cases and is specified to do that, but implementing this in software makes using it just a pessimization in most cases. > For now link libm's C version of the required support routines. Even libm doesn't use these in some cases. i386 mostly uses asm versions. Hopefully the rt division routines don't need to be efficient because they are rarely called. > Reviewed by: ed > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D8190 > > Modified: > head/lib/libgcc_s/Makefile > > Modified: head/lib/libgcc_s/Makefile > ============================================================================== > --- head/lib/libgcc_s/Makefile Thu Oct 13 18:57:18 2016 (r307230) > +++ head/lib/libgcc_s/Makefile Thu Oct 13 19:18:00 2016 (r307231) > @@ -11,4 +11,22 @@ VERSION_MAP= ${.CURDIR}/Version.map > .include "../libcompiler_rt/Makefile.inc" > .include "../libgcc_eh/Makefile.inc" > > +LIBCSRCDIR= ${SRCTOP}/lib/libc > +LIBMSRCDIR= ${SRCTOP}/lib/msun/src > +CFLAGS+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}/${MACHINE_CPUARCH} > +CFLAGS+= -I${LIBMSRCDIR} > +.PATH: ${LIBMSRCDIR} > +SRCS+= s_fabs.c > +SRCS+= s_fabsf.c > +SRCS+= s_fabsl.c The fabs functions cause a smaller set of problems for builtins: - normally they are automatically inlined as a builtin if they are spelled fabs*() - -ffreestanding turns this off, so rt might need to spell them __builtin_fabs*(), but on arches where they aren't real builtins the above is still needed - i386 doesn't bother implementing these in asm since they are usually builtins - the C implementations are good, but are often very badly optimized by compilers, due to problems with compilers not understanding load/store penalties for the current arch or the compile-time arch not matching the runtime arch - the builtins have the same problem with arch mismatches. > +SRCS+= s_fmax.c > +SRCS+= s_fmaxf.c > +SRCS+= s_fmaxl.c These are exotic functions which should rarely be used, especially in portable code that doesn't need to be efficient. They just give subtle behaviour for NaNs. I checked recently that the special builtins for comparing possible NaNs are insignificantly faster than the generic code which starts with isnan(), on x86 (this depends on isnan() being a fast builtin). The implementation of these functions is basically to start with an inline C implementation of isnan(). This is likely to be just slower than the natural max(x, y) code using a comparison, after adding some isnan()s to the latter. Division code should have classified NaNs up front and never use these functions. i386 doesn't bother to optimize these functions. I think it can't do any better than the C code using a builtin relop (x86 has special relops that behave differently for NaNs, but IIRC these functions treat NaNs too unusually for either the normal relop or a special relop to work directly). > +SRCS+= s_logb.c > +SRCS+= s_logbf.c > +SRCS+= s_logbl.c i386 does these in asm. amd64 does only logbl() in asm. These optimizations are barely worth it, though they map directly to an x87 instruction and this instruction is not slow. > +SRCS+= s_scalbn.c > +SRCS+= s_scalbnf.c > +SRCS+= s_scalbnl.c Both i386 and amd64 do all of these in asm. This is a dubious optimization. The C versions are quite complicated and not very good. libm knows this and uses lots of inline expansions of core parts of these functions. This is much faster than calling the x86 MD versions too. > + > .include I think there are still namespace bugs. scalbnl() is in the application namespace for -ffreestanding. There are similar bugs from calling mem*() for struct copying. libcompiler_rt.a now on amd64 now has the following namespace bugs: U compilerrt_abort_impl U fflush U fprintf U mprotect U sysconf U fmaxl U logbl U scalbnl U logbf U scalbnf U logb U scalbn U abort These are bugs since division must be available with -ffreestanding and the freestanding library shouldn't have to reimplement it. Bruce From owner-svn-src-head@freebsd.org Fri Oct 14 02:06:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22534C10F3F; Fri, 14 Oct 2016 02:06:30 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E05D53D3; Fri, 14 Oct 2016 02:06:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x243.google.com with SMTP id p26so6004657ioo.2; Thu, 13 Oct 2016 19:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=eZ3B0uTAEe3iwyjQ/gV8PiYyQ4D2rOOPw0ZgO5y98jY=; b=uVESCNk/s3O8XVjngI4v8j7w6ilCrqpeUT2W2soMPoCPh/j7cLYecT/l8TgVuDW2yn wg3yZuqoiySzg7NR3yIkLF4iMxbD5Bglu0CCmL8Q81Ph/2ghlrYL5OzVWPAZIrmCDq5M WAxg/XIlGReh6GcXVqQmxBo2jEYx8HLlZLYZ7BwugI+zfX2HloVqHUjAYdbBrC7Y7Ebl +FwrR93ePXDd0x7c+DtnmHt48MMccU8llZIFNn/A5eAxUnMJ97RIu142B+tdLS83TXZI 4uN5Zsp7QpPRoKtM9JZ3OUgF6o+wbkGg8dC8RZHNNmOoTRhCcSieLHIX+3psx5Fri+rg IecA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=eZ3B0uTAEe3iwyjQ/gV8PiYyQ4D2rOOPw0ZgO5y98jY=; b=dYp7dqvjcN5l0N8O5q3lxIpeukF8AQura0cxZ2zbUArsJDxkfSGBTkzAT/UF02a8sy Jf50Cg/eaVfwLV3xn7QMm2jXFgQGt24ob9wfcFLi+t9J6xn3WNhGV0lSFvO5BXHcnHRd M3d6Y6EDLZe/g+nOONZIz1gvy0Lgu4QMeMa9zoiw4Z+40v471fC++eEYUkkGWgjqwJJc YNO0hbzpU9AHPHqhFOzEV5q/ZxoAA/1U09J3GEmSKAoAgIOavdfQ2d0ZYhB2u+Z/+pqQ d6IOArmz15xkEXMtqMyXXzz6qlP9z8sBv4dREm0gbkbYGkMNSf86Vi0o8NSIKEO3BWHD Rozw== X-Gm-Message-State: AA6/9RkZEsD4ytCTBwM6iLCHWBfcVI+jITpxEic8z3C1Fw5yD2s1f//sKYbPSQrqCigwjY+gnnKkWOhGFUByjQ== X-Received: by 10.107.23.197 with SMTP id 188mr8912338iox.162.1476410789183; Thu, 13 Oct 2016 19:06:29 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.180.211 with HTTP; Thu, 13 Oct 2016 19:06:08 -0700 (PDT) In-Reply-To: <20161014113603.F1039@besplex.bde.org> References: <201610131918.u9DJI0bX085695@repo.freebsd.org> <20161014113603.F1039@besplex.bde.org> From: Ed Maste Date: Fri, 14 Oct 2016 02:06:08 +0000 X-Google-Sender-Auth: cyw6T_vxGvrmzv8bpfzAI9dhUpw Message-ID: Subject: Re: svn commit: r307231 - head/lib/libgcc_s To: Bruce Evans Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 02:06:30 -0000 Hi Bruce, thank you for the detailed response. On 14 October 2016 at 01:53, Bruce Evans wrote: >> compiler-rt's complex division support routines contain calls to >> compiler builtins such as `__builtin_scalbnl`. Unfortunately Clang >> turns these back into a call to `scalbnl`. > > gcc-4.2 has the same bug. Oh, interesting. Do you know off hand if it's resolved in later GCC? It seems particularly unfortunate for the compiler to report (by whatever mechanism) that a builtin exists, and then just turn that builtin into a library call. >> For now link libm's C version of the required support routines. > > Even libm doesn't use these in some cases. i386 mostly uses asm > versions. Hopefully the rt division routines don't need to be efficient > because they are rarely called. Most likely I'll switch to the asm versions across suitable architectures in a subsequent change, mirroring the choices made in libm. I just wanted to get a version in, to enable further testing (ports exp-runs, etc.) of this libunwind / compiler-rt combination. [Details about specific groups of functions omitted -- I'll try to take a look at these later.] > libcompiler_rt.a now on amd64 now has the following namespace bugs: > > U compilerrt_abort_impl > U fflush > U fprintf > U mprotect > U sysconf > U fmaxl > U logbl > U scalbnl > U logbf > U scalbnf > U logb > U scalbn > U abort > > These are bugs since division must be available with -ffreestanding and > the freestanding library shouldn't have to reimplement it. Yes, these libcompiler_rt.a issues seem rather surprising to me, but presumably they aren't causing much of an issue in practice in the static lib. In any case, my hope is that once I try disentangling these libraries I can take a look at these issues across the set of libraries (libcompiler_rt.a aka libgcc.a, libgcc_eh.a, libgcc_s.so). From owner-svn-src-head@freebsd.org Fri Oct 14 03:00:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D7EEC11BB7; Fri, 14 Oct 2016 03:00:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46115817; Fri, 14 Oct 2016 03:00:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9E30rJM061197; Fri, 14 Oct 2016 03:00:53 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9E30r1O061196; Fri, 14 Oct 2016 03:00:53 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610140300.u9E30r1O061196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 14 Oct 2016 03:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307252 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 03:00:54 -0000 Author: gonzo Date: Fri Oct 14 03:00:53 2016 New Revision: 307252 URL: https://svnweb.freebsd.org/changeset/base/307252 Log: Make bcm2835_machdep.c optional bcm2835_machdep.c contains only bits enabled by "options PLATFORM", this option available only on ARM, not ARM64 Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 02:58:31 2016 (r307251) +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 03:00:53 2016 (r307252) @@ -9,7 +9,7 @@ arm/broadcom/bcm2835/bcm2835_fbd.c opti arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio arm/broadcom/bcm2835/bcm2835_intr.c standard -arm/broadcom/bcm2835/bcm2835_machdep.c standard +arm/broadcom/bcm2835/bcm2835_machdep.c optional platform arm/broadcom/bcm2835/bcm2835_mbox.c standard arm/broadcom/bcm2835/bcm2835_rng.c optional random arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci From owner-svn-src-head@freebsd.org Fri Oct 14 03:25:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D6EFC10163; Fri, 14 Oct 2016 03:25:17 +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 2EE7AA46; Fri, 14 Oct 2016 03:25:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-78.carlnfd1.nsw.optusnet.com.au [110.21.100.78]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 3CE9710425F2; Fri, 14 Oct 2016 14:02:48 +1100 (AEDT) Date: Fri, 14 Oct 2016 14:02:47 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: Bruce Evans , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307231 - head/lib/libgcc_s In-Reply-To: Message-ID: <20161014132243.M1338@besplex.bde.org> References: <201610131918.u9DJI0bX085695@repo.freebsd.org> <20161014113603.F1039@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=RIxOZNW+ c=1 sm=1 tr=0 a=uGjuzT6u7JdBDS7kH8taPg==:117 a=uGjuzT6u7JdBDS7kH8taPg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=nd2t5aUcH_zjbgAxzD4A:9 a=CjuIK1q_8ugA:10 a=Oa0T6EYmKFNB-xRHvYM1:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 03:25:17 -0000 On Fri, 14 Oct 2016, Ed Maste wrote: > Hi Bruce, thank you for the detailed response. > > On 14 October 2016 at 01:53, Bruce Evans wrote: >>> compiler-rt's complex division support routines contain calls to >>> compiler builtins such as `__builtin_scalbnl`. Unfortunately Clang >>> turns these back into a call to `scalbnl`. >> >> gcc-4.2 has the same bug. > > Oh, interesting. Do you know off hand if it's resolved in later GCC? Don't know. > It seems particularly unfortunate for the compiler to report (by > whatever mechanism) that a builtin exists, and then just turn that > builtin into a library call. Since there is no documentation, I sometimes use strings -a | grep builtin on the compiler binary to find builtins. This finds that there are too many for clang (4655 lines starting with __builtin for the amd64 binary). Then write some code to see if they are actual builtins. >>> For now link libm's C version of the required support routines. >> >> Even libm doesn't use these in some cases. i386 mostly uses asm >> versions. Hopefully the rt division routines don't need to be efficient >> because they are rarely called. > > Most likely I'll switch to the asm versions across suitable > architectures in a subsequent change, mirroring the choices made in > libm. I just wanted to get a version in, to enable further testing > (ports exp-runs, etc.) of this libunwind / compiler-rt combination. The ifdefs in the makefiles might get complicated sonce it was not designed for this. I usually build libm stand-alone, often with older compilers, and don't like any dependencies on other libraries or includes in it (I use stub libraries and includes). scalbn() is also in libc under the name ldexp(). This causes various messes. It used to have clones of a C implementation in alpha, amd64, arm, i386, ia64, powerpc and sparc64 (where at least the i386 version is in inline asm). This was cleaned up by removing all the MD implementations and using 1 generic C implementation with no inline asm. Then it was uncleaned by adding an extern asm version for mips. But the mips Makefile doesn't use this, except possibly by a magic .c.S suffix translation. The msun Makefiles have the relatively minor magic for suffixes. (They list the .c and .S file and then remove the .c file from the final list.) Bruce From owner-svn-src-head@freebsd.org Fri Oct 14 03:37:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFDC8C105F6; Fri, 14 Oct 2016 03:37:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 645B3300; Fri, 14 Oct 2016 03:37:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9E3baNm077183; Fri, 14 Oct 2016 03:37:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9E3baB7077179; Fri, 14 Oct 2016 03:37:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610140337.u9E3baB7077179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 14 Oct 2016 03:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307257 - in head/sys: arm/broadcom/bcm2835 arm64/broadcom arm64/broadcom/bcm2837 arm64/conf conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 03:37:37 -0000 Author: gonzo Date: Fri Oct 14 03:37:35 2016 New Revision: 307257 URL: https://svnweb.freebsd.org/changeset/base/307257 Log: Add initial Raspberry Pi 3 support RPI3 kernel config builds kernel compatible with latest upstream device tree and firmware: https://github.com/raspberrypi/firmware/tree/master/boot As of today it's 597c662a613df1144a6bc43e5f4505d83bd748ca Default console is PL01x, so pi3-disable-bt dt overlay should be configured in config.txt and stock U-Boot should be patched to use proper serial port. Yet unsupported: SMP, VCHIQ, RNG driver. RNG requires some work due to upstream device tree incompatibility. Multiple people contributed to this work over time: db@, loos@, manu@ Added: head/sys/arm64/broadcom/ head/sys/arm64/broadcom/bcm2837/ head/sys/arm64/broadcom/bcm2837/files.bcm2837 (contents, props changed) head/sys/arm64/conf/RPI3 (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h head/sys/conf/options.arm64 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 03:32:20 2016 (r307256) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 03:37:35 2016 (r307257) @@ -37,7 +37,7 @@ #define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 -#ifdef SOC_BCM2836 +#if defined(SOC_BCM2836) || defined(SOC_BCM2837) #define BCM2835_ARM_IO_BASE 0x3f000000 #define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED #else Added: head/sys/arm64/broadcom/bcm2837/files.bcm2837 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/broadcom/bcm2837/files.bcm2837 Fri Oct 14 03:37:35 2016 (r307257) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +arm/broadcom/bcm2835/bcm2836.c standard +kern/kern_clocksource.c standard Added: head/sys/arm64/conf/RPI3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/conf/RPI3 Fri Oct 14 03:37:35 2016 (r307257) @@ -0,0 +1,160 @@ +# +# +# RPI3 -- Custom configuration for the Raspberry Pi 3 +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +cpu ARM64 +ident RPI3 + +files "../../arm/broadcom/bcm2835/files.bcm283x" +files "../broadcom/bcm2837/files.bcm2837" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +#makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support + +options SCHED_ULE # ULE scheduler +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options IPSEC # IP (v4/v6) security +options TCP_HHOOK # hhook(9) framework for TCP +options TCP_OFFLOAD # TCP offload +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS +options MD_ROOT # MD is a potential root device +options NFSCL # Network Filesystem Client +options NFSD # Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_RAID # Soft RAID functionality. +options GEOM_LABEL # Provides labelization +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options STACK # stack(9) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) +options AUDIT # Security event auditing +options CAPABILITY_MODE # Capsicum capability mode +options CAPABILITIES # Capsicum capabilities +options MAC # TrustedBSD MAC Framework +options KDTRACE_FRAME # Ensure frames are compiled in +options KDTRACE_HOOKS # Kernel DTrace hooks +options VFP # Floating-point support +options RACCT # Resource accounting framework +options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default +options RCTL # Resource limits +# SMP is not there yet +# options SMP +options INTRNG + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use (turn off in stable branch): +options DDB # Support DDB. +#options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +options SOC_BCM2837 + +options ROOTDEVNAME=\"ufs:mmcsd0s2\" + +# SPI +device spibus +device bcm2835_spi + +# MMC/SD/SDIO Card slot support +device sdhci +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards + +# Serial (COM) ports +device uart # Generic UART driver +device uart_ns8250 # ns8250-type UART driver +device pl011 + +# USB support +options USB_DEBUG # enable debug msgs +device usb # USB Bus (required) +device dwcotg # DWC OTG controller + +# USB storage support +device scbus +device da +device umass + +# USB ethernet support +device smcphy +device mii +device smsc + +# Comment following lines for boot console on serial port +device vt +device kbdmux +device ukbd # Keyboard + +# GPIO +device gpio +device fdt_pinctrl +device gpioled + +# I2C +device iicbus +device bcm2835_bsc + +# Not ready for ARM64 yet +# device vchiq +# device sound + +# Pseudo devices. +device bpf +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device firmware # firmware assist module +device psci # Support for ARM PSCI + +options FDT + +# The crypto framework is required by IPSEC +device crypto # Required by IPSEC Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Fri Oct 14 03:32:20 2016 (r307256) +++ head/sys/conf/options.arm64 Fri Oct 14 03:37:35 2016 (r307257) @@ -9,5 +9,6 @@ VFP opt_global.h # SoC Support SOC_ALLWINNER_A64 opt_soc.h +SOC_BCM2837 opt_global.h SOC_CAVM_THUNDERX opt_soc.h SOC_HISI_HI6220 opt_soc.h From owner-svn-src-head@freebsd.org Fri Oct 14 05:32:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69238C0FE35; Fri, 14 Oct 2016 05:32:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33A49850; Fri, 14 Oct 2016 05:32:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9E5WlHY022381; Fri, 14 Oct 2016 05:32:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9E5WlqF022380; Fri, 14 Oct 2016 05:32:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610140532.u9E5WlqF022380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 14 Oct 2016 05:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307261 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 05:32:48 -0000 Author: sephe Date: Fri Oct 14 05:32:47 2016 New Revision: 307261 URL: https://svnweb.freebsd.org/changeset/base/307261 Log: hyperv/stor: Fix off-by-one bug; this brings back TRIM support. Submitted by: Hongjiang Zhang Reported by: Lili Deng MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8238 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Oct 14 05:05:23 2016 (r307260) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Oct 14 05:32:47 2016 (r307261) @@ -2210,7 +2210,7 @@ storvsc_io_done(struct hv_storvsc_reques resp_buf[3], resp_buf[4]); } if (vm_srb->srb_status == SRB_STATUS_SUCCESS && - data_len > SHORT_INQUIRY_LENGTH) { + data_len >= SHORT_INQUIRY_LENGTH) { char vendor[16]; cam_strvis(vendor, inq_data->vendor, From owner-svn-src-head@freebsd.org Fri Oct 14 05:41:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E790C110CF; Fri, 14 Oct 2016 05:41:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3163D6D; Fri, 14 Oct 2016 05:41:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9E5fqwU025479; Fri, 14 Oct 2016 05:41:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9E5fpxJ025478; Fri, 14 Oct 2016 05:41:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610140541.u9E5fpxJ025478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 14 Oct 2016 05:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307262 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 05:41:53 -0000 Author: sephe Date: Fri Oct 14 05:41:51 2016 New Revision: 307262 URL: https://svnweb.freebsd.org/changeset/base/307262 Log: hyperv/hn: Management parts always need suspend and resume. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 14 05:32:47 2016 (r307261) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 14 05:41:51 2016 (r307262) @@ -354,6 +354,8 @@ static void hn_suspend(struct hn_softc * static void hn_suspend_data(struct hn_softc *); static void hn_suspend_mgmt(struct hn_softc *); static void hn_resume(struct hn_softc *); +static void hn_resume_data(struct hn_softc *); +static void hn_resume_mgmt(struct hn_softc *); static void hn_rx_drain(struct vmbus_channel *); static void hn_tx_resume(struct hn_softc *, int); static void hn_tx_ring_qflush(struct hn_tx_ring *); @@ -1689,8 +1691,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MIN(ifp)); #endif - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - hn_suspend(sc); + /* + * Suspend this interface before the synthetic parts + * are ripped. + */ + hn_suspend(sc); /* * Detach the synthetics parts, i.e. NVS and RNDIS. @@ -1708,9 +1713,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_set_chim_size(sc, sc->hn_chim_szmax); hn_set_tso_maxsize(sc, hn_tso_maxlen, ifr->ifr_mtu); - /* All done! Resume now. */ - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - hn_resume(sc); + /* + * All done! Resume the interface now. + */ + hn_resume(sc); HN_UNLOCK(sc); break; @@ -3717,7 +3723,8 @@ static void hn_suspend(struct hn_softc *sc) { - hn_suspend_data(sc); + if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + hn_suspend_data(sc); hn_suspend_mgmt(sc); } @@ -3739,7 +3746,7 @@ hn_tx_resume(struct hn_softc *sc, int tx } static void -hn_resume(struct hn_softc *sc) +hn_resume_data(struct hn_softc *sc) { int i; @@ -3779,6 +3786,11 @@ hn_resume(struct hn_softc *sc) */ taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_txeof_task); } +} + +static void +hn_resume_mgmt(struct hn_softc *sc) +{ /* * Kick off link status check. @@ -3788,6 +3800,15 @@ hn_resume(struct hn_softc *sc) } static void +hn_resume(struct hn_softc *sc) +{ + + if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + hn_resume_data(sc); + hn_resume_mgmt(sc); +} + +static void hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) { const struct hn_nvs_hdr *hdr; From owner-svn-src-head@freebsd.org Fri Oct 14 05:48:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97D51C11227; Fri, 14 Oct 2016 05:48:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 685848A; Fri, 14 Oct 2016 05:48:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9E5lx2g026366; Fri, 14 Oct 2016 05:47:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9E5lxcs026365; Fri, 14 Oct 2016 05:47:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201610140547.u9E5lxcs026365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 14 Oct 2016 05:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307263 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 05:48:00 -0000 Author: sephe Date: Fri Oct 14 05:47:59 2016 New Revision: 307263 URL: https://svnweb.freebsd.org/changeset/base/307263 Log: hyperv/vmbus: Add __FBSDID Sponsored by: Microsoft Modified: head/sys/dev/hyperv/vmbus/vmbus_br.c Modified: head/sys/dev/hyperv/vmbus/vmbus_br.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_br.c Fri Oct 14 05:41:51 2016 (r307262) +++ head/sys/dev/hyperv/vmbus/vmbus_br.c Fri Oct 14 05:47:59 2016 (r307263) @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include From owner-svn-src-head@freebsd.org Fri Oct 14 08:25:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85900C10210; Fri, 14 Oct 2016 08:25:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF6A11B; Fri, 14 Oct 2016 08:25:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [172.16.5.2] (vega.codepro.be [IPv6:2a01:4f8:162:1127::3]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 19DBE15371; Fri, 14 Oct 2016 10:25:49 +0200 (CEST) From: "Kristof Provost" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: franco@opnsense.org Subject: Re: svn commit: r307235 - in head: sbin/pfctl share/man/man5 sys/netpfil/pf Date: Fri, 14 Oct 2016 10:25:47 +0200 Message-ID: <676A40F0-F529-4DFB-8F56-2607D000A47F@FreeBSD.org> In-Reply-To: <201610132034.u9DKYi07016276@repo.freebsd.org> References: <201610132034.u9DKYi07016276@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (2.0BETAr6058) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 14 Oct 2016 08:25:51 -0000 This work was done by franco_opnsense.org I forgot to credit him in the commit message. Sorry Franco. Regards, Kristof On 13 Oct 2016, at 22:34, Kristof Provost wrote: > Author: kp > Date: Thu Oct 13 20:34:44 2016 > New Revision: 307235 > URL: https://svnweb.freebsd.org/changeset/base/307235 > > Log: > pf: port extended DSCP support from OpenBSD > > Ignore the ECN bits on 'tos' and 'set-tos' and allow to use > DCSP names instead of having to embed their TOS equivalents > as plain numbers. > > Obtained from: OpenBSD > Sponsored by: OPNsense > Differential Revision: https://reviews.freebsd.org/D8165 > > Modified: > head/sbin/pfctl/parse.y > head/share/man/man5/pf.conf.5 > head/sys/netpfil/pf/pf.c > head/sys/netpfil/pf/pf_norm.c > > Modified: head/sbin/pfctl/parse.y > ============================================================================== > --- head/sbin/pfctl/parse.y Thu Oct 13 20:15:47 2016 (r307234) > +++ head/sbin/pfctl/parse.y Thu Oct 13 20:34:44 2016 (r307235) > @@ -351,6 +351,8 @@ void decide_address_family(struct node_ > void remove_invalid_hosts(struct node_host **, sa_family_t *); > int invalid_redirect(struct node_host *, sa_family_t); > u_int16_t parseicmpspec(char *, sa_family_t); > +int kw_casecmp(const void *, const void *); > +int map_tos(char *string, int *); > > static TAILQ_HEAD(loadanchorshead, loadanchors) > loadanchorshead = TAILQ_HEAD_INITIALIZER(loadanchorshead); > @@ -3584,15 +3586,17 @@ icmp6type : STRING { > ; > > tos : STRING { > - if (!strcmp($1, "lowdelay")) > - $$ = IPTOS_LOWDELAY; > - else if (!strcmp($1, "throughput")) > - $$ = IPTOS_THROUGHPUT; > - else if (!strcmp($1, "reliability")) > - $$ = IPTOS_RELIABILITY; > - else if ($1[0] == '0' && $1[1] == 'x') > - $$ = strtoul($1, NULL, 16); > - else > + int val; > + char *end; > + > + if (map_tos($1, &val)) > + $$ = val; > + else if ($1[0] == '0' && $1[1] == 'x') { > + errno = 0; > + $$ = strtoul($1, &end, 16); > + if (errno || *end != '\0') > + $$ = 256; > + } else > $$ = 256; /* flag bad argument */ > if ($$ < 0 || $$ > 255) { > yyerror("illegal tos value %s", $1); > @@ -6250,6 +6254,57 @@ pfctl_load_anchors(int dev, struct pfctl > } > > int > +kw_casecmp(const void *k, const void *e) > +{ > + return (strcasecmp(k, ((const struct keywords *)e)->k_name)); > +} > + > +int > +map_tos(char *s, int *val) > +{ > + /* DiffServ Codepoints and other TOS mappings */ > + const struct keywords toswords[] = { > + { "af11", IPTOS_DSCP_AF11 }, > + { "af12", IPTOS_DSCP_AF12 }, > + { "af13", IPTOS_DSCP_AF13 }, > + { "af21", IPTOS_DSCP_AF21 }, > + { "af22", IPTOS_DSCP_AF22 }, > + { "af23", IPTOS_DSCP_AF23 }, > + { "af31", IPTOS_DSCP_AF31 }, > + { "af32", IPTOS_DSCP_AF32 }, > + { "af33", IPTOS_DSCP_AF33 }, > + { "af41", IPTOS_DSCP_AF41 }, > + { "af42", IPTOS_DSCP_AF42 }, > + { "af43", IPTOS_DSCP_AF43 }, > + { "critical", IPTOS_PREC_CRITIC_ECP }, > + { "cs0", IPTOS_DSCP_CS0 }, > + { "cs1", IPTOS_DSCP_CS1 }, > + { "cs2", IPTOS_DSCP_CS2 }, > + { "cs3", IPTOS_DSCP_CS3 }, > + { "cs4", IPTOS_DSCP_CS4 }, > + { "cs5", IPTOS_DSCP_CS5 }, > + { "cs6", IPTOS_DSCP_CS6 }, > + { "cs7", IPTOS_DSCP_CS7 }, > + { "ef", IPTOS_DSCP_EF }, > + { "inetcontrol", IPTOS_PREC_INTERNETCONTROL }, > + { "lowdelay", IPTOS_LOWDELAY }, > + { "netcontrol", IPTOS_PREC_NETCONTROL }, > + { "reliability", IPTOS_RELIABILITY }, > + { "throughput", IPTOS_THROUGHPUT } > + }; > + const struct keywords *p; > + > + p = bsearch(s, toswords, sizeof(toswords)/sizeof(toswords[0]), > + sizeof(toswords[0]), kw_casecmp); > + > + if (p) { > + *val = p->k_val; > + return (1); > + } > + return (0); > +} > + > +int > rt_tableid_max(void) > { > #ifdef __FreeBSD__ > > Modified: head/share/man/man5/pf.conf.5 > ============================================================================== > --- head/share/man/man5/pf.conf.5 Thu Oct 13 20:15:47 2016 (r307234) > +++ head/share/man/man5/pf.conf.5 Thu Oct 13 20:34:44 2016 (r307235) > @@ -28,7 +28,7 @@ > .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > .\" POSSIBILITY OF SUCH DAMAGE. > .\" > -.Dd September 28, 2016 > +.Dd October 6, 2016 > .Dt PF.CONF 5 > .Os > .Sh NAME > @@ -648,9 +648,16 @@ for matching IP packets. > .Em TOS > may be > given as one of > +.Ar critical , > +.Ar inetcontrol , > .Ar lowdelay , > +.Ar netcontrol , > .Ar throughput , > .Ar reliability , > +or one of the DiffServ Code Points: > +.Ar ef , > +.Ar af11 No ... Ar af43 , > +.Ar cs0 No ... Ar cs7 ; > or as either hex or decimal. > .It Ar random-id > Replaces the IP identification field with random values to compensate > @@ -1697,9 +1704,16 @@ bits set. > .Em TOS > may be > given as one of > +.Ar critical , > +.Ar inetcontrol , > .Ar lowdelay , > +.Ar netcontrol , > .Ar throughput , > .Ar reliability , > +or one of the DiffServ Code Points: > +.Ar ef , > +.Ar af11 No ... Ar af43 , > +.Ar cs0 No ... Ar cs7 ; > or as either hex or decimal. > .Pp > For example, the following rules are identical: > @@ -1803,7 +1817,6 @@ pass in proto tcp to port 25 set prio 2 > pass in proto tcp to port 22 set prio (2, 5) > .Ed > .Pp > - > .It Ar tag Aq Ar string > Packets matching this rule will be tagged with the > specified string. > > Modified: head/sys/netpfil/pf/pf.c > ============================================================================== > --- head/sys/netpfil/pf/pf.c Thu Oct 13 20:15:47 2016 (r307234) > +++ head/sys/netpfil/pf/pf.c Thu Oct 13 20:34:44 2016 (r307235) > @@ -5893,7 +5893,7 @@ pf_test(int dir, struct ifnet *ifp, stru > pd.sidx = (dir == PF_IN) ? 0 : 1; > pd.didx = (dir == PF_IN) ? 1 : 0; > pd.af = AF_INET; > - pd.tos = h->ip_tos; > + pd.tos = h->ip_tos & ~IPTOS_ECN_MASK; > pd.tot_len = ntohs(h->ip_len); > > /* handle fragments that didn't get reassembled by normalization */ > > Modified: head/sys/netpfil/pf/pf_norm.c > ============================================================================== > --- head/sys/netpfil/pf/pf_norm.c Thu Oct 13 20:15:47 2016 (r307234) > +++ head/sys/netpfil/pf/pf_norm.c Thu Oct 13 20:34:44 2016 (r307235) > @@ -1811,7 +1811,7 @@ pf_scrub_ip(struct mbuf **m0, u_int32_t > u_int16_t ov, nv; > > ov = *(u_int16_t *)h; > - h->ip_tos = tos; > + h->ip_tos = tos | (h->ip_tos & IPTOS_ECN_MASK); > nv = *(u_int16_t *)h; > > h->ip_sum = pf_cksum_fixup(h->ip_sum, ov, nv, 0); > From owner-svn-src-head@freebsd.org Fri Oct 14 08:31:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4031DC10344; Fri, 14 Oct 2016 08:31:34 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 1022B8C9; Fri, 14 Oct 2016 08:31:33 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (5ec3950e.skybroadband.com [94.195.149.14]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 72A77D78E6; Fri, 14 Oct 2016 08:31:26 +0000 (UTC) Date: Fri, 14 Oct 2016 09:31:23 +0100 From: Andrew Turner To: Oleksandr Tymoshenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307257 - in head/sys: arm/broadcom/bcm2835 arm64/broadcom arm64/broadcom/bcm2837 arm64/conf conf Message-ID: <20161014093123.606cb8f3@zapp> In-Reply-To: <201610140337.u9E3baB7077179@repo.freebsd.org> References: <201610140337.u9E3baB7077179@repo.freebsd.org> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 08:31:34 -0000 On Fri, 14 Oct 2016 03:37:36 +0000 (UTC) Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Fri Oct 14 03:37:35 2016 > New Revision: 307257 > URL: https://svnweb.freebsd.org/changeset/base/307257 > > Log: > Add initial Raspberry Pi 3 support > > RPI3 kernel config builds kernel compatible with latest upstream > device tree and firmware: > https://github.com/raspberrypi/firmware/tree/master/boot As of today > it's 597c662a613df1144a6bc43e5f4505d83bd748ca > Default console is PL01x, so pi3-disable-bt dt overlay should be > configured in config.txt and stock U-Boot should be patched to use > proper serial port. > Yet unsupported: SMP, VCHIQ, RNG driver. RNG requires some work due > to upstream device tree incompatibility. > > Multiple people contributed to this work over time: db@, loos@, > manu@ > > Added: > head/sys/arm64/broadcom/ > head/sys/arm64/broadcom/bcm2837/ > head/sys/arm64/broadcom/bcm2837/files.bcm2837 (contents, props > changed) head/sys/arm64/conf/RPI3 (contents, props changed) > Modified: > head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h > head/sys/conf/options.arm64 > > Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h > ============================================================================== > --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 > 03:32:20 2016 (r307256) +++ > head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 > 03:37:35 2016 (r307257) @@ -37,7 +37,7 @@ #define > BCM2835_VCBUS_IO_BASE 0x7E000000 #define > BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 > -#ifdef SOC_BCM2836 > +#if defined(SOC_BCM2836) || defined(SOC_BCM2837) You could reverse the logic here to: #ifdef SOC_BCM2835 <2835 macros> #else #endif > #define BCM2835_ARM_IO_BASE 0x3f000000 > #define BCM2835_VCBUS_SDRAM_BASE > BCM2835_VCBUS_SDRAM_UNCACHED #else > > Added: head/sys/arm64/broadcom/bcm2837/files.bcm2837 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is > newly added) +++ head/sys/arm64/broadcom/bcm2837/files.bcm2837 > Fri Oct 14 03:37:35 2016 (r307257) @@ -0,0 +1,4 @@ > +# $FreeBSD$ > + > +arm/broadcom/bcm2835/bcm2836.c standard This should be in files.arm64 and enabled when the SOC_ option is set. > +kern/kern_clocksource.c standard This is already in files.arm64. > > Added: head/sys/arm64/conf/RPI3 Why a new kernel config and not GENERIC? ... > Modified: head/sys/conf/options.arm64 > ============================================================================== > --- head/sys/conf/options.arm64 Fri Oct 14 03:32:20 > 2016 (r307256) +++ head/sys/conf/options.arm64 Fri Oct > 14 03:37:35 2016 (r307257) @@ -9,5 +9,6 @@ > VFP opt_global.h > # SoC Support > SOC_ALLWINNER_A64 opt_soc.h > +SOC_BCM2837 opt_global.h This should be SOC_BRCM_BCM2837 (or maybe SOC_BRCM_BCM283X) and live in opt_soc.h Andrew From owner-svn-src-head@freebsd.org Fri Oct 14 08:37:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0D56C105CD; Fri, 14 Oct 2016 08:37:59 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 6F147CEC; Fri, 14 Oct 2016 08:37:58 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (5ec3950e.skybroadband.com [94.195.149.14]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 9E750D78E6; Fri, 14 Oct 2016 08:37:28 +0000 (UTC) Date: Fri, 14 Oct 2016 09:37:26 +0100 From: Andrew Turner To: Oleksandr Tymoshenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307252 - head/sys/arm/broadcom/bcm2835 Message-ID: <20161014093726.197f8e05@zapp> In-Reply-To: <201610140300.u9E30r1O061196@repo.freebsd.org> References: <201610140300.u9E30r1O061196@repo.freebsd.org> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 08:37:59 -0000 On Fri, 14 Oct 2016 03:00:53 +0000 (UTC) Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Fri Oct 14 03:00:53 2016 > New Revision: 307252 > URL: https://svnweb.freebsd.org/changeset/base/307252 > > Log: > Make bcm2835_machdep.c optional > > bcm2835_machdep.c contains only bits enabled by "options PLATFORM", > this option available only on ARM, not ARM64 > > Modified: > head/sys/arm/broadcom/bcm2835/files.bcm283x > > Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x > ============================================================================== > --- head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 02:58:31 2016 (r307251) > +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 03:00:53 2016 (r307252) > @@ -9,7 +9,7 @@ arm/broadcom/bcm2835/bcm2835_fbd.c opti > arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 > arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio > arm/broadcom/bcm2835/bcm2835_intr.c standard > -arm/broadcom/bcm2835/bcm2835_machdep.c standard > +arm/broadcom/bcm2835/bcm2835_machdep.c optional platform > arm/broadcom/bcm2835/bcm2835_mbox.c standard > arm/broadcom/bcm2835/bcm2835_rng.c optional random > arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci > Any of these files you need should be added to files.arm64 being optional on the appropriate soc_ value. Andrew From owner-svn-src-head@freebsd.org Fri Oct 14 11:57:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15233C11B67; Fri, 14 Oct 2016 11:57:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB1C1D3C; Fri, 14 Oct 2016 11:57:09 +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 u9EBv9lN070070; Fri, 14 Oct 2016 11:57:09 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EBv9xf070069; Fri, 14 Oct 2016 11:57:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610141157.u9EBv9xf070069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 14 Oct 2016 11:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307316 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 11:57:10 -0000 Author: bapt Date: Fri Oct 14 11:57:08 2016 New Revision: 307316 URL: https://svnweb.freebsd.org/changeset/base/307316 Log: Fix build WITHOUT_FORTH MFC after: 1 week Sponsored by: Gandi.net Modified: head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Fri Oct 14 11:49:36 2016 (r307315) +++ head/sys/boot/userboot/userboot/Makefile Fri Oct 14 11:57:08 2016 (r307316) @@ -51,9 +51,10 @@ BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 CFLAGS+= -DBF_DICTSIZE=15000 LIBFICL= ${.OBJDIR}/../ficl/libficl.a -LIBSTAND= ${.OBJDIR}/../libstand/libstand.a .endif +LIBSTAND= ${.OBJDIR}/../libstand/libstand.a + .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a From owner-svn-src-head@freebsd.org Fri Oct 14 12:01:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF749C10311; Fri, 14 Oct 2016 12:01:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF1746B3; Fri, 14 Oct 2016 12:01:34 +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 u9EC1XRM073186; Fri, 14 Oct 2016 12:01:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EC1X2O073182; Fri, 14 Oct 2016 12:01:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610141201.u9EC1X2O073182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 14 Oct 2016 12:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307317 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 12:01:35 -0000 Author: mav Date: Fri Oct 14 12:01:33 2016 New Revision: 307317 URL: https://svnweb.freebsd.org/changeset/base/307317 Log: MFV r307313: 5120 zfs should allow large block/gzip/raidz boot pool (loader project) Reviewed by: George Wilson Reviewed by: Yuri Pankov Reviewed by: Andrew Stormont Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Toomas Soome openzfs/openzfs@c8811bd3e2427dddbac6c05a59cfe117d8fea370 FreeBSD still does not support booting from gzip-compressed datasets, so keep one chunk of this commit out. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Oct 14 11:57:08 2016 (r307316) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Oct 14 12:01:33 2016 (r307317) @@ -27,6 +27,7 @@ * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Toomas Soome */ /* @@ -539,12 +540,6 @@ spa_prop_validate(spa_t *spa, nvlist_t * &propval)) == 0 && !BOOTFS_COMPRESS_VALID(propval)) { error = SET_ERROR(ENOTSUP); - } else if ((error = - dsl_prop_get_int_ds(dmu_objset_ds(os), - zfs_prop_to_name(ZFS_PROP_RECORDSIZE), - &propval)) == 0 && - propval > SPA_OLD_MAXBLOCKSIZE) { - error = SET_ERROR(ENOTSUP); } else { objnum = dmu_objset_id(os); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Oct 14 11:57:08 2016 (r307316) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Oct 14 12:01:33 2016 (r307317) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright 2016 Toomas Soome */ #ifndef _ZIO_H Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Oct 14 11:57:08 2016 (r307316) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Oct 14 12:01:33 2016 (r307317) @@ -25,6 +25,7 @@ * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Toomas Soome */ #include @@ -3474,16 +3475,10 @@ vdev_set_state(vdev_t *vd, boolean_t iso /* * Check the vdev configuration to ensure that it's capable of supporting - * a root pool. + * a root pool. We do not support partial configuration. + * In addition, only a single top-level vdev is allowed. * - * On Solaris, we do not support RAID-Z or partial configuration. In - * addition, only a single top-level vdev is allowed and none of the - * leaves can be wholedisks. - * - * For FreeBSD, we can boot from any configuration. There is a - * limitation that the boot filesystem must be either uncompressed or - * compresses with lzjb compression but I'm not sure how to enforce - * that here. + * FreeBSD does not have above limitations. */ boolean_t vdev_is_bootable(vdev_t *vd) @@ -3495,8 +3490,7 @@ vdev_is_bootable(vdev_t *vd) if (strcmp(vdev_type, VDEV_TYPE_ROOT) == 0 && vd->vdev_children > 1) { return (B_FALSE); - } else if (strcmp(vdev_type, VDEV_TYPE_RAIDZ) == 0 || - strcmp(vdev_type, VDEV_TYPE_MISSING) == 0) { + } else if (strcmp(vdev_type, VDEV_TYPE_MISSING) == 0) { return (B_FALSE); } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 14 11:57:08 2016 (r307316) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 14 12:01:33 2016 (r307317) @@ -31,6 +31,7 @@ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Toomas Soome */ /* @@ -3945,16 +3946,6 @@ zfs_check_settable(const char *dsname, n spa_t *spa; /* - * If this is a bootable dataset then - * the we don't allow large (>128K) blocks, - * because GRUB doesn't support them. - */ - if (zfs_is_bootfs(dsname) && - intval > SPA_OLD_MAXBLOCKSIZE) { - return (SET_ERROR(ERANGE)); - } - - /* * We don't allow setting the property above 1MB, * unless the tunable has been changed. */ From owner-svn-src-head@freebsd.org Fri Oct 14 12:03:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74CE4C105B9; Fri, 14 Oct 2016 12:03:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C13EB16; Fri, 14 Oct 2016 12:03:05 +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 u9EC34CB074057; Fri, 14 Oct 2016 12:03:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EC34mk074056; Fri, 14 Oct 2016 12:03:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610141203.u9EC34mk074056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 14 Oct 2016 12:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307318 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 12:03:05 -0000 Author: mav Date: Fri Oct 14 12:03:04 2016 New Revision: 307318 URL: https://svnweb.freebsd.org/changeset/base/307318 Log: MFV r307314: 6988 spa_sync() spends half its time in dmu_objset_do_userquota_updates Using a benchmark which creates 2 million files in one TXG, I observe that the thread running spa_sync() is on CPU almost the entire time we are syncing, and therefore can be a performance bottleneck. About 50% of the time in spa_sync() is in dmu_objset_do_userquota_updates(). The problem is that dmu_objset_do_userquota_updates() calls zap_increment_int(DMU_USERUSED_OBJECT) once for every file that was modified (or created). In this benchmark, all the files are owned by the same user/group, so all 2 million calls to zap_increment_int() are modifying the same entry in the zap. The same issue exists for the DMU_GROUPUSED_OBJECT. We should keep an in-memory map from user to space delta while we are syncing, and when we finish, iterate over the in-memory map and modify the ZAP once per entry. This reduces the number of calls to zap_increment_int() from "number of objects modified" to "number of owners/groups of modified files". This reduced the time spent in spa_sync() in the file create benchmark by ~33%, from 11 seconds to 7 seconds. Closes #107 Reviewed by: George Wilson Reviewed by: Steve Gonczi Reviewed by: Ned Bass Reviewed by: Jinshan Xiong Author: Matthew Ahrens openzfs/openzfs@5fc46359c569369d87728ca09f8705cdff6cc8e2 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Oct 14 12:01:33 2016 (r307317) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Oct 14 12:03:04 2016 (r307318) @@ -1207,18 +1207,83 @@ dmu_objset_userused_enabled(objset_t *os DMU_USERUSED_DNODE(os) != NULL); } +typedef struct userquota_node { + uint64_t uqn_id; + int64_t uqn_delta; + avl_node_t uqn_node; +} userquota_node_t; + +typedef struct userquota_cache { + avl_tree_t uqc_user_deltas; + avl_tree_t uqc_group_deltas; +} userquota_cache_t; + +static int +userquota_compare(const void *l, const void *r) +{ + const userquota_node_t *luqn = l; + const userquota_node_t *ruqn = r; + + if (luqn->uqn_id < ruqn->uqn_id) + return (-1); + if (luqn->uqn_id > ruqn->uqn_id) + return (1); + return (0); +} + static void -do_userquota_update(objset_t *os, uint64_t used, uint64_t flags, - uint64_t user, uint64_t group, boolean_t subtract, dmu_tx_t *tx) +do_userquota_cacheflush(objset_t *os, userquota_cache_t *cache, dmu_tx_t *tx) +{ + void *cookie; + userquota_node_t *uqn; + + ASSERT(dmu_tx_is_syncing(tx)); + + cookie = NULL; + while ((uqn = avl_destroy_nodes(&cache->uqc_user_deltas, + &cookie)) != NULL) { + VERIFY0(zap_increment_int(os, DMU_USERUSED_OBJECT, + uqn->uqn_id, uqn->uqn_delta, tx)); + kmem_free(uqn, sizeof (*uqn)); + } + avl_destroy(&cache->uqc_user_deltas); + + cookie = NULL; + while ((uqn = avl_destroy_nodes(&cache->uqc_group_deltas, + &cookie)) != NULL) { + VERIFY0(zap_increment_int(os, DMU_GROUPUSED_OBJECT, + uqn->uqn_id, uqn->uqn_delta, tx)); + kmem_free(uqn, sizeof (*uqn)); + } + avl_destroy(&cache->uqc_group_deltas); +} + +static void +userquota_update_cache(avl_tree_t *avl, uint64_t id, int64_t delta) +{ + userquota_node_t search = { .uqn_id = id }; + avl_index_t idx; + + userquota_node_t *uqn = avl_find(avl, &search, &idx); + if (uqn == NULL) { + uqn = kmem_zalloc(sizeof (*uqn), KM_SLEEP); + uqn->uqn_id = id; + avl_insert(avl, uqn, idx); + } + uqn->uqn_delta += delta; +} + +static void +do_userquota_update(userquota_cache_t *cache, uint64_t used, uint64_t flags, + uint64_t user, uint64_t group, boolean_t subtract) { if ((flags & DNODE_FLAG_USERUSED_ACCOUNTED)) { int64_t delta = DNODE_SIZE + used; if (subtract) delta = -delta; - VERIFY3U(0, ==, zap_increment_int(os, DMU_USERUSED_OBJECT, - user, delta, tx)); - VERIFY3U(0, ==, zap_increment_int(os, DMU_GROUPUSED_OBJECT, - group, delta, tx)); + + userquota_update_cache(&cache->uqc_user_deltas, user, delta); + userquota_update_cache(&cache->uqc_group_deltas, group, delta); } } @@ -1227,9 +1292,15 @@ dmu_objset_do_userquota_updates(objset_t { dnode_t *dn; list_t *list = &os->os_synced_dnodes; + userquota_cache_t cache = { 0 }; ASSERT(list_head(list) == NULL || dmu_objset_userused_enabled(os)); + avl_create(&cache.uqc_user_deltas, userquota_compare, + sizeof (userquota_node_t), offsetof(userquota_node_t, uqn_node)); + avl_create(&cache.uqc_group_deltas, userquota_compare, + sizeof (userquota_node_t), offsetof(userquota_node_t, uqn_node)); + while (dn = list_head(list)) { int flags; ASSERT(!DMU_OBJECT_IS_SPECIAL(dn->dn_object)); @@ -1239,32 +1310,26 @@ dmu_objset_do_userquota_updates(objset_t /* Allocate the user/groupused objects if necessary. */ if (DMU_USERUSED_DNODE(os)->dn_type == DMU_OT_NONE) { - VERIFY(0 == zap_create_claim(os, + VERIFY0(zap_create_claim(os, DMU_USERUSED_OBJECT, DMU_OT_USERGROUP_USED, DMU_OT_NONE, 0, tx)); - VERIFY(0 == zap_create_claim(os, + VERIFY0(zap_create_claim(os, DMU_GROUPUSED_OBJECT, DMU_OT_USERGROUP_USED, DMU_OT_NONE, 0, tx)); } - /* - * We intentionally modify the zap object even if the - * net delta is zero. Otherwise - * the block of the zap obj could be shared between - * datasets but need to be different between them after - * a bprewrite. - */ - flags = dn->dn_id_flags; ASSERT(flags); if (flags & DN_ID_OLD_EXIST) { - do_userquota_update(os, dn->dn_oldused, dn->dn_oldflags, - dn->dn_olduid, dn->dn_oldgid, B_TRUE, tx); + do_userquota_update(&cache, + dn->dn_oldused, dn->dn_oldflags, + dn->dn_olduid, dn->dn_oldgid, B_TRUE); } if (flags & DN_ID_NEW_EXIST) { - do_userquota_update(os, DN_USED_BYTES(dn->dn_phys), + do_userquota_update(&cache, + DN_USED_BYTES(dn->dn_phys), dn->dn_phys->dn_flags, dn->dn_newuid, - dn->dn_newgid, B_FALSE, tx); + dn->dn_newgid, B_FALSE); } mutex_enter(&dn->dn_mtx); @@ -1285,6 +1350,7 @@ dmu_objset_do_userquota_updates(objset_t list_remove(list, dn); dnode_rele(dn, list); } + do_userquota_cacheflush(os, &cache, tx); } /* From owner-svn-src-head@freebsd.org Fri Oct 14 12:12:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DE74C109D6; Fri, 14 Oct 2016 12:12:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E8FB42FB; Fri, 14 Oct 2016 12:12:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA08899; Fri, 14 Oct 2016 15:12:42 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bv1Lu-000KnV-H4; Fri, 14 Oct 2016 15:12:42 +0300 Subject: Re: svn commit: r307317 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys To: Alexander Motin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201610141201.u9EC1X2O073182@repo.freebsd.org> From: Andriy Gapon Message-ID: <0e5b9464-e039-1c00-9805-6110f154f9f0@FreeBSD.org> Date: Fri, 14 Oct 2016 15:11:21 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201610141201.u9EC1X2O073182@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 12:12:52 -0000 On 14/10/2016 15:01, Alexander Motin wrote: > Author: mav > Date: Fri Oct 14 12:01:33 2016 > New Revision: 307317 > URL: https://svnweb.freebsd.org/changeset/base/307317 > > Log: > MFV r307313: > 5120 zfs should allow large block/gzip/raidz boot pool (loader project) > > Reviewed by: George Wilson > Reviewed by: Yuri Pankov > Reviewed by: Andrew Stormont > Reviewed by: Matthew Ahrens > Approved by: Robert Mustacchi > Author: Toomas Soome > > openzfs/openzfs@c8811bd3e2427dddbac6c05a59cfe117d8fea370 > > FreeBSD still does not support booting from gzip-compressed datasets, > so keep one chunk of this commit out. Does FreeBSD boot code support large blocks? Just to be sure. And maybe this is worth some additional notice because users sometimes forget to upgrade gptzfsboot / zfsboot. -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Oct 14 12:23:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB250C10CA2; Fri, 14 Oct 2016 12:23:04 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45542C1C; Fri, 14 Oct 2016 12:23:04 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lf0-x235.google.com with SMTP id b75so192828434lfg.3; Fri, 14 Oct 2016 05:23:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=TKnWtdbZzIfjoRjzv6QzAGXvBud4W+Tt1Y3BZM6dqyU=; b=lSf9l26zLA10uJJFb97RHIzCqWmKHHXevi7Tzj98u8gickF8uMQgTuIeEbo33PjVty 2S2tGakgQwq3vCBtAxzFY4rDb/jPNZ3tPvpDiunipOQ1Xm2csDvjCb6xA+0TjKGTWqZQ 1E4r4bjio4F4tXsCmPAHmGHm553ceX6nAprLwxScLZrJH/Wh07IzQp8mNzJ/EaxXjWbF 8rZq9pEKtrnigt5HRwkpm0eAjN6hLhJSxgdlK4WSNbMOLVLK3Ynz4xrLrVg6zGai/3NU U50tEthQZeCejMeva+EhvdLyiibfhnP6vyQPhwn9sjrIIO34EQ46xYLOWBZcbGU/oFSQ MYXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=TKnWtdbZzIfjoRjzv6QzAGXvBud4W+Tt1Y3BZM6dqyU=; b=CmHhIFJTi3Hfzh8/QlOgEMJ8E/5oYX2+IT773cK17RqUcHhkCvaEereKZaECJl1sky YnIjdsLOVm2OYPCs74KGUOLb/kSQx3YpFCMmUF1cd2DaanxvNHjDaD4noxvVCQhSTgOa A3rX/qVcUrBTqyPw1YfC3AW3RdsVkNYaMsfo7XDo2hAHr/PdPZ3wtrFyg0H1vnRKpTNZ FCVBwmUIjSLhIFYGylWhIUbYByAbPCDvnv+cYPevzfyt37lbKemF9ek18yr6pMCc8W0j uzc7luTjW4bE3lcj8n0W8EVIYbZSMtWVkquzceVVEOg6cTvKknXnWrY35wi9ud1Rbzk4 l8cA== X-Gm-Message-State: AA6/9RkuMa6gWRCig4L/cSm20Q5yPRR/XYNEpwG4dn1aZDFkq9cFoxWqKzjAdsp0vvD7AA== X-Received: by 10.25.234.141 with SMTP id y13mr3581557lfi.25.1476447781096; Fri, 14 Oct 2016 05:23:01 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by smtp.gmail.com with ESMTPSA id g7sm5112680ljg.44.2016.10.14.05.22.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Oct 2016 05:23:00 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r307317 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201610141201.u9EC1X2O073182@repo.freebsd.org> <0e5b9464-e039-1c00-9805-6110f154f9f0@FreeBSD.org> From: Alexander Motin Message-ID: <65265e09-a704-86c0-8e8a-ed423c941d40@FreeBSD.org> Date: Fri, 14 Oct 2016 15:22:59 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <0e5b9464-e039-1c00-9805-6110f154f9f0@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 14 Oct 2016 12:23:04 -0000 On 14.10.2016 15:11, Andriy Gapon wrote: > On 14/10/2016 15:01, Alexander Motin wrote: >> Author: mav >> Date: Fri Oct 14 12:01:33 2016 >> New Revision: 307317 >> URL: https://svnweb.freebsd.org/changeset/base/307317 >> >> Log: >> MFV r307313: >> 5120 zfs should allow large block/gzip/raidz boot pool (loader project) >> >> Reviewed by: George Wilson >> Reviewed by: Yuri Pankov >> Reviewed by: Andrew Stormont >> Reviewed by: Matthew Ahrens >> Approved by: Robert Mustacchi >> Author: Toomas Soome >> >> openzfs/openzfs@c8811bd3e2427dddbac6c05a59cfe117d8fea370 >> >> FreeBSD still does not support booting from gzip-compressed datasets, >> so keep one chunk of this commit out. > > Does FreeBSD boot code support large blocks? Just to be sure. According to r304321 commit message -- it does now. > And maybe this is worth some additional notice because users sometimes forget to > upgrade gptzfsboot / zfsboot. Where would you like to see it to be noticeable? -- Alexander Motin From owner-svn-src-head@freebsd.org Fri Oct 14 12:59:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 536A1C115AE; Fri, 14 Oct 2016 12:59:52 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EF729EEE; Fri, 14 Oct 2016 12:59:51 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from julian-mbp3.pixel8networks.com (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u9ECxnVd096664 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 14 Oct 2016 05:59:50 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r307317 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201610141201.u9EC1X2O073182@repo.freebsd.org> From: Julian Elischer Message-ID: Date: Fri, 14 Oct 2016 05:59:44 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201610141201.u9EC1X2O073182@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 12:59:52 -0000 On 14/10/2016 5:01 AM, Alexander Motin wrote: > Author: mav > Date: Fri Oct 14 12:01:33 2016 > New Revision: 307317 > URL: https://svnweb.freebsd.org/changeset/base/307317 > > Log: > MFV r307313: > 5120 zfs should allow large block/gzip/raidz boot pool (loader project) > > Reviewed by: George Wilson > Reviewed by: Yuri Pankov > Reviewed by: Andrew Stormont > Reviewed by: Matthew Ahrens > Approved by: Robert Mustacchi > Author: Toomas Soome > > openzfs/openzfs@c8811bd3e2427dddbac6c05a59cfe117d8fea370 > > FreeBSD still does not support booting from gzip-compressed datasets, > so keep one chunk of this commit out. might it not have been a bit better to have just put #if 0 around the bits so that we could still see them? also may help with future merges > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > Directory Properties: > head/sys/cddl/contrib/opensolaris/ (props changed) > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Oct 14 11:57:08 2016 (r307316) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Oct 14 12:01:33 2016 (r307317) > @@ -27,6 +27,7 @@ > * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. > * Copyright 2013 Saso Kiselkov. All rights reserved. > * Copyright (c) 2014 Integros [integros.com] > + * Copyright 2016 Toomas Soome > */ > > /* > @@ -539,12 +540,6 @@ spa_prop_validate(spa_t *spa, nvlist_t * > &propval)) == 0 && > !BOOTFS_COMPRESS_VALID(propval)) { > error = SET_ERROR(ENOTSUP); > - } else if ((error = > - dsl_prop_get_int_ds(dmu_objset_ds(os), > - zfs_prop_to_name(ZFS_PROP_RECORDSIZE), > - &propval)) == 0 && > - propval > SPA_OLD_MAXBLOCKSIZE) { > - error = SET_ERROR(ENOTSUP); > } else { > objnum = dmu_objset_id(os); > } > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Oct 14 11:57:08 2016 (r307316) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Oct 14 12:01:33 2016 (r307317) > @@ -24,6 +24,7 @@ > * Copyright 2011 Nexenta Systems, Inc. All rights reserved. > * Copyright (c) 2012, 2016 by Delphix. All rights reserved. > * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. > + * Copyright 2016 Toomas Soome > */ > > #ifndef _ZIO_H > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Oct 14 11:57:08 2016 (r307316) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Oct 14 12:01:33 2016 (r307317) > @@ -25,6 +25,7 @@ > * Copyright 2015 Nexenta Systems, Inc. All rights reserved. > * Copyright 2013 Martin Matuska . All rights reserved. > * Copyright (c) 2014 Integros [integros.com] > + * Copyright 2016 Toomas Soome > */ > > #include > @@ -3474,16 +3475,10 @@ vdev_set_state(vdev_t *vd, boolean_t iso > > /* > * Check the vdev configuration to ensure that it's capable of supporting > - * a root pool. > + * a root pool. We do not support partial configuration. > + * In addition, only a single top-level vdev is allowed. > * > - * On Solaris, we do not support RAID-Z or partial configuration. In > - * addition, only a single top-level vdev is allowed and none of the > - * leaves can be wholedisks. > - * > - * For FreeBSD, we can boot from any configuration. There is a > - * limitation that the boot filesystem must be either uncompressed or > - * compresses with lzjb compression but I'm not sure how to enforce > - * that here. > + * FreeBSD does not have above limitations. > */ > boolean_t > vdev_is_bootable(vdev_t *vd) > @@ -3495,8 +3490,7 @@ vdev_is_bootable(vdev_t *vd) > if (strcmp(vdev_type, VDEV_TYPE_ROOT) == 0 && > vd->vdev_children > 1) { > return (B_FALSE); > - } else if (strcmp(vdev_type, VDEV_TYPE_RAIDZ) == 0 || > - strcmp(vdev_type, VDEV_TYPE_MISSING) == 0) { > + } else if (strcmp(vdev_type, VDEV_TYPE_MISSING) == 0) { > return (B_FALSE); > } > } > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 14 11:57:08 2016 (r307316) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Oct 14 12:01:33 2016 (r307317) > @@ -31,6 +31,7 @@ > * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. > * Copyright (c) 2013 Steven Hartland. All rights reserved. > * Copyright (c) 2014 Integros [integros.com] > + * Copyright 2016 Toomas Soome > */ > > /* > @@ -3945,16 +3946,6 @@ zfs_check_settable(const char *dsname, n > spa_t *spa; > > /* > - * If this is a bootable dataset then > - * the we don't allow large (>128K) blocks, > - * because GRUB doesn't support them. > - */ > - if (zfs_is_bootfs(dsname) && > - intval > SPA_OLD_MAXBLOCKSIZE) { > - return (SET_ERROR(ERANGE)); > - } > - > - /* > * We don't allow setting the property above 1MB, > * unless the tunable has been changed. > */ > > From owner-svn-src-head@freebsd.org Fri Oct 14 13:20:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF2A4C10429; Fri, 14 Oct 2016 13:20:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4504F64E; Fri, 14 Oct 2016 13:20:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA09074; Fri, 14 Oct 2016 16:20:00 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bv2P2-000KrM-MC; Fri, 14 Oct 2016 16:20:00 +0300 Subject: Re: svn commit: r307317 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys To: Alexander Motin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201610141201.u9EC1X2O073182@repo.freebsd.org> <0e5b9464-e039-1c00-9805-6110f154f9f0@FreeBSD.org> <65265e09-a704-86c0-8e8a-ed423c941d40@FreeBSD.org> From: Andriy Gapon Message-ID: <030747b3-a83c-8b16-d9b1-3d5d3b7ae142@FreeBSD.org> Date: Fri, 14 Oct 2016 16:18:39 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <65265e09-a704-86c0-8e8a-ed423c941d40@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 13:20:04 -0000 On 14/10/2016 15:22, Alexander Motin wrote: > On 14.10.2016 15:11, Andriy Gapon wrote: >> On 14/10/2016 15:01, Alexander Motin wrote: >>> Author: mav >>> Date: Fri Oct 14 12:01:33 2016 >>> New Revision: 307317 >>> URL: https://svnweb.freebsd.org/changeset/base/307317 >>> >>> Log: >>> MFV r307313: >>> 5120 zfs should allow large block/gzip/raidz boot pool (loader project) >>> >>> Reviewed by: George Wilson >>> Reviewed by: Yuri Pankov >>> Reviewed by: Andrew Stormont >>> Reviewed by: Matthew Ahrens >>> Approved by: Robert Mustacchi >>> Author: Toomas Soome >>> >>> openzfs/openzfs@c8811bd3e2427dddbac6c05a59cfe117d8fea370 >>> >>> FreeBSD still does not support booting from gzip-compressed datasets, >>> so keep one chunk of this commit out. >> >> Does FreeBSD boot code support large blocks? Just to be sure. > > According to r304321 commit message -- it does now. Okay. >> And maybe this is worth some additional notice because users sometimes forget to >> upgrade gptzfsboot / zfsboot. > > Where would you like to see it to be noticeable? That's a good question for which I do not have a good answer. Ideally 'zfs set recordsize=' would warn when setting a large block size on a boot filesystem and 'zpool set bootfs=' would warn when switching the boot filesystem to a filesystem that already has a large block size. But not sure if that's doable without kludges. -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Oct 14 14:57:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8341EC11E50; Fri, 14 Oct 2016 14:57:44 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FE8E630; Fri, 14 Oct 2016 14:57:44 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EEvhsp039213; Fri, 14 Oct 2016 14:57:43 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EEvhT8039210; Fri, 14 Oct 2016 14:57:43 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201610141457.u9EEvhT8039210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 14 Oct 2016 14:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307319 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 14:57:44 -0000 Author: jtl Date: Fri Oct 14 14:57:43 2016 New Revision: 307319 URL: https://svnweb.freebsd.org/changeset/base/307319 Log: The code currently resets the keepalive timer each time a packet is received on a TCP session that has entered the ESTABLISHED state. This results in a lot of calls to reset the keepalive timer. This patch changes the behavior so we set the keepalive timer for the keepalive idle time (TP_KEEPIDLE). When the keepalive timer fires, it will first check to see if the session has been idle for TP_KEEPIDLE ticks. If not, it will reschedule the keepalive timer for the time the session will have been idle for TP_KEEPIDLE ticks. For a session with regular communication, the keepalive timer should fire approximately once every TP_KEEPIDLE ticks. For sessions with irregular communication, the keepalive timer might fire more often. But, the disruption from a periodic keepalive timer should be less than the regular cost of resetting the keepalive timer on every packet. (FWIW, this change saved approximately 1.73% of the busy CPU cycles on a particular test system with a heavy TCP output load. Of course, the actual impact is very specific to the particular hardware and workload.) Reviewed by: gallatin, rrs MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D8243 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Oct 14 12:03:04 2016 (r307318) +++ head/sys/netinet/tcp_input.c Fri Oct 14 14:57:43 2016 (r307319) @@ -1565,8 +1565,6 @@ tcp_do_segment(struct mbuf *m, struct tc * validation to ignore broken/spoofed segs. */ tp->t_rcvtime = ticks; - if (TCPS_HAVEESTABLISHED(tp->t_state)) - tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); /* * Scale up the window into a 32-bit value. Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Fri Oct 14 12:03:04 2016 (r307318) +++ head/sys/netinet/tcp_stacks/fastpath.c Fri Oct 14 14:57:43 2016 (r307319) @@ -1819,8 +1819,6 @@ tcp_do_segment_fastslow(struct mbuf *m, * validation to ignore broken/spoofed segs. */ tp->t_rcvtime = ticks; - if (TCPS_HAVEESTABLISHED(tp->t_state)) - tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); /* * Unscale the window into a 32-bit value. @@ -2266,8 +2264,6 @@ tcp_do_segment_fastack(struct mbuf *m, s * validation to ignore broken/spoofed segs. */ tp->t_rcvtime = ticks; - if (TCPS_HAVEESTABLISHED(tp->t_state)) - tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); /* * Unscale the window into a 32-bit value. Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Fri Oct 14 12:03:04 2016 (r307318) +++ head/sys/netinet/tcp_timer.c Fri Oct 14 14:57:43 2016 (r307319) @@ -468,6 +468,26 @@ tcp_timer_keep(void *xtp) } KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); + + /* + * Because we don't regularly reset the keepalive callout in + * the ESTABLISHED state, it may be that we don't actually need + * to send a keepalive yet. If that occurs, schedule another + * call for the next time the keepalive timer might expire. + */ + if (TCPS_HAVEESTABLISHED(tp->t_state)) { + u_int idletime; + + idletime = ticks - tp->t_rcvtime; + if (idletime < TP_KEEPIDLE(tp)) { + callout_reset(&tp->t_timers->tt_keep, + TP_KEEPIDLE(tp) - idletime, tcp_timer_keep, tp); + INP_WUNLOCK(inp); + CURVNET_RESTORE(); + return; + } + } + /* * Keep-alive timer went off; send something * or drop connection if idle for too long. From owner-svn-src-head@freebsd.org Fri Oct 14 15:16:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC9ACC113AE; Fri, 14 Oct 2016 15:16:45 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C609BB9; Fri, 14 Oct 2016 15:16:45 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EFGio0046618; Fri, 14 Oct 2016 15:16:44 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EFGiV8046617; Fri, 14 Oct 2016 15:16:44 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201610141516.u9EFGiV8046617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Fri, 14 Oct 2016 15:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307320 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 15:16:46 -0000 Author: luigi Date: Fri Oct 14 15:16:44 2016 New Revision: 307320 URL: https://svnweb.freebsd.org/changeset/base/307320 Log: adjust picobsd script to work with HEAD Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Fri Oct 14 14:57:43 2016 (r307319) +++ head/release/picobsd/build/picobsd Fri Oct 14 15:16:44 2016 (r307320) @@ -8,6 +8,10 @@ # picobsd [options] image_type [site_name] # # CWARNFLAGS can be used to pass -Wall or similar options +#export CWARNFLAGS=-D______________sxasxa__________________________ +#export WARNS=2 +# EFIABI... unused attributes ? +export NO_WERROR=1 # # Where image_type is a directory with the picobsd config info, # and ${image_type}/floppy.tree.${site_name} contains @@ -165,7 +169,7 @@ create_includes_and_libraries2() { # opt local no log "create_includes_and_libraries2() for ${SRC} $1" - no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" + no="-DNO_CLEAN -DMK_PROFILE=no -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" no="$no -DWITHOUT_CASPER" no="$no -DMALLOC_PRODUCTION" @@ -674,7 +678,7 @@ populate_mfs_tree() { ) || fail $? crunch log "Setting up host key for sshd:" - for K in rsa1 rsa dsa ; do + for K in rsa dsa ; do if [ $K = rsa1 ] ; then i=ssh_host_key else @@ -844,6 +848,7 @@ fill_floppy_image() { mkdir -p ${dst} ( cd ${BUILDDIR} + # old style mfs lookup, find markers in kernel set 0 0 # reset variables # $1 takes the offset of the MFS filesystem set `strings -at d kernel | grep "MFS Filesystem goes here"` @@ -852,6 +857,16 @@ fill_floppy_image() { set `strings -at d kernel | grep "MFS Filesystem had better"` mfs_end=$1 mfs_size="$((${mfs_end} - ${mfs_start}))" + if [ ${mfs_start} = 0 -o ${mfs_end} = 0 ] ; then + # similar to sys/tools/embed_mfs.sh + local x="`objdump -h kernel | grep oldmfs`" + mfs_size=`echo ${x} | awk '{printf("%d", "0x" $3)}' 2> /dev/null` + mfs_start=`echo ${x} | awk '{printf("%d", "0x" $6)}' 2> /dev/null` + if [ ${mfs_start} = 0 -o ${mfs_size} = 0 ] ; then + log "-- old style mfs location not found, have" + logverbose "$x" + fi + fi set -- `ls -l ${c_fs}`; imgsize="$5" if [ ${mfs_start} -gt 0 -a ${mfs_size} -ge ${imgsize} ] ; then mfs_ofs=$((${mfs_start} + 8192)) @@ -953,9 +968,15 @@ set_build_parameters() { OSVERSION=$3 log "OSVERSION is ${OSVERSION}" - export MAKEOBJDIRPREFIX=${l_objtree} - export TARGET_ARCH=${o_arch} TARGET=${o_arch} - # XXX 20131001 see if CLANG fixes the build + export MAKEOBJDIRPREFIX=${l_objtree} + export TARGET_ARCH=${o_arch} TARGET=${o_arch} + # XXX 20131001 see if CLANG fixes the build + if true; then + echo "--- build with clang" + export WITHOUT_CLANG=yes + export WITHOUT_CLANG_BOOTSTRAP=yes + # export WITH_CLANG_BOOTSTRAP=yes + else export WITHOUT_CLANG_IS_CC=yes export WITHOUT_CLANG_BOOTSTRAP=yes export WITH_GCC=yes @@ -964,14 +985,15 @@ set_build_parameters() { export WITHOUT_CLANG=yes export WITHOUT_ICONV=yes export WITHOUT_TESTS=yes + fi - # XXX why change machine_arch ? - #-- export MACHINE_ARCH=`uname -m` MACHINE=`uname -m` - # export CWARNFLAGS="-Wextra -Wno-sign-compare -Wno-missing-field-initializers" - # XXX BINMAKE does not really exist anymore - eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" - [ "$BINMAKE" = "" ] && \ - eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V SUB_MAKE`\"" + # XXX why change machine_arch ? + #-- export MACHINE_ARCH=`uname -m` MACHINE=`uname -m` + # export CWARNFLAGS="-Wextra -Wno-sign-compare -Wno-missing-field-initializers" + # XXX BINMAKE does not really exist anymore + eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" + [ "$BINMAKE" = "" ] && \ + eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V SUB_MAKE`\"" if [ "${o_init_src}" != "" ] ; then create_includes_and_libraries2 From owner-svn-src-head@freebsd.org Fri Oct 14 15:53:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E83A9C102B7; Fri, 14 Oct 2016 15:53:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C289AB9; Fri, 14 Oct 2016 15:53:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EFrmqn062161; Fri, 14 Oct 2016 15:53:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EFrmT7062155; Fri, 14 Oct 2016 15:53:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201610141553.u9EFrmT7062155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 14 Oct 2016 15:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307321 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 15:53:50 -0000 Author: andrew Date: Fri Oct 14 15:53:48 2016 New Revision: 307321 URL: https://svnweb.freebsd.org/changeset/base/307321 Log: Rework how we store the VFP registers in the pcb. This will be used when creating a floating-point context within the kernel without having to move the stored values in memory. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/vfp.c head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/include/pcb.h head/sys/arm64/include/vfp.h Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Fri Oct 14 15:16:44 2016 (r307320) +++ head/sys/arm64/arm64/machdep.c Fri Oct 14 15:53:48 2016 (r307321) @@ -192,9 +192,12 @@ fill_fpregs(struct thread *td, struct fp */ vfp_save_state(td, pcb); - memcpy(regs->fp_q, pcb->pcb_vfp, sizeof(regs->fp_q)); - regs->fp_cr = pcb->pcb_fpcr; - regs->fp_sr = pcb->pcb_fpsr; + KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, + ("Called fill_fpregs while the kernel is using the VFP")); + memcpy(regs->fp_q, pcb->pcb_fpustate.vfp_regs, + sizeof(regs->fp_q)); + regs->fp_cr = pcb->pcb_fpustate.vfp_fpcr; + regs->fp_sr = pcb->pcb_fpustate.vfp_fpsr; } else #endif memset(regs->fp_q, 0, sizeof(regs->fp_q)); @@ -208,9 +211,11 @@ set_fpregs(struct thread *td, struct fpr struct pcb *pcb; pcb = td->td_pcb; - memcpy(pcb->pcb_vfp, regs->fp_q, sizeof(regs->fp_q)); - pcb->pcb_fpcr = regs->fp_cr; - pcb->pcb_fpsr = regs->fp_sr; + KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, + ("Called set_fpregs while the kernel is using the VFP")); + memcpy(pcb->pcb_fpustate.vfp_regs, regs->fp_q, sizeof(regs->fp_q)); + pcb->pcb_fpustate.vfp_fpcr = regs->fp_cr; + pcb->pcb_fpustate.vfp_fpsr = regs->fp_sr; #endif return (0); } @@ -334,10 +339,12 @@ get_fpcontext(struct thread *td, mcontex */ vfp_save_state(td, curpcb); - memcpy(mcp->mc_fpregs.fp_q, curpcb->pcb_vfp, + KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, + ("Called get_fpcontext while the kernel is using the VFP")); + memcpy(mcp->mc_fpregs.fp_q, curpcb->pcb_fpustate.vfp_regs, sizeof(mcp->mc_fpregs)); - mcp->mc_fpregs.fp_cr = curpcb->pcb_fpcr; - mcp->mc_fpregs.fp_sr = curpcb->pcb_fpsr; + mcp->mc_fpregs.fp_cr = curpcb->pcb_fpustate.vfp_fpcr; + mcp->mc_fpregs.fp_sr = curpcb->pcb_fpustate.vfp_fpsr; mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags; mcp->mc_flags |= _MC_FP_VALID; } @@ -363,10 +370,12 @@ set_fpcontext(struct thread *td, mcontex */ vfp_discard(td); - memcpy(curpcb->pcb_vfp, mcp->mc_fpregs.fp_q, + KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, + ("Called set_fpcontext while the kernel is using the VFP")); + memcpy(curpcb->pcb_fpustate.vfp_regs, mcp->mc_fpregs.fp_q, sizeof(mcp->mc_fpregs)); - curpcb->pcb_fpcr = mcp->mc_fpregs.fp_cr; - curpcb->pcb_fpsr = mcp->mc_fpregs.fp_sr; + curpcb->pcb_fpustate.vfp_fpcr = mcp->mc_fpregs.fp_cr; + curpcb->pcb_fpustate.vfp_fpsr = mcp->mc_fpregs.fp_sr; curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags; } @@ -607,6 +616,7 @@ init_proc0(vm_offset_t kstack) thread0.td_kstack = kstack; thread0.td_pcb = (struct pcb *)(thread0.td_kstack) - 1; thread0.td_pcb->pcb_fpflags = 0; + thread0.td_pcb->pcb_fpusaved = &thread0.td_pcb->pcb_fpustate; thread0.td_pcb->pcb_vfpcpu = UINT_MAX; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Fri Oct 14 15:16:44 2016 (r307320) +++ head/sys/arm64/arm64/vfp.c Fri Oct 14 15:53:48 2016 (r307321) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -42,7 +43,10 @@ __FBSDID("$FreeBSD$"); #include /* Sanity check we can store all the VFP registers */ -CTASSERT(sizeof(((struct pcb *)0)->pcb_vfp) == 16 * 32); +CTASSERT(sizeof(((struct pcb *)0)->pcb_fpustate.vfp_regs) == 16 * 32); + +static MALLOC_DEFINE(M_FPUKERN_CTX, "fpukern_ctx", + "Kernel contexts for VFP state"); static void vfp_enable(void) @@ -81,11 +85,73 @@ vfp_discard(struct thread *td) vfp_disable(); } -void -vfp_save_state(struct thread *td, struct pcb *pcb) +static void +vfp_store(struct vfpstate *state) +{ + __int128_t *vfp_state; + uint64_t fpcr, fpsr; + + vfp_state = state->vfp_regs; + __asm __volatile( + "mrs %0, fpcr \n" + "mrs %1, fpsr \n" + "stp q0, q1, [%2, #16 * 0]\n" + "stp q2, q3, [%2, #16 * 2]\n" + "stp q4, q5, [%2, #16 * 4]\n" + "stp q6, q7, [%2, #16 * 6]\n" + "stp q8, q9, [%2, #16 * 8]\n" + "stp q10, q11, [%2, #16 * 10]\n" + "stp q12, q13, [%2, #16 * 12]\n" + "stp q14, q15, [%2, #16 * 14]\n" + "stp q16, q17, [%2, #16 * 16]\n" + "stp q18, q19, [%2, #16 * 18]\n" + "stp q20, q21, [%2, #16 * 20]\n" + "stp q22, q23, [%2, #16 * 22]\n" + "stp q24, q25, [%2, #16 * 24]\n" + "stp q26, q27, [%2, #16 * 26]\n" + "stp q28, q29, [%2, #16 * 28]\n" + "stp q30, q31, [%2, #16 * 30]\n" + : "=&r"(fpcr), "=&r"(fpsr) : "r"(vfp_state)); + + state->vfp_fpcr = fpcr; + state->vfp_fpsr = fpsr; +} + +static void +vfp_restore(struct vfpstate *state) { __int128_t *vfp_state; uint64_t fpcr, fpsr; + + vfp_state = state->vfp_regs; + fpcr = state->vfp_fpcr; + fpsr = state->vfp_fpsr; + + __asm __volatile( + "ldp q0, q1, [%2, #16 * 0]\n" + "ldp q2, q3, [%2, #16 * 2]\n" + "ldp q4, q5, [%2, #16 * 4]\n" + "ldp q6, q7, [%2, #16 * 6]\n" + "ldp q8, q9, [%2, #16 * 8]\n" + "ldp q10, q11, [%2, #16 * 10]\n" + "ldp q12, q13, [%2, #16 * 12]\n" + "ldp q14, q15, [%2, #16 * 14]\n" + "ldp q16, q17, [%2, #16 * 16]\n" + "ldp q18, q19, [%2, #16 * 18]\n" + "ldp q20, q21, [%2, #16 * 20]\n" + "ldp q22, q23, [%2, #16 * 22]\n" + "ldp q24, q25, [%2, #16 * 24]\n" + "ldp q26, q27, [%2, #16 * 26]\n" + "ldp q28, q29, [%2, #16 * 28]\n" + "ldp q30, q31, [%2, #16 * 30]\n" + "msr fpcr, %0 \n" + "msr fpsr, %1 \n" + : : "r"(fpcr), "r"(fpsr), "r"(vfp_state)); +} + +void +vfp_save_state(struct thread *td, struct pcb *pcb) +{ uint32_t cpacr; KASSERT(pcb != NULL, ("NULL vfp pcb")); @@ -104,31 +170,7 @@ vfp_save_state(struct thread *td, struct KASSERT(PCPU_GET(fpcurthread) == td, ("Storing an invalid VFP state")); - vfp_state = pcb->pcb_vfp; - __asm __volatile( - "mrs %0, fpcr \n" - "mrs %1, fpsr \n" - "stp q0, q1, [%2, #16 * 0]\n" - "stp q2, q3, [%2, #16 * 2]\n" - "stp q4, q5, [%2, #16 * 4]\n" - "stp q6, q7, [%2, #16 * 6]\n" - "stp q8, q9, [%2, #16 * 8]\n" - "stp q10, q11, [%2, #16 * 10]\n" - "stp q12, q13, [%2, #16 * 12]\n" - "stp q14, q15, [%2, #16 * 14]\n" - "stp q16, q17, [%2, #16 * 16]\n" - "stp q18, q19, [%2, #16 * 18]\n" - "stp q20, q21, [%2, #16 * 20]\n" - "stp q22, q23, [%2, #16 * 22]\n" - "stp q24, q25, [%2, #16 * 24]\n" - "stp q26, q27, [%2, #16 * 26]\n" - "stp q28, q29, [%2, #16 * 28]\n" - "stp q30, q31, [%2, #16 * 30]\n" - : "=&r"(fpcr), "=&r"(fpsr) : "r"(vfp_state)); - - pcb->pcb_fpcr = fpcr; - pcb->pcb_fpsr = fpsr; - + vfp_store(pcb->pcb_fpusaved); dsb(ish); vfp_disable(); } @@ -138,8 +180,6 @@ vfp_save_state(struct thread *td, struct void vfp_restore_state(void) { - __int128_t *vfp_state; - uint64_t fpcr, fpsr; struct pcb *curpcb; u_int cpu; @@ -158,31 +198,7 @@ vfp_restore_state(void) */ if (PCPU_GET(fpcurthread) != curthread || cpu != curpcb->pcb_vfpcpu) { - vfp_state = curthread->td_pcb->pcb_vfp; - fpcr = curthread->td_pcb->pcb_fpcr; - fpsr = curthread->td_pcb->pcb_fpsr; - - __asm __volatile( - "ldp q0, q1, [%2, #16 * 0]\n" - "ldp q2, q3, [%2, #16 * 2]\n" - "ldp q4, q5, [%2, #16 * 4]\n" - "ldp q6, q7, [%2, #16 * 6]\n" - "ldp q8, q9, [%2, #16 * 8]\n" - "ldp q10, q11, [%2, #16 * 10]\n" - "ldp q12, q13, [%2, #16 * 12]\n" - "ldp q14, q15, [%2, #16 * 14]\n" - "ldp q16, q17, [%2, #16 * 16]\n" - "ldp q18, q19, [%2, #16 * 18]\n" - "ldp q20, q21, [%2, #16 * 20]\n" - "ldp q22, q23, [%2, #16 * 22]\n" - "ldp q24, q25, [%2, #16 * 24]\n" - "ldp q26, q27, [%2, #16 * 26]\n" - "ldp q28, q29, [%2, #16 * 28]\n" - "ldp q30, q31, [%2, #16 * 30]\n" - "msr fpcr, %0 \n" - "msr fpsr, %1 \n" - : : "r"(fpcr), "r"(fpsr), "r"(vfp_state)); - + vfp_restore(curthread->td_pcb->pcb_fpusaved); PCPU_SET(fpcurthread, curthread); curpcb->pcb_vfpcpu = cpu; } Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Fri Oct 14 15:16:44 2016 (r307320) +++ head/sys/arm64/arm64/vm_machdep.c Fri Oct 14 15:53:48 2016 (r307321) @@ -101,6 +101,7 @@ cpu_fork(struct thread *td1, struct proc td2->td_pcb->pcb_x[9] = (uintptr_t)td2; td2->td_pcb->pcb_x[PCB_LR] = (uintptr_t)fork_trampoline; td2->td_pcb->pcb_sp = (uintptr_t)td2->td_frame; + td2->td_pcb->pcb_fpusaved = &td2->td_pcb->pcb_fpustate; td2->td_pcb->pcb_vfpcpu = UINT_MAX; /* Setup to release spin count in fork_exit(). */ @@ -169,6 +170,7 @@ cpu_copy_thread(struct thread *td, struc td->td_pcb->pcb_x[9] = (uintptr_t)td; td->td_pcb->pcb_x[PCB_LR] = (uintptr_t)fork_trampoline; td->td_pcb->pcb_sp = (uintptr_t)td->td_frame; + td->td_pcb->pcb_fpusaved = &td->td_pcb->pcb_fpustate; td->td_pcb->pcb_vfpcpu = UINT_MAX; /* Setup to release spin count in fork_exit(). */ @@ -246,6 +248,7 @@ cpu_fork_kthread_handler(struct thread * td->td_pcb->pcb_x[9] = (uintptr_t)arg; td->td_pcb->pcb_x[PCB_LR] = (uintptr_t)fork_trampoline; td->td_pcb->pcb_sp = (uintptr_t)td->td_frame; + td->td_pcb->pcb_fpusaved = &td->td_pcb->pcb_fpustate; td->td_pcb->pcb_vfpcpu = UINT_MAX; } Modified: head/sys/arm64/include/pcb.h ============================================================================== --- head/sys/arm64/include/pcb.h Fri Oct 14 15:16:44 2016 (r307320) +++ head/sys/arm64/include/pcb.h Fri Oct 14 15:53:48 2016 (r307321) @@ -31,6 +31,8 @@ #ifndef LOCORE +#include + struct trapframe; #define PCB_LR 30 @@ -49,13 +51,17 @@ struct pcb { #define PCB_SINGLE_STEP_SHIFT 0 #define PCB_SINGLE_STEP (1 << PCB_SINGLE_STEP_SHIFT) - /* Place last to simplify the asm to access the rest if the struct */ - __uint128_t pcb_vfp[32]; - uint32_t pcb_fpcr; - uint32_t pcb_fpsr; + struct vfpstate *pcb_fpusaved; int pcb_fpflags; #define PCB_FP_STARTED 0x01 u_int pcb_vfpcpu; /* Last cpu this thread ran VFP code */ + + /* + * The userspace VFP state. The pcb_fpusaved pointer will point to + * this unless the kernel has allocated a VFP context. + * Place last to simplify the asm to access the rest if the struct. + */ + struct vfpstate pcb_fpustate; }; #ifdef _KERNEL Modified: head/sys/arm64/include/vfp.h ============================================================================== --- head/sys/arm64/include/vfp.h Fri Oct 14 15:16:44 2016 (r307320) +++ head/sys/arm64/include/vfp.h Fri Oct 14 15:53:48 2016 (r307321) @@ -35,6 +35,12 @@ #ifdef _KERNEL #ifndef LOCORE +struct vfpstate { + __uint128_t vfp_regs[32]; + uint32_t vfp_fpcr; + uint32_t vfp_fpsr; +}; + void vfp_init(void); void vfp_discard(struct thread *); void vfp_restore_state(void); From owner-svn-src-head@freebsd.org Fri Oct 14 16:05:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1865FC1083E; Fri, 14 Oct 2016 16:05:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC431BA0; Fri, 14 Oct 2016 16:05:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EG5it7065966; Fri, 14 Oct 2016 16:05:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EG5iBX065964; Fri, 14 Oct 2016 16:05:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610141605.u9EG5iBX065964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 14 Oct 2016 16:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307322 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 16:05:46 -0000 Author: imp Date: Fri Oct 14 16:05:44 2016 New Revision: 307322 URL: https://svnweb.freebsd.org/changeset/base/307322 Log: The file /boot/boot.conf existed for the 3.0 release (r38764). It was replaced by /boot/loader.rc for 3.1 (r42682). In May 2000, this was documented as deprecated (r61942) (between FreeBSD 4.0 and 4.1). Remove it since it's not been the preferred method in 17 years and has been deprecated for 16. Differential Revision: https://reviews.freebsd.org/D8142 Modified: head/sys/boot/common/interp.c head/sys/boot/common/loader.8 Modified: head/sys/boot/common/interp.c ============================================================================== --- head/sys/boot/common/interp.c Fri Oct 14 15:53:48 2016 (r307321) +++ head/sys/boot/common/interp.c Fri Oct 14 16:05:44 2016 (r307322) @@ -104,8 +104,7 @@ interact(const char *rc) if (rc == NULL) { /* Read our default configuration. */ - if (include("/boot/loader.rc") != CMD_OK) - include("/boot/boot.conf"); + include("/boot/loader.rc"); } else if (*rc != '\0') include(rc); Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Fri Oct 14 15:53:48 2016 (r307321) +++ head/sys/boot/common/loader.8 Fri Oct 14 16:05:44 2016 (r307322) @@ -90,9 +90,7 @@ which is default. After that, .Pa /boot/loader.rc -is processed if available, and, failing that, -.Pa /boot/boot.conf -is read for historical reasons. +is processed if available. These files are processed through the .Ic include command, which reads all of them into memory before processing them, @@ -957,10 +955,6 @@ itself. Additional .Tn FICL initialization. -.It Pa /boot/boot.conf -.Nm -bootstrapping script. -Deprecated. .It Pa /boot/defaults/loader.conf .It Pa /boot/loader.conf .It Pa /boot/loader.conf.local From owner-svn-src-head@freebsd.org Fri Oct 14 16:23:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44C99C11011; Fri, 14 Oct 2016 16:23:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16F45A59; Fri, 14 Oct 2016 16:23:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EGN56Q073167; Fri, 14 Oct 2016 16:23:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EGN552073166; Fri, 14 Oct 2016 16:23:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610141623.u9EGN552073166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 14 Oct 2016 16:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307323 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 16:23:06 -0000 Author: imp Date: Fri Oct 14 16:23:05 2016 New Revision: 307323 URL: https://svnweb.freebsd.org/changeset/base/307323 Log: Remove fetching of pInterp. Currently, there's no actual effect other than to store the location of a forth word that is subsequently never used. It was last used before the 2.03 ficl upgrade in r51786. It was only used from r43614 (so Feb-Sept 1999) on head and in the 3.x branch (merged r43715 3.1 -> EOL). Remove it since nobody cared enough to report the bug in the last 18 years rather than fix it. It's need seems to have passed in the 2.03 ficl update. Differential Revision: https://reviews.freebsd.org/D8150 Modified: head/sys/boot/common/interp_forth.c Modified: head/sys/boot/common/interp_forth.c ============================================================================== --- head/sys/boot/common/interp_forth.c Fri Oct 14 16:05:44 2016 (r307322) +++ head/sys/boot/common/interp_forth.c Fri Oct 14 16:23:05 2016 (r307323) @@ -63,7 +63,6 @@ extern char bootprog_rev[]; FICL_SYSTEM *bf_sys; FICL_VM *bf_vm; -FICL_WORD *pInterp; /* * Shim for taking commands from BF and passing them out to 'standard' @@ -281,8 +280,6 @@ bf_init(const char *rc) ficlSetEnv(bf_sys, "loader_version", (bootprog_rev[0] - '0') * 10 + (bootprog_rev[2] - '0')); - pInterp = ficlLookup(bf_sys, "interpret"); - /* try to load and run init file if present */ if (rc == NULL) rc = "/boot/boot.4th"; @@ -293,9 +290,6 @@ bf_init(const char *rc) close(fd); } } - - /* Do this again, so that interpret can be redefined. */ - pInterp = ficlLookup(bf_sys, "interpret"); } /* From owner-svn-src-head@freebsd.org Fri Oct 14 16:23:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 419F5C1107E; Fri, 14 Oct 2016 16:23:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 089D4BE9; Fri, 14 Oct 2016 16:23:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EGNEg3073235; Fri, 14 Oct 2016 16:23:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EGNCNO073220; Fri, 14 Oct 2016 16:23:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610141623.u9EGNCNO073220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 14 Oct 2016 16:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307324 - in head/sys/boot: common efi/loader efi/loader/arch/amd64 efi/loader/arch/arm efi/loader/arch/arm64 efi/loader/arch/i386 ficl ficl/i386 i386/libi386 mips/beri/loader pc98/libpc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 16:23:15 -0000 Author: imp Date: Fri Oct 14 16:23:12 2016 New Revision: 307324 URL: https://svnweb.freebsd.org/changeset/base/307324 Log: Create a new linker set, Xficl_compile_set which contains a list of functions to call at the appropriate time to register new forth words. In the past we've done this with ifdef soup, but now if the file is included in the build, we'll get the new forth words. Use this new functionality to move the pci bios stuff out of loader.c by moving it to biospci.c. Move the pnp functionality to common/pnp.c. Move the inb/outb forth words to the i386 sysdep.c file where their implementation is defined. Adjust the efi linker scripts and build machinery to cope. his should be an invisible change to forth scripts and user experience. Differential Revision: https://reviews.freebsd.org/D8145 Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/pnp.c head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 head/sys/boot/efi/loader/arch/arm/ldscript.arm head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 head/sys/boot/efi/loader/arch/i386/ldscript.i386 head/sys/boot/ficl/ficl.h head/sys/boot/ficl/i386/sysdep.c head/sys/boot/ficl/loader.c head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/libi386/biospci.c head/sys/boot/i386/libi386/libi386.h head/sys/boot/mips/beri/loader/loader.ldscript head/sys/boot/pc98/libpc98/Makefile Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/common/bootstrap.h Fri Oct 14 16:23:12 2016 (r307324) @@ -142,8 +142,6 @@ struct pnpinfo STAILQ_HEAD(pnpinfo_stql, pnpinfo); -extern struct pnpinfo_stql pnp_devices; - extern struct pnphandler *pnphandlers[]; /* provided by MD code */ void pnp_addident(struct pnpinfo *pi, char *ident); Modified: head/sys/boot/common/pnp.c ============================================================================== --- head/sys/boot/common/pnp.c Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/common/pnp.c Fri Oct 14 16:23:12 2016 (r307324) @@ -17,8 +17,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "ficl.h" -struct pnpinfo_stql pnp_devices; +static struct pnpinfo_stql pnp_devices; static int pnp_devices_initted = 0; static void pnp_discard(void); @@ -185,3 +186,47 @@ pnp_eisaformat(u_int8_t *data) return(idbuf); } +void +ficlPnpdevices(FICL_VM *pVM) +{ + static int pnp_devices_initted = 0; +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 0, 1); +#endif + + if(!pnp_devices_initted) { + STAILQ_INIT(&pnp_devices); + pnp_devices_initted = 1; + } + + stackPushPtr(pVM->pStack, &pnp_devices); + + return; +} + +void +ficlPnphandlers(FICL_VM *pVM) +{ +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 0, 1); +#endif + + stackPushPtr(pVM->pStack, pnphandlers); + + return; +} + +/* + * Glue function to add the appropriate forth words to access pnp BIOS + * functionality. + */ +static void ficlCompilePnp(FICL_SYSTEM *pSys) +{ + FICL_DICT *dp = pSys->dp; + assert (dp); + + dictAppendWord(dp, "pnpdevices",ficlPnpdevices, FW_DEFAULT); + dictAppendWord(dp, "pnphandlers",ficlPnphandlers, FW_DEFAULT); +} + +FICL_COMPILE_SET(ficlCompilePnp); Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/efi/loader/Makefile Fri Oct 14 16:23:12 2016 (r307324) @@ -145,6 +145,7 @@ loader.efi: ${PROG} ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ + -j set_Xficl_compile_set \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} LIBEFI= ${.OBJDIR}/../libefi/libefi.a Modified: head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Fri Oct 14 16:23:12 2016 (r307324) @@ -40,6 +40,11 @@ SECTIONS *(set_Xcommand_set) __stop_set_Xcommand_set = .; } + set_Xficl_compile_set : { + __start_set_Xficl_compile_set = .; + *(set_Xficl_compile_set) + __stop_set_Xficl_compile_set = .; + } . = ALIGN(4096); __gp = .; .sdata : { Modified: head/sys/boot/efi/loader/arch/arm/ldscript.arm ============================================================================== --- head/sys/boot/efi/loader/arch/arm/ldscript.arm Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/efi/loader/arch/arm/ldscript.arm Fri Oct 14 16:23:12 2016 (r307324) @@ -47,6 +47,11 @@ SECTIONS *(set_Xcommand_set) __stop_set_Xcommand_set = .; } + set_Xficl_compile_set : { + __start_set_Xficl_compile_set = .; + *(set_Xficl_compile_set) + __stop_set_Xficl_compile_set = .; + } __gp = .; .plt : { *(.plt) } .dynamic : { *(.dynamic) } Modified: head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Fri Oct 14 16:23:12 2016 (r307324) @@ -43,6 +43,11 @@ SECTIONS *(set_Xcommand_set) __stop_set_Xcommand_set = .; } + set_Xficl_compile_set : { + __start_set_Xficl_compile_set = .; + *(set_Xficl_compile_set) + __stop_set_Xficl_compile_set = .; + } . = ALIGN(16); __gp = .; .sdata : { Modified: head/sys/boot/efi/loader/arch/i386/ldscript.i386 ============================================================================== --- head/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/efi/loader/arch/i386/ldscript.i386 Fri Oct 14 16:23:12 2016 (r307324) @@ -35,6 +35,11 @@ SECTIONS *(set_Xcommand_set) __stop_set_Xcommand_set = .; } + set_Xficl_compile_set : { + __start_set_Xficl_compile_set = .; + *(set_Xficl_compile_set) + __stop_set_Xficl_compile_set = .; + } . = ALIGN(4096); __gp = .; .sdata : { Modified: head/sys/boot/ficl/ficl.h ============================================================================== --- head/sys/boot/ficl/ficl.h Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/ficl/ficl.h Fri Oct 14 16:23:12 2016 (r307324) @@ -1150,6 +1150,13 @@ typedef struct ficlFILE } ficlFILE; #endif +#include + +typedef void ficlCompileFcn(FICL_SYSTEM *); +#define FICL_COMPILE_SET(func) \ + DATA_SET(Xficl_compile_set, func) +SET_DECLARE(Xficl_compile_set, ficlCompileFcn); + #ifdef __cplusplus } #endif Modified: head/sys/boot/ficl/i386/sysdep.c ============================================================================== --- head/sys/boot/ficl/i386/sysdep.c Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/ficl/i386/sysdep.c Fri Oct 14 16:23:12 2016 (r307324) @@ -81,7 +81,6 @@ void ficlFree (void *p) } #ifndef TESTMAIN -#ifdef __i386__ /* * outb ( port# c -- ) * Store a byte to I/O port number port# @@ -111,7 +110,22 @@ ficlInb(FICL_VM *pVM) c=inb(port); stackPushINT(pVM->pStack,c); } -#endif + +/* + * Glue function to add the appropriate forth words to access x86 special cpu + * functionality. + */ +static void ficlCompileCpufunc(FICL_SYSTEM *pSys) +{ + FICL_DICT *dp = pSys->dp; + assert (dp); + + dictAppendWord(dp, "outb", ficlOutb, FW_DEFAULT); + dictAppendWord(dp, "inb", ficlInb, FW_DEFAULT); +} + +FICL_COMPILE_SET(ficlCompileCpufunc); + #endif /* Modified: head/sys/boot/ficl/loader.c ============================================================================== --- head/sys/boot/ficl/loader.c Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/ficl/loader.c Fri Oct 14 16:23:12 2016 (r307324) @@ -287,43 +287,6 @@ ficlFindfile(FICL_VM *pVM) return; } -#ifndef TESTMAIN -#ifdef HAVE_PNP - -void -ficlPnpdevices(FICL_VM *pVM) -{ - static int pnp_devices_initted = 0; -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 0, 1); -#endif - - if(!pnp_devices_initted) { - STAILQ_INIT(&pnp_devices); - pnp_devices_initted = 1; - } - - stackPushPtr(pVM->pStack, &pnp_devices); - - return; -} - -void -ficlPnphandlers(FICL_VM *pVM) -{ -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 0, 1); -#endif - - stackPushPtr(pVM->pStack, pnphandlers); - - return; -} - -#endif - -#endif /* ndef TESTMAIN */ - void ficlCcall(FICL_VM *pVM) { @@ -800,141 +763,6 @@ static void fkey(FICL_VM *pVM) } -#ifdef __i386__ -/* - * pcibios-device-count (devid -- count) - * - * Returns the PCI BIOS' count of how many devices matching devid are in the system. - * devid is the 32-bit vendor + device. - */ -static void -ficlPciBiosCountDevices(FICL_VM *pVM) -{ - uint32_t devid; - int i; - - devid = stackPopINT(pVM->pStack); - - i = biospci_count_device_type(devid); - - stackPushINT(pVM->pStack, i); -} - -/* - * pcibios-write-config (locator offset width value -- ) - * - * Writes the specified config register. - * Locator is bus << 8 | device << 3 | fuction - * offset is the pci config register - * width is 0 for byte, 1 for word, 2 for dword - * value is the value to write - */ -static void -ficlPciBiosWriteConfig(FICL_VM *pVM) -{ - uint32_t value, width, offset, locator; - - value = stackPopINT(pVM->pStack); - width = stackPopINT(pVM->pStack); - offset = stackPopINT(pVM->pStack); - locator = stackPopINT(pVM->pStack); - - biospci_write_config(locator, offset, width, value); -} - -/* - * pcibios-read-config (locator offset width -- value) - * - * Reads the specified config register. - * Locator is bus << 8 | device << 3 | fuction - * offset is the pci config register - * width is 0 for byte, 1 for word, 2 for dword - * value is the value to read from the register - */ -static void -ficlPciBiosReadConfig(FICL_VM *pVM) -{ - uint32_t value, width, offset, locator; - - width = stackPopINT(pVM->pStack); - offset = stackPopINT(pVM->pStack); - locator = stackPopINT(pVM->pStack); - - biospci_read_config(locator, offset, width, &value); - - stackPushINT(pVM->pStack, value); -} - -/* - * pcibios-find-devclass (class index -- locator) - * - * Finds the index'th instance of class in the pci tree. - * must be an exact match. - * class is the class to search for. - * index 0..N (set to 0, increment until error) - * - * Locator is bus << 8 | device << 3 | fuction (or -1 on error) - */ -static void -ficlPciBiosFindDevclass(FICL_VM *pVM) -{ - uint32_t index, class, locator; - - index = stackPopINT(pVM->pStack); - class = stackPopINT(pVM->pStack); - - if (biospci_find_devclass(class, index, &locator)) - locator = 0xffffffff; - - stackPushINT(pVM->pStack, locator); -} - -/* - * pcibios-find-device(devid index -- locator) - * - * Finds the index'th instance of devid in the pci tree. - * must be an exact match. - * class is the class to search for. - * index 0..N (set to 0, increment until error) - * - * Locator is bus << 8 | device << 3 | fuction (or -1 on error) - */ -static void -ficlPciBiosFindDevice(FICL_VM *pVM) -{ - uint32_t index, devid, locator; - - index = stackPopINT(pVM->pStack); - devid = stackPopINT(pVM->pStack); - - if (biospci_find_device(devid, index, &locator)) - locator = 0xffffffff; - - stackPushINT(pVM->pStack, locator); -} - -/* - * pcibios-find-device(bus device function -- locator) - * - * converts bus, device, function to locator. - * - * Locator is bus << 8 | device << 3 | fuction - */ -static void -ficlPciBiosLocator(FICL_VM *pVM) -{ - uint32_t bus, device, function, locator; - - function = stackPopINT(pVM->pStack); - device = stackPopINT(pVM->pStack); - bus = stackPopINT(pVM->pStack); - - locator = biospci_locator(bus, device, function); - - stackPushINT(pVM->pStack, locator); -} -#endif - /* ** Retrieves free space remaining on the dictionary */ @@ -963,6 +791,7 @@ static void ficlDictIncrease(FICL_VM *pV **************************************************************************/ void ficlCompilePlatform(FICL_SYSTEM *pSys) { + ficlCompileFcn **fnpp; FICL_DICT *dp = pSys->dp; assert (dp); @@ -994,24 +823,10 @@ void ficlCompilePlatform(FICL_SYSTEM *pS dictAppendWord(dp, "ccall", ficlCcall, FW_DEFAULT); dictAppendWord(dp, "uuid-from-string", ficlUuidFromString, FW_DEFAULT); dictAppendWord(dp, "uuid-to-string", ficlUuidToString, FW_DEFAULT); -#ifndef TESTMAIN -#ifdef __i386__ - dictAppendWord(dp, "outb", ficlOutb, FW_DEFAULT); - dictAppendWord(dp, "inb", ficlInb, FW_DEFAULT); -#endif -#ifdef HAVE_PNP - dictAppendWord(dp, "pnpdevices",ficlPnpdevices, FW_DEFAULT); - dictAppendWord(dp, "pnphandlers",ficlPnphandlers, FW_DEFAULT); -#endif -#endif -#ifdef __i386__ - dictAppendWord(dp, "pcibios-device-count", ficlPciBiosCountDevices, FW_DEFAULT); - dictAppendWord(dp, "pcibios-read-config", ficlPciBiosReadConfig, FW_DEFAULT); - dictAppendWord(dp, "pcibios-write-config", ficlPciBiosWriteConfig, FW_DEFAULT); - dictAppendWord(dp, "pcibios-find-devclass", ficlPciBiosFindDevclass, FW_DEFAULT); - dictAppendWord(dp, "pcibios-find-device", ficlPciBiosFindDevice, FW_DEFAULT); - dictAppendWord(dp, "pcibios-locator", ficlPciBiosLocator, FW_DEFAULT); -#endif + + SET_FOREACH(fnpp, Xficl_compile_set) { + (*fnpp)(pSys); + } #if defined(PC98) ficlSetEnv(pSys, "arch-pc98", FICL_TRUE); Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/i386/libi386/Makefile Fri Oct 14 16:23:12 2016 (r307324) @@ -54,7 +54,8 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../common \ +CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 \ + -I${.CURDIR}/../../common -I${.CURDIR}/../common \ -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../../contrib/dev/acpica/include \ -I${.CURDIR}/../../.. -I. Modified: head/sys/boot/i386/libi386/biospci.c ============================================================================== --- head/sys/boot/i386/libi386/biospci.c Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/i386/libi386/biospci.c Fri Oct 14 16:23:12 2016 (r307324) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1998 Michael Smith + * Copyright (c) 2016 Netflix, Inc * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "libi386.h" +#include "ficl.h" /* * Stupid PCI BIOS interface doesn't let you simply enumerate everything @@ -338,7 +340,7 @@ biospci_find_devclass(uint32_t class, in return (0); } -int +static int biospci_find_device(uint32_t devid, int index, uint32_t *locator) { v86.ctl = V86_FLAGS; @@ -407,7 +409,7 @@ biospci_locator(int8_t bus, uint8_t devi * Counts the number of instances of devid we have in the system, as least as * far as the PCI BIOS is able to tell. */ -int +static int biospci_count_device_type(uint32_t devid) { int i; @@ -426,3 +428,155 @@ biospci_count_device_type(uint32_t devid } return i; } + +/* + * pcibios-device-count (devid -- count) + * + * Returns the PCI BIOS' count of how many devices matching devid are in the system. + * devid is the 32-bit vendor + device. + */ +static void +ficlPciBiosCountDevices(FICL_VM *pVM) +{ + uint32_t devid; + int i; + + devid = stackPopINT(pVM->pStack); + + i = biospci_count_device_type(devid); + + stackPushINT(pVM->pStack, i); +} + +/* + * pcibios-write-config (locator offset width value -- ) + * + * Writes the specified config register. + * Locator is bus << 8 | device << 3 | fuction + * offset is the pci config register + * width is 0 for byte, 1 for word, 2 for dword + * value is the value to write + */ +static void +ficlPciBiosWriteConfig(FICL_VM *pVM) +{ + uint32_t value, width, offset, locator; + + value = stackPopINT(pVM->pStack); + width = stackPopINT(pVM->pStack); + offset = stackPopINT(pVM->pStack); + locator = stackPopINT(pVM->pStack); + + biospci_write_config(locator, offset, width, value); +} + +/* + * pcibios-read-config (locator offset width -- value) + * + * Reads the specified config register. + * Locator is bus << 8 | device << 3 | fuction + * offset is the pci config register + * width is 0 for byte, 1 for word, 2 for dword + * value is the value to read from the register + */ +static void +ficlPciBiosReadConfig(FICL_VM *pVM) +{ + uint32_t value, width, offset, locator; + + width = stackPopINT(pVM->pStack); + offset = stackPopINT(pVM->pStack); + locator = stackPopINT(pVM->pStack); + + biospci_read_config(locator, offset, width, &value); + + stackPushINT(pVM->pStack, value); +} + +/* + * pcibios-find-devclass (class index -- locator) + * + * Finds the index'th instance of class in the pci tree. + * must be an exact match. + * class is the class to search for. + * index 0..N (set to 0, increment until error) + * + * Locator is bus << 8 | device << 3 | fuction (or -1 on error) + */ +static void +ficlPciBiosFindDevclass(FICL_VM *pVM) +{ + uint32_t index, class, locator; + + index = stackPopINT(pVM->pStack); + class = stackPopINT(pVM->pStack); + + if (biospci_find_devclass(class, index, &locator)) + locator = 0xffffffff; + + stackPushINT(pVM->pStack, locator); +} + +/* + * pcibios-find-device(devid index -- locator) + * + * Finds the index'th instance of devid in the pci tree. + * must be an exact match. + * class is the class to search for. + * index 0..N (set to 0, increment until error) + * + * Locator is bus << 8 | device << 3 | fuction (or -1 on error) + */ +static void +ficlPciBiosFindDevice(FICL_VM *pVM) +{ + uint32_t index, devid, locator; + + index = stackPopINT(pVM->pStack); + devid = stackPopINT(pVM->pStack); + + if (biospci_find_device(devid, index, &locator)) + locator = 0xffffffff; + + stackPushINT(pVM->pStack, locator); +} + +/* + * pcibios-find-device(bus device function -- locator) + * + * converts bus, device, function to locator. + * + * Locator is bus << 8 | device << 3 | fuction + */ +static void +ficlPciBiosLocator(FICL_VM *pVM) +{ + uint32_t bus, device, function, locator; + + function = stackPopINT(pVM->pStack); + device = stackPopINT(pVM->pStack); + bus = stackPopINT(pVM->pStack); + + locator = biospci_locator(bus, device, function); + + stackPushINT(pVM->pStack, locator); +} + +/* + * Glue function to add the appropriate forth words to access pci bios + * functionality. + */ +static void ficlCompilePciBios(FICL_SYSTEM *pSys) +{ + FICL_DICT *dp = pSys->dp; + assert (dp); + + dictAppendWord(dp, "pcibios-device-count", ficlPciBiosCountDevices, FW_DEFAULT); + dictAppendWord(dp, "pcibios-read-config", ficlPciBiosReadConfig, FW_DEFAULT); + dictAppendWord(dp, "pcibios-write-config", ficlPciBiosWriteConfig, FW_DEFAULT); + dictAppendWord(dp, "pcibios-find-devclass", ficlPciBiosFindDevclass, FW_DEFAULT); + dictAppendWord(dp, "pcibios-find-device", ficlPciBiosFindDevice, FW_DEFAULT); + dictAppendWord(dp, "pcibios-locator", ficlPciBiosLocator, FW_DEFAULT); +} + +FICL_COMPILE_SET(ficlCompilePciBios); Modified: head/sys/boot/i386/libi386/libi386.h ============================================================================== --- head/sys/boot/i386/libi386/libi386.h Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/i386/libi386/libi386.h Fri Oct 14 16:23:12 2016 (r307324) @@ -104,12 +104,10 @@ extern uint32_t high_heap_size; /* exte extern vm_offset_t high_heap_base; /* for use as the heap */ void biospci_detect(void); -int biospci_count_device_type(uint32_t devid); -int biospci_find_devclass(uint32_t class, int index, uint32_t *locator); -int biospci_find_device(uint32_t devid, int index, uint32_t *locator); -int biospci_write_config(uint32_t locator, int offset, int width, uint32_t val); -int biospci_read_config(uint32_t locator, int offset, int width, uint32_t *val); +int biospci_find_devclass(uint32_t class, int index, uint32_t *locator); +int biospci_read_config(uint32_t locator, int offset, int width, uint32_t *val); uint32_t biospci_locator(int8_t bus, uint8_t device, uint8_t function); +int biospci_write_config(uint32_t locator, int offset, int width, uint32_t val); void biosacpi_detect(void); Modified: head/sys/boot/mips/beri/loader/loader.ldscript ============================================================================== --- head/sys/boot/mips/beri/loader/loader.ldscript Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/mips/beri/loader/loader.ldscript Fri Oct 14 16:23:12 2016 (r307324) @@ -65,6 +65,10 @@ SECTIONS __start_set_Xcommand_set = .; KEEP(*(set_Xcommand_set)) __stop_set_Xcommand_set = .; + + __start_set_Xficl_compile_set = .; + KEEP(*(set_Xficl_compile_set)) + __stop_set_Xficl_compile_set = .; } .data ALIGN(0x10): { *(.data*)} .bss ALIGN(0x10): { *(.bss*) } Modified: head/sys/boot/pc98/libpc98/Makefile ============================================================================== --- head/sys/boot/pc98/libpc98/Makefile Fri Oct 14 16:23:05 2016 (r307323) +++ head/sys/boot/pc98/libpc98/Makefile Fri Oct 14 16:23:12 2016 (r307324) @@ -37,7 +37,8 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../common \ +CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 \ + -I${.CURDIR}/../../common \ -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../i386/libi386 \ -I${.CURDIR}/../../.. -I. From owner-svn-src-head@freebsd.org Fri Oct 14 17:04:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6F39C11ED2; Fri, 14 Oct 2016 17:04:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A748B755; Fri, 14 Oct 2016 17:04:08 +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 u9EH47oh088474; Fri, 14 Oct 2016 17:04:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EH475B088473; Fri, 14 Oct 2016 17:04:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201610141704.u9EH475B088473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 14 Oct 2016 17:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307325 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:04:08 -0000 Author: emaste Date: Fri Oct 14 17:04:07 2016 New Revision: 307325 URL: https://svnweb.freebsd.org/changeset/base/307325 Log: Simplify logic for libproc and librtld_db in lib/Makefile Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Oct 14 16:23:12 2016 (r307324) +++ head/lib/Makefile Fri Oct 14 17:04:07 2016 (r307325) @@ -166,26 +166,13 @@ SUBDIR.${MK_NIS}+= libypclnt .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _libvgl= libvgl -_libproc= libproc -_librtld_db= librtld_db .endif .if ${MACHINE_CPUARCH} == "amd64" SUBDIR.${MK_BHYVE}+= libvmmapi .endif -.if ${MACHINE_CPUARCH} == "mips" -_libproc= libproc -_librtld_db= librtld_db -.endif - -.if ${MACHINE_CPUARCH} == "powerpc" -_libproc= libproc -_librtld_db= librtld_db -.endif - -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ - ${MACHINE_CPUARCH} == "riscv" +.if ${MACHINE_CPUARCH} != "sparc64" _libproc= libproc _librtld_db= librtld_db .endif From owner-svn-src-head@freebsd.org Fri Oct 14 17:10:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED879C12070; Fri, 14 Oct 2016 17:10:54 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A87DB993; Fri, 14 Oct 2016 17:10:54 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EHArFX089413; Fri, 14 Oct 2016 17:10:53 GMT (envelope-from ambrisko@FreeBSD.org) Received: (from ambrisko@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EHArlL089412; Fri, 14 Oct 2016 17:10:53 GMT (envelope-from ambrisko@FreeBSD.org) Message-Id: <201610141710.u9EHArlL089412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ambrisko set sender to ambrisko@FreeBSD.org using -f From: Doug Ambrisko Date: Fri, 14 Oct 2016 17:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307326 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:10:55 -0000 Author: ambrisko Date: Fri Oct 14 17:10:53 2016 New Revision: 307326 URL: https://svnweb.freebsd.org/changeset/base/307326 Log: In UEFI mode expose the SMBIOS anchor base address via kenv so the kernel etc. can find out where the SMBIOS entry point is located. In pure UEFI mode the BIOS is not mapped into the standard address space so the SMBIOS table might not appear between 0xf0000 and 0xfffff. The UEFI environment can report this the location of the anchor. If it is reported then expose it as hint.smbios.0.mem. This can then be used by other tools. However, we should make smbios(4) useful and have it take this value and provide accesor function so ipmi(4) etc. don't have to parse and figure things about the SMBIOS table. I have some simple patches to smbios(4) to expose this address as sysctl and for ipmi(4) to get the base address. However, the real fix is to have ipmi(4) ask smbios(4) for what it wants and have smbios(4) parse it out and return it. This would make smbios(4) useful and reduce duplicated code. If this address doesn't point to the anchor then finding SMBIOS info. will fail as if this didn't exist. So there should be no harm. With this change and the following hack, dmidecode works on a bunch of UEFI machines that I tested: if kenv hint.smbios.0.mem > /dev/null then mkdir -p /sys/firmware/efi mount -t tmpfs -o size=8k tmpfs /sys/firmware/efi echo "SMBIOS=`kenv hint.smbios.0.mem`" > /sys/firmware/efi/systab fi Linux exposes this information via the /sys/firmware/efi/systab file which dmidecode looks at. We should update dmidecode to do this the FreeBSD way when we determine what that is! Reviewed by: jhb Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri Oct 14 17:04:07 2016 (r307325) +++ head/sys/boot/efi/loader/main.c Fri Oct 14 17:10:53 2016 (r307326) @@ -235,6 +235,7 @@ main(int argc, CHAR16 *argv[]) uint64_t pool_guid; UINTN k; int has_kbd; + char buf[40]; archsw.arch_autoload = efi_autoload; archsw.arch_getdev = efi_getdev; @@ -447,6 +448,9 @@ main(int argc, CHAR16 *argv[]) for (k = 0; k < ST->NumberOfTableEntries; k++) { guid = &ST->ConfigurationTable[k].VendorGuid; if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { + snprintf(buf, sizeof(buf), "%p", + ST->ConfigurationTable[k].VendorTable); + setenv("hint.smbios.0.mem", buf, 1); smbios_detect(ST->ConfigurationTable[k].VendorTable); break; } @@ -603,7 +607,8 @@ command_configuration(int argc, char *ar else if (!memcmp(guid, &acpi20, sizeof(EFI_GUID))) printf("ACPI 2.0 Table"); else if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) - printf("SMBIOS Table"); + printf("SMBIOS Table %p", + ST->ConfigurationTable[i].VendorTable); else if (!memcmp(guid, &dxe, sizeof(EFI_GUID))) printf("DXE Table"); else if (!memcmp(guid, &hoblist, sizeof(EFI_GUID))) From owner-svn-src-head@freebsd.org Fri Oct 14 17:16:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5E21C1211F for ; Fri, 14 Oct 2016 17:16:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74BC8D42 for ; Fri, 14 Oct 2016 17:16:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id i202so127344363ioi.2 for ; Fri, 14 Oct 2016 10:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qlpBKLImWdQ+oox1XayuRsswXPtrHZ7z2bRuUr6zV8I=; b=UfS0q14kUFcc6IIFTHCtCsTdDsJuPwVs+P/L3Qu9vyKvIXkUFAOOmRSI3ZTLFIPsnv zthkJEWFk2/MIJP9sEQ9n0JJUkRQsmhlfcpzzb+AvDmJ4zxDrljGFWiicNdFoFQxNT3d rRBLb6OU0l9hzsuWcsNeLrXDnf5X4WGhbdMMoWX50TP+eMdYDCBV2+WZXXwZkja5K+TX OjYhJVRjBiWWjG7sT9YvJD7hV15+BlcItwxaS49mgzeMpPN4pxqylosEymhGSQkTZSOZ JCFd6Tvin1uBtgzuI0QrJsUX+TnZgUQx/+b/Ngv29SW7IEx+vdCmc1SfgWTt2x5fRj+p bRbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=qlpBKLImWdQ+oox1XayuRsswXPtrHZ7z2bRuUr6zV8I=; b=IVrcq7uLv6uyKovCJrp7iwX+lPeXD8XTStbiNffHnVryqDrAi91vlVoFh/+DNBd0FC UJRD5XVU9PicQifOKyae4I8b2cREdlDq2w9iECI3BVrUKg1EQ20BNPe0sq+LAstDJAQR XLTzApYlH9PFav7M0LW+tn8g67o7XDPjFpx0/lCSQWoR6n9N+aIyQi4MSghVbNwPUUmO ww99kms8XGTRdL4btLhXj7uA2+BJvsM0aEjWxP2298P2F/BdjKU3L1uvBPE0x/5dpfvm FY+GDGiHB1wb4fst8cDpXHBfRLEzV507X0CjFwgNiMLZR4aQUqMwYaNuBK0+ZYM8eWgw CNPA== X-Gm-Message-State: AA6/9Rkzznnmma/pYOgLZp5D9aZcisFCr2kUA2W87X3oskrw99gb5lSvdRZUmp9ONg5YjxV03ynkKW/fMKYqoA== X-Received: by 10.107.139.79 with SMTP id n76mr14303401iod.166.1476465362851; Fri, 14 Oct 2016 10:16:02 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Fri, 14 Oct 2016 10:16:02 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <201610141710.u9EHArlL089412@repo.freebsd.org> References: <201610141710.u9EHArlL089412@repo.freebsd.org> From: Warner Losh Date: Fri, 14 Oct 2016 11:16:02 -0600 X-Google-Sender-Auth: FpWsXjim2P93vs0DxZi91dZts24 Message-ID: Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader To: Doug Ambrisko Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:16:03 -0000 Love the functionality, but don't like using the 'hint' namespace for this. Can we change it now before too many things depend on it? We had similar issues in ACPI and moved it to the 'acpi' space. Can we move this to the 'smbios' space please? The reason is that 'hint' is special and sometimes filtered out, so it is a poor choice to export data from the boot loader to the kernel. Warner On Fri, Oct 14, 2016 at 11:10 AM, Doug Ambrisko wrote: > Author: ambrisko > Date: Fri Oct 14 17:10:53 2016 > New Revision: 307326 > URL: https://svnweb.freebsd.org/changeset/base/307326 > > Log: > In UEFI mode expose the SMBIOS anchor base address via kenv so the kernel > etc. can find out where the SMBIOS entry point is located. In pure > UEFI mode the BIOS is not mapped into the standard address space so the > SMBIOS table might not appear between 0xf0000 and 0xfffff. The > UEFI environment can report this the location of the anchor. If it is > reported then expose it as hint.smbios.0.mem. This can then be used > by other tools. However, we should make smbios(4) useful and have it > take this value and provide accesor function so ipmi(4) etc. don't > have to parse and figure things about the SMBIOS table. I have some > simple patches to smbios(4) to expose this address as sysctl and > for ipmi(4) to get the base address. However, the real fix is to > have ipmi(4) ask smbios(4) for what it wants and have smbios(4) > parse it out and return it. This would make smbios(4) useful and reduce > duplicated code. If this address doesn't point to the anchor then > finding SMBIOS info. will fail as if this didn't exist. So there should > be no harm. > > With this change and the following hack, dmidecode works on a bunch of > UEFI machines that I tested: > > if kenv hint.smbios.0.mem > /dev/null > then > mkdir -p /sys/firmware/efi > mount -t tmpfs -o size=8k tmpfs /sys/firmware/efi > echo "SMBIOS=`kenv hint.smbios.0.mem`" > /sys/firmware/efi/systab > fi > > Linux exposes this information via the /sys/firmware/efi/systab file which > dmidecode looks at. We should update dmidecode to do this the FreeBSD > way when we determine what that is! > > Reviewed by: jhb > > Modified: > head/sys/boot/efi/loader/main.c > > Modified: head/sys/boot/efi/loader/main.c > ============================================================================== > --- head/sys/boot/efi/loader/main.c Fri Oct 14 17:04:07 2016 (r307325) > +++ head/sys/boot/efi/loader/main.c Fri Oct 14 17:10:53 2016 (r307326) > @@ -235,6 +235,7 @@ main(int argc, CHAR16 *argv[]) > uint64_t pool_guid; > UINTN k; > int has_kbd; > + char buf[40]; > > archsw.arch_autoload = efi_autoload; > archsw.arch_getdev = efi_getdev; > @@ -447,6 +448,9 @@ main(int argc, CHAR16 *argv[]) > for (k = 0; k < ST->NumberOfTableEntries; k++) { > guid = &ST->ConfigurationTable[k].VendorGuid; > if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { > + snprintf(buf, sizeof(buf), "%p", > + ST->ConfigurationTable[k].VendorTable); > + setenv("hint.smbios.0.mem", buf, 1); > smbios_detect(ST->ConfigurationTable[k].VendorTable); > break; > } > @@ -603,7 +607,8 @@ command_configuration(int argc, char *ar > else if (!memcmp(guid, &acpi20, sizeof(EFI_GUID))) > printf("ACPI 2.0 Table"); > else if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) > - printf("SMBIOS Table"); > + printf("SMBIOS Table %p", > + ST->ConfigurationTable[i].VendorTable); > else if (!memcmp(guid, &dxe, sizeof(EFI_GUID))) > printf("DXE Table"); > else if (!memcmp(guid, &hoblist, sizeof(EFI_GUID))) > From owner-svn-src-head@freebsd.org Fri Oct 14 17:23:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2A09C12286; Fri, 14 Oct 2016 17:23:28 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FFDC1B0; Fri, 14 Oct 2016 17:23:28 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [76.102.118.237] (helo=[10.0.1.5]) by id.bluezbox.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1bv6CZ-0005VE-UD; Fri, 14 Oct 2016 10:23:25 -0700 From: Oleksandr Tymoshenko Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Re: svn commit: r307257 - in head/sys: arm/broadcom/bcm2835 arm64/broadcom arm64/broadcom/bcm2837 arm64/conf conf Date: Fri, 14 Oct 2016 10:23:24 -0700 In-Reply-To: <20161014093123.606cb8f3@zapp> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Andrew Turner References: <201610140337.u9E3baB7077179@repo.freebsd.org> <20161014093123.606cb8f3@zapp> X-Mailer: Apple Mail (2.3226) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Oct 14, 2016, at 1:31 AM, Andrew Turner wrote: > > On Fri, 14 Oct 2016 03:37:36 +0000 (UTC) > Oleksandr Tymoshenko > wrote: > >> Author: gonzo >> Date: Fri Oct 14 03:37:35 2016 >> New Revision: 307257 >> URL: https://svnweb.freebsd.org/changeset/base/307257 >> >> Log: >> Add initial Raspberry Pi 3 support >> >> RPI3 kernel config builds kernel compatible with latest upstream >> device tree and firmware: >> https://github.com/raspberrypi/firmware/tree/master/boot As of today >> it's 597c662a613df1144a6bc43e5f4505d83bd748ca >> Default console is PL01x, so pi3-disable-bt dt overlay should be >> configured in config.txt and stock U-Boot should be patched to use >> proper serial port. >> Yet unsupported: SMP, VCHIQ, RNG driver. RNG requires some work due >> to upstream device tree incompatibility. >> >> Multiple people contributed to this work over time: db@, loos@, >> manu@ >> >> Added: >> head/sys/arm64/broadcom/ >> head/sys/arm64/broadcom/bcm2837/ >> head/sys/arm64/broadcom/bcm2837/files.bcm2837 (contents, props >> changed) head/sys/arm64/conf/RPI3 (contents, props changed) >> Modified: >> head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h >> head/sys/conf/options.arm64 >> >> Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h >> ============================================================================== >> --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 >> 03:32:20 2016 (r307256) +++ >> head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 >> 03:37:35 2016 (r307257) @@ -37, 7 +37, 7 @@ #define >> BCM2835_VCBUS_IO_BASE 0x7E000000 #define >> BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 >> -#ifdef SOC_BCM2836 >> +#if defined(SOC_BCM2836) || defined(SOC_BCM2837) > > You could reverse the logic here to: > #ifdef SOC_BCM2835 > <2835 macros> > #else > > #endif > >> #define BCM2835_ARM_IO_BASE 0x3f000000 >> #define BCM2835_VCBUS_SDRAM_BASE >> BCM2835_VCBUS_SDRAM_UNCACHED #else >> >> Added: [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 HTML_MESSAGE BODY: HTML included in message Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:23:28 -0000 > On Oct 14, 2016, at 1:31 AM, Andrew Turner = wrote: >=20 > On Fri, 14 Oct 2016 03:37:36 +0000 (UTC) > Oleksandr Tymoshenko > = wrote: >=20 >> Author: gonzo >> Date: Fri Oct 14 03:37:35 2016 >> New Revision: 307257 >> URL: https://svnweb.freebsd.org/changeset/base/307257 >>=20 >> Log: >> Add initial Raspberry Pi 3 support >>=20 >> RPI3 kernel config builds kernel compatible with latest upstream >> device tree and firmware: >> https://github.com/raspberrypi/firmware/tree/master/boot As of today >> it's 597c662a613df1144a6bc43e5f4505d83bd748ca=20 >> Default console is PL01x, so pi3-disable-bt dt overlay should be >> configured in config.txt and stock U-Boot should be patched to use >> proper serial port.=20 >> Yet unsupported: SMP, VCHIQ, RNG driver. RNG requires some work due >> to upstream device tree incompatibility. >>=20 >> Multiple people contributed to this work over time: db@, loos@, >> manu@ >>=20 >> Added: >> head/sys/arm64/broadcom/ >> head/sys/arm64/broadcom/bcm2837/ >> head/sys/arm64/broadcom/bcm2837/files.bcm2837 (contents, props >> changed) head/sys/arm64/conf/RPI3 (contents, props changed) >> Modified: >> head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h >> head/sys/conf/options.arm64 >>=20 >> Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 >> 03:32:20 2016 (r307256) +++ >> head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 >> 03:37:35 2016 (r307257) @@ -37,7 +37,7 @@ #define >> BCM2835_VCBUS_IO_BASE 0x7E000000 #define >> BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000=20 >> -#ifdef SOC_BCM2836 >> +#if defined(SOC_BCM2836) || defined(SOC_BCM2837) >=20 > You could reverse the logic here to: > #ifdef SOC_BCM2835 > <2835 macros> > #else > > #endif >=20 >> #define BCM2835_ARM_IO_BASE 0x3f000000 >> #define BCM2835_VCBUS_SDRAM_BASE >> BCM2835_VCBUS_SDRAM_UNCACHED #else >>=20 >> Added: head/sys/arm64/broadcom/bcm2837/files.bcm2837 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- /dev/null 00:00:00 1970 (empty, because file is >> newly added) +++ head/sys/arm64/broadcom/bcm2837/files.bcm2837 >> Fri Oct 14 03:37:35 2016 (r307257) @@ -0,0 +1,4 @@ >> +# $FreeBSD$ >> + >> +arm/broadcom/bcm2835/bcm2836.c standard > This should be in files.arm64 and enabled when the SOC_ option is set. >=20 >> +kern/kern_clocksource.c standard > This is already in files.arm64. Thanks, I will fix these.=20 >>=20 >> Added: head/sys/arm64/conf/RPI3 >=20 > Why a new kernel config and not GENERIC? I thought about it. But no SMP support yet. When we have SMP support we = can get rid of RPI3 config.=20 > ... >> Modified: head/sys/conf/options.arm64 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/conf/options.arm64 Fri Oct 14 03:32:20 >> 2016 (r307256) +++ head/sys/conf/options.arm64 Fri Oct >> 14 03:37:35 2016 (r307257) @@ -9,5 +9,6 @@ >> VFP opt_global.h=20 >> # SoC Support >> SOC_ALLWINNER_A64 opt_soc.h >> +SOC_BCM2837 opt_global.h > This should be SOC_BRCM_BCM2837 (or maybe SOC_BRCM_BCM283X) and live = in > opt_soc.h This one to match ARM SOC_XXX pattern. All SOC_ for arm reside in = opt_global, since BCM SoC files are used in ARM and ARM64 files they will need to = include two files to get options from the same category. Probably we should = convert all SOC_XXX opts to opt_soc.h for consistency, but I didn=E2=80=99t want to do this = in this change. =20= From owner-svn-src-head@freebsd.org Fri Oct 14 17:25:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC596C122FD; Fri, 14 Oct 2016 17:25:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9695C3C6; Fri, 14 Oct 2016 17:25:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EHPTRP096073; Fri, 14 Oct 2016 17:25:29 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EHPT5p096069; Fri, 14 Oct 2016 17:25:29 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201610141725.u9EHPT5p096069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 14 Oct 2016 17:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307327 - in head: sys/boot/efi/loader/arch/i386 targets/pseudo/userland/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:25:30 -0000 Author: sbruno Date: Fri Oct 14 17:25:29 2016 New Revision: 307327 URL: https://svnweb.freebsd.org/changeset/base/307327 Log: Update i386 build of loader.efi (but leave it disabled) so that we at least build it now. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D7801 Modified: head/sys/boot/efi/loader/arch/i386/efimd.c head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c head/sys/boot/efi/loader/arch/i386/exec.c head/targets/pseudo/userland/misc/Makefile.depend Modified: head/sys/boot/efi/loader/arch/i386/efimd.c ============================================================================== --- head/sys/boot/efi/loader/arch/i386/efimd.c Fri Oct 14 17:10:53 2016 (r307326) +++ head/sys/boot/efi/loader/arch/i386/efimd.c Fri Oct 14 17:25:29 2016 (r307327) @@ -48,7 +48,10 @@ static EFI_GUID hcdp_guid = HCDP_TABLE_G static UINTN mapkey; -uint64_t +int ldr_bootinfo(struct bootinfo *, uint64_t *); +int ldr_enter(const char *); + +static uint64_t ldr_alloc(vm_offset_t va) { Modified: head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c ============================================================================== --- head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c Fri Oct 14 17:10:53 2016 (r307326) +++ head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c Fri Oct 14 17:25:29 2016 (r307327) @@ -35,12 +35,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "bootstrap.h" #include "../libi386/libi386.h" #include "../btx/lib/btxv86.h" extern void __exec(caddr_t addr, ...); - +extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); +extern int ldr_enter(const char *kernel); static int elf32_exec(struct preloaded_file *amp); static int elf32_obj_exec(struct preloaded_file *amp); @@ -72,14 +76,14 @@ elf32_exec(struct preloaded_file *fp) ehdr = (Elf_Ehdr *)&(md->md_data); efi_time_fini(); - err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep, &kernend); + err = bi_load(fp->f_args, &modulep, &kernend); if (err != 0) { efi_time_init(); return(err); } entry = ehdr->e_entry & 0xffffff; - printf("Start @ 0x%lx ...\n", entry); + printf("Start @ 0x%x ...\n", entry); ldr_enter(fp->f_name); Modified: head/sys/boot/efi/loader/arch/i386/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/i386/exec.c Fri Oct 14 17:10:53 2016 (r307326) +++ head/sys/boot/efi/loader/arch/i386/exec.c Fri Oct 14 17:25:29 2016 (r307327) @@ -36,6 +36,12 @@ __FBSDID("$FreeBSD$"); uint32_t __base; struct __v86 __v86; +/* XXX - Needed a definition here to implicitly define exit(); do not remove. */ +static void +exit(int x) +{ +} + void __v86int() { Modified: head/targets/pseudo/userland/misc/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/misc/Makefile.depend Fri Oct 14 17:10:53 2016 (r307326) +++ head/targets/pseudo/userland/misc/Makefile.depend Fri Oct 14 17:25:29 2016 (r307327) @@ -77,7 +77,7 @@ DIRDEPS.amd64+= \ DIRDEPS.arm= ${_sys_boot_fdt} ${_sys_boot_efi} DIRDEPS.arm64= ${_sys_boot_fdt} ${_sys_boot_efi} -DIRDEPS.i386= ${DIRDEPS.x86sys} sys/boot/efi/libefi +DIRDEPS.i386= ${DIRDEPS.x86sys} ${_sys_boot_efi} DIRDEPS.powerpc= ${_sys_boot_fdt} sys/boot/libstand32 sys/boot/ofw sys/boot/uboot DIRDEPS.pc98= sys/boot/libstand32 DIRDEPS.sparc64= sys/boot/ofw ${_sys_boot_zfs} From owner-svn-src-head@freebsd.org Fri Oct 14 17:26:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34CA2C1238F; Fri, 14 Oct 2016 17:26:12 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1859F7E2; Fri, 14 Oct 2016 17:26:12 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp002.me.com by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OF100300S5S3V00@mr11p00im-asmtp002.me.com>; Fri, 14 Oct 2016 17:26:06 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1476465966; bh=CLnjgBpsjqQdU2QVw8G04mzbN4t4okiMwl1lQCMbup4=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=sMMjixqVnp3/srRYLs53GdTeqCyg26aff0tvZ/HpjbN3Ntt9uELqZanfTUyZKAdP2 dNptJbBhUw50V3wDhCEnR9rE41RrLGLc/3Nl5GAI2SNtVl1BQ3PO9Zw9edUDag122a M7Ice8psKM3//tCpAoJc+n6qO8wnVl0n6sqwn+Flo6SFdoDkAib6PJ7T7InEmcMe0N n5RSMBnffP1Ofr5oAnkpiUq4TpmTyGSLrJm1dGeZ3ce7rvRk2JvrjheTNjNlJhJv0s e4To3UDCf6c+3VxoB4kD3EI4UUMYSyYXAWDBpDka3KHm14R1zyoh6GHuYeDtd6VqCH s31QLmt4KWpNQ== Received: from [192.168.1.4] (c-67-188-225-23.hsd1.ca.comcast.net [67.188.225.23]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OF100DNASFGC910@mr11p00im-asmtp002.me.com>; Fri, 14 Oct 2016 17:26:06 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-14_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1610140311 User-Agent: Microsoft-MacOutlook/f.1b.0.161010 Date: Fri, 14 Oct 2016 10:26:04 -0700 Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader From: Ravi Pokala Sender: "Pokala, Ravi" To: Warner Losh , Doug Ambrisko Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-id: <1D37BB03-A7B1-443B-B628-E712202D3934@panasas.com> Thread-topic: svn commit: r307326 - head/sys/boot/efi/loader References: <201610141710.u9EHArlL089412@repo.freebsd.org> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:26:12 -0000 -----Original Message----- > From: on behalf of Warner Losh > Date: 2016-10-14, Friday at 10:16 > To: Doug Ambrisko > Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader > > Love the functionality, Ditto! Thank you Doug! :-) > but don't like using the 'hint' namespace for > this. Can we change it now before too many things depend on it? We had > similar issues in ACPI and moved it to the 'acpi' space. Can we move > this to the 'smbios' space please? > > The reason is that 'hint' is special and sometimes filtered out, so it > is a poor choice to export data from the boot loader to the kernel. Loader already exports a bunch of stuff as "smbios.*" kenv variables. So perhaps "smbios.addr" or somesuch? Thanks, Ravi (rpokala@) > Warner > > On Fri, Oct 14, 2016 at 11:10 AM, Doug Ambrisko wrote: >> Author: ambrisko >> Date: Fri Oct 14 17:10:53 2016 >> New Revision: 307326 >> URL: https://svnweb.freebsd.org/changeset/base/307326 >> >> Log: >> In UEFI mode expose the SMBIOS anchor base address via kenv so the kernel >> etc. can find out where the SMBIOS entry point is located. In pure >> UEFI mode the BIOS is not mapped into the standard address space so the >> SMBIOS table might not appear between 0xf0000 and 0xfffff. The >> UEFI environment can report this the location of the anchor. If it is >> reported then expose it as hint.smbios.0.mem. This can then be used >> by other tools. However, we should make smbios(4) useful and have it >> take this value and provide accesor function so ipmi(4) etc. don't >> have to parse and figure things about the SMBIOS table. I have some >> simple patches to smbios(4) to expose this address as sysctl and >> for ipmi(4) to get the base address. However, the real fix is to >> have ipmi(4) ask smbios(4) for what it wants and have smbios(4) >> parse it out and return it. This would make smbios(4) useful and reduce >> duplicated code. If this address doesn't point to the anchor then >> finding SMBIOS info. will fail as if this didn't exist. So there should >> be no harm. >> >> With this change and the following hack, dmidecode works on a bunch of >> UEFI machines that I tested: >> >> if kenv hint.smbios.0.mem > /dev/null >> then >> mkdir -p /sys/firmware/efi >> mount -t tmpfs -o size=8k tmpfs /sys/firmware/efi >> echo "SMBIOS=`kenv hint.smbios.0.mem`" > /sys/firmware/efi/systab >> fi >> >> Linux exposes this information via the /sys/firmware/efi/systab file which >> dmidecode looks at. We should update dmidecode to do this the FreeBSD >> way when we determine what that is! >> >> Reviewed by: jhb >> >> Modified: >> head/sys/boot/efi/loader/main.c >> >> Modified: head/sys/boot/efi/loader/main.c >> ============================================================================== >> --- head/sys/boot/efi/loader/main.c Fri Oct 14 17:04:07 2016 (r307325) >> +++ head/sys/boot/efi/loader/main.c Fri Oct 14 17:10:53 2016 (r307326) >> @@ -235,6 +235,7 @@ main(int argc, CHAR16 *argv[]) >> uint64_t pool_guid; >> UINTN k; >> int has_kbd; >> + char buf[40]; >> >> archsw.arch_autoload = efi_autoload; >> archsw.arch_getdev = efi_getdev; >> @@ -447,6 +448,9 @@ main(int argc, CHAR16 *argv[]) >> for (k = 0; k < ST->NumberOfTableEntries; k++) { >> guid = &ST->ConfigurationTable[k].VendorGuid; >> if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { >> + snprintf(buf, sizeof(buf), "%p", >> + ST->ConfigurationTable[k].VendorTable); >> + setenv("hint.smbios.0.mem", buf, 1); >> smbios_detect(ST->ConfigurationTable[k].VendorTable); >> break; >> } >> @@ -603,7 +607,8 @@ command_configuration(int argc, char *ar >> else if (!memcmp(guid, &acpi20, sizeof(EFI_GUID))) >> printf("ACPI 2.0 Table"); >> else if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) >> - printf("SMBIOS Table"); >> + printf("SMBIOS Table %p", >> + ST->ConfigurationTable[i].VendorTable); >> else if (!memcmp(guid, &dxe, sizeof(EFI_GUID))) >> printf("DXE Table"); >> else if (!memcmp(guid, &hoblist, sizeof(EFI_GUID))) >> From owner-svn-src-head@freebsd.org Fri Oct 14 17:26:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEB7CC123DF; Fri, 14 Oct 2016 17:26:43 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A43C3952; Fri, 14 Oct 2016 17:26:43 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [76.102.118.237] (helo=[10.0.1.5]) by id.bluezbox.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1bv6Fk-0005Vp-PK; Fri, 14 Oct 2016 10:26:41 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Re: svn commit: r307252 - head/sys/arm/broadcom/bcm2835 From: Oleksandr Tymoshenko In-Reply-To: <20161014093726.197f8e05@zapp> Date: Fri, 14 Oct 2016 10:26:41 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201610140300.u9E30r1O061196@repo.freebsd.org> <20161014093726.197f8e05@zapp> To: Andrew Turner X-Mailer: Apple Mail (2.3226) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Oct 14, 2016, at 1:37 AM, Andrew Turner wrote: > > On Fri, 14 Oct 2016 03:00:53 +0000 (UTC) > Oleksandr Tymoshenko wrote: > >> Author: gonzo >> Date: Fri Oct 14 03:00:53 2016 >> New Revision: 307252 >> URL: https://svnweb.freebsd.org/changeset/base/307252 >> >> Log: >> Make bcm2835_machdep.c optional >> >> bcm2835_machdep.c contains only bits enabled by "options PLATFORM", >> this option available only on ARM, not ARM64 >> >> Modified: >> head/sys/arm/broadcom/bcm2835/files.bcm283x >> >> Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x >> ============================================================================== >> --- head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 02:58:31 2016 (r307251) >> +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 03:00:53 2016 (r307252) >> @@ -9,7 +9,7 @@ arm/broadcom/bcm2835/bcm2835_fbd.c opti >> arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 >> arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio >> arm/broadcom/bcm2835/bcm2835_intr.c standard >> -arm/broadcom/bcm2835/bcm2835_machdep.c standard >> +arm/broadcom/bcm2835/bcm2835_machdep.c optional platform >> arm/broadcom/bcm2835/bcm2835_mbox.c standard >> arm/broadcom/bcm2835/bcm2835_rng.c optional random >> arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci >> > > Any of these files you need should be added to files.arm64 being > optional on the appropriate soc_ value. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 14 Oct 2016 17:26:43 -0000 > On Oct 14, 2016, at 1:37 AM, Andrew Turner = wrote: >=20 > On Fri, 14 Oct 2016 03:00:53 +0000 (UTC) > Oleksandr Tymoshenko wrote: >=20 >> Author: gonzo >> Date: Fri Oct 14 03:00:53 2016 >> New Revision: 307252 >> URL: https://svnweb.freebsd.org/changeset/base/307252 >>=20 >> Log: >> Make bcm2835_machdep.c optional >>=20 >> bcm2835_machdep.c contains only bits enabled by "options PLATFORM", >> this option available only on ARM, not ARM64 >>=20 >> Modified: >> head/sys/arm/broadcom/bcm2835/files.bcm283x >>=20 >> Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 = 02:58:31 2016 (r307251) >> +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Fri Oct 14 = 03:00:53 2016 (r307252) >> @@ -9,7 +9,7 @@ arm/broadcom/bcm2835/bcm2835_fbd.c opti >> arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev = bcm2835_ft5406 >> arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio >> arm/broadcom/bcm2835/bcm2835_intr.c standard >> -arm/broadcom/bcm2835/bcm2835_machdep.c standard >> +arm/broadcom/bcm2835/bcm2835_machdep.c optional = platform >> arm/broadcom/bcm2835/bcm2835_mbox.c standard >> arm/broadcom/bcm2835/bcm2835_rng.c optional random >> arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci >>=20 >=20 > Any of these files you need should be added to files.arm64 being > optional on the appropriate soc_ value. I don=E2=80=99t quite follow. These files are shared between ARM and = ARM64 port, does that mean they should be in both files.arm64 and files.arm? Or in files.arm64 and files.bcm283x? From owner-svn-src-head@freebsd.org Fri Oct 14 17:27:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBB4EC12430; Fri, 14 Oct 2016 17:27:11 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id AA6EBAC7; Fri, 14 Oct 2016 17:27:11 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 14 Oct 2016 10:40:04 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.15.2/8.14.4) with ESMTP id u9EHR5eT066494; Fri, 14 Oct 2016 10:27:05 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.15.2/8.14.4/Submit) id u9EHR5sL066493; Fri, 14 Oct 2016 10:27:05 -0700 (PDT) (envelope-from ambrisko) Date: Fri, 14 Oct 2016 10:27:05 -0700 From: Doug Ambrisko To: Warner Losh Cc: Doug Ambrisko , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader Message-ID: <20161014172705.GA65545@ambrisko.com> References: <201610141710.u9EHArlL089412@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:27:11 -0000 On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: | Love the functionality, but don't like using the 'hint' namespace for | this. Can we change it now before too many things depend on it? We had | similar issues in ACPI and moved it to the 'acpi' space. Can we move | this to the 'smbios' space please? | | The reason is that 'hint' is special and sometimes filtered out, so it | is a poor choice to export data from the boot loader to the kernel. The reason I picked hint was it could be put /boot/device.hints to make it work as well and that it was a hint. Other standards in the future might use other methods. Looking back over the email I had with John he had suggested hint.smbios.0.anchor to make this look different. This code had been hanging around for so long I forgot about that and we were using hint.smbios.0.mem in our shipping code base. However, I hope that nothing would use this except for smbios(4) and for people to make smbios(4) useful for this info. Thanks, Doug A. | On Fri, Oct 14, 2016 at 11:10 AM, Doug Ambrisko wrote: | > Author: ambrisko | > Date: Fri Oct 14 17:10:53 2016 | > New Revision: 307326 | > URL: https://svnweb.freebsd.org/changeset/base/307326 | > | > Log: | > In UEFI mode expose the SMBIOS anchor base address via kenv so the kernel | > etc. can find out where the SMBIOS entry point is located. In pure | > UEFI mode the BIOS is not mapped into the standard address space so the | > SMBIOS table might not appear between 0xf0000 and 0xfffff. The | > UEFI environment can report this the location of the anchor. If it is | > reported then expose it as hint.smbios.0.mem. This can then be used | > by other tools. However, we should make smbios(4) useful and have it | > take this value and provide accesor function so ipmi(4) etc. don't | > have to parse and figure things about the SMBIOS table. I have some | > simple patches to smbios(4) to expose this address as sysctl and | > for ipmi(4) to get the base address. However, the real fix is to | > have ipmi(4) ask smbios(4) for what it wants and have smbios(4) | > parse it out and return it. This would make smbios(4) useful and reduce | > duplicated code. If this address doesn't point to the anchor then | > finding SMBIOS info. will fail as if this didn't exist. So there should | > be no harm. | > | > With this change and the following hack, dmidecode works on a bunch of | > UEFI machines that I tested: | > | > if kenv hint.smbios.0.mem > /dev/null | > then | > mkdir -p /sys/firmware/efi | > mount -t tmpfs -o size=8k tmpfs /sys/firmware/efi | > echo "SMBIOS=`kenv hint.smbios.0.mem`" > /sys/firmware/efi/systab | > fi | > | > Linux exposes this information via the /sys/firmware/efi/systab file which | > dmidecode looks at. We should update dmidecode to do this the FreeBSD | > way when we determine what that is! | > | > Reviewed by: jhb | > | > Modified: | > head/sys/boot/efi/loader/main.c | > | > Modified: head/sys/boot/efi/loader/main.c | > ============================================================================== | > --- head/sys/boot/efi/loader/main.c Fri Oct 14 17:04:07 2016 (r307325) | > +++ head/sys/boot/efi/loader/main.c Fri Oct 14 17:10:53 2016 (r307326) | > @@ -235,6 +235,7 @@ main(int argc, CHAR16 *argv[]) | > uint64_t pool_guid; | > UINTN k; | > int has_kbd; | > + char buf[40]; | > | > archsw.arch_autoload = efi_autoload; | > archsw.arch_getdev = efi_getdev; | > @@ -447,6 +448,9 @@ main(int argc, CHAR16 *argv[]) | > for (k = 0; k < ST->NumberOfTableEntries; k++) { | > guid = &ST->ConfigurationTable[k].VendorGuid; | > if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { | > + snprintf(buf, sizeof(buf), "%p", | > + ST->ConfigurationTable[k].VendorTable); | > + setenv("hint.smbios.0.mem", buf, 1); | > smbios_detect(ST->ConfigurationTable[k].VendorTable); | > break; | > } | > @@ -603,7 +607,8 @@ command_configuration(int argc, char *ar | > else if (!memcmp(guid, &acpi20, sizeof(EFI_GUID))) | > printf("ACPI 2.0 Table"); | > else if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) | > - printf("SMBIOS Table"); | > + printf("SMBIOS Table %p", | > + ST->ConfigurationTable[i].VendorTable); | > else if (!memcmp(guid, &dxe, sizeof(EFI_GUID))) | > printf("DXE Table"); | > else if (!memcmp(guid, &hoblist, sizeof(EFI_GUID))) | > From owner-svn-src-head@freebsd.org Fri Oct 14 17:33:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD927C1263C; Fri, 14 Oct 2016 17:33:33 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0268EDF; Fri, 14 Oct 2016 17:33:33 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OF100G00SACXS00@mr11p00im-asmtp004.me.com>; Fri, 14 Oct 2016 17:33:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1476466397; bh=zvPoYPQq03zjqodIMcPo2HdMU/Juo2b/Cju/W+4Sqdk=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=qYoARebOuSTQ3uZdaNPXAAO2vd4EzsG2AqZDPZ/ANbrUA1pesaRid5rs1xGjfdUZI vZ/4VDjD/koyLWc3Avgh+N0cjjwuxrkEobcvF2rMegLBUf1I8YdQEDInABVkyov+BH 3nQkXZJYx44y5O4Ecg2i+Ot/o4NkMeHt1huUt3Ta9xWS1oDE4xxnxv9nLi1fMiz+fg gTDxCMbeqBrE40WDsMNyY0q7dSI1smYCERZ4Yu90QgCDWLXKPbhXruL4vQ5q7c6ghF Kh202gJUduQJbMRw4dtq4zc9kqFUoYzm3Gu8j7fmVR8Zw97aAyM8hju0hETuBdIvTl jQFgNTThcLq+A== Received: from [192.168.1.4] (c-67-188-225-23.hsd1.ca.comcast.net [67.188.225.23]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OF1004J0SRGC920@mr11p00im-asmtp004.me.com>; Fri, 14 Oct 2016 17:33:17 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-14_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1610140313 User-Agent: Microsoft-MacOutlook/f.1b.0.161010 Date: Fri, 14 Oct 2016 10:33:15 -0700 Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader From: Ravi Pokala Sender: "Pokala, Ravi" To: Doug Ambrisko , Warner Losh Cc: Doug Ambrisko , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-id: <3FF8A9D8-0C8A-4033-A7FC-8B64E9AB025F@panasas.com> Thread-topic: svn commit: r307326 - head/sys/boot/efi/loader References: <201610141710.u9EHArlL089412@repo.freebsd.org> <20161014172705.GA65545@ambrisko.com> In-reply-to: <20161014172705.GA65545@ambrisko.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:33:34 -0000 -----Original Message----- > From: on behalf of Doug Ambrisko > Date: 2016-10-14, Friday at 10:27 > To: Warner Losh > Cc: Doug Ambrisko , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader > > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: > | Love the functionality, but don't like using the 'hint' namespace for > | this. Can we change it now before too many things depend on it? We had > | similar issues in ACPI and moved it to the 'acpi' space. Can we move > | this to the 'smbios' space please? > | > | The reason is that 'hint' is special and sometimes filtered out, so it > | is a poor choice to export data from the boot loader to the kernel. > > The reason I picked hint was it could be put /boot/device.hints > to make it work as well and that it was a hint. Other standards in the > future might use other methods. Looking back over the email I had > with John he had suggested hint.smbios.0.anchor to make this look > different. This code had been hanging around for so long I forgot > about that and we were using hint.smbios.0.mem in our shipping code base. > > However, I hope that nothing would use this except for smbios(4) and > for people to make smbios(4) useful for this info. Doug's looking at me when he says that. :-) We talked about this last night at BAFUG; right now, even if smbios(4) is able to find the SMBIOS info -- it currently only looks at the aforementioned 0xf0000 - 0xfffff range, so it can't find it on UEFI -- smbios(4) doesn't actually provide any interface for that information. Doug and I have talked about making smbios(4) useful, by parsing the data and providing KPIs and APIs, for years now; I think I'll *finally* have the time and motivation to do so "soon". -Ravi (rpokala@) > Thanks, > > Doug A. From owner-svn-src-head@freebsd.org Fri Oct 14 17:40:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71538C127E2; Fri, 14 Oct 2016 17:40:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4320912A9; Fri, 14 Oct 2016 17:40:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EHemo6002882; Fri, 14 Oct 2016 17:40:48 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EHemIk002881; Fri, 14 Oct 2016 17:40:48 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610141740.u9EHemIk002881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 14 Oct 2016 17:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307328 - head/sys/arm64/broadcom/bcm2837 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:40:49 -0000 Author: gonzo Date: Fri Oct 14 17:40:48 2016 New Revision: 307328 URL: https://svnweb.freebsd.org/changeset/base/307328 Log: Remove redundant kern_clocksource.c. It is already in conf/files.arm64 Reported by: andrew Modified: head/sys/arm64/broadcom/bcm2837/files.bcm2837 Modified: head/sys/arm64/broadcom/bcm2837/files.bcm2837 ============================================================================== --- head/sys/arm64/broadcom/bcm2837/files.bcm2837 Fri Oct 14 17:25:29 2016 (r307327) +++ head/sys/arm64/broadcom/bcm2837/files.bcm2837 Fri Oct 14 17:40:48 2016 (r307328) @@ -1,4 +1,3 @@ # $FreeBSD$ arm/broadcom/bcm2835/bcm2836.c standard -kern/kern_clocksource.c standard From owner-svn-src-head@freebsd.org Fri Oct 14 17:55:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DC51C12BE4; Fri, 14 Oct 2016 17:55:43 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id 4041A1D21; Fri, 14 Oct 2016 17:55:43 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 14 Oct 2016 11:08:42 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.15.2/8.14.4) with ESMTP id u9EHtgG4069054; Fri, 14 Oct 2016 10:55:42 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.15.2/8.14.4/Submit) id u9EHtgtb069053; Fri, 14 Oct 2016 10:55:42 -0700 (PDT) (envelope-from ambrisko) Date: Fri, 14 Oct 2016 10:55:42 -0700 From: Doug Ambrisko To: Ravi Pokala Cc: Warner Losh , Doug Ambrisko , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader Message-ID: <20161014175542.GB65545@ambrisko.com> References: <201610141710.u9EHArlL089412@repo.freebsd.org> <20161014172705.GA65545@ambrisko.com> <3FF8A9D8-0C8A-4033-A7FC-8B64E9AB025F@panasas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FF8A9D8-0C8A-4033-A7FC-8B64E9AB025F@panasas.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 17:55:43 -0000 On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote: | -----Original Message----- | > From: on behalf of Doug Ambrisko | > Date: 2016-10-14, Friday at 10:27 | > To: Warner Losh | > Cc: Doug Ambrisko , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader | > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: | > | Love the functionality, but don't like using the 'hint' namespace for | > | this. Can we change it now before too many things depend on it? We had | > | similar issues in ACPI and moved it to the 'acpi' space. Can we move | > | this to the 'smbios' space please? | > | | > | The reason is that 'hint' is special and sometimes filtered out, so it | > | is a poor choice to export data from the boot loader to the kernel. | > | > The reason I picked hint was it could be put /boot/device.hints | > to make it work as well and that it was a hint. Other standards in the | > future might use other methods. Looking back over the email I had | > with John he had suggested hint.smbios.0.anchor to make this look | > different. This code had been hanging around for so long I forgot | > about that and we were using hint.smbios.0.mem in our shipping code base. | > | > However, I hope that nothing would use this except for smbios(4) and | > for people to make smbios(4) useful for this info. | | Doug's looking at me when he says that. :-) | | We talked about this last night at BAFUG; right now, even if smbios(4) | is able to find the SMBIOS info -- it currently only looks at the | aforementioned 0xf0000 - 0xfffff range, so it can't find it on UEFI -- | smbios(4) doesn't actually provide any interface for that information. | Doug and I have talked about making smbios(4) useful, by parsing the | data and providing KPIs and APIs, for years now; I think I'll *finally* | have the time and motivation to do so "soon". I've actually talked to a few people. However, your the first to step up. This needs to be designed and will take some time and review. I would hope that except for smbios(4), nothing else would use this kenv but there is nothing to prevent that :-( I could name it super_secret_dont_use. BTW, to get you started this patch prevents smbios(4) from blowing chunks when it gets a anchor in high memory and works on legacy machines. --- /sys/x86/bios/smbios.c 2013-10-01 14:28:25.000000000 -0700 +++ ./smbios.c 2016-04-11 11:58:03.234969000 -0700 @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8 #include #include #include +#include #include #include @@ -59,7 +60,7 @@ struct smbios_softc { }; #define RES2EPS(res) ((struct smbios_eps *)rman_get_virtual(res)) -#define ADDR2EPS(addr) ((struct smbios_eps *)BIOS_PADDRTOVADDR(addr)) +#define ADDR2EPS(addr) ((struct smbios_eps *)PHYS_TO_DMAP(addr)) static devclass_t smbios_devclass; @@ -71,19 +72,26 @@ static int smbios_modevent (module_t, in static int smbios_cksum (struct smbios_eps *); +static unsigned long addr; +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0, + "SMBIOS driver parameters"); +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW, + &addr, 0, ""); + static void smbios_identify (driver_t *driver, device_t parent) { device_t child; - u_int32_t addr; int length; int rid; if (!device_is_alive(parent)) return; - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, - SMBIOS_STEP, SMBIOS_OFF); + if (resource_long_value("smbios", 0, "mem", &addr) != 0 || + addr == 0) + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, + SMBIOS_STEP, SMBIOS_OFF); if (addr != 0) { rid = 0; length = ADDR2EPS(addr)->length; Note I don't plan to commit this since it doesn't really do much and we need a lot more. Thanks, Doug A. From owner-svn-src-head@freebsd.org Fri Oct 14 18:25:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22B8FC1216F for ; Fri, 14 Oct 2016 18:25:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB4A9D81 for ; Fri, 14 Oct 2016 18:25:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id i202so129306687ioi.2 for ; Fri, 14 Oct 2016 11:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GZTgEuTVhz29Xz4tjYWUnaBXd62F5LPZdmqJUFRB7oM=; b=DORQZd1zek3nKszWWMWVfuD2sQrT9vgCcSySLsRtto4OJZbuO+50HiV/FLMb0Ec72C mAZfAdleP4lVuZA29kOA/VSDrp4Y91iY8pRZj0l2TiczinuP3kLraxQiftapHhYubMf9 CdG920SaIsa0v6rjkvjpA2J2AVaIurgCIz8X0GrgbvI67yrATCA3FUcJfDCjfeF9ik/L dJBUYY/DB0iPRQX0x/W2sWOV1m8J0z8jCepLR8/2YiMZXWJz3qD9lXeCouSFxeX9UtT+ xfaM3HLKQJyyODkEA12I4QE6eqiBd/s3GKAwebDYmyIVCC/2GjYSiZxSKY72chDX1Uhu MdKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GZTgEuTVhz29Xz4tjYWUnaBXd62F5LPZdmqJUFRB7oM=; b=VUHCWW7aNfxDT468XmyLxyzU5s+yP6vtWxXe70Mh4bE4AqgJg2VSO8CTm9klyEywi0 e8jVVtFOWzI91uYjjuLX/MaaUOV0L8lFE0UljzNpi/ZZAa2e8kkPpjf0R0gg8sjgSoA6 NNaSlZU3KSEWiV6cqNhgHPOAcrAb0ABFfi69FJOebOtnL9iNVLU5uzz1dnRBkyc+nuVo +9ufOtT+/mrsQT/At+Quxal7JJFd+H+E9aSX698slYvnBjO7zFuNmeMiEMvC+ZdNWaWL AHmYkHofbj/wMgNduhCqVfGXHgUr9P03b6c2xbJbZZwNztfzPxtnpEXOqBK8du4kUaDA k9Ww== X-Gm-Message-State: AA6/9RkPIsjnRKh2VhFAtREWEjNpCVTwDoOCqPiGGm7S+LTv22jBm8REFsNhPPSs+de4G2X6R7Lq60f6uh8UBw== X-Received: by 10.107.139.79 with SMTP id n76mr14626164iod.166.1476469555278; Fri, 14 Oct 2016 11:25:55 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Fri, 14 Oct 2016 11:25:54 -0700 (PDT) X-Originating-IP: [2607:fb90:6c81:f6a1:0:22:e381:4d01] Received: by 10.79.77.85 with HTTP; Fri, 14 Oct 2016 11:25:54 -0700 (PDT) In-Reply-To: <20161014175542.GB65545@ambrisko.com> References: <201610141710.u9EHArlL089412@repo.freebsd.org> <20161014172705.GA65545@ambrisko.com> <3FF8A9D8-0C8A-4033-A7FC-8B64E9AB025F@panasas.com> <20161014175542.GB65545@ambrisko.com> From: Warner Losh Date: Fri, 14 Oct 2016 12:25:54 -0600 X-Google-Sender-Auth: V9n-d-WeNwgst20it5x-x-KCAy4 Message-ID: Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader To: Doug Ambrisko Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Doug Ambrisko , Ravi Pokala Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 18:25:56 -0000 On Oct 14, 2016 11:55 AM, "Doug Ambrisko" wrote: > > On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote: > | -----Original Message----- > | > From: on behalf of Doug Ambrisko < ambrisko@ambrisko.com> > | > Date: 2016-10-14, Friday at 10:27 > | > To: Warner Losh > | > Cc: Doug Ambrisko , src-committers < src-committers@freebsd.org>, "svn-src-all@freebsd.org" < svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" < svn-src-head@freebsd.org> > | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader > | > > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: > | > | Love the functionality, but don't like using the 'hint' namespace for > | > | this. Can we change it now before too many things depend on it? We had > | > | similar issues in ACPI and moved it to the 'acpi' space. Can we move > | > | this to the 'smbios' space please? > | > | > | > | The reason is that 'hint' is special and sometimes filtered out, so it > | > | is a poor choice to export data from the boot loader to the kernel. > | > > | > The reason I picked hint was it could be put /boot/device.hints > | > to make it work as well and that it was a hint. Other standards in the > | > future might use other methods. Looking back over the email I had > | > with John he had suggested hint.smbios.0.anchor to make this look > | > different. This code had been hanging around for so long I forgot > | > about that and we were using hint.smbios.0.mem in our shipping code base. > | > > | > However, I hope that nothing would use this except for smbios(4) and > | > for people to make smbios(4) useful for this info. > | > | Doug's looking at me when he says that. :-) > | > | We talked about this last night at BAFUG; right now, even if smbios(4) > | is able to find the SMBIOS info -- it currently only looks at the > | aforementioned 0xf0000 - 0xfffff range, so it can't find it on UEFI -- > | smbios(4) doesn't actually provide any interface for that information. > | Doug and I have talked about making smbios(4) useful, by parsing the > | data and providing KPIs and APIs, for years now; I think I'll *finally* > | have the time and motivation to do so "soon". > > I've actually talked to a few people. However, your the first to > step up. This needs to be designed and will take some time and > review. I would hope that except for smbios(4), nothing else would > use this kenv but there is nothing to prevent that :-( I could name > it super_secret_dont_use. > > BTW, to get you started this patch prevents smbios(4) from blowing chunks > when it gets a anchor in high memory and works on legacy machines. > > --- /sys/x86/bios/smbios.c 2013-10-01 14:28:25.000000000 -0700 > +++ ./smbios.c 2016-04-11 11:58:03.234969000 -0700 > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8 > #include > #include > #include > +#include > > #include > #include > @@ -59,7 +60,7 @@ struct smbios_softc { > }; > > #define RES2EPS(res) ((struct smbios_eps *)rman_get_virtual(res)) > -#define ADDR2EPS(addr) ((struct smbios_eps *)BIOS_PADDRTOVADDR(addr)) > +#define ADDR2EPS(addr) ((struct smbios_eps *)PHYS_TO_DMAP(addr)) > > static devclass_t smbios_devclass; > > @@ -71,19 +72,26 @@ static int smbios_modevent (module_t, in > > static int smbios_cksum (struct smbios_eps *); > > +static unsigned long addr; > +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0, > + "SMBIOS driver parameters"); > +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW, > + &addr, 0, ""); > + > static void > smbios_identify (driver_t *driver, device_t parent) > { > device_t child; > - u_int32_t addr; > int length; > int rid; > > if (!device_is_alive(parent)) > return; > > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, > - SMBIOS_STEP, SMBIOS_OFF); > + if (resource_long_value("smbios", 0, "mem", &addr) != 0 || > + addr == 0) > + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, > + SMBIOS_STEP, SMBIOS_OFF); > if (addr != 0) { > rid = 0; > length = ADDR2EPS(addr)->length; > > Note I don't plan to commit this since it doesn't really do much and we > need a lot more. I was planning on exporting all smbios stuff via sysctl. You can still put non hints.* in device.hints too. I can rework things a bit to be more complete is you like... Warner From owner-svn-src-head@freebsd.org Fri Oct 14 18:43:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B17FC12620; Fri, 14 Oct 2016 18:43:47 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id 69FBFCE3; Fri, 14 Oct 2016 18:43:47 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 14 Oct 2016 11:56:45 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.15.2/8.14.4) with ESMTP id u9EIhkF4073231; Fri, 14 Oct 2016 11:43:46 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.15.2/8.14.4/Submit) id u9EIhktm073230; Fri, 14 Oct 2016 11:43:46 -0700 (PDT) (envelope-from ambrisko) Date: Fri, 14 Oct 2016 11:43:46 -0700 From: Doug Ambrisko To: Warner Losh Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Doug Ambrisko , Ravi Pokala Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader Message-ID: <20161014184346.GA71804@ambrisko.com> References: <201610141710.u9EHArlL089412@repo.freebsd.org> <20161014172705.GA65545@ambrisko.com> <3FF8A9D8-0C8A-4033-A7FC-8B64E9AB025F@panasas.com> <20161014175542.GB65545@ambrisko.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 18:43:47 -0000 On Fri, Oct 14, 2016 at 12:25:54PM -0600, Warner Losh wrote: | On Oct 14, 2016 11:55 AM, "Doug Ambrisko" <[1]ambrisko@ambrisko.com> | wrote: | > | > On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote: | > | -----Original Message----- | > | > From: <[2]owner-src-committers@freebsd.org> on behalf of Doug | Ambrisko <[3]ambrisko@ambrisko.com> | > | > Date: 2016-10-14, Friday at 10:27 | > | > To: Warner Losh <[4]imp@bsdimp.com> | > | > Cc: Doug Ambrisko <[5]ambrisko@freebsd.org>, src-committers | <[6]src-committers@freebsd.org>, "[7]svn-src-all@freebsd.org" | <[8]svn-src-all@freebsd.org>, "[9]svn-src-head@freebsd.org" | <[10]svn-src-head@freebsd.org> | > | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader | > | > | > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: | > | > | Love the functionality, but don't like using the 'hint' | namespace for | > | > | this. Can we change it now before too many things depend on it? | We had | > | > | similar issues in ACPI and moved it to the 'acpi' space. Can we | move | > | > | this to the 'smbios' space please? | > | > | | > | > | The reason is that 'hint' is special and sometimes filtered | out, so it | > | > | is a poor choice to export data from the boot loader to the | kernel. | > | > | > | > The reason I picked hint was it could be put /boot/device.hints | > | > to make it work as well and that it was a hint. Other standards | in the | > | > future might use other methods. Looking back over the email I | had | > | > with John he had suggested hint.smbios.0.anchor to make this look | > | > different. This code had been hanging around for so long I | forgot | > | > about that and we were using hint.smbios.0.mem in our shipping | code base. | > | > | > | > However, I hope that nothing would use this except for smbios(4) | and | > | > for people to make smbios(4) useful for this info. | > | | > | Doug's looking at me when he says that. :-) | > | | > | We talked about this last night at BAFUG; right now, even if | smbios(4) | > | is able to find the SMBIOS info -- it currently only looks at the | > | aforementioned 0xf0000 - 0xfffff range, so it can't find it on UEFI | -- | > | smbios(4) doesn't actually provide any interface for that | information. | > | Doug and I have talked about making smbios(4) useful, by parsing | the | > | data and providing KPIs and APIs, for years now; I think I'll | *finally* | > | have the time and motivation to do so "soon". | > | > I've actually talked to a few people. However, your the first to | > step up. This needs to be designed and will take some time and | > review. I would hope that except for smbios(4), nothing else would | > use this kenv but there is nothing to prevent that :-( I could name | > it super_secret_dont_use. | > | > BTW, to get you started this patch prevents smbios(4) from blowing | chunks | > when it gets a anchor in high memory and works on legacy machines. | > | > --- /sys/x86/bios/smbios.c 2013-10-01 14:28:25.000000000 -0700 | > +++ ./smbios.c 2016-04-11 11:58:03.234969000 -0700 | > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8 | > #include | > #include | > #include | > +#include | > | > #include | > #include | > @@ -59,7 +60,7 @@ struct smbios_softc { | > }; | > | > #define RES2EPS(res) ((struct smbios_eps | *)rman_get_virtual(res)) | > -#define ADDR2EPS(addr) ((struct smbios_eps | *)BIOS_PADDRTOVADDR(addr)) | > +#define ADDR2EPS(addr) ((struct smbios_eps | *)PHYS_TO_DMAP(addr)) | > | > static devclass_t smbios_devclass; | > | > @@ -71,19 +72,26 @@ static int smbios_modevent (module_t, in | > | > static int smbios_cksum (struct smbios_eps *); | > | > +static unsigned long addr; | > +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0, | > + "SMBIOS driver parameters"); | > +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW, | > + &addr, 0, ""); | > + | > static void | > smbios_identify (driver_t *driver, device_t parent) | > { | > device_t child; | > - u_int32_t addr; | > int length; | > int rid; | > | > if (!device_is_alive(parent)) | > return; | > | > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, | > - SMBIOS_STEP, SMBIOS_OFF); | > + if (resource_long_value("smbios", 0, "mem", &addr) != 0 || | > + addr == 0) | > + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, | SMBIOS_LEN, | > + SMBIOS_STEP, SMBIOS_OFF); | > if (addr != 0) { | > rid = 0; | > length = ADDR2EPS(addr)->length; | > | > Note I don't plan to commit this since it doesn't really do much and | we | > need a lot more. | | I was planning on exporting all smbios stuff via sysctl. | | You can still put non hints.* in device.hints too. I wondered about that. It would look a bit strange. | I can rework things a bit to be more complete is you like... That would be great. A few people have expressed need of this from a kernel level. Adrian mentioned it for NUMA, ipmi(4) needs it, it could be used on Dell machines to fix HW layout issues for NICs. A couple companies could use it for internal needs. Anything to move this forward would help. I don't mind running dmidecode etc. but not needing that would be nice. Thanks, Doug A. From owner-svn-src-head@freebsd.org Fri Oct 14 18:55:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EA5BC12A22; Fri, 14 Oct 2016 18:55:46 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F5238A1; Fri, 14 Oct 2016 18:55:45 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:7b8:3a7::11ea:67ab:fdec:9446] (unknown [IPv6:2001:7b8:3a7:0:11ea:67ab:fdec:9446]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3229E314C5; Fri, 14 Oct 2016 20:55:36 +0200 (CEST) Subject: Re: svn commit: r307231 - head/lib/libgcc_s Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_39A3A199-5ACE-4C30-A9A6-089782D8B7E8"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6.1 From: Dimitry Andric In-Reply-To: Date: Fri, 14 Oct 2016 20:55:30 +0200 Cc: Bruce Evans , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201610131918.u9DJI0bX085695@repo.freebsd.org> <20161014113603.F1039@besplex.bde.org> To: Ed Maste X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 18:55:46 -0000 --Apple-Mail=_39A3A199-5ACE-4C30-A9A6-089782D8B7E8 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 14 Oct 2016, at 04:06, Ed Maste wrote: > > Hi Bruce, thank you for the detailed response. > > On 14 October 2016 at 01:53, Bruce Evans wrote: >>> compiler-rt's complex division support routines contain calls to >>> compiler builtins such as `__builtin_scalbnl`. Unfortunately Clang >>> turns these back into a call to `scalbnl`. >> >> gcc-4.2 has the same bug. > > Oh, interesting. Do you know off hand if it's resolved in later GCC? Not for x86, in any case (I think I talked about this with you on IRC before). For example, using the latest gcc 7.0.0 20160911 on this program: float f1(float x, int n) { return __builtin_scalbnf(x, n); } double f2(double x, int n) { return __builtin_scalbn(x, n); } long double f3(long double x, long n) { return __builtin_scalbnl(x, n); } gives this assembly: .p2align 4,,15 .globl f1 .type f1, @function f1: .LFB0: .cfi_startproc jmp scalbnf .cfi_endproc .LFE0: .size f1, .-f1 .p2align 4,,15 .globl f2 .type f2, @function f2: .LFB1: .cfi_startproc jmp scalbn .cfi_endproc .LFE1: .size f2, .-f2 .p2align 4,,15 .globl f3 .type f3, @function f3: .LFB2: .cfi_startproc jmp scalbnl .cfi_endproc .LFE2: .size f3, .-f3 E.g., it looks like the __builtin_scalbn functions were always a red herring. :-) > It seems particularly unfortunate for the compiler to report (by > whatever mechanism) that a builtin exists, and then just turn that > builtin into a library call. Yes, at best this is misleading. -Dimitry --Apple-Mail=_39A3A199-5ACE-4C30-A9A6-089782D8B7E8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlgBKicACgkQsF6jCi4glqO+cwCaAwubamEu/RR+gK0kEkc0QOvV FfAAoNDhm2dpPWMOsbf3PlgPo6OIb48c =L87B -----END PGP SIGNATURE----- --Apple-Mail=_39A3A199-5ACE-4C30-A9A6-089782D8B7E8-- From owner-svn-src-head@freebsd.org Fri Oct 14 19:54:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082A8C118B3; Fri, 14 Oct 2016 19:54:33 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay105.isp.belgacom.be (mailrelay105.isp.belgacom.be [195.238.20.132]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6E9A7E8; Fri, 14 Oct 2016 19:54:31 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AWBQBJNgFY/1QiyVBcGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBgzwBAQEBAR1JDnykOZZAKIV6AoIWPRABAgEBAQEBAQFeJ4RiAQEEOhw?= =?us-ascii?q?jEAsYCSUPKh4GE4hWCsMaAQEBAQEBBAEBAQEBAR0FixKCY4FkhV8FmgaGKIlNc?= =?us-ascii?q?o8OSYwwg381H1KEazw0AYg0AQEB?= Received: from 84.34-201-80.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([80.201.34.84]) by relay.skynet.be with ESMTP; 14 Oct 2016 21:53:16 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id u9EJrCSt062739; Fri, 14 Oct 2016 21:53:12 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Fri, 14 Oct 2016 21:53:11 +0200 From: Tijl Coosemans To: Dimitry Andric Cc: Ed Maste , Bruce Evans , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307231 - head/lib/libgcc_s Message-ID: <20161014215311.6b723fab@kalimero.tijl.coosemans.org> In-Reply-To: References: <201610131918.u9DJI0bX085695@repo.freebsd.org> <20161014113603.F1039@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 19:54:33 -0000 On Fri, 14 Oct 2016 20:55:30 +0200 Dimitry Andric wrot= e: > On 14 Oct 2016, at 04:06, Ed Maste wrote: >> On 14 October 2016 at 01:53, Bruce Evans wrote: = =20 >>>> compiler-rt's complex division support routines contain calls to >>>> compiler builtins such as `__builtin_scalbnl`. Unfortunately Clang >>>> turns these back into a call to `scalbnl`. =20 >>>=20 >>> gcc-4.2 has the same bug. =20 >>=20 >> Oh, interesting. Do you know off hand if it's resolved in later GCC? =20 >=20 > Not for x86, in any case (I think I talked about this with you on IRC > before). For example, using the latest gcc 7.0.0 20160911 on this > program: >=20 > float f1(float x, int n) > { > return __builtin_scalbnf(x, n); > } >=20 > double f2(double x, int n) > { > return __builtin_scalbn(x, n); > } >=20 > long double f3(long double x, long n) > { > return __builtin_scalbnl(x, n); > } >=20 > gives this assembly: >=20 > .p2align 4,,15 > .globl f1 > .type f1, @function > f1: > .LFB0: > .cfi_startproc > jmp scalbnf > .cfi_endproc > .LFE0: > .size f1, .-f1 > .p2align 4,,15 > .globl f2 > .type f2, @function > f2: > .LFB1: > .cfi_startproc > jmp scalbn > .cfi_endproc > .LFE1: > .size f2, .-f2 > .p2align 4,,15 > .globl f3 > .type f3, @function > f3: > .LFB2: > .cfi_startproc > jmp scalbnl > .cfi_endproc > .LFE2: > .size f3, .-f3 >=20 > E.g., it looks like the __builtin_scalbn functions were always a red > herring. :-) =46rom https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html: GCC includes built-in versions of many of the functions in the standard C library. These functions come in two forms: one whose names start with the __builtin_ prefix, and the other without. Both forms have the same type (including prototype), the same address (when their address is taken), and the same meaning as the C library functions even if you specify the -fno-builtin option see C Dialect Options). Many of these functions are only optimized in certain cases; if they are not optimized in a particular case, a call to the library function is emitted. From owner-svn-src-head@freebsd.org Fri Oct 14 20:01:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CAFCC11CC2; Fri, 14 Oct 2016 20:01:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDE45D55; Fri, 14 Oct 2016 20:01:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EK18wk053821; Fri, 14 Oct 2016 20:01:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EK17ZX053816; Fri, 14 Oct 2016 20:01:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201610142001.u9EK17ZX053816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 14 Oct 2016 20:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307332 - in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 20:01:09 -0000 Author: jhb Date: Fri Oct 14 20:01:07 2016 New Revision: 307332 URL: https://svnweb.freebsd.org/changeset/base/307332 Log: Drop support for using mmap() with /dev/kmem. Using the device pager with /dev/kmem is not stable since KVA mappings are transient, but the device pager caches the PA associated with a given offset forever. Interestingly, mips' implementation of memmap() already refused requests for /dev/kmem. Note that kvm_read/kvm_write do not use mmap, but use read and write on /dev/kmem, so this should not affect libkvm users. Reviewed by: kib MFC after: 2 months Modified: head/sys/amd64/amd64/mem.c head/sys/arm/arm/mem.c head/sys/arm64/arm64/mem.c head/sys/i386/i386/mem.c head/sys/powerpc/powerpc/mem.c Modified: head/sys/amd64/amd64/mem.c ============================================================================== --- head/sys/amd64/amd64/mem.c Fri Oct 14 18:43:17 2016 (r307331) +++ head/sys/amd64/amd64/mem.c Fri Oct 14 20:01:07 2016 (r307332) @@ -172,10 +172,9 @@ memmmap(struct cdev *dev, vm_ooffset_t o if (offset >= (1ULL << cpu_maxphyaddr)) return (-1); *paddr = offset; - } else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } /* Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Fri Oct 14 18:43:17 2016 (r307331) +++ head/sys/arm/arm/mem.c Fri Oct 14 20:01:07 2016 (r307332) @@ -161,10 +161,9 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } Modified: head/sys/arm64/arm64/mem.c ============================================================================== --- head/sys/arm64/arm64/mem.c Fri Oct 14 18:43:17 2016 (r307331) +++ head/sys/arm64/arm64/mem.c Fri Oct 14 20:01:07 2016 (r307332) @@ -123,10 +123,9 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } Modified: head/sys/i386/i386/mem.c ============================================================================== --- head/sys/i386/i386/mem.c Fri Oct 14 18:43:17 2016 (r307331) +++ head/sys/i386/i386/mem.c Fri Oct 14 20:01:07 2016 (r307332) @@ -161,12 +161,11 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } /* Modified: head/sys/powerpc/powerpc/mem.c ============================================================================== --- head/sys/powerpc/powerpc/mem.c Fri Oct 14 18:43:17 2016 (r307331) +++ head/sys/powerpc/powerpc/mem.c Fri Oct 14 20:01:07 2016 (r307332) @@ -179,8 +179,6 @@ memmmap(struct cdev *dev, vm_ooffset_t o if (dev2unit(dev) == CDEV_MINOR_MEM) *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); else return (EFAULT); From owner-svn-src-head@freebsd.org Fri Oct 14 21:51:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2829C11610; Fri, 14 Oct 2016 21:51:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76742375; Fri, 14 Oct 2016 21:51:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9ELpoJg097724; Fri, 14 Oct 2016 21:51:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9ELpomV097723; Fri, 14 Oct 2016 21:51:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201610142151.u9ELpomV097723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 14 Oct 2016 21:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307333 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 21:51:51 -0000 Author: jhb Date: Fri Oct 14 21:51:50 2016 New Revision: 307333 URL: https://svnweb.freebsd.org/changeset/base/307333 Log: Reprogram I/O APIC interrupt pins when registering an I/O APIC. All I/O APIC pins are masked when an I/O APIC is first probed. The APIC enumerator (MP Table or MADT) then parses its associated tables to configure individual pins to set custom delivery modes or alternate routing (e.g. routing IRQ 0 to intpin 2). Pins for regular interrupt pins are left masked until the first interrupt is assigned. However, pins with unusual settings (e.g. NMI or SMI) are never assigned an interrupt and thus never re-programmed. The I/O APIC code used to reprogram all interrupt pins during registration but this was lost in r151979. In theory, this is mostly a no-op as the ACPI APIC table does not include a way to enumerate NMI or SMI pins for the I/O APIC, so only systems using an MP Table would be affected. Reported by: avg MFC after: 1 month Modified: head/sys/x86/x86/io_apic.c Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Fri Oct 14 20:01:07 2016 (r307332) +++ head/sys/x86/x86/io_apic.c Fri Oct 14 21:51:50 2016 (r307333) @@ -916,11 +916,16 @@ ioapic_register(void *cookie) io->io_id, flags >> 4, flags & 0xf, io->io_intbase, io->io_intbase + io->io_numintr - 1); - /* Register valid pins as interrupt sources. */ + /* + * Reprogram pins to handle special case pins (such as NMI and + * SMI) and register valid pins as interrupt sources. + */ intr_register_pic(&io->io_pic); - for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) + for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) { + ioapic_reprogram_intpin(&pin->io_intsrc); if (pin->io_irq < NUM_IO_INTS) intr_register_source(&pin->io_intsrc); + } } /* A simple new-bus driver to consume PCI I/O APIC devices. */ From owner-svn-src-head@freebsd.org Fri Oct 14 22:20:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FFE4C11D8D; Fri, 14 Oct 2016 22:20:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0513FAB; Fri, 14 Oct 2016 22:20:15 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EMKErC006602; Fri, 14 Oct 2016 22:20:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EMKE2l006600; Fri, 14 Oct 2016 22:20:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201610142220.u9EMKE2l006600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 14 Oct 2016 22:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307334 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 22:20:16 -0000 Author: andrew Date: Fri Oct 14 22:20:14 2016 New Revision: 307334 URL: https://svnweb.freebsd.org/changeset/base/307334 Log: Create macros for the MAIR memory attributes. While here add an uncached memory type, however the VM code still needs to be taught about this. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/locore.S head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Fri Oct 14 21:51:50 2016 (r307333) +++ head/sys/arm64/arm64/locore.S Fri Oct 14 22:20:14 2016 (r307334) @@ -617,8 +617,10 @@ start_mmu: .align 3 mair: - /* Device Normal, no cache Normal, write-back */ - .quad MAIR_ATTR(0x00, 0) | MAIR_ATTR(0x44, 1) | MAIR_ATTR(0xff, 2) + .quad MAIR_ATTR(MAIR_DEVICE_nGnRnE, 0) | \ + MAIR_ATTR(MAIR_NORMAL_NC, 1) | \ + MAIR_ATTR(MAIR_NORMAL_WB, 2) | \ + MAIR_ATTR(MAIR_NORMAL_WT, 3) tcr: .quad (TCR_TxSZ(64 - VIRT_BITS) | TCR_ASID_16 | TCR_TG1_4K | \ TCR_CACHE_ATTRS | TCR_SMP_ATTRS) Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Fri Oct 14 21:51:50 2016 (r307333) +++ head/sys/arm64/include/armreg.h Fri Oct 14 22:20:14 2016 (r307334) @@ -357,6 +357,10 @@ /* MAIR_EL1 - Memory Attribute Indirection Register */ #define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8)) #define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8)) +#define MAIR_DEVICE_nGnRnE 0x00 +#define MAIR_NORMAL_NC 0x44 +#define MAIR_NORMAL_WT 0x88 +#define MAIR_NORMAL_WB 0xff /* PAR_EL1 - Physical Address Register */ #define PAR_F_SHIFT 0 From owner-svn-src-head@freebsd.org Fri Oct 14 22:23:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64674C11F4E; Fri, 14 Oct 2016 22:23:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A6773E8; Fri, 14 Oct 2016 22:23:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9EMN4El010031; Fri, 14 Oct 2016 22:23:04 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9EMN3Cb010028; Fri, 14 Oct 2016 22:23:03 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201610142223.u9EMN3Cb010028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 14 Oct 2016 22:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307335 - in head/sys: arm/broadcom/bcm2835 arm64/broadcom arm64/conf conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 22:23:05 -0000 Author: gonzo Date: Fri Oct 14 22:23:03 2016 New Revision: 307335 URL: https://svnweb.freebsd.org/changeset/base/307335 Log: Make BRCM2837 port conform FreeBSD/ARM64 guidelines - Rename SOC_BCM2837 to SOC_BRCM_BCM2837, put it to opt_soc.h - do not use files.XXX files, just move required sources to conf/files.arm64 and make them depend on soc_brcm_bcm2837 Suggested by: andrew Deleted: head/sys/arm64/broadcom/ Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h head/sys/arm64/conf/RPI3 head/sys/conf/files.arm64 head/sys/conf/options.arm64 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 22:20:14 2016 (r307334) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 14 22:23:03 2016 (r307335) @@ -33,16 +33,23 @@ #ifndef _BCM2835_VCBUS_H_ #define _BCM2835_VCBUS_H_ +/* + * ARM64 define its SOC options in opt_soc.h + */ +#if defined(__aarch64__) +#include "opt_soc.h" +#endif + #define BCM2835_VCBUS_SDRAM_CACHED 0x40000000 #define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 -#if defined(SOC_BCM2836) || defined(SOC_BCM2837) -#define BCM2835_ARM_IO_BASE 0x3f000000 -#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED -#else +#if defined(SOC_BCM2835) #define BCM2835_ARM_IO_BASE 0x20000000 #define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_CACHED +#else +#define BCM2835_ARM_IO_BASE 0x3f000000 +#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED #endif #define BCM2835_ARM_IO_SIZE 0x01000000 Modified: head/sys/arm64/conf/RPI3 ============================================================================== --- head/sys/arm64/conf/RPI3 Fri Oct 14 22:20:14 2016 (r307334) +++ head/sys/arm64/conf/RPI3 Fri Oct 14 22:23:03 2016 (r307335) @@ -22,9 +22,6 @@ cpu ARM64 ident RPI3 -files "../../arm/broadcom/bcm2835/files.bcm283x" -files "../broadcom/bcm2837/files.bcm2837" - makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols #makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support @@ -91,7 +88,7 @@ options WITNESS # Enable checks to de options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options SOC_BCM2837 +options SOC_BRCM_BCM2837 options ROOTDEVNAME=\"ufs:mmcsd0s2\" Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Oct 14 22:20:14 2016 (r307334) +++ head/sys/conf/files.arm64 Fri Oct 14 22:23:03 2016 (r307335) @@ -45,6 +45,24 @@ arm/arm/generic_timer.c standard arm/arm/gic.c standard arm/arm/gic_fdt.c optional fdt arm/arm/pmu.c standard +arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc +arm/broadcom/bcm2835/bcm2835_common.c optional fdt soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_fbd.c optional vt soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_rng.c optional random soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 arm64/acpica/acpi_machdep.c optional acpi arm64/acpica/OsdEnvironment.c optional acpi arm64/acpica/acpi_wakeup.c optional acpi @@ -96,6 +114,24 @@ arm64/cavium/thunder_pcie_pem.c optiona arm64/cavium/thunder_pcie_pem_fdt.c optional soc_cavm_thunderx pci fdt arm64/cavium/thunder_pcie_common.c optional soc_cavm_thunderx pci arm64/cloudabi64/cloudabi64_sysvec.c optional compat_cloudabi64 +contrib/vchiq/interface/compat/vchi_bsd.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_arm.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_connected.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_core.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_shim.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_util.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/acpica/acpi_if.m optional acpi @@ -103,6 +139,7 @@ dev/ahci/ahci_generic.c optional ahci f dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/hwpmc/hwpmc_arm64.c optional hwpmc dev/hwpmc/hwpmc_arm64_md.c optional hwpmc +dev/mbox/mbox_if.m optional soc_brcm_bcm2837 dev/mmc/host/dwmmc.c optional dwmmc fdt dev/mmc/host/dwmmc_hisi.c optional dwmmc fdt soc_hisi_hi6220 dev/ofw/ofw_cpu.c optional fdt Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Fri Oct 14 22:20:14 2016 (r307334) +++ head/sys/conf/options.arm64 Fri Oct 14 22:23:03 2016 (r307335) @@ -9,6 +9,6 @@ VFP opt_global.h # SoC Support SOC_ALLWINNER_A64 opt_soc.h -SOC_BCM2837 opt_global.h +SOC_BRCM_BCM2837 opt_soc.h SOC_CAVM_THUNDERX opt_soc.h SOC_HISI_HI6220 opt_soc.h From owner-svn-src-head@freebsd.org Sat Oct 15 00:01:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60D04C1046B for ; Sat, 15 Oct 2016 00:01:23 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11CC5D9F for ; Sat, 15 Oct 2016 00:01:23 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x230.google.com with SMTP id o68so214609855qkf.3 for ; Fri, 14 Oct 2016 17:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9bxD518i0BIPGecK1r8L2XzaOOPYnmjSPQ8FL6KZVRg=; b=Ejkq+FetP9tYtd7Kw7OS4ontImcp1J3JfiTwIvoBfa2NKxjibK9cE01HxU8AXDjlrO 6k5bQHIIdoau9CayWmwxhDrP2j2a6ujcdDVRwLJbCnIVgJsbokt8akZ7Xl3J0cALSTGB 8vT34fpmv8TmMNZDJniuoVNE+eyx28ZSjhe7H7NfhGTtBznK0f8cJSlaQRKehIVxKCOD W9wWrmMa2q/9of2CJhvF3yn1jRuzaUu/Q23v8+vWUnyXYDjOh2x6QiNZYtAcrpyhzp4I T6i7k3wqOBl5HTM0IX7T76snqpk3P6nEvPV+uc0ho5S6fUL/eTFgxRtMJd+kO61ZoxkT 1Hew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9bxD518i0BIPGecK1r8L2XzaOOPYnmjSPQ8FL6KZVRg=; b=fODaVaU0p12kXKHjpTH95ZnNX4wj4zCgZyy8VRl3WY1et8JGmb8++uSImNSygeaIV5 F87VeuCDc1DWotH7TAhzk6LTZX2Ujj4YvhTidR13HzyTr2KdD6B28vULJH5jnm/cd2ua X+a2udigca0TKTlOSWgY1FVIoEqX083fQu49LNQvubNnSPI272HPMZxONvfySvWh0vQf IfZwJNKxvwVAwf91TUvc2TBqShM8WWur/Tw7H2RHHCVSfh19tQbCXFOrFtsO5kkt9Ah1 ofKbb8retoJJeIw+eWibICn6ep8NDDZYNsn3YV7AECo53h63hwd1qBnNi5ef+QtDx/Av KMkw== X-Gm-Message-State: AA6/9Rkje1q/JiPia11R85U+UrCJG9YNsBNWdEzm56gKmyPwkS+W09ldVVK8ADxdKlzLyfpP X-Received: by 10.55.162.150 with SMTP id l144mr15859593qke.72.1476489682130; Fri, 14 Oct 2016 17:01:22 -0700 (PDT) Received: from mutt-hardenedbsd (pool-100-16-218-231.bltmmd.fios.verizon.net. [100.16.218.231]) by smtp.gmail.com with ESMTPSA id y33sm8827397qtc.34.2016.10.14.17.01.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Oct 2016 17:01:20 -0700 (PDT) Date: Fri, 14 Oct 2016 20:01:19 -0400 From: Shawn Webb To: "Jonathan T. Looney" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307082 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/cc sys/modules/khelp sys/netinet sys/netinet/tcp_stacks sys/pc98/conf sy... Message-ID: <20161015000119.GA17390@mutt-hardenedbsd> References: <201610120216.u9C2Gga8041814@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="H+4ONPRPur6+Ovig" Content-Disposition: inline In-Reply-To: <201610120216.u9C2Gga8041814@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 00:01:23 -0000 --H+4ONPRPur6+Ovig Content-Type: multipart/mixed; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 12, 2016 at 02:16:42AM +0000, Jonathan T. Looney wrote: > Author: jtl > Date: Wed Oct 12 02:16:42 2016 > New Revision: 307082 > URL: https://svnweb.freebsd.org/changeset/base/307082 >=20 > Log: > In the TCP stack, the hhook(9) framework provides hooks for kernel modu= les > to add actions that run when a TCP frame is sent or received on a TCP > session in the ESTABLISHED state. In the base tree, this functionality = is > only used for the h_ertt module, which is used by the cc_cdg, cc_chd, c= c_hd, > and cc_vegas congestion control modules. > =20 > Presently, we incur overhead to check for hooks each time a TCP frame is > sent or received on an ESTABLISHED TCP session. > =20 > This change adds a new compile-time option (TCP_HHOOK) to determine whe= ther > to include the hhook(9) framework for TCP. To retain backwards > compatibility, I added the TCP_HHOOK option to every configuration file= that > already defined "options INET". (Therefore, this patch introduces no > functional change. In order to see a functional difference, you need to > compile a custom kernel without the TCP_HHOOK option.) This change will > allow users to easily exclude this functionality from their kernel, sho= uld > they wish to do so. > =20 > Note that any users who use a custom kernel configuration and use one o= f the > congestion control modules listed above will need to add the TCP_HHOOK > option to their kernel configuration. > =20 > Reviewed by: rrs, lstewart, hiren (previous version), sjg (makefiles on= ly) > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D8185 This commit breaks the build when VNET is enabled. Attached is a candidate patch to fix. If the patch doesn't make it to the list, I've pasted it here: http://ix.io/1wbE Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="2016-10-14-tcp_subr.c.patch.txt" Content-Transfer-Encoding: quoted-printable diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index b8c9ff0..e69c3d4 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -742,7 +742,10 @@ tcp_init(void) static void tcp_destroy(void *unused __unused) { - int error, n; + int n; +#ifdef TCP_HHOOK + int error; +#endif =20 /* * All our processes are gone, all our sockets should be cleaned --ReaqsoxgOBHFXBhH-- --H+4ONPRPur6+Ovig Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYAXHMAAoJEGqEZY9SRW7ur/YQAIr0AlUhxRxuPJwatB+Y9Iyx qbiN3PgBgtCjYXA0JMqZuJP775xnF//pvyXvRgRev1lTTLTK6MLd+j/xTT+kT70l vWCkLI2iNhEz3ZWN2vIIlJbq4fMsyxVTehb07IqdLRehlbvS+Y+cB7Ck6xRFo+DX 0icx4KfWC+zHHtE2ZzyLGb28BLJgk22lBZe5lB4luvsnEIVC37O4A1wAoLw82fMY GYuSnnSVgDPyBYwAvNQa///tVb9iM6EtvCNN6p44NrOtKZRzJIA3BJrwOF94rfB/ wyvW5RXpkRwYiKfwQiyzUvLQf/uRXvYdZfkyjxPq8veaivozTScBXblDQSLjH88P EjuKVu/H94zlTXeNNtXClbL6zLxFankzCFbvhHTtvZ40ajSqF1LfrFo4lZqAWi7/ 7XSiFq4e9w2CdldoMquMIn8/naVELwhWGnm7SD2rSIGk1pWOpOyk0Vm+2VpgvA5j lc/Ef07vQorTwEhmlS0inqEoji1+j2EUVWuTbVe3AgOzYEXBZtbtrcZYdw/O6zwX sr7to/XDtkfAkTgpWsYmb+r91Ngy7EsaLGMtMfYWb7d7ajUhRcmxANiuNN7UiS6O aQkXMhxjXCDQXrFPw2DI/Cg83SSyCqmwrncAXJCXhBf744Hs5f7vCt8gLtXy2rB9 LBTMaLGTGjQ4nDq3e5c+ =laFA -----END PGP SIGNATURE----- --H+4ONPRPur6+Ovig-- From owner-svn-src-head@freebsd.org Sat Oct 15 00:29:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8596FC10C34; Sat, 15 Oct 2016 00:29:16 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55F61A05; Sat, 15 Oct 2016 00:29:16 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9F0TFEB054587; Sat, 15 Oct 2016 00:29:15 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9F0TFNS054586; Sat, 15 Oct 2016 00:29:15 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201610150029.u9F0TFNS054586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sat, 15 Oct 2016 00:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307336 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 00:29:16 -0000 Author: jtl Date: Sat Oct 15 00:29:15 2016 New Revision: 307336 URL: https://svnweb.freebsd.org/changeset/base/307336 Log: r307082 added the TCP_HHOOK kernel option and made some existing code only compile when that option is configured. In tcp_destroy(), the error variable is now only used in code enclosed in an '#ifdef TCP_HHOOK' block. This broke the build for VNET images. Enclose the error variable itself in an #ifdef block. Submitted by: Shawn Webb Reported by: Shawn Webb PointyHat to: jtl Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Oct 14 22:23:03 2016 (r307335) +++ head/sys/netinet/tcp_subr.c Sat Oct 15 00:29:15 2016 (r307336) @@ -742,7 +742,10 @@ tcp_init(void) static void tcp_destroy(void *unused __unused) { - int error, n; + int n; +#ifdef TCP_HHOOK + int error; +#endif /* * All our processes are gone, all our sockets should be cleaned From owner-svn-src-head@freebsd.org Sat Oct 15 00:31:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 903FEC10D0C; Sat, 15 Oct 2016 00:31:22 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48D4EC35; Sat, 15 Oct 2016 00:31:22 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-qt0-x22a.google.com with SMTP id f6so88802483qtd.2; Fri, 14 Oct 2016 17:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=USAHVk0rxHop7CuIHdV2Dl535k9UQXuyy/RKFh+S2jk=; b=XUJbh+ESLCEDArKjApfXDfwrlRteAkz+m3ap8Cgtpsb3Q2rWNs8XMibGMnSpAdTBG6 YOXzsdlCUpFGydOWOV2svbKtdDFhKFjcQy6QMwMmfBPPrRSv/57q8NR8Z9Kfbj84wGai AApQHTELw0WSbBqoQSbbDdvWYk6KGKwCl/T6khqPW8D2fZylgOEdfRWWF8YCqqNzvqvl 9l6U87+rIxi0fTOcOD+u9C8xZ0YTx4JhYhHvNXa07roryRncLlk7lwdjM26FInIjYojE ju2QWv4c2GHKyqXfhP0YWr/J7ztIrl5Uy6aEDOgdxAfKzzmuoVgeHgQh0/7K0zwG5Zr1 gzHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=USAHVk0rxHop7CuIHdV2Dl535k9UQXuyy/RKFh+S2jk=; b=SPYLhzfAltQrpAMil/DndnQxszHnnSZVwNpelqRcadEquMrIForuaRFXTixibUbXlC WMJaGoEa0c/I8ww255HZFEVGaZ4y6UZJV5NUPzF2If5WTM/qFpksD7thMyPrpaz++4nA KVunoSJQ0N2MR24StpoRbZ5O+Xk22WLvN3V1iIviTZzGT1a/9L+8AlKQxsCVHOsJEwN1 DLEW2YHTdcEFDb6b1mIvpuYQAwKC9aD+60gzeOAARkKTc90ulvyLxZj1sqPo2pSgzPom ES7yuDy2DxgHfWZXwEtWjGCnBVwm7xk28/CgEzKyLxGLGORrJESLyvSBySMu0MPcLBOc pMvQ== X-Gm-Message-State: AA6/9RnnkVueGr6H3pzHkx6945BppvXhKRhrecE1P7LT9mjl/Yn53nS38bQbRtmiefHAhChwyK2XrFSY5Ab+DQ== X-Received: by 10.200.33.201 with SMTP id 9mr15305921qtz.141.1476491481465; Fri, 14 Oct 2016 17:31:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.53.208 with HTTP; Fri, 14 Oct 2016 17:31:20 -0700 (PDT) In-Reply-To: <20161015000119.GA17390@mutt-hardenedbsd> References: <201610120216.u9C2Gga8041814@repo.freebsd.org> <20161015000119.GA17390@mutt-hardenedbsd> From: Jonathan Looney Date: Fri, 14 Oct 2016 20:31:20 -0400 Message-ID: Subject: Re: svn commit: r307082 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/cc sys/modules/khelp sys/netinet sys/netinet/tcp_stacks sys/pc98/conf sy... To: Shawn Webb Cc: "Jonathan T. Looney" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 00:31:22 -0000 Thanks! Yes, that was clearly an error on my part, and your patch is an obvious solution. I committed it at r307336. Thanks again! Jonathan On Fri, Oct 14, 2016 at 8:01 PM, Shawn Webb wrote: > On Wed, Oct 12, 2016 at 02:16:42AM +0000, Jonathan T. Looney wrote: > > Author: jtl > > Date: Wed Oct 12 02:16:42 2016 > > New Revision: 307082 > > URL: https://svnweb.freebsd.org/changeset/base/307082 > > > > Log: > > In the TCP stack, the hhook(9) framework provides hooks for kernel > modules > > to add actions that run when a TCP frame is sent or received on a TCP > > session in the ESTABLISHED state. In the base tree, this functionality > is > > only used for the h_ertt module, which is used by the cc_cdg, cc_chd, > cc_hd, > > and cc_vegas congestion control modules. > > > > Presently, we incur overhead to check for hooks each time a TCP frame > is > > sent or received on an ESTABLISHED TCP session. > > > > This change adds a new compile-time option (TCP_HHOOK) to determine > whether > > to include the hhook(9) framework for TCP. To retain backwards > > compatibility, I added the TCP_HHOOK option to every configuration > file that > > already defined "options INET". (Therefore, this patch introduces no > > functional change. In order to see a functional difference, you need to > > compile a custom kernel without the TCP_HHOOK option.) This change will > > allow users to easily exclude this functionality from their kernel, > should > > they wish to do so. > > > > Note that any users who use a custom kernel configuration and use one > of the > > congestion control modules listed above will need to add the TCP_HHOOK > > option to their kernel configuration. > > > > Reviewed by: rrs, lstewart, hiren (previous version), sjg > (makefiles only) > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D8185 > > This commit breaks the build when VNET is enabled. Attached is a > candidate patch to fix. > > If the patch doesn't make it to the list, I've pasted it here: > http://ix.io/1wbE > > Thanks, > > -- > Shawn Webb > Cofounder and Security Engineer > HardenedBSD > > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > From owner-svn-src-head@freebsd.org Sat Oct 15 01:41:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1CF1C11EE6; Sat, 15 Oct 2016 01:41:29 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEB0BB9D; Sat, 15 Oct 2016 01:41:29 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9F1fSUf082016; Sat, 15 Oct 2016 01:41:28 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9F1fSht082014; Sat, 15 Oct 2016 01:41:28 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201610150141.u9F1fSht082014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sat, 15 Oct 2016 01:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307337 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 01:41:29 -0000 Author: pkelsey Date: Sat Oct 15 01:41:28 2016 New Revision: 307337 URL: https://svnweb.freebsd.org/changeset/base/307337 Log: Fix cases where the TFO pending counter would leak references, and eventually, memory. Also renamed some tfo labels and added/reworked comments for clarity. Based on an initial patch from jtl. PR: 213424 Reviewed by: jtl MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8235 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Oct 15 00:29:15 2016 (r307336) +++ head/sys/netinet/tcp_input.c Sat Oct 15 01:41:28 2016 (r307337) @@ -1121,7 +1121,7 @@ relocked: goto dropwithreset; } #ifdef TCP_RFC7413 -new_tfo_socket: +tfo_socket_result: #endif if (so == NULL) { /* @@ -1387,7 +1387,7 @@ new_tfo_socket: tcp_dooptions(&to, optp, optlen, TO_SYN); #ifdef TCP_RFC7413 if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL)) - goto new_tfo_socket; + goto tfo_socket_result; #else syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL); #endif Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sat Oct 15 00:29:15 2016 (r307336) +++ head/sys/netinet/tcp_syncache.c Sat Oct 15 01:41:28 2016 (r307337) @@ -1151,11 +1151,10 @@ syncache_tfo_expand(struct syncache *sc, * the data, we avoid this DoS scenario. * * The exception to the above is when a SYN with a valid TCP Fast Open (TFO) - * cookie is processed, V_tcp_fastopen_enabled set to true, and the - * TCP_FASTOPEN socket option is set. In this case, a new socket is created - * and returned via lsop, the mbuf is not freed so that tcp_input() can - * queue its data to the socket, and 1 is returned to indicate the - * TFO-socket-creation path was taken. + * cookie is processed and a new socket is created. In this case, any data + * accompanying the SYN will be queued to the socket by tcp_input() and will + * be ACKed either when the application sends response data or the delayed + * ACK timer expires, whichever comes first. */ int syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, @@ -1181,6 +1180,7 @@ syncache_add(struct in_conninfo *inc, st struct ucred *cred; #ifdef TCP_RFC7413 uint64_t tfo_response_cookie; + unsigned int *tfo_pending = NULL; int tfo_cookie_valid = 0; int tfo_response_cookie_valid = 0; #endif @@ -1226,8 +1226,13 @@ syncache_add(struct in_conninfo *inc, st &tfo_response_cookie); tfo_cookie_valid = (result > 0); tfo_response_cookie_valid = (result >= 0); - } else - atomic_subtract_int(tp->t_tfo_pending, 1); + } + + /* + * Remember the TFO pending counter as it will have to be + * decremented below if we don't make it to syncache_tfo_expand(). + */ + tfo_pending = tp->t_tfo_pending; } #endif @@ -1468,9 +1473,9 @@ skip_alloc: #ifdef TCP_RFC7413 if (tfo_cookie_valid) { syncache_tfo_expand(sc, lsop, m, tfo_response_cookie); - /* INP_WUNLOCK(inp) will be performed by the called */ + /* INP_WUNLOCK(inp) will be performed by the caller */ rv = 1; - goto tfo_done; + goto tfo_expanded; } #endif @@ -1496,7 +1501,16 @@ done: m_freem(m); } #ifdef TCP_RFC7413 -tfo_done: + /* + * If tfo_pending is not NULL here, then a TFO SYN that did not + * result in a new socket was processed and the associated pending + * counter has not yet been decremented. All such TFO processing paths + * transit this point. + */ + if (tfo_pending != NULL) + tcp_fastopen_decrement_counter(tfo_pending); + +tfo_expanded: #endif if (cred != NULL) crfree(cred); From owner-svn-src-head@freebsd.org Sat Oct 15 05:53:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36F56C12EF9; Sat, 15 Oct 2016 05:53:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05374BBD; Sat, 15 Oct 2016 05:53:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9F5rAFH080193; Sat, 15 Oct 2016 05:53:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9F5rAMF080192; Sat, 15 Oct 2016 05:53:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610150553.u9F5rAMF080192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 15 Oct 2016 05:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307338 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 05:53:11 -0000 Author: imp Date: Sat Oct 15 05:53:09 2016 New Revision: 307338 URL: https://svnweb.freebsd.org/changeset/base/307338 Log: Create a pcibios-version environment FORTH word. This allows one to conditionally compile forth code before using the pcibios- words. Modified: head/sys/boot/i386/libi386/biospci.c Modified: head/sys/boot/i386/libi386/biospci.c ============================================================================== --- head/sys/boot/i386/libi386/biospci.c Sat Oct 15 01:41:28 2016 (r307337) +++ head/sys/boot/i386/libi386/biospci.c Sat Oct 15 05:53:09 2016 (r307338) @@ -190,7 +190,6 @@ static struct pci_class {-1, NULL, NULL} }; - static void biospci_enumerate(void); static void biospci_addinfo(int devid, struct pci_class *pc, struct pci_subclass *psc, struct pci_progif *ppi); @@ -199,6 +198,7 @@ struct pnphandler biospcihandler = "PCI BIOS", biospci_enumerate }; +static int biospci_version; #define PCI_BIOS_PRESENT 0xb101 #define FIND_PCI_DEVICE 0xb102 @@ -254,7 +254,7 @@ biospci_detect(void) setenv("pcibios.config2", buf, 1); sprintf(buf, "%d", maxbus); setenv("pcibios.maxbus", buf, 1); - + biospci_version = bcd2bin((version >> 8) & 0xf) * 10 + bcd2bin(version & 0xf); } static void @@ -577,6 +577,8 @@ static void ficlCompilePciBios(FICL_SYST dictAppendWord(dp, "pcibios-find-devclass", ficlPciBiosFindDevclass, FW_DEFAULT); dictAppendWord(dp, "pcibios-find-device", ficlPciBiosFindDevice, FW_DEFAULT); dictAppendWord(dp, "pcibios-locator", ficlPciBiosLocator, FW_DEFAULT); + + ficlSetEnv(pSys, "pcibios-version", biospci_version); } FICL_COMPILE_SET(ficlCompilePciBios); From owner-svn-src-head@freebsd.org Sat Oct 15 06:16:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FD69C1152F; Sat, 15 Oct 2016 06:16:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3A2769; Sat, 15 Oct 2016 06:16:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9F6GZan087591; Sat, 15 Oct 2016 06:16:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9F6GZCp087590; Sat, 15 Oct 2016 06:16:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201610150616.u9F6GZCp087590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 15 Oct 2016 06:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307339 - head/usr.sbin/efivar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 06:16:36 -0000 Author: imp Date: Sat Oct 15 06:16:35 2016 New Revision: 307339 URL: https://svnweb.freebsd.org/changeset/base/307339 Log: Implement -t. Use symbolic names in place of the magical 0x7. Submitted by: ambrisko@ Modified: head/usr.sbin/efivar/efivar.c Modified: head/usr.sbin/efivar/efivar.c ============================================================================== --- head/usr.sbin/efivar/efivar.c Sat Oct 15 05:53:09 2016 (r307338) +++ head/usr.sbin/efivar/efivar.c Sat Oct 15 06:16:35 2016 (r307339) @@ -62,7 +62,7 @@ static struct option longopts[] = { static int aflag, Aflag, bflag, dflag, Dflag, Hflag, Nflag, lflag, Lflag, Rflag, wflag, pflag; static char *varname; -static u_long attrib = 0x7; +static u_long attrib = EFI_VARIABLE_NON_VOLATILE |EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; static void usage(void) @@ -294,11 +294,13 @@ parse_args(int argc, char **argv) case 'R': Rflag++; break; + case 't': + attrib = strtoul(optarg, NULL, 16); + break; case 'w': wflag++; break; case 'f': - case 't': case 0: errx(1, "unknown or unimplemented option\n"); break; From owner-svn-src-head@freebsd.org Sat Oct 15 08:09:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FC2AC110F6; Sat, 15 Oct 2016 08:09:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61DD5A36; Sat, 15 Oct 2016 08:09:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9F89tdr029703; Sat, 15 Oct 2016 08:09:55 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9F89tHm029702; Sat, 15 Oct 2016 08:09:55 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201610150809.u9F89tHm029702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sat, 15 Oct 2016 08:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307343 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 08:09:56 -0000 Author: ed Date: Sat Oct 15 08:09:55 2016 New Revision: 307343 URL: https://svnweb.freebsd.org/changeset/base/307343 Log: Improve phrasing of the STANDARDS section. Reported by: wblock MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8205 Modified: head/lib/libc/stdlib/tsearch.3 Modified: head/lib/libc/stdlib/tsearch.3 ============================================================================== --- head/lib/libc/stdlib/tsearch.3 Sat Oct 15 07:38:27 2016 (r307342) +++ head/lib/libc/stdlib/tsearch.3 Sat Oct 15 08:09:55 2016 (r307343) @@ -142,10 +142,10 @@ The .Fa posix_tnode type is not part of .St -p1003.1-2008 , -but it is expected to be standardized by future versions of the standard. +but is expected to be standardized by future versions of the standard. It is defined as .Fa void for source-level compatibility. Using .Fa posix_tnode -makes it easier to distinguish between nodes and keys. +makes distinguishing between nodes and keys easier. From owner-svn-src-head@freebsd.org Sat Oct 15 09:10:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFD19C1243D; Sat, 15 Oct 2016 09:10:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C2003DA; Sat, 15 Oct 2016 09:10:36 +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 u9F9AZac052561; Sat, 15 Oct 2016 09:10:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9F9AZvk052560; Sat, 15 Oct 2016 09:10:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201610150910.u9F9AZvk052560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 15 Oct 2016 09:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307348 - head/sys/dev/acpi_support X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 09:10:36 -0000 Author: avg Date: Sat Oct 15 09:10:35 2016 New Revision: 307348 URL: https://svnweb.freebsd.org/changeset/base/307348 Log: aibs / atk0110: add support for querying sensors via GGRP and GITM Comparing to the Linux driver there is still one missing feature. The Linux driver finds and enables "Embedded Controller" item in the 0x11 group if it's not enabled yet. I tested the new method, Torfinn Ingolfsen tested the old method and helped to fix several bugs in the earlier versions of the patch. Tested by: Torfinn Ingolfsen Reviewed by: rpaulo MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D8227 Modified: head/sys/dev/acpi_support/atk0110.c Modified: head/sys/dev/acpi_support/atk0110.c ============================================================================== --- head/sys/dev/acpi_support/atk0110.c Sat Oct 15 09:09:25 2016 (r307347) +++ head/sys/dev/acpi_support/atk0110.c Sat Oct 15 09:10:35 2016 (r307348) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -51,18 +52,23 @@ ACPI_SERIAL_DECL(aibs, "aibs"); #define AIBS_MORE_SENSORS #define AIBS_VERBOSE -enum aibs_type { - AIBS_VOLT, - AIBS_TEMP, - AIBS_FAN -}; +#define AIBS_GROUP_SENSORS 0x06 + +#define AIBS_SENS_TYPE(x) (((x) >> 16) & 0xff) +#define AIBS_SENS_TYPE_VOLT 2 +#define AIBS_SENS_TYPE_TEMP 3 +#define AIBS_SENS_TYPE_FAN 4 + +#define AIBS_SENS_TYPE_VOLT_NAME "volt" +#define AIBS_SENS_TYPE_VOLT_TEMP "temp" +#define AIBS_SENS_TYPE_VOLT_FAN "fan" struct aibs_sensor { ACPI_INTEGER v; ACPI_INTEGER i; ACPI_INTEGER l; ACPI_INTEGER h; - enum aibs_type t; + int t; }; struct aibs_softc { @@ -72,14 +78,23 @@ struct aibs_softc { struct aibs_sensor *sc_asens_volt; struct aibs_sensor *sc_asens_temp; struct aibs_sensor *sc_asens_fan; + struct aibs_sensor *sc_asens_all; + + struct sysctl_oid *sc_volt_sysctl; + struct sysctl_oid *sc_temp_sysctl; + struct sysctl_oid *sc_fan_sysctl; + + bool sc_ggrp_method; }; static int aibs_probe(device_t); static int aibs_attach(device_t); static int aibs_detach(device_t); static int aibs_sysctl(SYSCTL_HANDLER_ARGS); +static int aibs_sysctl_ggrp(SYSCTL_HANDLER_ARGS); -static void aibs_attach_sif(struct aibs_softc *, enum aibs_type); +static int aibs_attach_ggrp(struct aibs_softc *); +static int aibs_attach_sif(struct aibs_softc *, int); static device_method_t aibs_methods[] = { DEVMETHOD(device_probe, aibs_probe), @@ -109,54 +124,240 @@ aibs_probe(device_t dev) { if (acpi_disabled("aibs") || ACPI_ID_PROBE(device_get_parent(dev), dev, aibs_hids) == NULL) - return ENXIO; + return (ENXIO); device_set_desc(dev, "ASUSTeK AI Booster (ACPI ASOC ATK0110)"); - return 0; + return (0); } static int aibs_attach(device_t dev) { struct aibs_softc *sc = device_get_softc(dev); + int err; sc->sc_dev = dev; sc->sc_ah = acpi_get_handle(dev); - aibs_attach_sif(sc, AIBS_VOLT); - aibs_attach_sif(sc, AIBS_TEMP); - aibs_attach_sif(sc, AIBS_FAN); + sc->sc_ggrp_method = false; + err = aibs_attach_sif(sc, AIBS_SENS_TYPE_VOLT); + if (err == 0) + err = aibs_attach_sif(sc, AIBS_SENS_TYPE_TEMP); + if (err == 0) + err = aibs_attach_sif(sc, AIBS_SENS_TYPE_FAN); + + if (err == 0) + return (0); + + /* Clean up whatever was allocated earlier. */ + if (sc->sc_volt_sysctl != NULL) + sysctl_remove_oid(sc->sc_volt_sysctl, true, true); + if (sc->sc_temp_sysctl != NULL) + sysctl_remove_oid(sc->sc_temp_sysctl, true, true); + if (sc->sc_fan_sysctl != NULL) + sysctl_remove_oid(sc->sc_fan_sysctl, true, true); + aibs_detach(dev); + + sc->sc_ggrp_method = true; + err = aibs_attach_ggrp(sc); + return (err); +} + +static int +aibs_add_sensor(struct aibs_softc *sc, ACPI_OBJECT *o, + struct aibs_sensor* sensor, const char ** descr) +{ + int off; - return 0; + /* + * Packages for the old and new methods are quite + * similar except that the new package has two + * new (unknown / unused) fields after the name field. + */ + if (sc->sc_ggrp_method) + off = 4; + else + off = 2; + + if (o->Type != ACPI_TYPE_PACKAGE) { + device_printf(sc->sc_dev, + "sensor object is not a package: %i type\n", + o->Type); + return (ENXIO); + } + if (o[0].Package.Count != (off + 3) || + o->Package.Elements[0].Type != ACPI_TYPE_INTEGER || + o->Package.Elements[1].Type != ACPI_TYPE_STRING || + o->Package.Elements[off].Type != ACPI_TYPE_INTEGER || + o->Package.Elements[off + 1].Type != ACPI_TYPE_INTEGER || + o->Package.Elements[off + 2].Type != ACPI_TYPE_INTEGER) { + device_printf(sc->sc_dev, "unexpected package content\n"); + return (ENXIO); + } + + sensor->i = o->Package.Elements[0].Integer.Value; + *descr = o->Package.Elements[1].String.Pointer; + sensor->l = o->Package.Elements[off].Integer.Value; + sensor->h = o->Package.Elements[off + 1].Integer.Value; + /* For the new method the second value is a range size. */ + if (sc->sc_ggrp_method) + sensor->h += sensor->l; + sensor->t = AIBS_SENS_TYPE(sensor->i); + + switch (sensor->t) { + case AIBS_SENS_TYPE_VOLT: + case AIBS_SENS_TYPE_TEMP: + case AIBS_SENS_TYPE_FAN: + return (0); + default: + device_printf(sc->sc_dev, "unknown sensor type 0x%x", + sensor->t); + return (ENXIO); + } } static void -aibs_attach_sif(struct aibs_softc *sc, enum aibs_type st) +aibs_sensor_added(struct aibs_softc *sc, struct sysctl_oid *so, + const char *type_name, int idx, struct aibs_sensor *sensor, + const char *descr) +{ + char sysctl_name[8]; + + snprintf(sysctl_name, sizeof(sysctl_name), "%i", idx); +#ifdef AIBS_VERBOSE + device_printf(sc->sc_dev, "%c%i: 0x%08jx %20s %5jd / %5jd\n", + type_name[0], idx, + (uintmax_t)sensor->i, descr, (intmax_t)sensor->l, + (intmax_t)sensor->h); +#endif + SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->sc_dev), + SYSCTL_CHILDREN(so), idx, sysctl_name, + CTLTYPE_INT | CTLFLAG_RD, sc, (uintptr_t)sensor, + sc->sc_ggrp_method ? aibs_sysctl_ggrp : aibs_sysctl, + sensor->t == AIBS_SENS_TYPE_TEMP ? "IK" : "I", descr); +} + +static int +aibs_attach_ggrp(struct aibs_softc *sc) +{ + ACPI_STATUS s; + ACPI_BUFFER buf; + ACPI_HANDLE h; + ACPI_OBJECT id; + ACPI_OBJECT *bp; + ACPI_OBJECT_LIST arg; + int i; + int t, v, f; + int err; + int *s_idx; + const char *name; + const char *descr; + struct aibs_sensor *sensor; + struct sysctl_oid **so; + + /* First see if GITM is available. */ + s = AcpiGetHandle(sc->sc_ah, "GITM", &h); + if (ACPI_FAILURE(s)) { + if (bootverbose) + device_printf(sc->sc_dev, "GITM not found\n"); + return (ENXIO); + } + + /* + * Now call GGRP with the appropriate argument to list sensors. + * The method lists different groups of entities depending on + * the argument. + */ + id.Integer.Value = AIBS_GROUP_SENSORS; + id.Type = ACPI_TYPE_INTEGER; + arg.Count = 1; + arg.Pointer = &id; + buf.Length = ACPI_ALLOCATE_BUFFER; + buf.Pointer = NULL; + s = AcpiEvaluateObjectTyped(sc->sc_ah, "GGRP", &arg, &buf, + ACPI_TYPE_PACKAGE); + if (ACPI_FAILURE(s)) { + device_printf(sc->sc_dev, "GGRP not found\n"); + return (ENXIO); + } + + bp = buf.Pointer; + sc->sc_asens_all = malloc(sizeof(*sc->sc_asens_all) * bp->Package.Count, + M_DEVBUF, M_WAITOK | M_ZERO); + v = t = f = 0; + for (i = 0; i < bp->Package.Count; i++) { + sensor = &sc->sc_asens_all[i]; + err = aibs_add_sensor(sc, &bp->Package.Elements[i], sensor, + &descr); + if (err != 0) + continue; + + switch (sensor->t) { + case AIBS_SENS_TYPE_VOLT: + name = "volt"; + so = &sc->sc_volt_sysctl; + s_idx = &v; + break; + case AIBS_SENS_TYPE_TEMP: + name = "temp"; + so = &sc->sc_temp_sysctl; + s_idx = &t; + break; + case AIBS_SENS_TYPE_FAN: + name = "fan"; + so = &sc->sc_fan_sysctl; + s_idx = &f; + break; + default: + panic("add_sensor succeeded for unknown sensor type %d", + sensor->t); + } + + if (*so == NULL) { + /* sysctl subtree for sensors of this type */ + *so = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->sc_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sc_dev)), + sensor->t, name, CTLFLAG_RD, NULL, NULL); + } + aibs_sensor_added(sc, *so, name, *s_idx, sensor, descr); + *s_idx += 1; + } + + AcpiOsFree(buf.Pointer); + return (0); +} + +static int +aibs_attach_sif(struct aibs_softc *sc, int st) { + char name[] = "?SIF"; ACPI_STATUS s; ACPI_BUFFER b; ACPI_OBJECT *bp, *o; - int i, n; const char *node; - char name[] = "?SIF"; struct aibs_sensor *as; - struct sysctl_oid *so; + struct sysctl_oid **so; + int i, n; + int err; switch (st) { - case AIBS_VOLT: + case AIBS_SENS_TYPE_VOLT: node = "volt"; name[0] = 'V'; + so = &sc->sc_volt_sysctl; break; - case AIBS_TEMP: + case AIBS_SENS_TYPE_TEMP: node = "temp"; name[0] = 'T'; + so = &sc->sc_temp_sysctl; break; - case AIBS_FAN: + case AIBS_SENS_TYPE_FAN: node = "fan"; name[0] = 'F'; + so = &sc->sc_fan_sysctl; break; default: - return; + panic("Unsupported sensor type %d", st); } b.Length = ACPI_ALLOCATE_BUFFER; @@ -164,7 +365,7 @@ aibs_attach_sif(struct aibs_softc *sc, e ACPI_TYPE_PACKAGE); if (ACPI_FAILURE(s)) { device_printf(sc->sc_dev, "%s not found\n", name); - return; + return (ENXIO); } bp = b.Pointer; @@ -172,14 +373,14 @@ aibs_attach_sif(struct aibs_softc *sc, e if (o[0].Type != ACPI_TYPE_INTEGER) { device_printf(sc->sc_dev, "%s[0]: invalid type\n", name); AcpiOsFree(b.Pointer); - return; + return (ENXIO); } n = o[0].Integer.Value; if (bp->Package.Count - 1 < n) { device_printf(sc->sc_dev, "%s: invalid package\n", name); AcpiOsFree(b.Pointer); - return; + return (ENXIO); } else if (bp->Package.Count - 1 > n) { int on = n; @@ -193,76 +394,37 @@ aibs_attach_sif(struct aibs_softc *sc, e device_printf(sc->sc_dev, "%s: no members in the package\n", name); AcpiOsFree(b.Pointer); - return; + return (ENXIO); } - as = malloc(sizeof(*as) * n, M_DEVBUF, M_NOWAIT | M_ZERO); - if (as == NULL) { - device_printf(sc->sc_dev, "%s: malloc fail\n", name); - AcpiOsFree(b.Pointer); - return; - } + as = malloc(sizeof(*as) * n, M_DEVBUF, M_WAITOK | M_ZERO); switch (st) { - case AIBS_VOLT: + case AIBS_SENS_TYPE_VOLT: sc->sc_asens_volt = as; break; - case AIBS_TEMP: + case AIBS_SENS_TYPE_TEMP: sc->sc_asens_temp = as; break; - case AIBS_FAN: + case AIBS_SENS_TYPE_FAN: sc->sc_asens_fan = as; break; } /* sysctl subtree for sensors of this type */ - so = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->sc_dev), + *so = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->sc_dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sc_dev)), st, node, CTLFLAG_RD, NULL, NULL); for (i = 0, o++; i < n; i++, o++) { - ACPI_OBJECT *oi; - char si[3]; - const char *desc; - - /* acpica5 automatically evaluates the referenced package */ - if (o[0].Type != ACPI_TYPE_PACKAGE) { - device_printf(sc->sc_dev, - "%s: %i: not a package: %i type\n", - name, i, o[0].Type); - continue; - } - oi = o[0].Package.Elements; - if (o[0].Package.Count != 5 || - oi[0].Type != ACPI_TYPE_INTEGER || - oi[1].Type != ACPI_TYPE_STRING || - oi[2].Type != ACPI_TYPE_INTEGER || - oi[3].Type != ACPI_TYPE_INTEGER || - oi[4].Type != ACPI_TYPE_INTEGER) { - device_printf(sc->sc_dev, - "%s: %i: invalid package\n", - name, i); - continue; - } - as[i].i = oi[0].Integer.Value; - desc = oi[1].String.Pointer; - as[i].l = oi[2].Integer.Value; - as[i].h = oi[3].Integer.Value; - as[i].t = st; -#ifdef AIBS_VERBOSE - device_printf(sc->sc_dev, "%c%i: " - "0x%08"PRIx64" %20s %5"PRIi64" / %5"PRIi64" " - "0x%"PRIx64"\n", - name[0], i, - (uint64_t)as[i].i, desc, (int64_t)as[i].l, - (int64_t)as[i].h, (uint64_t)oi[4].Integer.Value); -#endif - snprintf(si, sizeof(si), "%i", i); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->sc_dev), - SYSCTL_CHILDREN(so), i, si, CTLTYPE_INT | CTLFLAG_RD, - sc, st, aibs_sysctl, st == AIBS_TEMP ? "IK" : "I", desc); + const char *descr; + + err = aibs_add_sensor(sc, o, &as[i], &descr); + if (err == 0) + aibs_sensor_added(sc, *so, node, i, &as[i], descr); } AcpiOsFree(b.Pointer); + return (0); } static int @@ -276,7 +438,9 @@ aibs_detach(device_t dev) free(sc->sc_asens_temp, M_DEVBUF); if (sc->sc_asens_fan != NULL) free(sc->sc_asens_fan, M_DEVBUF); - return 0; + if (sc->sc_asens_all != NULL) + free(sc->sc_asens_all, M_DEVBUF); + return (0); } #ifdef AIBS_VERBOSE @@ -289,39 +453,33 @@ static int aibs_sysctl(SYSCTL_HANDLER_ARGS) { struct aibs_softc *sc = arg1; - enum aibs_type st = arg2; + struct aibs_sensor *sensor = (void *)arg2; int i = oidp->oid_number; ACPI_STATUS rs; ACPI_OBJECT p, *bp; ACPI_OBJECT_LIST mp; ACPI_BUFFER b; char *name; - struct aibs_sensor *as; ACPI_INTEGER v, l, h; int so[3]; - switch (st) { - case AIBS_VOLT: + switch (sensor->t) { + case AIBS_SENS_TYPE_VOLT: name = "RVLT"; - as = sc->sc_asens_volt; break; - case AIBS_TEMP: + case AIBS_SENS_TYPE_TEMP: name = "RTMP"; - as = sc->sc_asens_temp; break; - case AIBS_FAN: + case AIBS_SENS_TYPE_FAN: name = "RFAN"; - as = sc->sc_asens_fan; break; default: - return ENOENT; + return (ENOENT); } - if (as == NULL) - return ENOENT; - l = as[i].l; - h = as[i].h; + l = sensor->l; + h = sensor->h; p.Type = ACPI_TYPE_INTEGER; - p.Integer.Value = as[i].i; + p.Integer.Value = sensor->i; mp.Count = 1; mp.Pointer = &p; b.Length = ACPI_ALLOCATE_BUFFER; @@ -333,26 +491,91 @@ aibs_sysctl(SYSCTL_HANDLER_ARGS) "%s: %i: evaluation failed\n", name, i); ACPI_SERIAL_END(aibs); - return EIO; + return (EIO); } bp = b.Pointer; v = bp->Integer.Value; AcpiOsFree(b.Pointer); ACPI_SERIAL_END(aibs); - switch (st) { - case AIBS_VOLT: + switch (sensor->t) { + case AIBS_SENS_TYPE_VOLT: + break; + case AIBS_SENS_TYPE_TEMP: + v += 2731; + l += 2731; + h += 2731; + break; + case AIBS_SENS_TYPE_FAN: + break; + } + so[0] = v; + so[1] = l; + so[2] = h; + return (sysctl_handle_opaque(oidp, &so, sizeof(so), req)); +} + +static int +aibs_sysctl_ggrp(SYSCTL_HANDLER_ARGS) +{ + struct aibs_softc *sc = arg1; + struct aibs_sensor *sensor = (void *)arg2; + ACPI_STATUS rs; + ACPI_OBJECT p, *bp; + ACPI_OBJECT_LIST arg; + ACPI_BUFFER buf; + ACPI_INTEGER v, l, h; + int so[3]; + uint32_t *ret; + uint32_t cmd[3]; + + cmd[0] = sensor->i; + cmd[1] = 0; + cmd[2] = 0; + p.Type = ACPI_TYPE_BUFFER; + p.Buffer.Pointer = (void *)cmd; + p.Buffer.Length = sizeof(cmd); + arg.Count = 1; + arg.Pointer = &p; + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + ACPI_SERIAL_BEGIN(aibs); + rs = AcpiEvaluateObjectTyped(sc->sc_ah, "GITM", &arg, &buf, + ACPI_TYPE_BUFFER); + ACPI_SERIAL_END(aibs); + if (ACPI_FAILURE(rs)) { + device_printf(sc->sc_dev, "GITM evaluation failed\n"); + return (EIO); + } + bp = buf.Pointer; + if (bp->Buffer.Length < 8) { + device_printf(sc->sc_dev, "GITM returned short buffer\n"); + return (EIO); + } + ret = (uint32_t *)bp->Buffer.Pointer; + if (ret[0] == 0) { + device_printf(sc->sc_dev, "GITM returned error status\n"); + return (EINVAL); + } + v = ret[1]; + AcpiOsFree(buf.Pointer); + + l = sensor->l; + h = sensor->h; + + switch (sensor->t) { + case AIBS_SENS_TYPE_VOLT: break; - case AIBS_TEMP: + case AIBS_SENS_TYPE_TEMP: v += 2731; l += 2731; h += 2731; break; - case AIBS_FAN: + case AIBS_SENS_TYPE_FAN: break; } so[0] = v; so[1] = l; so[2] = h; - return sysctl_handle_opaque(oidp, &so, sizeof(so), req); + return (sysctl_handle_opaque(oidp, &so, sizeof(so), req)); } From owner-svn-src-head@freebsd.org Sat Oct 15 09:54:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3B84C111ED; Sat, 15 Oct 2016 09:54:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83EF3DBB; Sat, 15 Oct 2016 09:54:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9F9sMkv070815; Sat, 15 Oct 2016 09:54:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9F9sM3W070814; Sat, 15 Oct 2016 09:54:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201610150954.u9F9sM3W070814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 15 Oct 2016 09:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307349 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 09:54:23 -0000 Author: andrew Date: Sat Oct 15 09:54:22 2016 New Revision: 307349 URL: https://svnweb.freebsd.org/changeset/base/307349 Log: Check we are in a critical section when calling vfp_discard. As we may call it with a NULL thread pointer only check when it is non-NULL. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/vfp.c Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Sat Oct 15 09:10:35 2016 (r307348) +++ head/sys/arm64/arm64/vfp.c Sat Oct 15 09:54:22 2016 (r307349) @@ -79,6 +79,10 @@ void vfp_discard(struct thread *td) { +#ifdef INVARIANTS + if (td != NULL) + CRITICAL_ASSERT(td); +#endif if (PCPU_GET(fpcurthread) == td) PCPU_SET(fpcurthread, NULL); From owner-svn-src-head@freebsd.org Sat Oct 15 10:29:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BE35C11BDA; Sat, 15 Oct 2016 10:29:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36BFCDC4; Sat, 15 Oct 2016 10:29:35 +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 u9FATYTh082413; Sat, 15 Oct 2016 10:29:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FATY8s082409; Sat, 15 Oct 2016 10:29:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610151029.u9FATY8s082409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 15 Oct 2016 10:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307350 - in head: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 10:29:35 -0000 Author: mav Date: Sat Oct 15 10:29:33 2016 New Revision: 307350 URL: https://svnweb.freebsd.org/changeset/base/307350 Log: Add LUN options to limit UNMAP and WRITE SAME sizes. CTL itself has no limits on on UNMAP and WRITE SAME sizes. But depending on backends large requests may take too much time. To avoid that new configuration options allow to hint initiator maximal sizes it should not exceed. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_backend.c head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Oct 15 09:54:22 2016 (r307349) +++ head/sys/cam/ctl/ctl.c Sat Oct 15 10:29:33 2016 (r307350) @@ -9903,6 +9903,7 @@ ctl_inquiry_evpd_block_limits(struct ctl { struct scsi_vpd_block_limits *bl_ptr; struct ctl_lun *lun; + uint64_t ival; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -9941,8 +9942,14 @@ ctl_inquiry_evpd_block_limits(struct ctl if (lun != NULL) { scsi_ulto4b(lun->be_lun->opttxferlen, bl_ptr->opt_txfer_len); if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { - scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); - scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_blk_cnt); + ival = 0xffffffff; + ctl_get_opt_number(&lun->be_lun->options, + "unmap_max_lba", &ival); + scsi_ulto4b(ival, bl_ptr->max_unmap_lba_cnt); + ival = 0xffffffff; + ctl_get_opt_number(&lun->be_lun->options, + "unmap_max_descr", &ival); + scsi_ulto4b(ival, bl_ptr->max_unmap_blk_cnt); if (lun->be_lun->ublockexp != 0) { scsi_ulto4b((1 << lun->be_lun->ublockexp), bl_ptr->opt_unmap_grain); @@ -9956,8 +9963,10 @@ ctl_inquiry_evpd_block_limits(struct ctl scsi_ulto4b(0, bl_ptr->atomic_transfer_length_granularity); scsi_ulto4b(0, bl_ptr->max_atomic_transfer_length_with_atomic_boundary); scsi_ulto4b(0, bl_ptr->max_atomic_boundary_size); + ival = UINT64_MAX; + ctl_get_opt_number(&lun->be_lun->options, "write_same_max_lba", &ival); + scsi_u64to8b(ival, bl_ptr->max_write_same_length); } - scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length); ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Sat Oct 15 09:54:22 2016 (r307349) +++ head/sys/cam/ctl/ctl.h Sat Oct 15 10:29:33 2016 (r307350) @@ -217,6 +217,7 @@ void ctl_update_opts(ctl_options_t *opts struct ctl_be_arg *args); void ctl_free_opts(ctl_options_t *opts); char * ctl_get_opt(ctl_options_t *opts, const char *name); +int ctl_get_opt_number(ctl_options_t *opts, const char *name, uint64_t *num); int ctl_expand_number(const char *buf, uint64_t *num); #endif /* _KERNEL */ Modified: head/sys/cam/ctl/ctl_backend.c ============================================================================== --- head/sys/cam/ctl/ctl_backend.c Sat Oct 15 09:54:22 2016 (r307349) +++ head/sys/cam/ctl/ctl_backend.c Sat Oct 15 10:29:33 2016 (r307350) @@ -243,3 +243,14 @@ ctl_get_opt(ctl_options_t *opts, const c } return (NULL); } + +int +ctl_get_opt_number(ctl_options_t *opts, const char *name, uint64_t *val) +{ + const char *value; + + value = ctl_get_opt(opts, name); + if (value == NULL) + return (-2); + return (ctl_expand_number(value, val)); +} Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Sat Oct 15 09:54:22 2016 (r307349) +++ head/usr.sbin/ctladm/ctladm.8 Sat Oct 15 10:29:33 2016 (r307350) @@ -35,7 +35,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd September 26, 2015 +.Dd October 15, 2016 .Dt CTLADM 8 .Os .Sh NAME @@ -905,6 +905,13 @@ Specifies nominal form factor of the dev 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". .It Va unmap Set to "on", enables UNMAP support for the LUN, if supported by the backend. +.It Va unmap_max_lba +.It Va unmap_max_descr +Specify maximum allowed number of LBAs and block descriptors per UNMAP +command to report in Block Limits VPD page. +.It Va write_same_max_lba +Specify maximum allowed number of LBAs per WRITE SAME command to report +in Block Limits VPD page. .It Va avail-threshold .It Va used-threshold .It Va pool-avail-threshold From owner-svn-src-head@freebsd.org Sat Oct 15 10:53:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55B8EC12171; Sat, 15 Oct 2016 10:53:31 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 1B1309BA; Sat, 15 Oct 2016 10:53:30 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (5ec3950e.skybroadband.com [94.195.149.14]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id A7B57D84ED; Sat, 15 Oct 2016 10:52:54 +0000 (UTC) Date: Sat, 15 Oct 2016 11:52:53 +0100 From: Andrew Turner To: Oleksandr Tymoshenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307257 - in head/sys: arm/broadcom/bcm2835 arm64/broadcom arm64/broadcom/bcm2837 arm64/conf conf Message-ID: <20161015115253.053550b7@zapp> In-Reply-To: References: <201610140337.u9E3baB7077179@repo.freebsd.org> <20161014093123.606cb8f3@zapp> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 10:53:31 -0000 On Fri, 14 Oct 2016 10:23:24 -0700 Oleksandr Tymoshenko wrote: > > On Oct 14, 2016, at 1:31 AM, Andrew Turner > > wrote: > > > > On Fri, 14 Oct 2016 03:37:36 +0000 (UTC) > > Oleksandr Tymoshenko > > > wrote: > >> > >> Added: head/sys/arm64/conf/RPI3 > > > > Why a new kernel config and not GENERIC? > I thought about it. But no SMP support yet. When we have SMP support > we can get rid of RPI3 config. The RPI3 config should then include GENERIC and add nooption SMP. We should possible name it GENERIC-UP or similar. Andrew From owner-svn-src-head@freebsd.org Sat Oct 15 11:41:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4DFC12314; Sat, 15 Oct 2016 11:41:44 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from troz.pl (troz.pl [37.187.125.115]) by mx1.freebsd.org (Postfix) with ESMTP id DA188171; Sat, 15 Oct 2016 11:41:43 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from [192.168.0.2] (unknown [185.118.250.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by troz.pl (Postfix) with ESMTPSA id 28D6C994; Sat, 15 Oct 2016 13:41:42 +0200 (CEST) Subject: Re: svn commit: r307321 - in head/sys/arm64: arm64 include To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201610141553.u9EFrmT7062155@repo.freebsd.org> From: Konrad Witaszczyk Message-ID: Date: Sat, 15 Oct 2016 13:41:38 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201610141553.u9EFrmT7062155@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LrR0ev3DmqnFePiuhcL61Fu1ljARN0KKN" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 15 Oct 2016 11:41:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LrR0ev3DmqnFePiuhcL61Fu1ljARN0KKN Content-Type: multipart/mixed; boundary="naRKO9CPQCK5o11CPCjgv7mm4qx6HpxMf"; protected-headers="v1" From: Konrad Witaszczyk To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r307321 - in head/sys/arm64: arm64 include References: <201610141553.u9EFrmT7062155@repo.freebsd.org> In-Reply-To: <201610141553.u9EFrmT7062155@repo.freebsd.org> --naRKO9CPQCK5o11CPCjgv7mm4qx6HpxMf Content-Type: multipart/mixed; boundary="------------0F29FCD2389F98BF52E7E1FC" This is a multi-part message in MIME format. --------------0F29FCD2389F98BF52E7E1FC Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Andrew, On 10/14/2016 17:53, Andrew Turner wrote: > Author: andrew > Date: Fri Oct 14 15:53:48 2016 > New Revision: 307321 > URL: https://svnweb.freebsd.org/changeset/base/307321 >=20 > Log: > Rework how we store the VFP registers in the pcb. This will be used w= hen > creating a floating-point context within the kernel without having to= move > the stored values in memory. > =20 > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/sys/arm64/arm64/machdep.c > head/sys/arm64/arm64/vfp.c > head/sys/arm64/arm64/vm_machdep.c > head/sys/arm64/include/pcb.h > head/sys/arm64/include/vfp.h [...] > Modified: head/sys/arm64/include/pcb.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/arm64/include/pcb.h Fri Oct 14 15:16:44 2016 (r307320) > +++ head/sys/arm64/include/pcb.h Fri Oct 14 15:53:48 2016 (r307321) > @@ -31,6 +31,8 @@ > =20 > #ifndef LOCORE > =20 > +#include > + > struct trapframe; > =20 > #define PCB_LR 30 > @@ -49,13 +51,17 @@ struct pcb { > #define PCB_SINGLE_STEP_SHIFT 0 > #define PCB_SINGLE_STEP (1 << PCB_SINGLE_STEP_SHIFT) > =20 > - /* Place last to simplify the asm to access the rest if the struct */= > - __uint128_t pcb_vfp[32]; > - uint32_t pcb_fpcr; > - uint32_t pcb_fpsr; > + struct vfpstate *pcb_fpusaved; > int pcb_fpflags; > #define PCB_FP_STARTED 0x01 > u_int pcb_vfpcpu; /* Last cpu this thread ran VFP code */ > + > + /* > + * The userspace VFP state. The pcb_fpusaved pointer will point to > + * this unless the kernel has allocated a VFP context. > + * Place last to simplify the asm to access the rest if the struct. > + */ > + struct vfpstate pcb_fpustate; > }; > =20 > #ifdef _KERNEL >=20 > Modified: head/sys/arm64/include/vfp.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/arm64/include/vfp.h Fri Oct 14 15:16:44 2016 (r307320) > +++ head/sys/arm64/include/vfp.h Fri Oct 14 15:53:48 2016 (r307321) > @@ -35,6 +35,12 @@ > #ifdef _KERNEL > =20 > #ifndef LOCORE > +struct vfpstate { > + __uint128_t vfp_regs[32]; > + uint32_t vfp_fpcr; > + uint32_t vfp_fpsr; > +}; > + > void vfp_init(void); > void vfp_discard(struct thread *); > void vfp_restore_state(void); These changes break buildworld for arm64: In file included from /usr/home/def/FreeBSD/ekcd/repo/lib/libutil/kinfo_g= etfile.c:5: In file included from /usr/obj/arm64.aarch64/usr/home/def/FreeBSD/ekcd/repo/tmp/usr/include/sys= /user.h:38: /usr/obj/arm64.aarch64/usr/home/def/FreeBSD/ekcd/repo/tmp/usr/include/mac= hine/pcb.h:64:18: error: field has incomplete type 'struct vfpstate' struct vfpstate pcb_fpustate; ^ /usr/obj/arm64.aarch64/usr/home/def/FreeBSD/ekcd/repo/tmp/usr/include/mac= hine/pcb.h:54:9: note: forward declaration of 'struct vfpstate' struct vfpstate *pcb_fpusaved; ^ 1 error generated. --- kinfo_getfile.o --- *** [kinfo_getfile.o] Error code 1 You might want to consider making vfpstate available for userland as in a= rm case. If so I'm attaching a patch for it. Konrad --------------0F29FCD2389F98BF52E7E1FC Content-Type: text/x-patch; name="vfpstate.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="vfpstate.patch" diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index de99118..9429247 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -32,15 +32,15 @@ #ifndef _MACHINE_VFP_H_ #define _MACHINE_VFP_H_ =20 -#ifdef _KERNEL - #ifndef LOCORE + struct vfpstate { __uint128_t vfp_regs[32]; uint32_t vfp_fpcr; uint32_t vfp_fpsr; }; =20 +#ifdef _KERNEL void vfp_init(void); void vfp_discard(struct thread *); void vfp_restore_state(void); --------------0F29FCD2389F98BF52E7E1FC-- --naRKO9CPQCK5o11CPCjgv7mm4qx6HpxMf-- --LrR0ev3DmqnFePiuhcL61Fu1ljARN0KKN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJYAhX1XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRGREI1MzAxNjZGNTBCM0NCRUQ5QjZGNzdF MUMxMjI1QjBCMjZBNEYwAAoJEOHBIlsLJqTwJPAQAJIuw61OdSgvS2Rr4WCa3MQf 6z2U1hYtSboIl8KLtFbkGSoqA6t6ef9pWmIUkZTIDTxXqawymL+5uqFuNI/H6aDZ gQNte91zrM0MYYEPEX/5nhWUbHbk8xfVaVa0zXhXP7dXZuWP3YGOjyjaNswjqA6o yDKPKLgDK5HAwfhsc0m5K12DhQ4vnJfMO9AziQlVTJJ8nfmbeC5EbvMd3L1v34se cLkHh2ElUTVK63MrkrAZbdOhgDy9tibO2CSA4twJO5g+LBIA4cNC0t7ZBwBRC/bn s4JKWpO0dHAj1PyyJ7A348yRFOWcg+z4jhGXnPsXKo3nK5Zedi810k75rNErBhz+ p9YjWdCWwmtX+sj4gKVoY3h8uEUXNvYIovec1Em51UtufaWIbBQfrWleDNnM7W8X /FD0+E379AgxOrAXsEvch6QKWo4CjGI6PALyawPXnfx6rJrNVKslRFhX+Yi2iph+ 0T+b01WRNFwdvqZythzM4tdG+IFwhFtcNRfZGTYekZ+g01YO/SUvhy0Rm2PExKyl ifxgnaGvjv0EauFVtG2zm0vsyqEsynSgxs79TnTk1ftBDIMTkO1Aemhj/1/7Lm/i dd4rcpXaznAuly15kQB3jfUJ3gXaBH14IryA/TCM+wO/xpLa9wYZG1fGjALp7iap ato1jTzqojr7J+usqVLi =7uVE -----END PGP SIGNATURE----- --LrR0ev3DmqnFePiuhcL61Fu1ljARN0KKN-- From owner-svn-src-head@freebsd.org Sat Oct 15 12:07:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DA96C110EC; Sat, 15 Oct 2016 12:07: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 mx1.freebsd.org (Postfix) with ESMTPS id 1F30F1B3; Sat, 15 Oct 2016 12:07: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 u9FC7chs019657; Sat, 15 Oct 2016 12:07:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FC7bwq019651; Sat, 15 Oct 2016 12:07:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151207.u9FC7bwq019651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 12:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307351 - in head: . etc/mtree gnu/usr.bin gnu/usr.bin/rcs share/doc/psd share/doc/psd/13.rcs tools/build/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 12:07:39 -0000 Author: bapt Date: Sat Oct 15 12:07:37 2016 New Revision: 307351 URL: https://svnweb.freebsd.org/changeset/base/307351 Log: Remove GNU rcs from base. GNU rcs is still available as a package: - rcs: Latest GPLv3 GNU rcs version. - rcs57: Copy of the latest version of GNU rcs (GPLv2) from base. Relnotes: yes Deleted: head/gnu/usr.bin/rcs/ head/share/doc/psd/13.rcs/ head/tools/build/options/WITH_RCS Modified: head/ObsoleteFiles.inc head/UPDATING head/etc/mtree/BSD.usr.dist head/gnu/usr.bin/Makefile head/share/doc/psd/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Oct 15 10:29:33 2016 (r307350) +++ head/ObsoleteFiles.inc Sat Oct 15 12:07:37 2016 (r307351) @@ -38,6 +38,30 @@ # xargs -n1 | sort | uniq -d; # done +# 20161015: Remove GNU rcs +OLD_FILES+=usr/bin/ci +OLD_FILES+=usr/bin/co +OLD_FILES+=usr/bin/merge +OLD_FILES+=usr/bin/rcs +OLD_FILES+=usr/bin/rcsclean +OLD_FILES+=usr/bin/rcsdiff +OLD_FILES+=usr/bin/rcsfreeze +OLD_FILES+=usr/bin/rcsmerge +OLD_FILES+=usr/bin/rlog +OLD_FILES+=usr/share/doc/psd/13.rcs/paper.ascii.gz +OLD_FILES+=usr/share/doc/psd/13.rcs/rcs_func.ascii.gz +OLD_DIRS+=usr/share/doc/psd/13.rcs +OLD_FILES+=usr/share/man/man1/ci.1.gz +OLD_FILES+=usr/share/man/man1/co.1.gz +OLD_FILES+=usr/share/man/man1/merge.1.gz +OLD_FILES+=usr/share/man/man1/rcs.1.gz +OLD_FILES+=usr/share/man/man1/rcsclean.1.gz +OLD_FILES+=usr/share/man/man1/rcsdiff.1.gz +OLD_FILES+=usr/share/man/man1/rcsfreeze.1.gz +OLD_FILES+=usr/share/man/man1/rcsintro.1.gz +OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz +OLD_FILES+=usr/share/man/man1/rlog.1.gz +OLD_FILES+=usr/share/man/man5/rcsfile.5.gz # 20161010: remove link to removed m_getclr(9) macro OLD_FILES+=usr/share/man/man9/m_getclr.9.gz # 20161003: MK_ELFCOPY_AS_OBJCOPY option retired Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Oct 15 10:29:33 2016 (r307350) +++ head/UPDATING Sat Oct 15 12:07:37 2016 (r307351) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20161015: + GNU rcs has been removed rom base. It is available as packages: + - rcs: Latest GPLv3 GNU rcs version. + - rcs57: Copy of the latest version of GNU rcs (GPLv2) from base. + 20161008: Use of the cc_cdg, cc_chd, cc_hd, or cc_vegas congestion control modules now requires that the kernel configuration contain the Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sat Oct 15 10:29:33 2016 (r307350) +++ head/etc/mtree/BSD.usr.dist Sat Oct 15 12:07:37 2016 (r307351) @@ -228,8 +228,6 @@ .. 12.make .. - 13.rcs - .. 15.yacc .. 16.lex Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Sat Oct 15 10:29:33 2016 (r307350) +++ head/gnu/usr.bin/Makefile Sat Oct 15 12:07:37 2016 (r307351) @@ -11,7 +11,6 @@ SUBDIR= ${_binutils} \ ${_gperf} \ grep \ ${_groff} \ - ${_rcs} \ ${_tests} SUBDIR_DEPEND_gdb= ${_binutils} @@ -29,10 +28,6 @@ _groff= groff _dtc= dtc .endif -.if ${MK_RCS} != "no" -_rcs= rcs -.endif - .if ${MK_TESTS} != "no" _tests= tests .endif Modified: head/share/doc/psd/Makefile ============================================================================== --- head/share/doc/psd/Makefile Sat Oct 15 10:29:33 2016 (r307350) +++ head/share/doc/psd/Makefile Sat Oct 15 12:07:37 2016 (r307351) @@ -20,7 +20,6 @@ SUBDIR= title \ 05.sysman \ 06.Clang \ 12.make \ - 13.rcs \ 15.yacc \ 16.lex \ 17.m4 \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 15 10:29:33 2016 (r307350) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 15 12:07:37 2016 (r307351) @@ -6810,29 +6810,6 @@ OLD_FILES+=usr/share/man/man8/rshd.8.gz OLD_FILES+=usr/share/man/man8/rwhod.8.gz .endif -.if ${MK_RCS} == no -OLD_FILES+=usr/bin/ci -OLD_FILES+=usr/bin/co -OLD_FILES+=usr/bin/merge -OLD_FILES+=usr/bin/rcs -OLD_FILES+=usr/bin/rcsclean -OLD_FILES+=usr/bin/rcsdiff -OLD_FILES+=usr/bin/rcsfreeze -OLD_FILES+=usr/bin/rcsmerge -OLD_FILES+=usr/bin/rlog -OLD_FILES+=usr/share/man/man1/ci.1.gz -OLD_FILES+=usr/share/man/man1/co.1.gz -OLD_FILES+=usr/share/man/man1/merge.1.gz -OLD_FILES+=usr/share/man/man1/rcs.1.gz -OLD_FILES+=usr/share/man/man1/rcsclean.1.gz -OLD_FILES+=usr/share/man/man1/rcsdiff.1.gz -OLD_FILES+=usr/share/man/man1/rcsfreeze.1.gz -OLD_FILES+=usr/share/man/man1/rcsintro.1.gz -OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz -OLD_FILES+=usr/share/man/man1/rlog.1.gz -OLD_FILES+=usr/share/man/man5/rcsfile.5.gz -.endif - #.if ${MK_RESCUE} == no # to be filled in or replaced with a special target #.endif From owner-svn-src-head@freebsd.org Sat Oct 15 12:11:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8260C112D4; Sat, 15 Oct 2016 12:11:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89F0C77D; Sat, 15 Oct 2016 12:11:31 +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 u9FCBUB3022015; Sat, 15 Oct 2016 12:11:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FCBUG0022014; Sat, 15 Oct 2016 12:11:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151211.u9FCBUG0022014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 12:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307352 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 12:11:31 -0000 Author: bapt Date: Sat Oct 15 12:11:30 2016 New Revision: 307352 URL: https://svnweb.freebsd.org/changeset/base/307352 Log: Regen Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Oct 15 12:07:37 2016 (r307351) +++ head/share/man/man5/src.conf.5 Sat Oct 15 12:11:30 2016 (r307352) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 306729 2016-10-05 20:12:00Z emaste .\" $FreeBSD$ -.Dd October 10, 2016 +.Dd October 15, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1322,11 +1322,6 @@ This includes .Xr rlogin 1 , .Xr rsh 1 , etc. -.It Va WITH_RCS -.\" from FreeBSD: head/tools/build/options/WITH_RCS 305931 2016-09-18 15:01:11Z bapt -Set to build -.Xr rcs 1 -and related utilities. .It Va WITHOUT_RESCUE .\" from FreeBSD: head/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 07:50:50Z ru Set to not build From owner-svn-src-head@freebsd.org Sat Oct 15 12:23:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C620C11BCA; Sat, 15 Oct 2016 12:23:56 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED89716; Sat, 15 Oct 2016 12:23:55 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9FCNt0j027064; Sat, 15 Oct 2016 12:23:55 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FCNtbD027063; Sat, 15 Oct 2016 12:23:55 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201610151223.u9FCNtbD027063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 15 Oct 2016 12:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307354 - head/sys/arm/allwinner/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 12:23:56 -0000 Author: jmcneill Date: Sat Oct 15 12:23:54 2016 New Revision: 307354 URL: https://svnweb.freebsd.org/changeset/base/307354 Log: Provide a complete A23 PLL1 factor table, from 60MHz to 1872MHz. Modified: head/sys/arm/allwinner/clk/aw_pll.c Modified: head/sys/arm/allwinner/clk/aw_pll.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_pll.c Sat Oct 15 12:22:06 2016 (r307353) +++ head/sys/arm/allwinner/clk/aw_pll.c Sat Oct 15 12:23:54 2016 (r307354) @@ -193,12 +193,76 @@ struct aw_pll_factor { { .n = (_n), .k = (_k), .m = (_m), .p = (_p), .freq = (_freq) } static struct aw_pll_factor aw_a23_pll1_factors[] = { + PLLFACTOR(9, 0, 0, 2, 60000000), + PLLFACTOR(10, 0, 0, 2, 66000000), + PLLFACTOR(11, 0, 0, 2, 72000000), + PLLFACTOR(12, 0, 0, 2, 78000000), + PLLFACTOR(13, 0, 0, 2, 84000000), + PLLFACTOR(14, 0, 0, 2, 90000000), + PLLFACTOR(15, 0, 0, 2, 96000000), + PLLFACTOR(16, 0, 0, 2, 102000000), + PLLFACTOR(17, 0, 0, 2, 108000000), + PLLFACTOR(18, 0, 0, 2, 114000000), + PLLFACTOR(9, 0, 0, 1, 120000000), + PLLFACTOR(10, 0, 0, 1, 132000000), + PLLFACTOR(11, 0, 0, 1, 144000000), + PLLFACTOR(12, 0, 0, 1, 156000000), + PLLFACTOR(13, 0, 0, 1, 168000000), + PLLFACTOR(14, 0, 0, 1, 180000000), + PLLFACTOR(15, 0, 0, 1, 192000000), + PLLFACTOR(16, 0, 0, 1, 204000000), + PLLFACTOR(17, 0, 0, 1, 216000000), + PLLFACTOR(18, 0, 0, 1, 228000000), + PLLFACTOR(9, 0, 0, 0, 240000000), + PLLFACTOR(10, 0, 0, 0, 264000000), + PLLFACTOR(11, 0, 0, 0, 288000000), + PLLFACTOR(12, 0, 0, 0, 312000000), + PLLFACTOR(13, 0, 0, 0, 336000000), + PLLFACTOR(14, 0, 0, 0, 360000000), + PLLFACTOR(15, 0, 0, 0, 384000000), PLLFACTOR(16, 0, 0, 0, 408000000), + PLLFACTOR(17, 0, 0, 0, 432000000), + PLLFACTOR(18, 0, 0, 0, 456000000), + PLLFACTOR(19, 0, 0, 0, 480000000), + PLLFACTOR(20, 0, 0, 0, 504000000), + PLLFACTOR(21, 0, 0, 0, 528000000), + PLLFACTOR(22, 0, 0, 0, 552000000), + PLLFACTOR(23, 0, 0, 0, 576000000), + PLLFACTOR(24, 0, 0, 0, 600000000), + PLLFACTOR(25, 0, 0, 0, 624000000), PLLFACTOR(26, 0, 0, 0, 648000000), + PLLFACTOR(27, 0, 0, 0, 672000000), + PLLFACTOR(28, 0, 0, 0, 696000000), + PLLFACTOR(29, 0, 0, 0, 720000000), + PLLFACTOR(15, 1, 0, 0, 768000000), + PLLFACTOR(10, 2, 0, 0, 792000000), PLLFACTOR(16, 1, 0, 0, 816000000), + PLLFACTOR(17, 1, 0, 0, 864000000), + PLLFACTOR(18, 1, 0, 0, 912000000), + PLLFACTOR(12, 2, 0, 0, 936000000), + PLLFACTOR(19, 1, 0, 0, 960000000), PLLFACTOR(20, 1, 0, 0, 1008000000), + PLLFACTOR(21, 1, 0, 0, 1056000000), + PLLFACTOR(14, 2, 0, 0, 1080000000), + PLLFACTOR(22, 1, 0, 0, 1104000000), + PLLFACTOR(23, 1, 0, 0, 1152000000), PLLFACTOR(24, 1, 0, 0, 1200000000), + PLLFACTOR(16, 2, 0, 0, 1224000000), + PLLFACTOR(25, 1, 0, 0, 1248000000), PLLFACTOR(26, 1, 0, 0, 1296000000), + PLLFACTOR(27, 1, 0, 0, 1344000000), + PLLFACTOR(18, 2, 0, 0, 1368000000), + PLLFACTOR(28, 1, 0, 0, 1392000000), + PLLFACTOR(29, 1, 0, 0, 1440000000), + PLLFACTOR(20, 2, 0, 0, 1512000000), + PLLFACTOR(15, 3, 0, 0, 1536000000), + PLLFACTOR(21, 2, 0, 0, 1584000000), + PLLFACTOR(16, 3, 0, 0, 1632000000), + PLLFACTOR(22, 2, 0, 0, 1656000000), + PLLFACTOR(23, 2, 0, 0, 1728000000), + PLLFACTOR(24, 2, 0, 0, 1800000000), + PLLFACTOR(18, 3, 0, 0, 1824000000), + PLLFACTOR(25, 2, 0, 0, 1872000000), }; enum aw_pll_type { From owner-svn-src-head@freebsd.org Sat Oct 15 12:33:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B20D5C13037; Sat, 15 Oct 2016 12:33: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 mx1.freebsd.org (Postfix) with ESMTPS id 84337B7B; Sat, 15 Oct 2016 12:33: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 u9FCWxYL031428; Sat, 15 Oct 2016 12:32:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FCWxt1031427; Sat, 15 Oct 2016 12:32:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151232.u9FCWxt1031427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 12:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307356 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 12:33:00 -0000 Author: bapt Date: Sat Oct 15 12:32:59 2016 New Revision: 307356 URL: https://svnweb.freebsd.org/changeset/base/307356 Log: Fix typo Reported by: "N.J. Mann" Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Oct 15 12:28:14 2016 (r307355) +++ head/UPDATING Sat Oct 15 12:32:59 2016 (r307356) @@ -32,7 +32,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20161015: - GNU rcs has been removed rom base. It is available as packages: + GNU rcs has been removed from base. It is available as packages: - rcs: Latest GPLv3 GNU rcs version. - rcs57: Copy of the latest version of GNU rcs (GPLv2) from base. From owner-svn-src-head@freebsd.org Sat Oct 15 13:16:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA625C13985; Sat, 15 Oct 2016 13:16:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAA7F687; Sat, 15 Oct 2016 13:16:53 +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 u9FDGq5k046947; Sat, 15 Oct 2016 13:16:52 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FDGqQN046946; Sat, 15 Oct 2016 13:16:52 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151316.u9FDGqQN046946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 13:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307364 - head/lib/libdevdctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 13:16:54 -0000 Author: bapt Date: Sat Oct 15 13:16:52 2016 New Revision: 307364 URL: https://svnweb.freebsd.org/changeset/base/307364 Log: directly create the socket with SOCK_NONBLOCK instead of calling fcntl(2) Modified: head/lib/libdevdctl/consumer.cc Modified: head/lib/libdevdctl/consumer.cc ============================================================================== --- head/lib/libdevdctl/consumer.cc Sat Oct 15 12:42:47 2016 (r307363) +++ head/lib/libdevdctl/consumer.cc Sat Oct 15 13:16:52 2016 (r307364) @@ -108,11 +108,9 @@ Consumer::ConnectToDevd() strlcpy(devdAddr.sun_path, s_devdSockPath, sizeof(devdAddr.sun_path)); sLen = SUN_LEN(&devdAddr); - m_devdSockFD = socket(AF_UNIX, SOCK_SEQPACKET, 0); + m_devdSockFD = socket(AF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK, 0); if (m_devdSockFD == -1) err(1, "Unable to create socket"); - if (fcntl(m_devdSockFD, F_SETFL, O_NONBLOCK) < 0) - err(1, "fcntl"); result = connect(m_devdSockFD, reinterpret_cast(&devdAddr), sLen); From owner-svn-src-head@freebsd.org Sat Oct 15 13:17:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EE06C139CE; Sat, 15 Oct 2016 13:17:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E74D853; Sat, 15 Oct 2016 13:17:28 +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 u9FDHR7A047012; Sat, 15 Oct 2016 13:17:27 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FDHRt9047011; Sat, 15 Oct 2016 13:17:27 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151317.u9FDHRt9047011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 13:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307365 - head/lib/libucl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 13:17:28 -0000 Author: bapt Date: Sat Oct 15 13:17:27 2016 New Revision: 307365 URL: https://svnweb.freebsd.org/changeset/base/307365 Log: Use SRCTOP to find the sources of libucl Modified: head/lib/libucl/Makefile Modified: head/lib/libucl/Makefile ============================================================================== --- head/lib/libucl/Makefile Sat Oct 15 13:16:52 2016 (r307364) +++ head/lib/libucl/Makefile Sat Oct 15 13:17:27 2016 (r307365) @@ -1,6 +1,6 @@ # $FreeBSD$ -LIBUCL= ${.CURDIR}/../../contrib/libucl +LIBUCL= ${SRCTOP}/contrib/libucl PACKAGE=lib${LIB} LIB= ucl From owner-svn-src-head@freebsd.org Sat Oct 15 13:27:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FB18C13D8E; Sat, 15 Oct 2016 13:27:02 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC51F39; Sat, 15 Oct 2016 13:27:02 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9FDR1s5050775; Sat, 15 Oct 2016 13:27:01 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FDR1Y0050774; Sat, 15 Oct 2016 13:27:01 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201610151327.u9FDR1Y0050774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 15 Oct 2016 13:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307366 - head/sys/arm/allwinner/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 13:27:02 -0000 Author: jmcneill Date: Sat Oct 15 13:27:01 2016 New Revision: 307366 URL: https://svnweb.freebsd.org/changeset/base/307366 Log: Match "allwinner,sun8i-h3-apb0-gates-clk" compatible string. Modified: head/sys/arm/allwinner/clk/aw_gate.c Modified: head/sys/arm/allwinner/clk/aw_gate.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_gate.c Sat Oct 15 13:17:27 2016 (r307365) +++ head/sys/arm/allwinner/clk/aw_gate.c Sat Oct 15 13:27:01 2016 (r307366) @@ -91,6 +91,8 @@ static struct ofw_compat_data compat_dat { "allwinner,sun8i-h3-bus-gates-clk", (uintptr_t)"Allwinner Bus Clock Gates" }, + { "allwinner,sun8i-h3-apb0-gates-clk", + (uintptr_t)"Allwinner APB0 Clock Gates" }, { "allwinner,sun9i-a80-apbs-gates-clk", (uintptr_t)"Allwinner APBS Clock Gates" }, From owner-svn-src-head@freebsd.org Sat Oct 15 13:41:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58AFEC1239E; Sat, 15 Oct 2016 13:41:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB3EAC9; Sat, 15 Oct 2016 13:41:59 +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 u9FDfwWf055456; Sat, 15 Oct 2016 13:41:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FDfwkJ055455; Sat, 15 Oct 2016 13:41:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151341.u9FDfwkJ055455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 13:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307368 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 13:41:59 -0000 Author: bapt Date: Sat Oct 15 13:41:58 2016 New Revision: 307368 URL: https://svnweb.freebsd.org/changeset/base/307368 Log: Remove the common.h include which is actually not used in sdiff.c Modified: head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Sat Oct 15 13:39:30 2016 (r307367) +++ head/usr.bin/sdiff/sdiff.c Sat Oct 15 13:41:58 2016 (r307368) @@ -27,7 +27,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "common.h" #include "extern.h" #define DIFF_PATH "/usr/bin/diff" From owner-svn-src-head@freebsd.org Sat Oct 15 13:42:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C31BC123F5; Sat, 15 Oct 2016 13:42: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 mx1.freebsd.org (Postfix) with ESMTPS id 48866C9D; Sat, 15 Oct 2016 13:42: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 u9FDgcaR058143; Sat, 15 Oct 2016 13:42:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FDgcpF058142; Sat, 15 Oct 2016 13:42:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151342.u9FDgcpF058142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 13:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307369 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 13:42:39 -0000 Author: bapt Date: Sat Oct 15 13:42:38 2016 New Revision: 307369 URL: https://svnweb.freebsd.org/changeset/base/307369 Log: Turn editit into a static function Modified: head/usr.bin/sdiff/edit.c Modified: head/usr.bin/sdiff/edit.c ============================================================================== --- head/usr.bin/sdiff/edit.c Sat Oct 15 13:41:58 2016 (r307368) +++ head/usr.bin/sdiff/edit.c Sat Oct 15 13:42:38 2016 (r307369) @@ -24,15 +24,13 @@ __FBSDID("$FreeBSD$"); #include "common.h" #include "extern.h" -int editit(const char *); - /* * Execute an editor on the specified pathname, which is interpreted * from the shell. This means flags may be included. * * Returns -1 on error, or the exit value on success. */ -int +static int editit(const char *pathname) { sig_t sighup, sigint, sigquit, sigchld; From owner-svn-src-head@freebsd.org Sat Oct 15 13:45:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10D9DC1257C; Sat, 15 Oct 2016 13:45:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D47D2166; Sat, 15 Oct 2016 13:45:10 +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 u9FDjAN4058426; Sat, 15 Oct 2016 13:45:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FDj9pN058424; Sat, 15 Oct 2016 13:45:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151345.u9FDj9pN058424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 13:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307372 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 13:45:11 -0000 Author: bapt Date: Sat Oct 15 13:45:09 2016 New Revision: 307372 URL: https://svnweb.freebsd.org/changeset/base/307372 Log: Move cleanup() into the edit.c file which is the only users of that function Remove common.{c,h} Deleted: head/usr.bin/sdiff/common.c head/usr.bin/sdiff/common.h Modified: head/usr.bin/sdiff/Makefile head/usr.bin/sdiff/edit.c Modified: head/usr.bin/sdiff/Makefile ============================================================================== --- head/usr.bin/sdiff/Makefile Sat Oct 15 13:44:13 2016 (r307371) +++ head/usr.bin/sdiff/Makefile Sat Oct 15 13:45:09 2016 (r307372) @@ -3,7 +3,7 @@ .include PROG= sdiff -SRCS= common.c edit.c sdiff.c +SRCS= edit.c sdiff.c WARNS= 3 MAN1= sdiff.1 Modified: head/usr.bin/sdiff/edit.c ============================================================================== --- head/usr.bin/sdiff/edit.c Sat Oct 15 13:44:13 2016 (r307371) +++ head/usr.bin/sdiff/edit.c Sat Oct 15 13:45:09 2016 (r307372) @@ -21,9 +21,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include "common.h" #include "extern.h" +static void +cleanup(const char *filename) +{ + + if (unlink(filename)) + err(2, "could not delete: %s", filename); + exit(2); +} + /* * Execute an editor on the specified pathname, which is interpreted * from the shell. This means flags may be included. From owner-svn-src-head@freebsd.org Sat Oct 15 14:40:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0D98C13186; Sat, 15 Oct 2016 14:40:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A312BA40; Sat, 15 Oct 2016 14:40:35 +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 u9FEeY6G077714; Sat, 15 Oct 2016 14:40:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FEeYZ0077712; Sat, 15 Oct 2016 14:40:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201610151440.u9FEeYZ0077712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 15 Oct 2016 14:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307374 - in head: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 14:40:36 -0000 Author: mav Date: Sat Oct 15 14:40:34 2016 New Revision: 307374 URL: https://svnweb.freebsd.org/changeset/base/307374 Log: Add LU option to control reported provisioning type. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Oct 15 13:45:12 2016 (r307373) +++ head/sys/cam/ctl/ctl.c Sat Oct 15 14:40:34 2016 (r307374) @@ -10040,6 +10040,7 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * { struct scsi_vpd_logical_block_prov *lbp_ptr; struct ctl_lun *lun; + const char *value; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -10077,7 +10078,14 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10 | SVPD_LBP_RZ | SVPD_LBP_ANC_SUP; - lbp_ptr->prov_type = SVPD_LBP_THIN; + value = ctl_get_opt(&lun->be_lun->options, "provisioning_type"); + if (value != NULL) { + if (strcmp(value, "resource") == 0) + lbp_ptr->prov_type = SVPD_LBP_RESOURCE; + else if (strcmp(value, "thin") == 0) + lbp_ptr->prov_type = SVPD_LBP_THIN; + } else + lbp_ptr->prov_type = SVPD_LBP_THIN; } ctl_set_success(ctsio); Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Sat Oct 15 13:45:12 2016 (r307373) +++ head/usr.sbin/ctladm/ctladm.8 Sat Oct 15 14:40:34 2016 (r307374) @@ -903,8 +903,14 @@ Specifies medium rotation rate of the de .It Va formfactor Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25", 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". +.It Va provisioning_type +When UNMAP support is enabled, this option specifies provisioning type: +"resource", "thin" or "unknown". +Default value is "thin". +Logical units without UNMAP support are reported as fully provisioned. .It Va unmap -Set to "on", enables UNMAP support for the LUN, if supported by the backend. +Setting to "on" or "off" controls UNMAP support for the logical unit. +Default value is "on" if supported by the backend. .It Va unmap_max_lba .It Va unmap_max_descr Specify maximum allowed number of LBAs and block descriptors per UNMAP From owner-svn-src-head@freebsd.org Sat Oct 15 15:10:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17488C136F9; Sat, 15 Oct 2016 15:10:57 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 0236B9D5; Sat, 15 Oct 2016 15:10:57 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from ford.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id D346756488; Sat, 15 Oct 2016 10:10:49 -0500 (CDT) Subject: Re: svn commit: r306346 - head/sys/kern To: Gleb Smirnoff References: <201609261530.u8QFUUZd020174@repo.freebsd.org> <20161004205600.GN23123@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eric van Gyzen Message-ID: Date: Sat, 15 Oct 2016 10:10:46 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161004205600.GN23123@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 15:10:57 -0000 On 10/04/2016 15:56, Gleb Smirnoff wrote: > Eric, > > E> @@ -924,7 +924,7 @@ __mtx_assert(const volatile uintptr_t *c > E> { > E> const struct mtx *m; > E> > E> - if (panicstr != NULL || dumping) > E> + if (panicstr != NULL || dumping || SCHEDULER_STOPPED()) > E> return; > > I wonder if all this disjunct can be reduced just to SCHEDULER_STOPPED()? > Positive panicstr and dumping imply scheduler stopped. If I read correctly, that's /almost/ true, but the scheduler is only stopped #ifdef SMP and we're panicking, so we need the full expression to cover the !SMP and reboot(RB_DUMP) cases. Eric From owner-svn-src-head@freebsd.org Sat Oct 15 15:55:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B153C131BA; Sat, 15 Oct 2016 15:55:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1644FD3; Sat, 15 Oct 2016 15:55:05 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9FFt53H008164; Sat, 15 Oct 2016 15:55:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FFt5QE008163; Sat, 15 Oct 2016 15:55:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151555.u9FFt5QE008163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 15:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307376 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 15:55:06 -0000 Author: bapt Date: Sat Oct 15 15:55:04 2016 New Revision: 307376 URL: https://svnweb.freebsd.org/changeset/base/307376 Log: Improve wording Submitted by: lidl Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Oct 15 14:42:41 2016 (r307375) +++ head/UPDATING Sat Oct 15 15:55:04 2016 (r307376) @@ -34,7 +34,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 20161015: GNU rcs has been removed from base. It is available as packages: - rcs: Latest GPLv3 GNU rcs version. - - rcs57: Copy of the latest version of GNU rcs (GPLv2) from base. + - rcs57: Copy of the latest version of GNU rcs (GPLv2) before it was + removed from base. 20161008: Use of the cc_cdg, cc_chd, cc_hd, or cc_vegas congestion control From owner-svn-src-head@freebsd.org Sat Oct 15 16:29:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00FD4C1383D; Sat, 15 Oct 2016 16:29:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C70DCEE; Sat, 15 Oct 2016 16:29:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9FGT6IW019395; Sat, 15 Oct 2016 16:29:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FGT6oR019394; Sat, 15 Oct 2016 16:29:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201610151629.u9FGT6oR019394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 15 Oct 2016 16:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307377 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 16:29:08 -0000 Author: andrew Date: Sat Oct 15 16:29:06 2016 New Revision: 307377 URL: https://svnweb.freebsd.org/changeset/base/307377 Log: Fix the build, struct vfpstate needs to be visible to userspace as it's part of struct pcb which is in a header used in libutil. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/include/vfp.h Modified: head/sys/arm64/include/vfp.h ============================================================================== --- head/sys/arm64/include/vfp.h Sat Oct 15 15:55:04 2016 (r307376) +++ head/sys/arm64/include/vfp.h Sat Oct 15 16:29:06 2016 (r307377) @@ -32,7 +32,6 @@ #ifndef _MACHINE_VFP_H_ #define _MACHINE_VFP_H_ -#ifdef _KERNEL #ifndef LOCORE struct vfpstate { @@ -41,6 +40,7 @@ struct vfpstate { uint32_t vfp_fpsr; }; +#ifdef _KERNEL void vfp_init(void); void vfp_discard(struct thread *); void vfp_restore_state(void); From owner-svn-src-head@freebsd.org Sat Oct 15 17:49:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EE11C137E6; Sat, 15 Oct 2016 17:49:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18BF0322; Sat, 15 Oct 2016 17:49:43 +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 u9FHngW5049128; Sat, 15 Oct 2016 17:49:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FHngP8049126; Sat, 15 Oct 2016 17:49:42 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201610151749.u9FHngP8049126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 15 Oct 2016 17:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307379 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 17:49:43 -0000 Author: manu Date: Sat Oct 15 17:49:41 2016 New Revision: 307379 URL: https://svnweb.freebsd.org/changeset/base/307379 Log: axp209: Add support for regulators Except for LDO4, all regulators are supported. MFC after: 1 week Modified: head/sys/arm/allwinner/axp209.c head/sys/arm/allwinner/axp209reg.h Modified: head/sys/arm/allwinner/axp209.c ============================================================================== --- head/sys/arm/allwinner/axp209.c Sat Oct 15 17:39:40 2016 (r307378) +++ head/sys/arm/allwinner/axp209.c Sat Oct 15 17:49:41 2016 (r307379) @@ -50,14 +50,92 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include +#include + #include #include "iicbus_if.h" #include "gpio_if.h" +#include "regdev_if.h" + +MALLOC_DEFINE(M_AXP209_REG, "Axp209 regulator", "Axp209 power regulator"); + +struct axp209_regdef { + intptr_t id; + char *name; + uint8_t enable_reg; + uint8_t enable_mask; + uint8_t voltage_reg; + uint8_t voltage_mask; + uint8_t voltage_shift; + int voltage_min; + int voltage_max; + int voltage_step; + int voltage_nstep; +}; + +static struct axp209_regdef axp209_regdefs[] = { + { + .id = AXP209_REG_ID_DCDC2, + .name = "dcdc2", + .enable_reg = AXP209_POWERCTL, + .enable_mask = AXP209_POWERCTL_DCDC2, + .voltage_reg = AXP209_REG_DCDC2_VOLTAGE, + .voltage_mask = 0x3f, + .voltage_min = 700, + .voltage_max = 2275, + .voltage_step = 25, + .voltage_nstep = 64, + }, + { + .id = AXP209_REG_ID_DCDC3, + .name = "dcdc3", + .enable_reg = AXP209_POWERCTL, + .enable_mask = AXP209_POWERCTL_DCDC3, + .voltage_reg = AXP209_REG_DCDC3_VOLTAGE, + .voltage_mask = 0x7f, + .voltage_min = 700, + .voltage_max = 3500, + .voltage_step = 25, + .voltage_nstep = 128, + }, + { + .id = AXP209_REG_ID_LDO2, + .name = "ldo2", + .enable_reg = AXP209_POWERCTL, + .enable_mask = AXP209_POWERCTL_LDO2, + .voltage_reg = AXP209_REG_LDO24_VOLTAGE, + .voltage_mask = 0xf0, + .voltage_shift = 4, + .voltage_min = 1800, + .voltage_max = 3300, + .voltage_step = 100, + .voltage_nstep = 16, + }, + { + .id = AXP209_REG_ID_LDO3, + .name = "ldo3", + .enable_reg = AXP209_POWERCTL, + .enable_mask = AXP209_POWERCTL_LDO3, + .voltage_reg = AXP209_REG_LDO3_VOLTAGE, + .voltage_mask = 0x7f, + .voltage_min = 700, + .voltage_max = 2275, + .voltage_step = 25, + .voltage_nstep = 128, + }, +}; + +struct axp209_reg_sc { + struct regnode *regnode; + device_t base_dev; + struct axp209_regdef *def; + phandle_t xref; + struct regnode_std_param *param; +}; struct axp209_softc { device_t dev; @@ -67,6 +145,10 @@ struct axp209_softc { struct intr_config_hook intr_hook; device_t gpiodev; struct mtx mtx; + + /* Regulators */ + struct axp209_reg_sc **regs; + int nregs; }; /* GPIO3 is different, don't expose it for now */ @@ -125,6 +207,115 @@ axp209_write(device_t dev, uint8_t reg, } static int +axp209_regnode_init(struct regnode *regnode) +{ + return (0); +} + +static int +axp209_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +{ + struct axp209_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + axp209_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (enable) + val |= sc->def->enable_mask; + else + val &= ~sc->def->enable_mask; + axp209_write(sc->base_dev, sc->def->enable_reg, val); + + *udelay = 0; + + return (0); +} + +static void +axp209_regnode_reg_to_voltage(struct axp209_reg_sc *sc, uint8_t val, int *uv) +{ + if (val < sc->def->voltage_nstep) + *uv = sc->def->voltage_min + val * sc->def->voltage_step; + else + *uv = sc->def->voltage_min + + (sc->def->voltage_nstep * sc->def->voltage_step); + *uv *= 1000; +} + +static int +axp209_regnode_voltage_to_reg(struct axp209_reg_sc *sc, int min_uvolt, + int max_uvolt, uint8_t *val) +{ + uint8_t nval; + int nstep, uvolt; + + nval = 0; + uvolt = sc->def->voltage_min * 1000; + + for (nstep = 0; nstep < sc->def->voltage_nstep && uvolt < min_uvolt; + nstep++) { + ++nval; + uvolt += (sc->def->voltage_step * 1000); + } + if (uvolt > max_uvolt) + return (EINVAL); + + *val = nval; + return (0); +} + +static int +axp209_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay) +{ + struct axp209_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step) + return (ENXIO); + + if (axp209_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) + return (ERANGE); + + axp209_write(sc->base_dev, sc->def->voltage_reg, val); + + *udelay = 0; + + return (0); +} + +static int +axp209_regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct axp209_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step) + return (ENXIO); + + axp209_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + axp209_regnode_reg_to_voltage(sc, val & sc->def->voltage_mask, uvolt); + + return (0); +} + +static regnode_method_t axp209_regnode_methods[] = { + /* Regulator interface */ + REGNODEMETHOD(regnode_init, axp209_regnode_init), + REGNODEMETHOD(regnode_enable, axp209_regnode_enable), + REGNODEMETHOD(regnode_set_voltage, axp209_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, axp209_regnode_get_voltage), + REGNODEMETHOD_END +}; +DEFINE_CLASS_1(axp209_regnode, axp209_regnode_class, axp209_regnode_methods, + sizeof(struct axp209_reg_sc), regnode_class); + +static int axp209_sysctl(SYSCTL_HANDLER_ARGS) { device_t dev = arg1; @@ -517,6 +708,63 @@ axp209_get_node(device_t dev, device_t b return (ofw_bus_get_node(dev)); } +static struct axp209_reg_sc * +axp209_reg_attach(device_t dev, phandle_t node, + struct axp209_regdef *def) +{ + struct axp209_reg_sc *reg_sc; + struct regnode_init_def initdef; + struct regnode *regnode; + + memset(&initdef, 0, sizeof(initdef)); + if (regulator_parse_ofw_stdparam(dev, node, &initdef) != 0) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + if (initdef.std_param.min_uvolt == 0) + initdef.std_param.min_uvolt = def->voltage_min * 1000; + if (initdef.std_param.max_uvolt == 0) + initdef.std_param.max_uvolt = def->voltage_max * 1000; + initdef.id = def->id; + initdef.ofw_node = node; + regnode = regnode_create(dev, &axp209_regnode_class, &initdef); + if (regnode == NULL) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + + reg_sc = regnode_get_softc(regnode); + reg_sc->regnode = regnode; + reg_sc->base_dev = dev; + reg_sc->def = def; + reg_sc->xref = OF_xref_from_node(node); + reg_sc->param = regnode_get_stdparam(regnode); + + regnode_register(regnode); + + return (reg_sc); +} + +static int +axp209_regdev_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, + intptr_t *num) +{ + struct axp209_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->nregs; i++) { + if (sc->regs[i] == NULL) + continue; + if (sc->regs[i]->xref == xref) { + *num = sc->regs[i]->def->id; + return (0); + } + } + + return (ENXIO); +} + static void axp209_start(void *pdev) { @@ -654,6 +902,9 @@ static int axp209_attach(device_t dev) { struct axp209_softc *sc; + struct axp209_reg_sc *reg; + phandle_t rnode, child; + int i; sc = device_get_softc(dev); mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); @@ -669,6 +920,29 @@ axp209_attach(device_t dev) if (config_intrhook_establish(&sc->intr_hook) != 0) return (ENOMEM); + sc->nregs = nitems(axp209_regdefs); + sc->regs = malloc(sizeof(struct axp209_reg_sc *) * sc->nregs, + M_AXP209_REG, M_WAITOK | M_ZERO); + + /* Attach known regulators that exist in the DT */ + rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); + if (rnode > 0) { + for (i = 0; i < sc->nregs; i++) { + child = ofw_bus_find_child(rnode, + axp209_regdefs[i].name); + if (child == 0) + continue; + reg = axp209_reg_attach(dev, child, &axp209_regdefs[i]); + if (reg == NULL) { + device_printf(dev, + "cannot attach regulator %s\n", + axp209_regdefs[i].name); + continue; + } + sc->regs[i] = reg; + } + } + sc->gpiodev = gpiobus_attach_bus(dev); return (0); @@ -690,6 +964,9 @@ static device_method_t axp209_methods[] DEVMETHOD(gpio_pin_toggle, axp209_gpio_pin_toggle), DEVMETHOD(gpio_map_gpios, axp209_gpio_map_gpios), + /* Regdev interface */ + DEVMETHOD(regdev_map, axp209_regdev_map), + /* OFW bus interface */ DEVMETHOD(ofw_bus_get_node, axp209_get_node), Modified: head/sys/arm/allwinner/axp209reg.h ============================================================================== --- head/sys/arm/allwinner/axp209reg.h Sat Oct 15 17:39:40 2016 (r307378) +++ head/sys/arm/allwinner/axp209reg.h Sat Oct 15 17:49:41 2016 (r307379) @@ -146,6 +146,19 @@ #define AXP209_GPIO_DATA(x) (1 << (x + 4)) +/* Regulators registers */ +#define AXP209_POWERCTL 0x12 +#define AXP209_POWERCTL_DCDC3 (1 << 1) +#define AXP209_POWERCTL_LDO2 (1 << 2) +#define AXP209_POWERCTL_LDO4 (1 << 3) +#define AXP209_POWERCTL_DCDC2 (1 << 4) +#define AXP209_POWERCTL_LDO3 (1 << 6) + +#define AXP209_REG_DCDC2_VOLTAGE 0x23 +#define AXP209_REG_DCDC3_VOLTAGE 0x27 +#define AXP209_REG_LDO24_VOLTAGE 0x28 +#define AXP209_REG_LDO3_VOLTAGE 0x29 + enum axp209_sensor { AXP209_TEMP, AXP209_ACVOLT, @@ -157,4 +170,15 @@ enum axp209_sensor { AXP209_BATDISCHARGECURRENT, }; +enum axp209_regulators { + AXP209_REG_ID_DCDC2, + AXP209_REG_ID_DCDC3, + AXP209_REG_ID_LDO1, + AXP209_REG_ID_LDO2, + AXP209_REG_ID_LDO3, + /* LDO4 is weird, need to find a correct way to handle it */ + /* AXP209_REG_ID_LDO4, */ + AXP209_REG_ID_LDO5, +}; + #endif /* _AXP209REG_H_ */ From owner-svn-src-head@freebsd.org Sat Oct 15 18:20:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 658C2C13074; Sat, 15 Oct 2016 18:20:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3747921B; Sat, 15 Oct 2016 18:20:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9FIKFDI060341; Sat, 15 Oct 2016 18:20:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FIKF65060340; Sat, 15 Oct 2016 18:20:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <201610151820.u9FIKF65060340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 15 Oct 2016 18:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307380 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 18:20:16 -0000 Author: np Date: Sat Oct 15 18:20:15 2016 New Revision: 307380 URL: https://svnweb.freebsd.org/changeset/base/307380 Log: Fix typo in comments. Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat Oct 15 17:49:41 2016 (r307379) +++ head/sys/sys/mbuf.h Sat Oct 15 18:20:15 2016 (r307380) @@ -335,7 +335,7 @@ struct mbuf { #define M_HASHTYPE_RSS_TCP_IPV6 M_HASHTYPE_HASH(4) /* TCPv6 4-tuple */ #define M_HASHTYPE_RSS_IPV6_EX M_HASHTYPE_HASH(5) /* IPv6 2-tuple + * ext hdrs */ -#define M_HASHTYPE_RSS_TCP_IPV6_EX M_HASHTYPE_HASH(6) /* TCPv6 4-tiple + +#define M_HASHTYPE_RSS_TCP_IPV6_EX M_HASHTYPE_HASH(6) /* TCPv6 4-tuple + * ext hdrs */ /* Non-standard RSS hash types */ #define M_HASHTYPE_RSS_UDP_IPV4 M_HASHTYPE_HASH(7) /* IPv4 UDP 4-tuple*/ From owner-svn-src-head@freebsd.org Sat Oct 15 19:55:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9557DC1364C; Sat, 15 Oct 2016 19:55:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D13BD7A; Sat, 15 Oct 2016 19:55:08 +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 u9FJt7kT096944; Sat, 15 Oct 2016 19:55:07 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FJt7X5096943; Sat, 15 Oct 2016 19:55:07 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201610151955.u9FJt7X5096943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 15 Oct 2016 19:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307381 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 19:55:08 -0000 Author: bapt Date: Sat Oct 15 19:55:07 2016 New Revision: 307381 URL: https://svnweb.freebsd.org/changeset/base/307381 Log: Fix typos in sdiff(1) message and improve display Modified: head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Sat Oct 15 18:20:15 2016 (r307380) +++ head/usr.bin/sdiff/sdiff.c Sat Oct 15 19:55:07 2016 (r307381) @@ -137,24 +137,25 @@ static struct option longopts[] = { }; static const char *help_msg[] = { - "\nusage: sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] file1 file2\n", - "\t-l, --left-column, Only print the left column for identical lines.", - "\t-o OUTFILE, --output=OUTFILE, nteractively merge file1 and file2 into outfile.", - "\t-s, --suppress-common-lines, Skip identical lines.", - "\t-w WIDTH, --width=WIDTH, Print a maximum of WIDTH characters on each line.", - "\tOptions passed to diff(1) are:", - "\t\t-a, --text, Treat file1 and file2 as text files.", - "\t\t-b, --ignore-trailing-cr, Ignore trailing blank spaces.", - "\t\t-d, --minimal, Minimize diff size.", - "\t\t-I RE, --ignore-matching-lines=RE, Ignore changes whose line matches RE.", - "\t\t-i, --ignore-case, Do a case-insensitive comparison.", - "\t\t-t, --expand-tabs Expand tabs to spaces.", - "\t\t-W, --ignore-all-spaces, Ignore all spaces.", - "\t\t--speed-large-files, Assume large file with scattered changes.", - "\t\t--strip-trailing-cr, Strip trailing carriage return.", - "\t\t--ignore-file-name-case, Ignore case of file names.", - "\t\t--no-ignore-file-name-case, Do not ignore file name case", - "\t\t--tabsize NUM, Change size of tabs (default 8.)", + "usage: sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] file1 file2\n", + "-l, --left-column: only print the left column for identical lines.", + "-o OUTFILE, --output=OUTFILE: interactively merge file1 and file2 into outfile.", + "-s, --suppress-common-lines: skip identical lines.", + "-w WIDTH, --width=WIDTH: print a maximum of WIDTH characters on each line.", + "", + "Options passed to diff(1) are:", + "\t-a, --text: treat file1 and file2 as text files.", + "\t-b, --ignore-trailing-cr: ignore trailing blank spaces.", + "\t-d, --minimal: minimize diff size.", + "\t-I RE, --ignore-matching-lines=RE: ignore changes whose line matches RE.", + "\t-i, --ignore-case: do a case-insensitive comparison.", + "\t-t, --expand-tabs: sxpand tabs to spaces.", + "\t-W, --ignore-all-spaces: ignore all spaces.", + "\t--speed-large-files: assume large file with scattered changes.", + "\t--strip-trailing-cr: strip trailing carriage return.", + "\t--ignore-file-name-case: ignore case of file names.", + "\t--no-ignore-file-name-case: do not ignore file name case", + "\t--tabsize NUM: change size of tabs (default 8.)", NULL, }; From owner-svn-src-head@freebsd.org Sat Oct 15 20:04:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0ABD9C1384A; Sat, 15 Oct 2016 20:04:16 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0A29236; Sat, 15 Oct 2016 20:04:15 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9FK4Eqt000677; Sat, 15 Oct 2016 20:04:14 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FK4EL7000674; Sat, 15 Oct 2016 20:04:14 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201610152004.u9FK4EL7000674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 15 Oct 2016 20:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307382 - in head/sys: arm/conf conf dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 20:04:16 -0000 Author: jmcneill Date: Sat Oct 15 20:04:14 2016 New Revision: 307382 URL: https://svnweb.freebsd.org/changeset/base/307382 Log: Add driver for GPIO controlled regulator. Reviewed by: gonzo, manu, mmel Differential Revision: https://reviews.freebsd.org/D8257 Added: head/sys/dev/gpio/gpioregulator.c (contents, props changed) Modified: head/sys/arm/conf/GENERIC head/sys/conf/files Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Sat Oct 15 19:55:07 2016 (r307381) +++ head/sys/arm/conf/GENERIC Sat Oct 15 20:04:14 2016 (r307382) @@ -112,6 +112,7 @@ device icee # GPIO device gpio device gpioled +device gpioregulator # SPI device spibus Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Oct 15 19:55:07 2016 (r307381) +++ head/sys/conf/files Sat Oct 15 20:04:14 2016 (r307382) @@ -1573,6 +1573,7 @@ dev/gpio/gpioc.c optional gpio \ dependency "gpio_if.h" dev/gpio/gpioiic.c optional gpioiic dev/gpio/gpioled.c optional gpioled +dev/gpio/gpioregulator.c optional gpioregulator fdt ext_resources dev/gpio/gpiospi.c optional gpiospi dev/gpio/gpio_if.m optional gpio dev/gpio/gpiobus_if.m optional gpio Added: head/sys/dev/gpio/gpioregulator.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/gpioregulator.c Sat Oct 15 20:04:14 2016 (r307382) @@ -0,0 +1,348 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * GPIO controlled regulators + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include "regdev_if.h" + +struct gpioregulator_state { + int val; + uint32_t mask; +}; + +struct gpioregulator_init_def { + struct regnode_init_def reg_init_def; + struct gpiobus_pin *enable_pin; + int enable_pin_valid; + int startup_delay_us; + int nstates; + struct gpioregulator_state *states; + int npins; + struct gpiobus_pin **pins; +}; + +struct gpioregulator_reg_sc { + struct regnode *regnode; + device_t base_dev; + struct regnode_std_param *param; + struct gpioregulator_init_def *def; +}; + +struct gpioregulator_softc { + device_t dev; + struct gpioregulator_reg_sc *reg_sc; + struct gpioregulator_init_def init_def; +}; + +static int +gpioregulator_regnode_init(struct regnode *regnode) +{ + struct gpioregulator_reg_sc *sc; + int error, n; + + sc = regnode_get_softc(regnode); + + if (sc->def->enable_pin_valid == 1) { + error = gpio_pin_setflags(sc->def->enable_pin, GPIO_PIN_OUTPUT); + if (error != 0) + return (error); + } + + for (n = 0; n < sc->def->npins; n++) { + error = gpio_pin_setflags(sc->def->pins[n], GPIO_PIN_OUTPUT); + if (error != 0) + return (error); + } + + return (0); +} + +static int +gpioregulator_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +{ + struct gpioregulator_reg_sc *sc; + bool active; + int error; + + sc = regnode_get_softc(regnode); + + if (sc->def->enable_pin_valid == 1) { + active = enable; + if (!sc->param->enable_active_high) + active = !active; + error = gpio_pin_set_active(sc->def->enable_pin, active); + if (error != 0) + return (error); + } + + *udelay = sc->def->startup_delay_us; + + return (0); +} + +static int +gpioregulator_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay) +{ + struct gpioregulator_reg_sc *sc; + const struct gpioregulator_state *state; + int error, n; + + sc = regnode_get_softc(regnode); + state = NULL; + + for (n = 0; n < sc->def->nstates; n++) { + if (sc->def->states[n].val >= min_uvolt && + sc->def->states[n].val <= max_uvolt) { + state = &sc->def->states[n]; + break; + } + } + if (state == NULL) + return (EINVAL); + + for (n = 0; n < sc->def->npins; n++) { + error = gpio_pin_set_active(sc->def->pins[n], + (state->mask >> n) & 1); + if (error != 0) + return (error); + } + + *udelay = sc->def->startup_delay_us; + + return (0); +} + +static int +gpioregulator_regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct gpioregulator_reg_sc *sc; + uint32_t mask; + int error, n; + bool active; + + sc = regnode_get_softc(regnode); + mask = 0; + + for (n = 0; n < sc->def->npins; n++) { + error = gpio_pin_is_active(sc->def->pins[n], &active); + if (error != 0) + return (error); + mask |= (active << n); + } + + for (n = 0; n < sc->def->nstates; n++) { + if (sc->def->states[n].mask == mask) { + *uvolt = sc->def->states[n].val; + return (0); + } + } + + return (EIO); +} + +static regnode_method_t gpioregulator_regnode_methods[] = { + /* Regulator interface */ + REGNODEMETHOD(regnode_init, gpioregulator_regnode_init), + REGNODEMETHOD(regnode_enable, gpioregulator_regnode_enable), + REGNODEMETHOD(regnode_set_voltage, gpioregulator_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, gpioregulator_regnode_get_voltage), + REGNODEMETHOD_END +}; +DEFINE_CLASS_1(gpioregulator_regnode, gpioregulator_regnode_class, + gpioregulator_regnode_methods, sizeof(struct gpioregulator_reg_sc), + regnode_class); + +static int +gpioregulator_parse_fdt(struct gpioregulator_softc *sc) +{ + uint32_t *pstates, mask; + phandle_t node; + ssize_t len; + int error, n; + + node = ofw_bus_get_node(sc->dev); + pstates = NULL; + mask = 0; + + error = regulator_parse_ofw_stdparam(sc->dev, node, + &sc->init_def.reg_init_def); + if (error != 0) + return (error); + + /* "states" property (required) */ + len = OF_getencprop_alloc(node, "states", sizeof(*pstates), + (void **)&pstates); + if (len < 2) { + device_printf(sc->dev, "invalid 'states' property\n"); + error = EINVAL; + goto done; + } + sc->init_def.nstates = len / 2; + sc->init_def.states = malloc(sc->init_def.nstates * + sizeof(*sc->init_def.states), M_DEVBUF, M_WAITOK); + for (n = 0; n < sc->init_def.nstates; n++) { + sc->init_def.states[n].val = pstates[n * 2 + 0]; + sc->init_def.states[n].mask = pstates[n * 2 + 1]; + mask |= sc->init_def.states[n].mask; + } + + /* "startup-delay-us" property (optional) */ + len = OF_getencprop(node, "startup-delay-us", + &sc->init_def.startup_delay_us, + sizeof(sc->init_def.startup_delay_us)); + if (len <= 0) + sc->init_def.startup_delay_us = 0; + + /* "enable-gpio" property (optional) */ + error = gpio_pin_get_by_ofw_property(sc->dev, node, "enable-gpio", + &sc->init_def.enable_pin); + if (error == 0) + sc->init_def.enable_pin_valid = 1; + + /* "gpios" property */ + sc->init_def.npins = 32 - __builtin_clz(mask); + sc->init_def.pins = malloc(sc->init_def.npins * + sizeof(sc->init_def.pins), M_DEVBUF, M_WAITOK); + for (n = 0; n < sc->init_def.npins; n++) { + error = gpio_pin_get_by_ofw_idx(sc->dev, node, n, + &sc->init_def.pins[n]); + if (error != 0) { + device_printf(sc->dev, "cannot get pin %d\n", n); + goto done; + } + } + +done: + if (error != 0) { + for (n = 0; n < sc->init_def.npins; n++) { + if (sc->init_def.pins[n] != NULL) + gpio_pin_release(sc->init_def.pins[n]); + } + + free(sc->init_def.states, M_DEVBUF); + free(sc->init_def.pins, M_DEVBUF); + + } + OF_prop_free(pstates); + + return (error); +} + +static int +gpioregulator_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "regulator-gpio")) + return (ENXIO); + + device_set_desc(dev, "GPIO controlled regulator"); + return (BUS_PROBE_GENERIC); +} + +static int +gpioregulator_attach(device_t dev) +{ + struct gpioregulator_softc *sc; + struct regnode *regnode; + phandle_t node; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + error = gpioregulator_parse_fdt(sc); + if (error != 0) { + device_printf(dev, "cannot parse parameters\n"); + return (ENXIO); + } + sc->init_def.reg_init_def.id = 1; + sc->init_def.reg_init_def.ofw_node = node; + + regnode = regnode_create(dev, &gpioregulator_regnode_class, + &sc->init_def.reg_init_def); + if (regnode == NULL) { + device_printf(dev, "cannot create regulator\n"); + return (ENXIO); + } + + sc->reg_sc = regnode_get_softc(regnode); + sc->reg_sc->regnode = regnode; + sc->reg_sc->base_dev = dev; + sc->reg_sc->param = regnode_get_stdparam(regnode); + sc->reg_sc->def = &sc->init_def; + + regnode_register(regnode); + + return (0); +} + + +static device_method_t gpioregulator_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, gpioregulator_probe), + DEVMETHOD(device_attach, gpioregulator_attach), + + /* Regdev interface */ + DEVMETHOD(regdev_map, regdev_default_ofw_map), + + DEVMETHOD_END +}; + +static driver_t gpioregulator_driver = { + "gpioregulator", + gpioregulator_methods, + sizeof(struct gpioregulator_softc), +}; + +static devclass_t gpioregulator_devclass; + +EARLY_DRIVER_MODULE(gpioregulator, simplebus, gpioregulator_driver, + gpioregulator_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +MODULE_VERSION(gpioregulator, 1); From owner-svn-src-head@freebsd.org Sat Oct 15 23:46:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 250D1C135AE; Sat, 15 Oct 2016 23:46:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD3EC21C; Sat, 15 Oct 2016 23:46:56 +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 u9FNkuZv083026; Sat, 15 Oct 2016 23:46:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9FNku8F083025; Sat, 15 Oct 2016 23:46:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610152346.u9FNku8F083025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 15 Oct 2016 23:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307384 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2016 23:46:57 -0000 Author: markj Date: Sat Oct 15 23:46:55 2016 New Revision: 307384 URL: https://svnweb.freebsd.org/changeset/base/307384 Log: Remove an unused field from struct pmcstat_image. MFC after: 3 days Modified: head/usr.sbin/pmcstat/pmcstat_log.h Modified: head/usr.sbin/pmcstat/pmcstat_log.h ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.h Sat Oct 15 22:49:04 2016 (r307383) +++ head/usr.sbin/pmcstat/pmcstat_log.h Sat Oct 15 23:46:55 2016 (r307384) @@ -76,7 +76,6 @@ enum pmcstat_image_type { struct pmcstat_image { LIST_ENTRY(pmcstat_image) pi_next; /* hash link */ - TAILQ_ENTRY(pmcstat_image) pi_lru; /* LRU list */ pmcstat_interned_string pi_execpath; /* cookie */ pmcstat_interned_string pi_samplename; /* sample path name */ pmcstat_interned_string pi_fullpath; /* path to FS object */