From owner-svn-src-stable-12@freebsd.org Sun Jan 12 04:00:59 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 854BB2223DF; Sun, 12 Jan 2020 04:00:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47wNLM1kqMz3Pcp; Sun, 12 Jan 2020 04:00:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31468DCA7; Sun, 12 Jan 2020 04:00:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00C40wE1073131; Sun, 12 Jan 2020 04:00:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00C40wd7073130; Sun, 12 Jan 2020 04:00:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001120400.00C40wd7073130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 12 Jan 2020 04:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356646 - in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Commit-Revision: 356646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2020 04:00:59 -0000 Author: kevans Date: Sun Jan 12 04:00:58 2020 New Revision: 356646 URL: https://svnweb.freebsd.org/changeset/base/356646 Log: MFC r356539: md(4): improve documentation of preloading It's not immediately clear by what mechanism loader(8) will be loading the preloaded file. Specifically name-drop loader.conf(5) with a pointer to the module loading section and a description of what the 'name' should look like, because that certainly isn't clear from the loader.conf(5) standpoint. The default loader.conf already has a pointer to md(4) where it appears and the reference to loader.conf in the new version of this manpage should make it more clear that this is where one should look for information. Modified: stable/12/share/man/man4/md.4 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man4/md.4 Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man4/md.4 ============================================================================== --- stable/12/share/man/man4/md.4 Sat Jan 11 23:00:57 2020 (r356645) +++ stable/12/share/man/man4/md.4 Sun Jan 12 04:00:58 2020 (r356646) @@ -7,7 +7,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2017 +.Dd January 8, 2020 .Dt MD 4 .Os .Sh NAME @@ -46,7 +46,7 @@ system. The exact value can be determined with .Xr vmstat 8 . .It Cm preload -A file loaded by +A module loaded by .Xr loader 8 with type .Sq md_image @@ -54,6 +54,12 @@ is used for backing store. For backwards compatibility the type .Sq mfs_root is also recognized. +See the description of module loading directives in +.Xr loader.conf 5 +and note that the module name will either be an absolute path to the image file +or the name of a file in the +.Va module_path . +.Pp If the kernel is created with option .Dv MD_ROOT the first preloaded image found will become the root file system. From owner-svn-src-stable-12@freebsd.org Sun Jan 12 04:02:53 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD46E222587; Sun, 12 Jan 2020 04:02:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47wNNY4vClz3Q4t; Sun, 12 Jan 2020 04:02:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 978BFDE42; Sun, 12 Jan 2020 04:02:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00C42rns077716; Sun, 12 Jan 2020 04:02:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00C42rdQ077715; Sun, 12 Jan 2020 04:02:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001120402.00C42rdQ077715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 12 Jan 2020 04:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356647 - stable/12/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 356647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2020 04:02:53 -0000 Author: kevans Date: Sun Jan 12 04:02:53 2020 New Revision: 356647 URL: https://svnweb.freebsd.org/changeset/base/356647 Log: MFC r356562: bcm2835_vcbus: hide 'checking root' messages under bootverbose Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Sun Jan 12 04:00:58 2020 (r356646) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Sun Jan 12 04:02:53 2020 (r356647) @@ -219,8 +219,9 @@ bcm283x_get_current_memcfg(void) root = OF_finddevice("/"); for (i = 0; i < nitems(bcm283x_memory_configs); ++i) { booted_soc_memcfg = &bcm283x_memory_configs[i]; - printf("Checking root against %s\n", - booted_soc_memcfg->soc_compat); + if (bootverbose) + printf("Checking root against %s\n", + booted_soc_memcfg->soc_compat); if (ofw_bus_node_is_compatible(root, booted_soc_memcfg->soc_compat)) return (booted_soc_memcfg); From owner-svn-src-stable-12@freebsd.org Sun Jan 12 04:05:20 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9087022265E; Sun, 12 Jan 2020 04:05:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47wNRN1BTPz3QCT; Sun, 12 Jan 2020 04:05:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0B10DE46; Sun, 12 Jan 2020 04:05:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00C45JCC077914; Sun, 12 Jan 2020 04:05:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00C45J0R077913; Sun, 12 Jan 2020 04:05:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001120405.00C45J0R077913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 12 Jan 2020 04:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356648 - in stable: 11/sys/dev/usb/controller 12/sys/dev/usb/controller X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/dev/usb/controller 12/sys/dev/usb/controller X-SVN-Commit-Revision: 356648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2020 04:05:20 -0000 Author: kevans Date: Sun Jan 12 04:05:18 2020 New Revision: 356648 URL: https://svnweb.freebsd.org/changeset/base/356648 Log: MFC r356564: dwc_otg: fix fdt attachment for newer bcm2708-usb nodes The newer versions of RPi FDT flipped the order of the interrupts specification and added an 'interrupt-names' property for driver aide in finding the correct interrupt, rather than assuming the positions. Use it if it's available, or fallback to the old method if there is no interrupt-names property with a usb value. This has been tested with both old RPi3B FDT and new RPi3B FDT, USB again works on the latter. Modified: stable/12/sys/dev/usb/controller/dwc_otg_fdt.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/usb/controller/dwc_otg_fdt.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/usb/controller/dwc_otg_fdt.c ============================================================================== --- stable/12/sys/dev/usb/controller/dwc_otg_fdt.c Sun Jan 12 04:02:53 2020 (r356647) +++ stable/12/sys/dev/usb/controller/dwc_otg_fdt.c Sun Jan 12 04:05:18 2020 (r356648) @@ -80,6 +80,20 @@ dwc_otg_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static int +dwc_otg_irq_index(device_t dev, int *rid) +{ + int idx, rv; + phandle_t node; + + node = ofw_bus_get_node(dev); + rv = ofw_bus_find_string_index(node, "interrupt-names", "usb", &idx); + if (rv != 0) + return (rv); + *rid = idx; + return (0); +} + int dwc_otg_attach(device_t dev) { @@ -130,10 +144,16 @@ dwc_otg_attach(device_t dev) /* - * brcm,bcm2708-usb FDT provides two interrupts, - * we need only second one (VC_USB) + * brcm,bcm2708-usb FDT provides two interrupts, we need only the USB + * interrupt (VC_USB). The latest FDT for it provides an + * interrupt-names property and swapped them around, while older ones + * did not have interrupt-names and put the usb interrupt in the second + * position. We'll attempt to use interrupt-names first with a fallback + * to the old method of assuming the index based on the compatible + * string. */ - rid = ofw_bus_is_compatible(dev, "brcm,bcm2708-usb") ? 1 : 0; + if (dwc_otg_irq_index(dev, &rid) != 0) + 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-stable-12@freebsd.org Sun Jan 12 20:12:35 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45A341E9069; Sun, 12 Jan 2020 20:12:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47wnvR17LXz4mHC; Sun, 12 Jan 2020 20:12: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2214B2113B; Sun, 12 Jan 2020 20:12: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 00CKCZ30064552; Sun, 12 Jan 2020 20:12:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00CKCZDW064551; Sun, 12 Jan 2020 20:12:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001122012.00CKCZDW064551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 12 Jan 2020 20:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356664 - stable/12/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 356664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2020 20:12:35 -0000 Author: markj Date: Sun Jan 12 20:12:34 2020 New Revision: 356664 URL: https://svnweb.freebsd.org/changeset/base/356664 Log: MFC r356187: Add libdtrace support for arm64 USDT probes. Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Sun Jan 12 17:52:32 2020 (r356663) +++ stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Sun Jan 12 20:12:34 2020 (r356664) @@ -229,9 +229,10 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, for (j = 0; j < nrel; j++) { #if defined(__aarch64__) -/* XXX */ - printf("%s:%s(%d): aarch64 not implemented\n", - __FUNCTION__, __FILE__, __LINE__); + rel->r_offset = s->dofs_offset + + dofr[j].dofr_offset; + rel->r_info = ELF32_R_INFO(count + dep->de_global, + R_ARM_REL32); #elif defined(__arm__) /* XXX */ printf("%s:%s(%d): arm not implemented\n", @@ -425,7 +426,10 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, for (j = 0; j < nrel; j++) { #if defined(__aarch64__) -/* XXX */ + rel->r_offset = s->dofs_offset + + dofr[j].dofr_offset; + rel->r_info = ELF64_R_INFO(count + dep->de_global, + R_AARCH64_PREL64); #elif defined(__arm__) /* XXX */ #elif defined(__mips__) @@ -541,6 +545,8 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in elf_file.ehdr.e_machine = EM_SPARC; #elif defined(__i386) || defined(__amd64) elf_file.ehdr.e_machine = EM_386; +#elif defined(__aarch64__) + elf_file.ehdr.e_machine = EM_AARCH64; #endif elf_file.ehdr.e_version = EV_CURRENT; elf_file.ehdr.e_shoff = sizeof (Elf32_Ehdr); @@ -687,6 +693,8 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in elf_file.ehdr.e_machine = EM_SPARCV9; #elif defined(__i386) || defined(__amd64) elf_file.ehdr.e_machine = EM_AMD64; +#elif defined(__aarch64__) + elf_file.ehdr.e_machine = EM_AARCH64; #endif elf_file.ehdr.e_version = EV_CURRENT; elf_file.ehdr.e_shoff = sizeof (Elf64_Ehdr); @@ -802,14 +810,66 @@ dt_symtab_lookup(Elf_Data *data_sym, int start, int en } #if defined(__aarch64__) -/* XXX */ +#define DT_OP_NOP 0xd503201f +#define DT_OP_RET 0xd65f03c0 +#define DT_OP_CALL26 0x94000000 +#define DT_OP_JUMP26 0x14000000 + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) { - printf("%s:%s(%d): aarch64 not implemented\n", __FUNCTION__, __FILE__, - __LINE__); - return (-1); + uint32_t *ip; + + /* + * Ensure that the offset is aligned on an instruction boundary. + */ + if ((rela->r_offset & (sizeof (uint32_t) - 1)) != 0) + return (-1); + + /* + * We only know about some specific relocation types. + * We also recognize relocation type NONE, since that gets used for + * relocations of USDT probes, and we might be re-processing a file. + */ + if (GELF_R_TYPE(rela->r_info) != R_AARCH64_CALL26 && + GELF_R_TYPE(rela->r_info) != R_AARCH64_JUMP26 && + GELF_R_TYPE(rela->r_info) != R_AARCH64_NONE) + return (-1); + + ip = (uint32_t *)(p + rela->r_offset); + + /* + * We may have already processed this object file in an earlier linker + * invocation. Check to see if the present instruction sequence matches + * the one we would install below. + */ + if (ip[0] == DT_OP_NOP || ip[0] == DT_OP_RET) + return (0); + + /* + * We only expect call instructions with a displacement of 0, or a jump + * instruction acting as a tail call. + */ + if (ip[0] != DT_OP_CALL26 && ip[0] != DT_OP_JUMP26) { + dt_dprintf("found %x instead of a call or jmp instruction at " + "%llx\n", ip[0], (u_longlong_t)rela->r_offset); + return (-1); + } + + /* + * On arm64, we do not have to differentiate between regular probes and + * is-enabled probes. Both cases are encoded as a regular branch for + * non-tail call locations, and a jump for tail call locations. Calls + * are to be converted into a no-op whereas jumps should become a + * return. + */ + if (ip[0] == DT_OP_CALL26) + ip[0] = DT_OP_NOP; + else + ip[0] = DT_OP_RET; + + return (0); } #elif defined(__arm__) /* XXX */ @@ -1254,6 +1314,8 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e emachine1 = emachine2 = EM_SPARCV9; #elif defined(__i386) || defined(__amd64) emachine1 = emachine2 = EM_AMD64; +#elif defined(__aarch64__) + emachine1 = emachine2 = EM_AARCH64; #endif symsize = sizeof (Elf64_Sym); } else { From owner-svn-src-stable-12@freebsd.org Sun Jan 12 20:19:01 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65CE11E9252; Sun, 12 Jan 2020 20:19:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47wp2s26lCz4mdM; Sun, 12 Jan 2020 20:19:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 440E521145; Sun, 12 Jan 2020 20:19:01 +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 00CKJ1WJ065392; Sun, 12 Jan 2020 20:19:01 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00CKJ0Od065387; Sun, 12 Jan 2020 20:19:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <202001122019.00CKJ0Od065387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 12 Jan 2020 20:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356665 - in stable/12: share/man/man4 sys/dev/sound/pci/hda X-SVN-Group: stable-12 X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/sound/pci/hda X-SVN-Commit-Revision: 356665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2020 20:19:01 -0000 Author: sbruno Date: Sun Jan 12 20:19:00 2020 New Revision: 356665 URL: https://svnweb.freebsd.org/changeset/base/356665 Log: MFC r350078 Add the ability to accept the default pin widget configuration to help with various laptops using hdaa(4) sound devices. We don't seem to know the "correct" configurations for these devices and the defaults are far superiour, e.g. they work if you don't nuke the default configs. Modified: stable/12/share/man/man4/snd_hda.4 stable/12/sys/dev/sound/pci/hda/hdaa.c stable/12/sys/dev/sound/pci/hda/hdaa.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/snd_hda.4 ============================================================================== --- stable/12/share/man/man4/snd_hda.4 Sun Jan 12 20:12:34 2020 (r356664) +++ stable/12/share/man/man4/snd_hda.4 Sun Jan 12 20:19:00 2020 (r356665) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2018 +.Dd July 16, 2019 .Dt SND_HDA 4 .Os .Sh NAME @@ -153,6 +153,12 @@ The and .Dq Li ovref Ns Ar X options control the voltage used to power external microphones. +.It Va dev.hdaa.%d.init_clear +Zero out the pin widget config setup by the system. +Some systems seem to have unuseable audio devices if the pin widgit +configuration is cleared. +Set this value to 0 to accept the default configuration values setup by the +BIOS. .It Va hint.hdaa.%d.gpio_config Overrides audio function GPIO pins configuration set by BIOS. May be specified as a set of space-separated Modified: stable/12/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdaa.c Sun Jan 12 20:12:34 2020 (r356664) +++ stable/12/sys/dev/sound/pci/hda/hdaa.c Sun Jan 12 20:19:00 2020 (r356665) @@ -5034,11 +5034,13 @@ hdaa_audio_prepare_pin_ctrl(struct hdaa_devinfo *devin pincap = w->wclass.pin.cap; /* Disable everything. */ - w->wclass.pin.ctrl &= ~( - HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK); + if (devinfo->init_clear) { + w->wclass.pin.ctrl &= ~( + HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK); + } if (w->enable == 0) { /* Pin is unused so left it disabled. */ @@ -6671,6 +6673,10 @@ hdaa_attach(device_t dev) SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "reconfig", CTLTYPE_INT | CTLFLAG_RW, dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "init_clear", CTLFLAG_RW, + &devinfo->init_clear, 1,"Clear initial pin widget configuration"); bus_generic_attach(dev); return (0); } Modified: stable/12/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdaa.h Sun Jan 12 20:12:34 2020 (r356664) +++ stable/12/sys/dev/sound/pci/hda/hdaa.h Sun Jan 12 20:19:00 2020 (r356665) @@ -214,6 +214,7 @@ struct hdaa_devinfo { struct hdaa_chan *chans; struct callout poll_jack; int poll_ival; + uint32_t init_clear; }; #define HDAA_CHN_RUNNING 0x00000001 From owner-svn-src-stable-12@freebsd.org Mon Jan 13 11:27:31 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 488B51FFB55; Mon, 13 Jan 2020 11:27:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xBC71FBjz4Lxc; Mon, 13 Jan 2020 11:27:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25DA23E4D; Mon, 13 Jan 2020 11:27:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DBRVH1055676; Mon, 13 Jan 2020 11:27:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DBRU1B055673; Mon, 13 Jan 2020 11:27:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001131127.00DBRU1B055673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 13 Jan 2020 11:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356679 - in stable/12/sys: dev/usb sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: dev/usb sys X-SVN-Commit-Revision: 356679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 11:27:31 -0000 Author: hselasky Date: Mon Jan 13 11:27:30 2020 New Revision: 356679 URL: https://svnweb.freebsd.org/changeset/base/356679 Log: MFC r356409: Add own counter for cancelled USB transfers. Do not count these as errors. Bump the freebsd version to force recompilation of external modules. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/usb_device.h stable/12/sys/dev/usb/usb_transfer.c stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/usb_device.h ============================================================================== --- stable/12/sys/dev/usb/usb_device.h Mon Jan 13 06:55:38 2020 (r356678) +++ stable/12/sys/dev/usb/usb_device.h Mon Jan 13 11:27:30 2020 (r356679) @@ -191,6 +191,7 @@ struct usb_device { /* statistics */ struct usb_device_statistics stats_err; struct usb_device_statistics stats_ok; + struct usb_device_statistics stats_cancelled; /* generic clear stall message */ struct usb_udev_msg cs_msg[2]; Modified: stable/12/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/12/sys/dev/usb/usb_transfer.c Mon Jan 13 06:55:38 2020 (r356678) +++ stable/12/sys/dev/usb/usb_transfer.c Mon Jan 13 11:27:30 2020 (r356679) @@ -2593,7 +2593,10 @@ usbd_transfer_done(struct usb_xfer *xfer, usb_error_t } #endif /* keep some statistics */ - if (xfer->error) { + if (xfer->error == USB_ERR_CANCELLED) { + info->udev->stats_cancelled.uds_requests + [xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE]++; + } else if (xfer->error != USB_ERR_NORMAL_COMPLETION) { info->udev->stats_err.uds_requests [xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE]++; } else { Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Mon Jan 13 06:55:38 2020 (r356678) +++ stable/12/sys/sys/param.h Mon Jan 13 11:27:30 2020 (r356679) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201509 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201510 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-12@freebsd.org Mon Jan 13 18:16:57 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF4051E6E37; Mon, 13 Jan 2020 18:16:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xMHY4jLnz3yP4; Mon, 13 Jan 2020 18:16:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9862E8B1A; Mon, 13 Jan 2020 18:16:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DIGvve010376; Mon, 13 Jan 2020 18:16:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DIGvkS010375; Mon, 13 Jan 2020 18:16:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001131816.00DIGvkS010375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Jan 2020 18:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356689 - stable/12/sys/arm/allwinner X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/arm/allwinner X-SVN-Commit-Revision: 356689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 18:16:57 -0000 Author: kevans Date: Mon Jan 13 18:16:57 2020 New Revision: 356689 URL: https://svnweb.freebsd.org/changeset/base/356689 Log: MFC r356600: a10_ahci: grab the target-supply regulator and enable it This regulator is marked regulator-boot-on, but it will get shutdown if it's not actually used/enabled by a driver. This should fix sata on the cubieboard{1,2}. Modified: stable/12/sys/arm/allwinner/a10_ahci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/a10_ahci.c ============================================================================== --- stable/12/sys/arm/allwinner/a10_ahci.c Mon Jan 13 17:02:42 2020 (r356688) +++ stable/12/sys/arm/allwinner/a10_ahci.c Mon Jan 13 18:16:57 2020 (r356689) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* * Allwinner a1x/a2x/a8x SATA attachment. This is just the AHCI register @@ -119,6 +120,11 @@ __FBSDID("$FreeBSD$"); #define PLL_FREQ 100000000 +struct ahci_a10_softc { + struct ahci_controller ahci_ctlr; + regulator_t ahci_reg; +}; + static void inline ahci_set(struct resource *m, bus_size_t off, uint32_t set) { @@ -296,10 +302,12 @@ static int ahci_a10_attach(device_t dev) { int error; + struct ahci_a10_softc *sc; struct ahci_controller *ctlr; clk_t clk_pll, clk_gate; - ctlr = device_get_softc(dev); + sc = device_get_softc(dev); + ctlr = &sc->ahci_ctlr; clk_pll = clk_gate = NULL; ctlr->quirks = AHCI_Q_NOPMP; @@ -312,6 +320,19 @@ ahci_a10_attach(device_t dev) &ctlr->r_rid, RF_ACTIVE))) return (ENXIO); + /* Enable the regulator */ + error = regulator_get_by_ofw_property(dev, 0, "target-supply", + &sc->ahci_reg); + if (error != 0) { + device_printf(dev, "Cannot get regulator\n"); + goto fail; + } + error = regulator_enable(sc->ahci_reg); + if (error != 0) { + device_printf(dev, "Could not enable regulator\n"); + goto fail; + } + /* Enable clocks */ error = clk_get_by_ofw_index(dev, 0, 0, &clk_gate); if (error != 0) { @@ -358,6 +379,8 @@ ahci_a10_attach(device_t dev) return (ahci_attach(dev)); fail: + if (sc->ahci_reg != 0) + regulator_disable(sc->ahci_reg); if (clk_gate != NULL) clk_release(clk_gate); if (clk_pll != NULL) @@ -389,7 +412,7 @@ static device_method_t ahci_ata_methods[] = { static driver_t ahci_ata_driver = { "ahci", ahci_ata_methods, - sizeof(struct ahci_controller) + sizeof(struct ahci_a10_softc) }; DRIVER_MODULE(a10_ahci, simplebus, ahci_ata_driver, ahci_devclass, 0, 0); From owner-svn-src-stable-12@freebsd.org Mon Jan 13 18:18:25 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5000D1E6F2D; Mon, 13 Jan 2020 18:18:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xMKF1Ky7z3yXy; Mon, 13 Jan 2020 18:18:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2908A8B1C; Mon, 13 Jan 2020 18:18:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DIIOwg010507; Mon, 13 Jan 2020 18:18:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DIIOM4010506; Mon, 13 Jan 2020 18:18:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001131818.00DIIOM4010506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Jan 2020 18:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356690 - in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd X-SVN-Commit-Revision: 356690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 18:18:25 -0000 Author: kevans Date: Mon Jan 13 18:18:24 2020 New Revision: 356690 URL: https://svnweb.freebsd.org/changeset/base/356690 Log: MFC r356601-r356602: inetd fixes for WITHOUT_* knobs r356601: inetd: free WITHOUT_INET6_SUPPORT build of warnings If inetd is compiled without inet6 support, we need to error out on rpc+inet6 services rather than attempting to call into rpc bits with an uninitialized netid. v4bind is only used with INET6 support, so move it under the proper #ifdefs with v6bind. Reported by: Pavel Timofeev r356602: inetd: two more nits Use __COPYRIGHT for copyright to simply either embed it via .ident or have it properly marked __unused Move an ipsec reference to IPSEC Modified: stable/12/usr.sbin/inetd/inetd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/inetd/inetd.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/inetd/inetd.c ============================================================================== --- stable/12/usr.sbin/inetd/inetd.c Mon Jan 13 18:16:57 2020 (r356689) +++ stable/12/usr.sbin/inetd/inetd.c Mon Jan 13 18:18:24 2020 (r356690) @@ -29,10 +29,12 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1983, 1991, 1993, 1994\n\ - The Regents of the University of California. All rights reserved.\n"; +__COPYRIGHT("@(#) Copyright (c) 1983, 1991, 1993, 1994\n\ + The Regents of the University of California. All rights reserved.\n"); #endif /* not lint */ #ifndef lint @@ -41,9 +43,6 @@ static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkele #endif #endif /* not lint */ -#include -__FBSDID("$FreeBSD$"); - /* * Inetd - Internet super-server * @@ -1360,6 +1359,15 @@ setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (o sock.sin_port = sep->se_ctrladdr6.sin6_port; } } +#else + else { + syslog(LOG_ERR, + "%s/%s: inetd compiled without inet6 support\n", + sep->se_service, sep->se_proto); + (void) close(sep->se_fd); + sep->se_fd = -1; + return; + } #endif if (debug) print_service("REG ", sep); @@ -1611,8 +1619,8 @@ getconfigent(void) #ifdef IPSEC char *policy; #endif - int v4bind; #ifdef INET6 + int v4bind; int v6bind; #endif int i; @@ -1622,8 +1630,8 @@ getconfigent(void) policy = NULL; #endif more: - v4bind = 0; #ifdef INET6 + v4bind = 0; v6bind = 0; #endif while ((cp = nextline(fconfig)) != NULL) { @@ -1652,7 +1660,9 @@ more: break; } if (cp == NULL) { +#ifdef IPSEC free(policy); +#endif return (NULL); } @@ -1787,7 +1797,9 @@ more: #endif if (sep->se_proto[strlen(sep->se_proto) - 1] == '4') { sep->se_proto[strlen(sep->se_proto) - 1] = '\0'; +#ifdef INET6 v4bind = 1; +#endif continue; } /* illegal version num */ From owner-svn-src-stable-12@freebsd.org Mon Jan 13 18:20:04 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D38381E7072; Mon, 13 Jan 2020 18:20:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xMM84zy5z3ynJ; Mon, 13 Jan 2020 18:20:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A60BE8B21; Mon, 13 Jan 2020 18:20:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DIK45x010678; Mon, 13 Jan 2020 18:20:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DIK4ku010677; Mon, 13 Jan 2020 18:20:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001131820.00DIK4ku010677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Jan 2020 18:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356691 - stable/12/tests/sys/fs/fusefs X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/tests/sys/fs/fusefs X-SVN-Commit-Revision: 356691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 18:20:04 -0000 Author: kevans Date: Mon Jan 13 18:20:04 2020 New Revision: 356691 URL: https://svnweb.freebsd.org/changeset/base/356691 Log: MFC r356614: tests: fusefs: silence remaining unsigned/signed warnings External GCC turns these into errors; cast to long to silence them. Modified: stable/12/tests/sys/fs/fusefs/setattr.cc Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/fs/fusefs/setattr.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/setattr.cc Mon Jan 13 18:18:24 2020 (r356690) +++ stable/12/tests/sys/fs/fusefs/setattr.cc Mon Jan 13 18:20:04 2020 (r356691) @@ -586,11 +586,11 @@ TEST_F(Setattr, utimensat) { in.body.setattr.valid == valid && (time_t)in.body.setattr.atime == newtimes[0].tv_sec && - in.body.setattr.atimensec == + (long)in.body.setattr.atimensec == newtimes[0].tv_nsec && (time_t)in.body.setattr.mtime == newtimes[1].tv_sec && - in.body.setattr.mtimensec == + (long)in.body.setattr.mtimensec == newtimes[1].tv_nsec); }, Eq(true)), _) @@ -641,7 +641,7 @@ TEST_F(Setattr, utimensat_mtime_only) { in.body.setattr.valid == valid && (time_t)in.body.setattr.mtime == newtimes[1].tv_sec && - in.body.setattr.mtimensec == + (long)in.body.setattr.mtimensec == newtimes[1].tv_nsec); }, Eq(true)), _) From owner-svn-src-stable-12@freebsd.org Mon Jan 13 18:22:52 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D6F01E732C; Mon, 13 Jan 2020 18:22:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xMQN3DwDz40D1; Mon, 13 Jan 2020 18:22:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A5AF8CE2; Mon, 13 Jan 2020 18:22:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DIMqPx016291; Mon, 13 Jan 2020 18:22:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DIMqHZ016290; Mon, 13 Jan 2020 18:22:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001131822.00DIMqHZ016290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Jan 2020 18:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356692 - in stable: 11/usr.sbin/camdd 12/usr.sbin/camdd X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/camdd 12/usr.sbin/camdd X-SVN-Commit-Revision: 356692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 18:22:52 -0000 Author: kevans Date: Mon Jan 13 18:22:51 2020 New Revision: 356692 URL: https://svnweb.freebsd.org/changeset/base/356692 Log: MFC r356617: camdd: initialize devs earlier GCC9 points out that devs may be used initialized after the bailout label; in-fact, if num_io_opts != 2 then it is. Move the initialization up a little bit. Modified: stable/12/usr.sbin/camdd/camdd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/camdd/camdd.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/camdd/camdd.c ============================================================================== --- stable/12/usr.sbin/camdd/camdd.c Mon Jan 13 18:20:04 2020 (r356691) +++ stable/12/usr.sbin/camdd/camdd.c Mon Jan 13 18:22:51 2020 (r356692) @@ -3086,13 +3086,13 @@ camdd_rw(struct camdd_io_opts *io_opts, int num_io_opt int error = 0; int i; + bzero(devs, sizeof(devs)); + if (num_io_opts != 2) { warnx("Must have one input and one output path"); error = 1; goto bailout; } - - bzero(devs, sizeof(devs)); for (i = 0; i < num_io_opts; i++) { switch (io_opts[i].dev_type) { From owner-svn-src-stable-12@freebsd.org Mon Jan 13 19:22:52 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B00381E9B97; Mon, 13 Jan 2020 19:22:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xNlc4DSnz44gT; Mon, 13 Jan 2020 19:22:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C5CC9843; Mon, 13 Jan 2020 19:22:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DJMqCP052423; Mon, 13 Jan 2020 19:22:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DJMqbM052422; Mon, 13 Jan 2020 19:22:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202001131922.00DJMqbM052422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 13 Jan 2020 19:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356696 - stable/12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/12/share/mk X-SVN-Commit-Revision: 356696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 19:22:52 -0000 Author: bdrewery Date: Mon Jan 13 19:22:52 2020 New Revision: 356696 URL: https://svnweb.freebsd.org/changeset/base/356696 Log: MFC r355588: Fix WITHOUT_CLANG build. PR: 240507 Modified: stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Mon Jan 13 18:29:47 2020 (r356695) +++ stable/12/share/mk/src.opts.mk Mon Jan 13 19:22:52 2020 (r356696) @@ -129,6 +129,7 @@ __DEFAULT_YES_OPTIONS = \ LIBPTHREAD \ LIBTHR \ LLVM_COV \ + LLVM_TARGET_ALL \ LOADER_GELI \ LOADER_LUA \ LOADER_OFW \ @@ -217,7 +218,6 @@ __DEFAULT_NO_OPTIONS = \ # RIGHT option is disabled. __DEFAULT_DEPENDENT_OPTIONS= \ CLANG_FULL/CLANG \ - LLVM_TARGET_ALL/CLANG \ LOADER_VERIEXEC/BEARSSL \ LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \ VERIEXEC/BEARSSL \ @@ -269,9 +269,9 @@ __LLVM_TARGETS= \ x86 __LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/ .for __llt in ${__LLVM_TARGETS} -# Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. +# Default enable the given TARGET's LLVM_TARGET support .if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} -__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG +__DEFAULT_YES_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu} # Disable other targets for arm and armv6, to work around "relocation truncated # to fit" errors with BFD ld, since libllvm.a will get too large to link. .elif ${__T} == "arm" || ${__T} == "armv6" @@ -279,8 +279,7 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_${__llt:tu} # aarch64 needs arm for -m32 support. .elif ${__TT} == "arm64" && ${__llt} == "arm" __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 -# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL -# which is based on MK_CLANG. +# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL. .else __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL .endif From owner-svn-src-stable-12@freebsd.org Mon Jan 13 19:30:19 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 572EC1E9DBA; Mon, 13 Jan 2020 19:30:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xNwC1fP6z44w9; Mon, 13 Jan 2020 19:30:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33EC69862; Mon, 13 Jan 2020 19:30:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DJUJpl052869; Mon, 13 Jan 2020 19:30:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DJUJeW052868; Mon, 13 Jan 2020 19:30:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202001131930.00DJUJeW052868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 13 Jan 2020 19:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356697 - stable/12/usr.sbin/mergemaster X-SVN-Group: stable-12 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/12/usr.sbin/mergemaster X-SVN-Commit-Revision: 356697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 19:30:19 -0000 Author: bdrewery Date: Mon Jan 13 19:30:18 2020 New Revision: 356697 URL: https://svnweb.freebsd.org/changeset/base/356697 Log: MFC r355379,r355381: r355379: Run make in parallel. r355381: Use full path to sysctl(8) since /sbin is not in PATH. Modified: stable/12/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/12/usr.sbin/mergemaster/mergemaster.sh Mon Jan 13 19:22:52 2020 (r356696) +++ stable/12/usr.sbin/mergemaster/mergemaster.sh Mon Jan 13 19:30:18 2020 (r356697) @@ -508,6 +508,7 @@ SOURCEDIR=$(realpath "$SOURCEDIR") # Setup make to use system files from SOURCEDIR MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk -DNO_FILEMON" +MM_MAKE="${MM_MAKE} -j$(/sbin/sysctl -n hw.ncpu)" # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. From owner-svn-src-stable-12@freebsd.org Mon Jan 13 19:34:15 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 928791EA0DD; Mon, 13 Jan 2020 19:34:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xP0l3N5vz45Qd; Mon, 13 Jan 2020 19:34:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EE8D9A23; Mon, 13 Jan 2020 19:34:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DJYF3T058771; Mon, 13 Jan 2020 19:34:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DJYFiX058770; Mon, 13 Jan 2020 19:34:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202001131934.00DJYFiX058770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 13 Jan 2020 19:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356699 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 356699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 19:34:15 -0000 Author: bdrewery Date: Mon Jan 13 19:34:15 2020 New Revision: 356699 URL: https://svnweb.freebsd.org/changeset/base/356699 Log: Regen src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Mon Jan 13 19:33:26 2020 (r356698) +++ stable/12/share/man/man5/src.conf.5 Mon Jan 13 19:34:15 2020 (r356699) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd October 28, 2019 +.Dd January 13, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -368,39 +368,6 @@ When set, it enforces these options: .It .Va WITHOUT_LLVM_COV .El -.Pp -When set, these options are also in effect: -.Pp -.Bl -inset -compact -.It Va WITHOUT_LLVM_TARGET_AARCH64 -(unless -.Va WITH_LLVM_TARGET_AARCH64 -is set explicitly) -.It Va WITHOUT_LLVM_TARGET_ALL -(unless -.Va WITH_LLVM_TARGET_ALL -is set explicitly) -.It Va WITHOUT_LLVM_TARGET_ARM -(unless -.Va WITH_LLVM_TARGET_ARM -is set explicitly) -.It Va WITHOUT_LLVM_TARGET_MIPS -(unless -.Va WITH_LLVM_TARGET_MIPS -is set explicitly) -.It Va WITHOUT_LLVM_TARGET_POWERPC -(unless -.Va WITH_LLVM_TARGET_POWERPC -is set explicitly) -.It Va WITHOUT_LLVM_TARGET_SPARC -(unless -.Va WITH_LLVM_TARGET_SPARC -is set explicitly) -.It Va WITHOUT_LLVM_TARGET_X86 -(unless -.Va WITH_LLVM_TARGET_X86 -is set explicitly) -.El .It Va WITH_CLANG Set to build the Clang C/C++ compiler during the normal phase of the build. .Pp @@ -1108,7 +1075,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. +arm/arm and arm/armv6. .It Va WITH_LLVM_TARGET_AARCH64 Set to build LLVM target support for AArch64. The @@ -1116,13 +1083,10 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_ALL Set to only build the required LLVM target support. This option is preferred to specific target support options. -.Pp -This is a default setting on -riscv/riscv64 and sparc64/sparc64. When set, these options are also in effect: .Pp .Bl -inset -compact @@ -1147,29 +1111,11 @@ is set explicitly) .Va WITH_LLVM_TARGET_SPARC is set explicitly) .El -.It Va WITH_LLVM_TARGET_ALL -Set to build support for all LLVM targets. -This option is always applied to the bootstrap compiler for buildworld when -LLVM is used. -.Pp -This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_LLVM_TARGET_ARM Set to not build LLVM target support for ARM. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. -.Pp -This is a default setting on -riscv/riscv64 and sparc64/sparc64. -.It Va WITH_LLVM_TARGET_ARM -Set to build LLVM target support for ARM. -The -.Va LLVM_TARGET_ALL -option should be used rather than this in most cases. -.Pp -This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITH_LLVM_TARGET_BPF Set to build LLVM target support for BPF. The @@ -1182,7 +1128,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. +arm/arm and arm/armv6. .It Va WITH_LLVM_TARGET_MIPS Set to build LLVM target support for MIPS. The @@ -1190,7 +1136,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_POWERPC Set to not build LLVM target support for PowerPC. The @@ -1198,7 +1144,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. +arm/arm and arm/armv6. .It Va WITH_LLVM_TARGET_POWERPC Set to build LLVM target support for PowerPC. The @@ -1206,7 +1152,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_RISCV Set to build LLVM target support for RISC-V. The @@ -1219,7 +1165,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. +arm/arm and arm/armv6. .It Va WITH_LLVM_TARGET_SPARC Set to build LLVM target support for SPARC. The @@ -1227,7 +1173,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_X86 Set to not build LLVM target support for X86. The @@ -1235,7 +1181,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm, arm/armv6, riscv/riscv64 and sparc64/sparc64. +arm/arm and arm/armv6. .It Va WITH_LLVM_TARGET_X86 Set to build LLVM target support for X86. The @@ -1243,7 +1189,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LOADER_EFI_SECUREBOOT Enable building .Xr loader 8 From owner-svn-src-stable-12@freebsd.org Tue Jan 14 00:50:30 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F03ED1F2501; Tue, 14 Jan 2020 00:50:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xX1f65v5z4N4j; Tue, 14 Jan 2020 00:50:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC271D539; Tue, 14 Jan 2020 00:50:30 +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 00E0oUlr044380; Tue, 14 Jan 2020 00:50:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00E0oUkJ044379; Tue, 14 Jan 2020 00:50:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001140050.00E0oUkJ044379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 14 Jan 2020 00:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356711 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 356711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2020 00:50:31 -0000 Author: mav Date: Tue Jan 14 00:50:30 2020 New Revision: 356711 URL: https://svnweb.freebsd.org/changeset/base/356711 Log: MFC r356240: Relax locking of carp_forus(). This fixes deadlock between CARP and bridge. Bridge calls this function taking CARP lock while holding bridge lock. Same time CARP tries to send its announcements via the bridge while holding CARP lock. Use of CARP_LOCK() here does not solve anything, since sc_addr is constant while race on sc_state is harmless and use of the lock does not close it. Modified: stable/12/sys/netinet/ip_carp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_carp.c ============================================================================== --- stable/12/sys/netinet/ip_carp.c Mon Jan 13 23:09:00 2020 (r356710) +++ stable/12/sys/netinet/ip_carp.c Tue Jan 14 00:50:30 2020 (r356711) @@ -1232,14 +1232,15 @@ carp_forus(struct ifnet *ifp, u_char *dhost) CIF_LOCK(ifp->if_carp); IFNET_FOREACH_CARP(ifp, sc) { - CARP_LOCK(sc); + /* + * CARP_LOCK() is not here, since would protect nothing, but + * cause deadlock with if_bridge, calling this under its lock. + */ if (sc->sc_state == MASTER && !bcmp(dhost, LLADDR(&sc->sc_addr), ETHER_ADDR_LEN)) { - CARP_UNLOCK(sc); CIF_UNLOCK(ifp->if_carp); return (1); } - CARP_UNLOCK(sc); } CIF_UNLOCK(ifp->if_carp); From owner-svn-src-stable-12@freebsd.org Tue Jan 14 02:41:53 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2841C1F71EA; Tue, 14 Jan 2020 02:41:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xZV90JRwz4VKr; Tue, 14 Jan 2020 02:41:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05BB1EBEB; Tue, 14 Jan 2020 02:41:53 +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 00E2fqxc014604; Tue, 14 Jan 2020 02:41:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00E2fq3H014603; Tue, 14 Jan 2020 02:41:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001140241.00E2fq3H014603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Jan 2020 02:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356718 - stable/12/lib/libjail X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libjail X-SVN-Commit-Revision: 356718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2020 02:41:53 -0000 Author: markj Date: Tue Jan 14 02:41:52 2020 New Revision: 356718 URL: https://svnweb.freebsd.org/changeset/base/356718 Log: MFC r356476: libjail: Handle an error from reallocarray() when trimming the buffer. PR: 243106 Modified: stable/12/lib/libjail/jail.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libjail/jail.c ============================================================================== --- stable/12/lib/libjail/jail.c Tue Jan 14 02:14:15 2020 (r356717) +++ stable/12/lib/libjail/jail.c Tue Jan 14 02:41:52 2020 (r356718) @@ -263,7 +263,10 @@ jailparam_all(struct jailparam **jpp) goto error; mib1[1] = 2; } - jp = reallocarray(jp, njp, sizeof(*jp)); + /* Just return the untrimmed buffer if reallocarray() somehow fails. */ + tjp = reallocarray(jp, njp, sizeof(*jp)); + if (tjp != NULL) + jp = tjp; *jpp = jp; return (njp); From owner-svn-src-stable-12@freebsd.org Tue Jan 14 02:44:25 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A03F1F72B8; Tue, 14 Jan 2020 02:44:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xZY53bvRz4Vcb; Tue, 14 Jan 2020 02:44:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76A62EC36; Tue, 14 Jan 2020 02:44:25 +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 00E2iPWB016339; Tue, 14 Jan 2020 02:44:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00E2iP5I016337; Tue, 14 Jan 2020 02:44:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001140244.00E2iP5I016337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Jan 2020 02:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356719 - stable/12/sys/dev/smartpqi X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/smartpqi X-SVN-Commit-Revision: 356719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2020 02:44:25 -0000 Author: markj Date: Tue Jan 14 02:44:24 2020 New Revision: 356719 URL: https://svnweb.freebsd.org/changeset/base/356719 Log: MFC r356445: Decrease logging severity when adding a device or reading config table. PR: 243056 Modified: stable/12/sys/dev/smartpqi/smartpqi_discovery.c stable/12/sys/dev/smartpqi/smartpqi_init.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/smartpqi/smartpqi_discovery.c ============================================================================== --- stable/12/sys/dev/smartpqi/smartpqi_discovery.c Tue Jan 14 02:41:52 2020 (r356718) +++ stable/12/sys/dev/smartpqi/smartpqi_discovery.c Tue Jan 14 02:44:24 2020 (r356719) @@ -1213,7 +1213,7 @@ static int pqisrc_add_device(pqisrc_softstate_t *softs pqi_scsi_dev_t *device) { DBG_FUNC("IN\n"); - DBG_WARN("vendor: %s model: %s bus:%d target:%d lun:%d is_physical_device:0x%x expose_device:0x%x volume_offline 0x%x volume_status 0x%x \n", + DBG_DISC("vendor: %s model: %s bus:%d target:%d lun:%d is_physical_device:0x%x expose_device:0x%x volume_offline 0x%x volume_status 0x%x \n", device->vendor, device->model, device->bus, device->target, device->lun, device->is_physical_device, device->expose_device, device->volume_offline, device->volume_status); device->invalid = false; Modified: stable/12/sys/dev/smartpqi/smartpqi_init.c ============================================================================== --- stable/12/sys/dev/smartpqi/smartpqi_init.c Tue Jan 14 02:41:52 2020 (r356718) +++ stable/12/sys/dev/smartpqi/smartpqi_init.c Tue Jan 14 02:44:24 2020 (r356719) @@ -453,7 +453,7 @@ int pqisrc_process_config_table(pqisrc_softstate_t *so ret = PQI_STATUS_SUCCESS; break; default: - DBG_ERR("unrecognized PQI config table section ID: 0x%x\n", + DBG_INFO("unrecognized PQI config table section ID: 0x%x\n", LE_16(section_hdr->section_id)); break; } From owner-svn-src-stable-12@freebsd.org Tue Jan 14 06:28:08 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83DF31FC1C7; Tue, 14 Jan 2020 06:28:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xgWD2vzrz4gD8; Tue, 14 Jan 2020 06:28:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E58219568; Tue, 14 Jan 2020 06:28:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00E6S8ob048436; Tue, 14 Jan 2020 06:28:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00E6S85L048435; Tue, 14 Jan 2020 06:28:08 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202001140628.00E6S85L048435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 14 Jan 2020 06:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356722 - stable/12/sbin/fsck_msdosfs X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sbin/fsck_msdosfs X-SVN-Commit-Revision: 356722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2020 06:28:08 -0000 Author: delphij Date: Tue Jan 14 06:28:07 2020 New Revision: 356722 URL: https://svnweb.freebsd.org/changeset/base/356722 Log: MFC r356628: Require FAT to occupy at least one sector. Modified: stable/12/sbin/fsck_msdosfs/boot.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_msdosfs/boot.c ============================================================================== --- stable/12/sbin/fsck_msdosfs/boot.c Tue Jan 14 06:15:41 2020 (r356721) +++ stable/12/sbin/fsck_msdosfs/boot.c Tue Jan 14 06:28:07 2020 (r356722) @@ -253,7 +253,7 @@ readboot(int dosfs, struct bootblock *boot) boot->FATsecs = boot->bpbFATsmall; } - if (boot->FATsecs > UINT32_MAX / boot->bpbFATs) { + if (boot->FATsecs < 1 || boot->FATsecs > UINT32_MAX / boot->bpbFATs) { pfatal("Invalid FATs(%u) with FATsecs(%zu)", boot->bpbFATs, (size_t)boot->FATsecs); return FSFATAL; From owner-svn-src-stable-12@freebsd.org Wed Jan 15 02:31:04 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A8A61FC56D; Wed, 15 Jan 2020 02:31:04 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yBCD1rDfz3wb8; Wed, 15 Jan 2020 02:31:04 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A0C827608; Wed, 15 Jan 2020 02:31:04 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00F2V4iF079335; Wed, 15 Jan 2020 02:31:04 GMT (envelope-from anish@FreeBSD.org) Received: (from anish@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00F2V4bs079334; Wed, 15 Jan 2020 02:31:04 GMT (envelope-from anish@FreeBSD.org) Message-Id: <202001150231.00F2V4bs079334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: anish set sender to anish@FreeBSD.org using -f From: Anish Gupta Date: Wed, 15 Jan 2020 02:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356746 - stable/12/sys/amd64/vmm/amd X-SVN-Group: stable-12 X-SVN-Commit-Author: anish X-SVN-Commit-Paths: stable/12/sys/amd64/vmm/amd X-SVN-Commit-Revision: 356746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jan 2020 02:31:04 -0000 Author: anish Date: Wed Jan 15 02:31:03 2020 New Revision: 356746 URL: https://svnweb.freebsd.org/changeset/base/356746 Log: MFC r355258: Bhyve AMD IOMMU log the last timeout command. Differential Revision: https://reviews.freebsd.org/D22566 Modified: stable/12/sys/amd64/vmm/amd/amdvi_hw.c Modified: stable/12/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- stable/12/sys/amd64/vmm/amd/amdvi_hw.c Wed Jan 15 01:34:05 2020 (r356745) +++ stable/12/sys/amd64/vmm/amd/amdvi_hw.c Wed Jan 15 02:31:03 2020 (r356746) @@ -66,7 +66,7 @@ SYSCTL_NODE(_hw_vmm, OID_AUTO, amdvi, CTLFLAG_RW, NULL /* Print RID or device ID in PCI string format. */ #define RID2PCI_STR(d) PCI_RID2BUS(d), PCI_RID2SLOT(d), PCI_RID2FUNC(d) -static void amdvi_dump_cmds(struct amdvi_softc *softc); +static void amdvi_dump_cmds(struct amdvi_softc *softc, int count); static void amdvi_print_dev_cap(struct amdvi_softc *softc); MALLOC_DEFINE(M_AMDVI, "amdvi", "amdvi"); @@ -321,9 +321,7 @@ amdvi_cmd_cmp(struct amdvi_softc *softc, const uint64_ pa = vtophys(&softc->cmp_data); cmd->opcode = AMDVI_CMP_WAIT_OPCODE; - cmd->word0 = (pa & 0xFFFFFFF8) | - (AMDVI_CMP_WAIT_STORE); - //(AMDVI_CMP_WAIT_FLUSH | AMDVI_CMP_WAIT_STORE); + cmd->word0 = (pa & 0xFFFFFFF8) | AMDVI_CMP_WAIT_STORE; cmd->word1 = (pa >> 32) & 0xFFFFF; cmd->addr = data; @@ -492,26 +490,26 @@ amdvi_wait(struct amdvi_softc *softc) device_printf(softc->dev, "Error: completion failed" " tail:0x%x, head:0x%x.\n", ctrl->cmd_tail, ctrl->cmd_head); - amdvi_dump_cmds(softc); + /* Dump the last command. */ + amdvi_dump_cmds(softc, 1); } static void -amdvi_dump_cmds(struct amdvi_softc *softc) +amdvi_dump_cmds(struct amdvi_softc *softc, int count) { struct amdvi_ctrl *ctrl; struct amdvi_cmd *cmd; int off, i; ctrl = softc->ctrl; - device_printf(softc->dev, "Dump all the commands:\n"); + device_printf(softc->dev, "Dump last %d command(s):\n", count); /* * If h/w is stuck in completion, it is the previous command, * start dumping from previous command onward. */ off = MOD_DEC(ctrl->cmd_head, sizeof(struct amdvi_cmd), softc->cmd_max); - for (i = 0; off != ctrl->cmd_tail && - i < softc->cmd_max; i++) { + for (i = 0; off != ctrl->cmd_tail && i < count; i++) { cmd = (struct amdvi_cmd *)((uint8_t *)softc->cmd + off); printf(" [CMD%d, off:0x%x] opcode= 0x%x 0x%x" " 0x%x 0x%lx\n", i, off, cmd->opcode, From owner-svn-src-stable-12@freebsd.org Wed Jan 15 21:05:43 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF8071FD70D; Wed, 15 Jan 2020 21:05:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yfxM5c5Tz41b2; Wed, 15 Jan 2020 21:05:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBB5CCAD9; Wed, 15 Jan 2020 21:05:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00FL5hBR056445; Wed, 15 Jan 2020 21:05:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00FL5h3f056444; Wed, 15 Jan 2020 21:05:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001152105.00FL5h3f056444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 15 Jan 2020 21:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356768 - stable/12/tests/sys/capsicum X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/tests/sys/capsicum X-SVN-Commit-Revision: 356768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jan 2020 21:05:43 -0000 Author: emaste Date: Wed Jan 15 21:05:43 2020 New Revision: 356768 URL: https://svnweb.freebsd.org/changeset/base/356768 Log: MFC r345681: Skip test if feature security_capabilities is not available PR: 236863 Sponsored by: The FreeBSD Foundation Modified: stable/12/tests/sys/capsicum/Makefile stable/12/tests/sys/capsicum/ioctls_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/capsicum/Makefile ============================================================================== --- stable/12/tests/sys/capsicum/Makefile Wed Jan 15 20:25:52 2020 (r356767) +++ stable/12/tests/sys/capsicum/Makefile Wed Jan 15 21:05:43 2020 (r356768) @@ -5,7 +5,7 @@ TESTSDIR= ${TESTSBASE}/sys/capsicum ATF_TESTS_C+= bindat_connectat ATF_TESTS_C+= ioctls_test -CFLAGS.bindat_connectat.c+= -I${SRCTOP}/tests +CFLAGS+= -I${SRCTOP}/tests WARNS?= 6 Modified: stable/12/tests/sys/capsicum/ioctls_test.c ============================================================================== --- stable/12/tests/sys/capsicum/ioctls_test.c Wed Jan 15 20:25:52 2020 (r356767) +++ stable/12/tests/sys/capsicum/ioctls_test.c Wed Jan 15 21:05:43 2020 (r356768) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include +#include "freebsd_test_suite/macros.h" + /* * A variant of ATF_REQUIRE that is suitable for use in child * processes. This only works if the parent process is tripped up by @@ -73,6 +75,8 @@ ATF_TC_BODY(cap_ioctls__listen_copy, tc) pid_t pid; char dummy; int s[2], status; + + ATF_REQUIRE_FEATURE("security_capabilities"); s[0] = socket(AF_INET, SOCK_STREAM, 0); ATF_REQUIRE(s[0] > 0); From owner-svn-src-stable-12@freebsd.org Thu Jan 16 00:26:54 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2300E2228B1; Thu, 16 Jan 2020 00:26:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ylPV09DQz4DKY; Thu, 16 Jan 2020 00:26:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00CDCEF90; Thu, 16 Jan 2020 00:26:54 +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 00G0Qrtn078849; Thu, 16 Jan 2020 00:26:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G0Qrv1078847; Thu, 16 Jan 2020 00:26:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001160026.00G0Qrv1078847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 Jan 2020 00:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356769 - stable/12/lib/libc/locale X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libc/locale X-SVN-Commit-Revision: 356769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 00:26:54 -0000 Author: markj Date: Thu Jan 16 00:26:53 2020 New Revision: 356769 URL: https://svnweb.freebsd.org/changeset/base/356769 Log: MFC r356569: libc: Fix a few bugs in the xlocale collation code. PR: 243195 Modified: stable/12/lib/libc/locale/collate.c stable/12/lib/libc/locale/rune.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/locale/collate.c ============================================================================== --- stable/12/lib/libc/locale/collate.c Wed Jan 15 21:05:43 2020 (r356768) +++ stable/12/lib/libc/locale/collate.c Thu Jan 16 00:26:53 2020 (r356769) @@ -109,7 +109,7 @@ __collate_load_tables(const char *encoding) return (__collate_load_tables_l(encoding, &__xlocale_global_collate)); } -int +static int __collate_load_tables_l(const char *encoding, struct xlocale_collate *table) { int i, chains, z; @@ -147,7 +147,7 @@ __collate_load_tables_l(const char *encoding, struct x } map = mmap(NULL, sbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0); (void) _close(fd); - if ((TMP = map) == NULL) { + if ((TMP = map) == MAP_FAILED) { return (_LDP_ERROR); } @@ -181,6 +181,11 @@ __collate_load_tables_l(const char *encoding, struct x return (_LDP_ERROR); } + if (table->map && (table->maplen > 0)) { + (void) munmap(table->map, table->maplen); + } + table->map = map; + table->maplen = sbuf.st_size; table->info = info; table->char_pri_table = (void *)TMP; TMP += sizeof (collate_char_t) * (UCHAR_MAX + 1); Modified: stable/12/lib/libc/locale/rune.c ============================================================================== --- stable/12/lib/libc/locale/rune.c Wed Jan 15 21:05:43 2020 (r356768) +++ stable/12/lib/libc/locale/rune.c Thu Jan 16 00:26:53 2020 (r356769) @@ -94,7 +94,7 @@ _Read_RuneMagi(const char *fname) fdata = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0); (void) _close(fd); - if (fdata == NULL) { + if (fdata == MAP_FAILED) { errno = EINVAL; return (NULL); } From owner-svn-src-stable-12@freebsd.org Thu Jan 16 01:13:33 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9840E223A74; Thu, 16 Jan 2020 01:13:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ymRK3YTLz4GDW; Thu, 16 Jan 2020 01:13:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7385DF8DA; Thu, 16 Jan 2020 01:13:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00G1DXKx008525; Thu, 16 Jan 2020 01:13:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G1DXRA008524; Thu, 16 Jan 2020 01:13:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202001160113.00G1DXRA008524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Jan 2020 01:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356770 - in stable: 11/release 12/release X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release 12/release X-SVN-Commit-Revision: 356770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 01:13:33 -0000 Author: gjb Date: Thu Jan 16 01:13:32 2020 New Revision: 356770 URL: https://svnweb.freebsd.org/changeset/base/356770 Log: MFC r356685, r356686: r356685: Ensure the TYPE, BRANCH, and REVISION variables are set in cloudware targets when OSRELEASE is overridden. [1] r356686: Fix a typo. PR: 243287 [1] Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/12/release/Makefile stable/12/release/Makefile.vm Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/Makefile stable/11/release/Makefile.vm Directory Properties: stable/11/ (props changed) Modified: stable/12/release/Makefile ============================================================================== --- stable/12/release/Makefile Thu Jan 16 00:26:53 2020 (r356769) +++ stable/12/release/Makefile Thu Jan 16 01:13:32 2020 (r356770) @@ -54,7 +54,7 @@ TARGET_ARCH= ${TARGET} IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= dist -# Define OSRELEASE by using newvars.sh +# Define OSRELEASE by using newvers.sh .if !defined(OSRELEASE) || empty(OSRELEASE) .for _V in TYPE BRANCH REVISION ${_V}!= eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V} Modified: stable/12/release/Makefile.vm ============================================================================== --- stable/12/release/Makefile.vm Thu Jan 16 00:26:53 2020 (r356769) +++ stable/12/release/Makefile.vm Thu Jan 16 01:13:32 2020 (r356770) @@ -39,6 +39,12 @@ VAGRANT-VMWARE_FORMAT= vmdk VAGRANT-VMWARE_DESC= Vagrant Image for VMWare VAGRANT-VMWARE_DISK= ${OSRELEASE}.vmware.${VAGRANT_FORMAT} +.for _V in TYPE BRANCH REVISION +. if !defined(${_V}) || empty(${_V}) +${_V}!= eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V} +. endif +.endfor + emulator-portinstall: .if ${TARGET_ARCH} != ${MACHINE_ARCH} .if ( ${TARGET_ARCH} != "i386" ) || ( ${MACHINE_ARCH} != "amd64" ) From owner-svn-src-stable-12@freebsd.org Thu Jan 16 03:11:27 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DD61226F40; Thu, 16 Jan 2020 03:11:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yq3M1vnWz4MQh; Thu, 16 Jan 2020 03:11:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B0ED18DEC; Thu, 16 Jan 2020 03:11:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00G3BRNx077862; Thu, 16 Jan 2020 03:11:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G3BQwI077860; Thu, 16 Jan 2020 03:11:26 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001160311.00G3BQwI077860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Jan 2020 03:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356771 - in stable: 11/stand/fdt 11/stand/uboot/fdt 12/stand/fdt 12/stand/uboot/fdt X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/fdt 11/stand/uboot/fdt 12/stand/fdt 12/stand/uboot/fdt X-SVN-Commit-Revision: 356771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 03:11:27 -0000 Author: kevans Date: Thu Jan 16 03:11:25 2020 New Revision: 356771 URL: https://svnweb.freebsd.org/changeset/base/356771 Log: MFC r356538: stand/fdt: Scale blob size better as overlays apply Currently, our overlay blob will grow to include the size of the complete overlay blob we're applying. This doesn't scale very well with a lot of overlays- they tend to include a lot of overhead, and they will generally only add a fraction of their total size to the blob they're being applied to. To combat this, pack the blob as we apply new overlays and keep track of how many overlays we've applied. Only ubldr has any fixups to be applied after overlays, so we only need to re-pad the blob in ubldr. Presumably the allocation won't fail since we just did a lot worse in trying to apply overlays and succeeded. I have no intention of removing the padding in make_dtb.sh. There might be an argument to be had over whether it should be configurable, since ubldr *is* the only loader that actually has fixups to be applied and we can do this at runtime, but I'm not too concerned about this. This diff has been sitting in Phabricator for a year and a half, but I've decided to flush it as it does make sure that we're scaling the blob appropriately and leave room at the end for fixups in case of some freak circumstance where applying overlays leaves us with a blob of insufficient size. Modified: stable/12/stand/fdt/fdt_loader_cmd.c stable/12/stand/fdt/fdt_platform.h stable/12/stand/uboot/fdt/uboot_fdt.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/stand/fdt/fdt_loader_cmd.c stable/11/stand/fdt/fdt_platform.h stable/11/stand/uboot/fdt/uboot_fdt.c Directory Properties: stable/11/ (props changed) Modified: stable/12/stand/fdt/fdt_loader_cmd.c ============================================================================== --- stable/12/stand/fdt/fdt_loader_cmd.c Thu Jan 16 01:13:32 2020 (r356770) +++ stable/12/stand/fdt/fdt_loader_cmd.c Thu Jan 16 03:11:25 2020 (r356771) @@ -427,7 +427,10 @@ fdt_check_overlay_compatible(void *base_fdt, void *ove return (1); } -void +/* + * Returns the number of overlays successfully applied + */ +int fdt_apply_overlays() { struct preloaded_file *fp; @@ -436,13 +439,13 @@ fdt_apply_overlays() void *current_fdtp; void *next_fdtp; void *overlay; - int rv; + int overlays_applied, rv; if ((fdtp == NULL) || (fdtp_size == 0)) - return; + return (0); if (fdt_overlays_applied) - return; + return (0); max_overlay_size = 0; for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { @@ -452,15 +455,16 @@ fdt_apply_overlays() /* Nothing to apply */ if (max_overlay_size == 0) - return; + return (0); overlay = malloc(max_overlay_size); if (overlay == NULL) { printf("failed to allocate memory for DTB blob with overlays\n"); - return; + return (0); } current_fdtp = fdtp; current_fdtp_size = fdtp_size; + overlays_applied = 0; for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { COPYOUT(fp->f_addr, overlay, fp->f_size); /* Check compatible first to avoid unnecessary allocation */ @@ -493,7 +497,9 @@ fdt_apply_overlays() if (current_fdtp != fdtp) free(current_fdtp); current_fdtp = next_fdtp; - current_fdtp_size = next_fdtp_size; + fdt_pack(current_fdtp); + current_fdtp_size = fdt_totalsize(current_fdtp); + overlays_applied++; } else { /* * Assume here that the base we tried to apply on is @@ -513,6 +519,26 @@ fdt_apply_overlays() } free(overlay); fdt_overlays_applied = 1; + return (overlays_applied); +} + +int +fdt_pad_dtb(size_t padding) +{ + void *padded_fdtp; + size_t padded_fdtp_size; + + padded_fdtp_size = fdtp_size + padding; + padded_fdtp = malloc(padded_fdtp_size); + if (padded_fdtp == NULL) + return (1); + if (fdt_open_into(fdtp, padded_fdtp, padded_fdtp_size) != 0) { + free(padded_fdtp); + return (1); + } + fdtp = padded_fdtp; + fdtp_size = padded_fdtp_size; + return (0); } int Modified: stable/12/stand/fdt/fdt_platform.h ============================================================================== --- stable/12/stand/fdt/fdt_platform.h Thu Jan 16 01:13:32 2020 (r356770) +++ stable/12/stand/fdt/fdt_platform.h Thu Jan 16 03:11:25 2020 (r356771) @@ -43,7 +43,8 @@ void fdt_fixup_cpubusfreqs(unsigned long, unsigned lon void fdt_fixup_ethernet(const char *, char *, int); void fdt_fixup_memory(struct fdt_mem_region *, size_t); void fdt_fixup_stdout(const char *); -void fdt_apply_overlays(void); +int fdt_apply_overlays(void); +int fdt_pad_dtb(size_t); int fdt_load_dtb_addr(struct fdt_header *); int fdt_load_dtb_file(const char *); void fdt_load_dtb_overlays(const char *); Modified: stable/12/stand/uboot/fdt/uboot_fdt.c ============================================================================== --- stable/12/stand/uboot/fdt/uboot_fdt.c Thu Jan 16 01:13:32 2020 (r356770) +++ stable/12/stand/uboot/fdt/uboot_fdt.c Thu Jan 16 03:11:25 2020 (r356771) @@ -63,6 +63,8 @@ fdt_platform_load_from_ubenv(const char *var) return (1); } +#define FDT_DTB_PADSZ 1024 + int fdt_platform_load_dtb(void) { @@ -127,7 +129,8 @@ fdt_platform_fixups(void) ethstr = NULL; /* Apply overlays before anything else */ - fdt_apply_overlays(); + if (fdt_apply_overlays() > 0) + fdt_pad_dtb(FDT_DTB_PADSZ); /* Acquire sys_info */ si = ub_get_sys_info(); From owner-svn-src-stable-12@freebsd.org Thu Jan 16 03:14:02 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03094227091; Thu, 16 Jan 2020 03:14:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yq6K6Pgnz4MrP; Thu, 16 Jan 2020 03:14:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BED4018F5E; Thu, 16 Jan 2020 03:14:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00G3E1Ag080505; Thu, 16 Jan 2020 03:14:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G3E1LF080504; Thu, 16 Jan 2020 03:14:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001160314.00G3E1LF080504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Jan 2020 03:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356772 - stable/12/sys/dev/extres/regulator X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/dev/extres/regulator X-SVN-Commit-Revision: 356772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 03:14:02 -0000 Author: kevans Date: Thu Jan 16 03:14:01 2020 New Revision: 356772 URL: https://svnweb.freebsd.org/changeset/base/356772 Log: MFC r356649: regulator: small enhancements to regulator_shutdown Highlights: - Exit early if we're not disabling unused regulators; there's no need to take the regulator topology lock and re-evaluate this every iteration, as it's not going to change. - Don't emit a notice that we're shutting down a regulator if it's not enabled, to reduce noise. - Mention the outcome of the shutdown, to aide debugging and easily let developer/user collect list of regulators we actually shutdown to determine problematic one. Modified: stable/12/sys/dev/extres/regulator/regulator.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/extres/regulator/regulator.c ============================================================================== --- stable/12/sys/dev/extres/regulator/regulator.c Thu Jan 16 03:11:25 2020 (r356771) +++ stable/12/sys/dev/extres/regulator/regulator.c Thu Jan 16 03:14:01 2020 (r356772) @@ -191,16 +191,36 @@ regulator_shutdown(void *dummy) int status, ret; int disable = 1; - REG_TOPO_SLOCK(); TUNABLE_INT_FETCH("hw.regulator.disable_unused", &disable); + if (!disable) + return; + REG_TOPO_SLOCK(); + + if (bootverbose) + printf("regulator: shutting down unused regulators\n"); TAILQ_FOREACH(entry, ®node_list, reglist_link) { - if (!entry->std_param.always_on && disable) { - if (bootverbose) - printf("regulator: shutting down %s\n", - entry->name); + if (!entry->std_param.always_on) { ret = regnode_status(entry, &status); - if (ret == 0 && status == REGULATOR_STATUS_ENABLED) - regnode_stop(entry, 0); + if (ret == 0 && status == REGULATOR_STATUS_ENABLED) { + if (bootverbose) + printf("regulator: shutting down %s... ", + entry->name); + ret = regnode_stop(entry, 0); + if (bootverbose) { + /* + * Call out busy in particular, here, + * because it's not unexpected to fail + * shutdown if the regulator is simply + * in-use. + */ + if (ret == EBUSY) + printf("busy\n"); + else if (ret != 0) + printf("error (%d)\n", ret); + else + printf("ok\n"); + } + } } } REG_TOPO_UNLOCK(); From owner-svn-src-stable-12@freebsd.org Thu Jan 16 03:16:09 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4A5D22719C; Thu, 16 Jan 2020 03:16:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yq8n409xz4N0c; Thu, 16 Jan 2020 03:16:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8411418F63; Thu, 16 Jan 2020 03:16:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00G3G9oQ080693; Thu, 16 Jan 2020 03:16:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G3G9Zb080691; Thu, 16 Jan 2020 03:16:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001160316.00G3G9Zb080691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Jan 2020 03:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356773 - in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Commit-Revision: 356773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 03:16:09 -0000 Author: kevans Date: Thu Jan 16 03:16:08 2020 New Revision: 356773 URL: https://svnweb.freebsd.org/changeset/base/356773 Log: MFC r356688, r356694: tap(4) manpage improvements r356688: Install tap(4) manpage as vmnet(4) as well If one comes across a vmnet interface, this is a useful pointer to have towards what it actually is if they're otherwise unfamiliar. r356694: tap(4): also note that we drop configured addresses This provides a specific pointer for users of tap(4) to understand why their interfaces are losing their addresses, and specifically how to workaround this if they need different behavior. This manpage received a .Dd bump earlier today in r35688, so no bump occurs this time. Modified: stable/12/share/man/man4/Makefile stable/12/share/man/man4/tap.4 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man4/Makefile stable/11/share/man/man4/tap.4 Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Thu Jan 16 03:14:01 2020 (r356772) +++ stable/12/share/man/man4/Makefile Thu Jan 16 03:16:08 2020 (r356773) @@ -749,7 +749,9 @@ MLINKS+=stf.4 if_stf.4 MLINKS+=stge.4 if_stge.4 MLINKS+=syncache.4 syncookies.4 MLINKS+=syscons.4 sc.4 -MLINKS+=tap.4 if_tap.4 +MLINKS+=tap.4 if_tap.4 \ + tap.4 vmnet.4 \ + tap.4 if_vmnet.4 MLINKS+=tdfx.4 tdfx_linux.4 MLINKS+=ti.4 if_ti.4 MLINKS+=tl.4 if_tl.4 Modified: stable/12/share/man/man4/tap.4 ============================================================================== --- stable/12/share/man/man4/tap.4 Thu Jan 16 03:14:01 2020 (r356772) +++ stable/12/share/man/man4/tap.4 Thu Jan 16 03:16:08 2020 (r356773) @@ -1,11 +1,12 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd April 29, 2019 +.Dd January 13, 2020 .Dt TAP 4 .Os .Sh NAME -.Nm tap +.Nm tap , +.Nm vmnet .Nd Ethernet tunnel software network interface .Sh SYNOPSIS .Cd device tuntap @@ -280,6 +281,7 @@ On the last close of the data device, the interface is brought down (as if with .Dq ifconfig tap Ns Sy N No down ) +and has all of its configured addresses deleted unless the device is a .Em VMnet device, or has From owner-svn-src-stable-12@freebsd.org Thu Jan 16 03:24:46 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4F9D227567; Thu, 16 Jan 2020 03:24:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yqLk3zZGz4NWx; Thu, 16 Jan 2020 03:24:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8401A1913D; Thu, 16 Jan 2020 03:24:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00G3OkH0086547; Thu, 16 Jan 2020 03:24:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G3Okj0086546; Thu, 16 Jan 2020 03:24:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001160324.00G3Okj0086546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Jan 2020 03:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356774 - in stable: 11 12 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11 12 X-SVN-Commit-Revision: 356774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 03:24:46 -0000 Author: kevans Date: Thu Jan 16 03:24:45 2020 New Revision: 356774 URL: https://svnweb.freebsd.org/changeset/base/356774 Log: Record-only MFC of r353140, r356735 The former added ALLOW_MIPS_SHARED_TEXTREL, and the latter reverted it. Modified: Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-stable-12@freebsd.org Thu Jan 16 03:38:11 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD601227AA5; Thu, 16 Jan 2020 03:38:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yqfC58s2z4PHn; Thu, 16 Jan 2020 03:38:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB0D61932F; Thu, 16 Jan 2020 03:38:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00G3cBfd092631; Thu, 16 Jan 2020 03:38:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G3c9YP092618; Thu, 16 Jan 2020 03:38:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001160338.00G3c9YP092618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Jan 2020 03:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356775 - in stable: 11 11/gnu/lib 11/lib 11/lib/libssp 11/lib/libssp_nonshared 11/share/mk 11/targets/pseudo/userland/gnu 11/tools/build/mk 12 12/gnu/lib 12/lib 12/lib/libc 12/lib/libs... X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11 11/gnu/lib 11/lib 11/lib/libssp 11/lib/libssp_nonshared 11/share/mk 11/targets/pseudo/userland/gnu 11/tools/build/mk 12 12/gnu/lib 12/lib 12/lib/libc 12/lib/libssp 12/lib/libssp_nonshare... X-SVN-Commit-Revision: 356775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 03:38:11 -0000 Author: kevans Date: Thu Jan 16 03:38:06 2020 New Revision: 356775 URL: https://svnweb.freebsd.org/changeset/base/356775 Log: MFC r356356, r356358, r356422: replace gcclibs' libssp r356356: Provide libssp based on libc For libssp.so, rebuild stack_protector.c with FORTIFY_SOURCE stubs that just abort built into it. For libssp_nonshared.a, steal stack_protector_compat.c from ^/lib/libc/secure and massage it to maintain that __stack_chk_fail_local is a hidden symbol. libssp is now built unconditionally regardless of {WITH,WITHOUT}_SSP in the build environment, and the gcclibs version has been disconnected from the build in favor of this one. r356358: libssp: fix FORTIFY_SOURCE stub declarations The LSB 4.1 that I referenced omitted the varargs, and I failed to catch it. The __vsnprintf_chk error was from just downright misreading the page. GCC6 caught all of these, but I had only tested GCC4.2. r356422: Update libssp paths in various Makefile.depend* files I've been advised that the model that uses these are fairly resilient, but we do know the proper path to use (or remove, in the case of ^/targets/...), so go ahead and update them to reflect that. Added: stable/12/lib/libssp/ - copied from r356356, head/lib/libssp/ stable/12/lib/libssp_nonshared/ - copied from r356356, head/lib/libssp_nonshared/ Modified: stable/12/Makefile.inc1 stable/12/ObsoleteFiles.inc stable/12/gnu/lib/Makefile stable/12/lib/Makefile stable/12/lib/libc/Makefile.depend.options stable/12/lib/libssp/fortify_stubs.c stable/12/lib/libsysdecode/Makefile.depend stable/12/share/mk/local.dirdeps.mk stable/12/share/mk/local.gendirdeps.mk stable/12/share/mk/src.libnames.mk stable/12/targets/pseudo/userland/gnu/Makefile.depend stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/lib/libssp/ - copied from r356356, head/lib/libssp/ stable/11/lib/libssp_nonshared/ - copied from r356356, head/lib/libssp_nonshared/ Modified: stable/11/Makefile.inc1 stable/11/ObsoleteFiles.inc stable/11/gnu/lib/Makefile stable/11/lib/Makefile stable/11/lib/libssp/fortify_stubs.c stable/11/share/mk/local.dirdeps.mk stable/11/share/mk/local.gendirdeps.mk stable/11/share/mk/src.libnames.mk stable/11/targets/pseudo/userland/gnu/Makefile.depend stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/Makefile.inc1 Thu Jan 16 03:38:06 2020 (r356775) @@ -2539,7 +2539,7 @@ libraries: .MAKE .PHONY # _prereq_libs= lib/libcompiler_rt .if ${MK_SSP} != "no" -_prereq_libs+= gnu/lib/libssp/libssp_nonshared +_prereq_libs+= lib/libssp_nonshared .endif # These dependencies are not automatically generated: Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/ObsoleteFiles.inc Thu Jan 16 03:38:06 2020 (r356775) @@ -38,6 +38,13 @@ # xargs -n1 | sort | uniq -d; # done +# 20200115: gcc libssp removed +OLD_FILES+=usr/include/ssp/ssp.h +OLD_FILES+=usr/include/ssp/stdio.h +OLD_FILES+=usr/include/ssp/string.h +OLD_FILES+=usr/include/ssp/unistd.h +OLD_DIRS+=usr/include/ssp + # 20200107: new clang import which bumps version from 9.0.0 to 9.0.1. OLD_FILES+=usr/lib/clang/9.0.0/include/cuda_wrappers/algorithm OLD_FILES+=usr/lib/clang/9.0.0/include/cuda_wrappers/complex Modified: stable/12/gnu/lib/Makefile ============================================================================== --- stable/12/gnu/lib/Makefile Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/gnu/lib/Makefile Thu Jan 16 03:38:06 2020 (r356775) @@ -8,7 +8,6 @@ SUBDIR.${MK_GCC}+= libgcov .if ${MK_GCC} != "no" && ${MK_OPENMP} == "no" SUBDIR+= libgomp .endif -SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_TESTS}+= tests .if ${MK_BSD_CRTBEGIN} == "no" Modified: stable/12/lib/Makefile ============================================================================== --- stable/12/lib/Makefile Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/lib/Makefile Thu Jan 16 03:38:06 2020 (r356775) @@ -18,6 +18,8 @@ SUBDIR_BOOTSTRAP= \ ${_libcplusplus} \ ${_libcxxrt} \ libelf \ + libssp \ + libssp_nonshared \ msun # The main list; please keep these sorted alphabetically. @@ -106,7 +108,9 @@ SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} SUBDIR_DEPEND_libc++:= libcxxrt -SUBDIR_DEPEND_libc= libcompiler_rt +# libssp_nonshared doesn't need to be linked into libc on every arch, but it is +# small enough to build that this bit of serialization is likely insignificant. +SUBDIR_DEPEND_libc= libcompiler_rt libssp_nonshared SUBDIR_DEPEND_libcam= libsbuf SUBDIR_DEPEND_libcasper= libnv SUBDIR_DEPEND_libdevstat= libkvm Modified: stable/12/lib/libc/Makefile.depend.options ============================================================================== --- stable/12/lib/libc/Makefile.depend.options Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/lib/libc/Makefile.depend.options Thu Jan 16 03:38:06 2020 (r356775) @@ -3,6 +3,6 @@ DIRDEPS_OPTIONS= SSP -DIRDEPS.SSP.yes= gnu/lib/libssp/libssp_nonshared +DIRDEPS.SSP.yes= lib/libssp_nonshared .include Modified: stable/12/lib/libssp/fortify_stubs.c ============================================================================== --- head/lib/libssp/fortify_stubs.c Sat Jan 4 20:19:25 2020 (r356356) +++ stable/12/lib/libssp/fortify_stubs.c Thu Jan 16 03:38:06 2020 (r356775) @@ -38,15 +38,15 @@ void *__memcpy_chk(void *dst, const void *src, size_t size_t dstlen); void *__memset_chk(void *dst, int c, size_t len, size_t dstlen); int __snprintf_chk(char *str, size_t maxlen, int flag, size_t strlen, - const char *fmt); -int __sprintf_chk(char *str, int flag, size_t strlen, const char *fmt); + const char *fmt, ...); +int __sprintf_chk(char *str, int flag, size_t strlen, const char *fmt, ...); char *__stpcpy_chk(char *dst, const char *src, size_t dstlen); char *__strcat_chk(char *dst, const char *src, size_t dstlen); char *__strcpy_chk(char *dst, const char *src, size_t dstlen); char *__strncat_chk(char *dst, const char *src, size_t len, size_t dstlen); char *__strncpy_chk(char *dst, const char *src, size_t len, size_t dstlen); -int __vsnprintf_chk(char *str, size_t size, const char *format, - va_list ap); +int __vsnprintf_chk(char *str, size_t size, int flags, size_t len, + const char *format, va_list ap); int __vsprintf_chk(char *str, int flag, size_t slen, const char *format, va_list ap); @@ -69,14 +69,14 @@ __memset_chk(void *dst, int c, size_t len, size_t dstl int __snprintf_chk(char *str, size_t maxlen, int flag, size_t strlen, - const char *fmt) + const char *fmt, ...) { ABORT(); } int -__sprintf_chk(char *str, int flag, size_t strlen, const char *fmt) +__sprintf_chk(char *str, int flag, size_t strlen, const char *fmt, ...) { ABORT(); @@ -118,8 +118,8 @@ __strncpy_chk(char *dst, const char *src, size_t len, } int -__vsnprintf_chk(char *str, size_t size, const char *format, - va_list ap) +__vsnprintf_chk(char *str, size_t size, int flags, size_t len, + const char *format, va_list ap) { ABORT(); Modified: stable/12/lib/libsysdecode/Makefile.depend ============================================================================== --- stable/12/lib/libsysdecode/Makefile.depend Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/lib/libsysdecode/Makefile.depend Thu Jan 16 03:38:06 2020 (r356775) @@ -7,7 +7,6 @@ DIRDEPS = \ gnu/lib/libdialog \ gnu/lib/libgomp \ gnu/lib/libregex \ - gnu/lib/libssp \ gnu/lib/libstdc++ \ gnu/lib/libsupc++ \ include \ @@ -99,6 +98,7 @@ DIRDEPS = \ lib/libsdp \ lib/libsecureboot \ lib/libsqlite3 \ + lib/libssp \ lib/libstdthreads \ lib/libtacplus \ lib/libthread_db \ Modified: stable/12/share/mk/local.dirdeps.mk ============================================================================== --- stable/12/share/mk/local.dirdeps.mk Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/share/mk/local.dirdeps.mk Thu Jan 16 03:38:06 2020 (r356775) @@ -75,7 +75,7 @@ DIRDEPS_FILTER.xtras+= Nusr.bin/clang/clang.host .if ${DEP_RELDIR} == "lib/libc" DIRDEPS += lib/libc_nonshared .if ${MK_SSP:Uno} != "no" -DIRDEPS += gnu/lib/libssp/libssp_nonshared +DIRDEPS += lib/libssp_nonshared .endif .else DIRDEPS_FILTER.xtras+= Nlib/libc_nonshared Modified: stable/12/share/mk/local.gendirdeps.mk ============================================================================== --- stable/12/share/mk/local.gendirdeps.mk Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/share/mk/local.gendirdeps.mk Thu Jan 16 03:38:06 2020 (r356775) @@ -7,7 +7,7 @@ GENDIRDEPS_HEADER= echo '\# ${FreeBSD:L:@v@$$$v$$ @:M* # local.dirdeps.mk will put them in if necessary GENDIRDEPS_FILTER+= \ Nbin/cat.host \ - Ngnu/lib/libssp/libssp_nonshared \ + Nlib/libssp_nonshared \ Ncddl/usr.bin/ctf* \ Nlib/libc_nonshared \ Ngnu/lib/csu \ Modified: stable/12/share/mk/src.libnames.mk ============================================================================== --- stable/12/share/mk/src.libnames.mk Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/share/mk/src.libnames.mk Thu Jan 16 03:38:06 2020 (r356775) @@ -561,8 +561,8 @@ LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog LIBGCOVDIR= ${OBJTOP}/gnu/lib/libgcov LIBGOMPDIR= ${OBJTOP}/gnu/lib/libgomp LIBGNUREGEXDIR= ${OBJTOP}/gnu/lib/libregex -LIBSSPDIR= ${OBJTOP}/gnu/lib/libssp -LIBSSP_NONSHAREDDIR= ${OBJTOP}/gnu/lib/libssp/libssp_nonshared +LIBSSPDIR= ${OBJTOP}/lib/libssp +LIBSSP_NONSHAREDDIR= ${OBJTOP}/lib/libssp_nonshared LIBSUPCPLUSPLUSDIR= ${OBJTOP}/gnu/lib/libsupc++ LIBASN1DIR= ${OBJTOP}/kerberos5/lib/libasn1 LIBGSSAPI_KRB5DIR= ${OBJTOP}/kerberos5/lib/libgssapi_krb5 Modified: stable/12/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- stable/12/targets/pseudo/userland/gnu/Makefile.depend Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/targets/pseudo/userland/gnu/Makefile.depend Thu Jan 16 03:38:06 2020 (r356775) @@ -12,8 +12,6 @@ DIRDEPS = \ gnu/lib/libgcov \ gnu/lib/libgomp \ gnu/lib/libregex/doc \ - gnu/lib/libssp \ - gnu/lib/libssp/libssp_nonshared \ gnu/lib/libstdc++ \ gnu/lib/libsupc++ \ gnu/usr.bin/binutils/ar \ Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Thu Jan 16 03:24:45 2020 (r356774) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Thu Jan 16 03:38:06 2020 (r356775) @@ -8317,41 +8317,6 @@ OLD_FILES+=usr/share/doc/pjdfstest/README OLD_DIRS+=usr/share/doc/pjdfstest .endif -.if ${MK_SSP} == no -OLD_LIBS+=lib/libssp.so.0 -OLD_FILES+=usr/include/ssp/ssp.h -OLD_FILES+=usr/include/ssp/stdio.h -OLD_FILES+=usr/include/ssp/string.h -OLD_FILES+=usr/include/ssp/unistd.h -OLD_FILES+=usr/lib/libssp.a -OLD_FILES+=usr/lib/libssp.so -OLD_FILES+=usr/lib/libssp_nonshared.a -OLD_FILES+=usr/lib32/libssp.a -OLD_FILES+=usr/lib32/libssp.so -OLD_LIBS+=usr/lib32/libssp.so.0 -OLD_FILES+=usr/lib32/libssp_nonshared.a -OLD_FILES+=usr/tests/lib/libc/ssp/Kyuafile -OLD_FILES+=usr/tests/lib/libc/ssp/h_fgets -OLD_FILES+=usr/tests/lib/libc/ssp/h_getcwd -OLD_FILES+=usr/tests/lib/libc/ssp/h_gets -OLD_FILES+=usr/tests/lib/libc/ssp/h_memcpy -OLD_FILES+=usr/tests/lib/libc/ssp/h_memmove -OLD_FILES+=usr/tests/lib/libc/ssp/h_memset -OLD_FILES+=usr/tests/lib/libc/ssp/h_read -OLD_FILES+=usr/tests/lib/libc/ssp/h_readlink -OLD_FILES+=usr/tests/lib/libc/ssp/h_snprintf -OLD_FILES+=usr/tests/lib/libc/ssp/h_sprintf -OLD_FILES+=usr/tests/lib/libc/ssp/h_stpcpy -OLD_FILES+=usr/tests/lib/libc/ssp/h_stpncpy -OLD_FILES+=usr/tests/lib/libc/ssp/h_strcat -OLD_FILES+=usr/tests/lib/libc/ssp/h_strcpy -OLD_FILES+=usr/tests/lib/libc/ssp/h_strncat -OLD_FILES+=usr/tests/lib/libc/ssp/h_strncpy -OLD_FILES+=usr/tests/lib/libc/ssp/h_vsnprintf -OLD_FILES+=usr/tests/lib/libc/ssp/h_vsprintf -OLD_FILES+=usr/tests/lib/libc/ssp/ssp_test -.endif - .if ${MK_SYSCONS} == no OLD_FILES+=usr/share/syscons/fonts/INDEX.fonts OLD_FILES+=usr/share/syscons/fonts/armscii8-8x14.fnt From owner-svn-src-stable-12@freebsd.org Thu Jan 16 07:02:10 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B2CF22BC6D; Thu, 16 Jan 2020 07:02:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yw9Z1rBRz4YcM; Thu, 16 Jan 2020 07:02:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A3661B840; Thu, 16 Jan 2020 07:02:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00G72AGI018030; Thu, 16 Jan 2020 07:02:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G729B1018027; Thu, 16 Jan 2020 07:02:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001160702.00G729B1018027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 16 Jan 2020 07:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356777 - stable/12/contrib/llvm-project/llvm/lib/Target/Mips X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/12/contrib/llvm-project/llvm/lib/Target/Mips X-SVN-Commit-Revision: 356777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 07:02:10 -0000 Author: dim Date: Thu Jan 16 07:02:09 2020 New Revision: 356777 URL: https://svnweb.freebsd.org/changeset/base/356777 Log: MFC r356701: Merge commit f46ba4f07 from llvm git (by Simon Atanasyan): [mips] Use less registers to load address of TargetExternalSymbol There is no pattern matched `add hi, (MipsLo texternalsym)`. As a result, loading an address of 32-bit symbol requires two registers and one more additional instruction: ``` addiu $1, $zero, %lo(foo) lui $2, %hi(foo) addu $25, $2, $1 ``` This patch adds the missed pattern and enables generation more effective set of instructions: ``` lui $1, %hi(foo) addiu $25, $1, %lo(foo) ``` Differential Revision: https://reviews.llvm.org/D66771 llvm-svn: 370196 Merge commit 59bb3609f from llvm git (by Simon Atanasyan): [mips] Fix 64-bit address loading in case of applying 32-bit mask to the result If result of 64-bit address loading combines with 32-bit mask, LLVM tries to optimize the code and remove "redundant" loading of upper 32-bits of the address. It leads to incorrect code on MIPS64 targets. MIPS backend creates the following chain of commands to load 64-bit address in the `MipsTargetLowering::getAddrNonPICSym64` method: ``` (add (shl (add (shl (add %highest(sym), %higher(sym)), 16), %hi(sym)), 16), %lo(%sym)) ``` If the mask presents, LLVM decides to optimize the chain of commands. It really does not make sense to load upper 32-bits because the 0x0fffffff mask anyway clears them. After removing redundant commands we get this chain: ``` (add (shl (%hi(sym), 16), %lo(%sym)) ``` There is no patterns matched `(MipsHi (i64 symbol))`. Due a bug in `SYM_32` predicate definition, backend incorrectly selects a pattern for a 32-bit symbols and uses the `lui` instruction for loading `%hi(sym)`. As a result we get incorrect set of instructions with unnecessary 16-bit left shifting: ``` lui at,0x0 R_MIPS_HI16 foo dsll at,at,0x10 daddiu at,at,0 R_MIPS_LO16 foo ``` This patch resolves two problems: - Fix `SYM_32/SYM_64` predicates to prevent selection of patterns dedicated to 32-bit symbols in case of using N64 ABI. - Add missed patterns for 64-bit symbols for `%hi/%lo`. Fix PR42736. Differential Revision: https://reviews.llvm.org/D66228 llvm-svn: 370268 These two commits fix a miscompilation of the kernel for mips64, and should allow clang to be used as the default compiler for mips64. Requested by: arichards Modified: stable/12/contrib/llvm-project/llvm/lib/Target/Mips/Mips.td stable/12/contrib/llvm-project/llvm/lib/Target/Mips/Mips64InstrInfo.td stable/12/contrib/llvm-project/llvm/lib/Target/Mips/MipsInstrInfo.td Directory Properties: stable/12/ (props changed) stable/12/contrib/llvm-project/llvm/ (props changed) Modified: stable/12/contrib/llvm-project/llvm/lib/Target/Mips/Mips.td ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Target/Mips/Mips.td Thu Jan 16 05:01:21 2020 (r356776) +++ stable/12/contrib/llvm-project/llvm/lib/Target/Mips/Mips.td Thu Jan 16 07:02:09 2020 (r356777) @@ -25,6 +25,8 @@ class PredicateControl { list GPRPredicates = []; // Predicates for the PTR size such as IsPTR64bit list PTRPredicates = []; + // Predicates for a symbol's size such as hasSym32. + list SYMPredicates = []; // Predicates for the FGR size and layout such as IsFP64bit list FGRPredicates = []; // Predicates for the instruction group membership such as ISA's. @@ -38,6 +40,7 @@ class PredicateControl { list Predicates = !listconcat(EncodingPredicates, GPRPredicates, PTRPredicates, + SYMPredicates, FGRPredicates, InsnPredicates, HardFloatPredicate, Modified: stable/12/contrib/llvm-project/llvm/lib/Target/Mips/Mips64InstrInfo.td ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Target/Mips/Mips64InstrInfo.td Thu Jan 16 05:01:21 2020 (r356776) +++ stable/12/contrib/llvm-project/llvm/lib/Target/Mips/Mips64InstrInfo.td Thu Jan 16 07:02:09 2020 (r356777) @@ -700,7 +700,21 @@ let AdditionalPredicates = [NotInMicroMips] in { (DADDiu GPR64:$hi, tjumptable:$lo)>, ISA_MIPS3, GPR_64, SYM_64; def : MipsPat<(add GPR64:$hi, (MipsHigher (i64 tconstpool:$lo))), (DADDiu GPR64:$hi, tconstpool:$lo)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(add GPR64:$hi, (MipsHigher (i64 texternalsym:$lo))), + (DADDiu GPR64:$hi, texternalsym:$lo)>, + ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsHi (i64 tglobaladdr:$in)), + (DADDiu ZERO_64, tglobaladdr:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsHi (i64 tblockaddress:$in)), + (DADDiu ZERO_64, tblockaddress:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsHi (i64 tjumptable:$in)), + (DADDiu ZERO_64, tjumptable:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsHi (i64 tconstpool:$in)), + (DADDiu ZERO_64, tconstpool:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsHi (i64 texternalsym:$in)), + (DADDiu ZERO_64, texternalsym:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(add GPR64:$hi, (MipsHi (i64 tglobaladdr:$lo))), (DADDiu GPR64:$hi, tglobaladdr:$lo)>, ISA_MIPS3, GPR_64, SYM_64; def : MipsPat<(add GPR64:$hi, (MipsHi (i64 tblockaddress:$lo))), @@ -710,7 +724,24 @@ let AdditionalPredicates = [NotInMicroMips] in { (DADDiu GPR64:$hi, tjumptable:$lo)>, ISA_MIPS3, GPR_64, SYM_64; def : MipsPat<(add GPR64:$hi, (MipsHi (i64 tconstpool:$lo))), (DADDiu GPR64:$hi, tconstpool:$lo)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(add GPR64:$hi, (MipsHi (i64 texternalsym:$lo))), + (DADDiu GPR64:$hi, texternalsym:$lo)>, + ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsLo (i64 tglobaladdr:$in)), + (DADDiu ZERO_64, tglobaladdr:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsLo (i64 tblockaddress:$in)), + (DADDiu ZERO_64, tblockaddress:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsLo (i64 tjumptable:$in)), + (DADDiu ZERO_64, tjumptable:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsLo (i64 tconstpool:$in)), + (DADDiu ZERO_64, tconstpool:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsLo (i64 tglobaltlsaddr:$in)), + (DADDiu ZERO_64, tglobaltlsaddr:$in)>, + ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(MipsLo (i64 texternalsym:$in)), + (DADDiu ZERO_64, texternalsym:$in)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(add GPR64:$hi, (MipsLo (i64 tglobaladdr:$lo))), (DADDiu GPR64:$hi, tglobaladdr:$lo)>, ISA_MIPS3, GPR_64, SYM_64; def : MipsPat<(add GPR64:$hi, (MipsLo (i64 tblockaddress:$lo))), @@ -723,6 +754,9 @@ let AdditionalPredicates = [NotInMicroMips] in { def : MipsPat<(add GPR64:$hi, (MipsLo (i64 tglobaltlsaddr:$lo))), (DADDiu GPR64:$hi, tglobaltlsaddr:$lo)>, ISA_MIPS3, GPR_64, SYM_64; + def : MipsPat<(add GPR64:$hi, (MipsLo (i64 texternalsym:$lo))), + (DADDiu GPR64:$hi, texternalsym:$lo)>, + ISA_MIPS3, GPR_64, SYM_64; } // gp_rel relocs Modified: stable/12/contrib/llvm-project/llvm/lib/Target/Mips/MipsInstrInfo.td ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Target/Mips/MipsInstrInfo.td Thu Jan 16 05:01:21 2020 (r356776) +++ stable/12/contrib/llvm-project/llvm/lib/Target/Mips/MipsInstrInfo.td Thu Jan 16 07:02:09 2020 (r356777) @@ -215,9 +215,9 @@ def HasCnMipsP : Predicate<"Subtarget->hasCnMipsP AssemblerPredicate<"FeatureCnMipsP">; def NotCnMipsP : Predicate<"!Subtarget->hasCnMipsP()">, AssemblerPredicate<"!FeatureCnMipsP">; -def IsSym32 : Predicate<"Subtarget->HasSym32()">, +def IsSym32 : Predicate<"Subtarget->hasSym32()">, AssemblerPredicate<"FeatureSym32">; -def IsSym64 : Predicate<"!Subtarget->HasSym32()">, +def IsSym64 : Predicate<"!Subtarget->hasSym32()">, AssemblerPredicate<"!FeatureSym32">; def IsN64 : Predicate<"Subtarget->isABI_N64()">; def IsNotN64 : Predicate<"!Subtarget->isABI_N64()">; @@ -3173,6 +3173,8 @@ multiclass MipsHiLoRelocs; def : MipsPat<(add GPROpnd:$hi, (MipsLo tglobaltlsaddr:$lo)), (Addiu GPROpnd:$hi, tglobaltlsaddr:$lo)>; + def : MipsPat<(add GPROpnd:$hi, (MipsLo texternalsym:$lo)), + (Addiu GPROpnd:$hi, texternalsym:$lo)>; } // wrapper_pic From owner-svn-src-stable-12@freebsd.org Thu Jan 16 08:11:45 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8B5022DC00; Thu, 16 Jan 2020 08:11:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yxjs5v1pz4cjy; Thu, 16 Jan 2020 08:11:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C59C61C4F5; Thu, 16 Jan 2020 08:11:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00G8Bjun057307; Thu, 16 Jan 2020 08:11:45 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G8Bj3A057306; Thu, 16 Jan 2020 08:11:45 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202001160811.00G8Bj3A057306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 16 Jan 2020 08:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356778 - stable/12/usr.sbin/arp X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/usr.sbin/arp X-SVN-Commit-Revision: 356778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 08:11:46 -0000 Author: eugen Date: Thu Jan 16 08:11:45 2020 New Revision: 356778 URL: https://svnweb.freebsd.org/changeset/base/356778 Log: MFC r356551: arp(8): avoid segfaulting due to out-of-bounds memory access Fix obvious mistake that sometimes results in reading memory past end of an array. PR: 242784 Modified: stable/12/usr.sbin/arp/arp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/arp/arp.c ============================================================================== --- stable/12/usr.sbin/arp/arp.c Thu Jan 16 07:02:09 2020 (r356777) +++ stable/12/usr.sbin/arp/arp.c Thu Jan 16 08:11:45 2020 (r356778) @@ -627,8 +627,7 @@ print_entry(struct sockaddr_dl *sdl, } else xo_emit("{d:/(incomplete)}{en:incomplete/true}"); - for (p = ifnameindex; p && ifnameindex->if_index && - ifnameindex->if_name; p++) { + for (p = ifnameindex; p && p->if_index && p->if_name; p++) { if (p->if_index == sdl->sdl_index) { xo_emit(" on {:interface/%s}", p->if_name); break; From owner-svn-src-stable-12@freebsd.org Thu Jan 16 08:51:59 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B388E22EBF5; Thu, 16 Jan 2020 08:51:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yycH2R3Xz4g7d; Thu, 16 Jan 2020 08:51:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ECB21CD84; Thu, 16 Jan 2020 08:51:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00G8pxOc083436; Thu, 16 Jan 2020 08:51:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00G8pwTa083434; Thu, 16 Jan 2020 08:51:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001160851.00G8pwTa083434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Jan 2020 08:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356781 - stable/12/sys/dev/usb/controller X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb/controller X-SVN-Commit-Revision: 356781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 08:51:59 -0000 Author: hselasky Date: Thu Jan 16 08:51:58 2020 New Revision: 356781 URL: https://svnweb.freebsd.org/changeset/base/356781 Log: MFC r356545: Fix a XHCI driver issue with Intel's Gemini Lake SOC. Do not configure any endpoint twice, but instead keep track of which endpoints are configured on a per device basis, and use an evaluate endpoint context command instead. When changing the configuration make sure all endpoints get deconfigured and the configured endpoint mask is reset. This fixes an issue where an endpoint might stop working if there is an error and the endpoint needs to be reconfigured as a part of the error recovery mechanism in the FreeBSD USB stack. Tested by: Shichun.Ma@dell.com Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/controller/xhci.c stable/12/sys/dev/usb/controller/xhci.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/12/sys/dev/usb/controller/xhci.c Thu Jan 16 08:27:30 2020 (r356780) +++ stable/12/sys/dev/usb/controller/xhci.c Thu Jan 16 08:51:58 2020 (r356781) @@ -3838,6 +3838,7 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer) struct usb_page_cache *pcinp; usb_error_t err; usb_stream_t stream_id; + uint32_t mask; uint8_t index; uint8_t epno; @@ -3903,16 +3904,20 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer) * endpoint context state diagram in the XHCI specification: */ - xhci_configure_mask(udev, (1U << epno) | 1U, 0); + mask = (1U << epno); + xhci_configure_mask(udev, mask | 1U, 0); - if (epno > 1) + if (!(sc->sc_hw.devs[index].ep_configured & mask)) { + sc->sc_hw.devs[index].ep_configured |= mask; err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index); - else + } else { err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index); + } - if (err != 0) - DPRINTF("Could not configure endpoint %u\n", epno); - + if (err != 0) { + DPRINTF("Could not configure " + "endpoint %u at slot %u.\n", epno, index); + } XHCI_CMD_UNLOCK(sc); return (0); @@ -4273,6 +4278,7 @@ xhci_device_state_change(struct usb_device *udev) /* set default state */ sc->sc_hw.devs[index].state = XHCI_ST_DEFAULT; + sc->sc_hw.devs[index].ep_configured = 3U; /* reset number of contexts */ sc->sc_hw.devs[index].context_num = 0; @@ -4290,6 +4296,7 @@ xhci_device_state_change(struct usb_device *udev) break; sc->sc_hw.devs[index].state = XHCI_ST_ADDRESSED; + sc->sc_hw.devs[index].ep_configured = 3U; /* set configure mask to slot only */ xhci_configure_mask(udev, 1, 0); @@ -4304,11 +4311,19 @@ xhci_device_state_change(struct usb_device *udev) break; case USB_STATE_CONFIGURED: - if (sc->sc_hw.devs[index].state == XHCI_ST_CONFIGURED) - break; + if (sc->sc_hw.devs[index].state == XHCI_ST_CONFIGURED) { + /* deconfigure all endpoints, except EP0 */ + err = xhci_cmd_configure_ep(sc, 0, 1, index); + if (err) { + DPRINTF("Failed to deconfigure " + "slot %u.\n", index); + } + } + /* set configured state */ sc->sc_hw.devs[index].state = XHCI_ST_CONFIGURED; + sc->sc_hw.devs[index].ep_configured = 3U; /* reset number of contexts */ sc->sc_hw.devs[index].context_num = 0; Modified: stable/12/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/12/sys/dev/usb/controller/xhci.h Thu Jan 16 08:27:30 2020 (r356780) +++ stable/12/sys/dev/usb/controller/xhci.h Thu Jan 16 08:51:58 2020 (r356781) @@ -408,6 +408,8 @@ struct xhci_hw_dev { struct xhci_endpoint_ext endp[XHCI_MAX_ENDPOINTS]; + uint32_t ep_configured; + uint8_t state; uint8_t nports; uint8_t tt; From owner-svn-src-stable-12@freebsd.org Thu Jan 16 10:25:47 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3D24231988; Thu, 16 Jan 2020 10:25:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47z0hW5Kpkz3JG4; Thu, 16 Jan 2020 10:25:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8AA71DF14; Thu, 16 Jan 2020 10:25:47 +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 00GAPlGW039906; Thu, 16 Jan 2020 10:25:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00GAPlKI039905; Thu, 16 Jan 2020 10:25:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001161025.00GAPlKI039905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Jan 2020 10:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356784 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 356784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 10:25:47 -0000 Author: kib Date: Thu Jan 16 10:25:47 2020 New Revision: 356784 URL: https://svnweb.freebsd.org/changeset/base/356784 Log: MFC r356549: rtld: Return error if $ORIGIN for a dlopen-ed library cannot be resolved. Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Thu Jan 16 08:53:59 2020 (r356783) +++ stable/12/libexec/rtld-elf/rtld.c Thu Jan 16 10:25:47 2020 (r356784) @@ -88,9 +88,9 @@ extern void (*__cleanup)(void); static const char *basename(const char *); static void digest_dynamic1(Obj_Entry *, int, const Elf_Dyn **, const Elf_Dyn **, const Elf_Dyn **); -static void digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *, +static bool digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *, const Elf_Dyn *); -static void digest_dynamic(Obj_Entry *, int); +static bool digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static void distribute_static_tls(Objlist *, RtldLockState *); static Obj_Entry *dlcheck(void *); @@ -640,7 +640,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr } #endif - digest_dynamic(obj_main, 0); + if (!digest_dynamic(obj_main, 0)) + rtld_die(); dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj_main->path, obj_main->valid_hash_sysv, obj_main->valid_hash_gnu, obj_main->dynsymcount); @@ -1364,13 +1365,13 @@ obj_resolve_origin(Obj_Entry *obj) return (rtld_dirname_abs(obj->path, obj->origin_path) != -1); } -static void +static bool digest_dynamic2(Obj_Entry *obj, const Elf_Dyn *dyn_rpath, const Elf_Dyn *dyn_soname, const Elf_Dyn *dyn_runpath) { if (obj->z_origin && !obj_resolve_origin(obj)) - rtld_die(); + return (false); if (dyn_runpath != NULL) { obj->runpath = (const char *)obj->strtab + dyn_runpath->d_un.d_val; @@ -1381,9 +1382,10 @@ digest_dynamic2(Obj_Entry *obj, const Elf_Dyn *dyn_rpa } if (dyn_soname != NULL) object_add_name(obj, obj->strtab + dyn_soname->d_un.d_val); + return (true); } -static void +static bool digest_dynamic(Obj_Entry *obj, int early) { const Elf_Dyn *dyn_rpath; @@ -1391,7 +1393,7 @@ digest_dynamic(Obj_Entry *obj, int early) const Elf_Dyn *dyn_runpath; digest_dynamic1(obj, early, &dyn_rpath, &dyn_soname, &dyn_runpath); - digest_dynamic2(obj, dyn_rpath, dyn_soname, dyn_runpath); + return (digest_dynamic2(obj, dyn_rpath, dyn_soname, dyn_runpath)); } /* @@ -2521,16 +2523,15 @@ do_load_object(int fd, const char *name, char *path, s if (name != NULL) object_add_name(obj, name); obj->path = path; - digest_dynamic(obj, 0); + if (!digest_dynamic(obj, 0)) + goto errp; dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path, obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount); if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == RTLD_LO_DLOPEN) { dbg("refusing to load non-loadable \"%s\"", obj->path); _rtld_error("Cannot dlopen non-loadable %s", obj->path); - munmap(obj->mapbase, obj->mapsize); - obj_free(obj); - return (NULL); + goto errp; } obj->dlopened = (flags & RTLD_LO_DLOPEN) != 0; @@ -2547,7 +2548,12 @@ do_load_object(int fd, const char *name, char *path, s LD_UTRACE(UTRACE_LOAD_OBJECT, obj, obj->mapbase, obj->mapsize, 0, obj->path); - return obj; + return (obj); + +errp: + munmap(obj->mapbase, obj->mapsize); + obj_free(obj); + return (NULL); } static Obj_Entry * @@ -3948,12 +3954,17 @@ rtld_dirname_abs(const char *path, char *base) { char *last; - if (realpath(path, base) == NULL) + if (realpath(path, base) == NULL) { + _rtld_error("realpath \"%s\" failed (%s)", path, + rtld_strerror(errno)); return (-1); + } dbg("%s -> %s", path, base); last = strrchr(base, '/'); - if (last == NULL) + if (last == NULL) { + _rtld_error("non-abs result from realpath \"%s\"", path); return (-1); + } if (last != base) *last = '\0'; return (0); From owner-svn-src-stable-12@freebsd.org Thu Jan 16 10:51:32 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A04582328E2; Thu, 16 Jan 2020 10:51:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47z1GD3l1Dz3KxJ; Thu, 16 Jan 2020 10:51:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B7AF1E35A; Thu, 16 Jan 2020 10:51:32 +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 00GApWcu053803; Thu, 16 Jan 2020 10:51:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00GApWrj053801; Thu, 16 Jan 2020 10:51:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001161051.00GApWrj053801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Jan 2020 10:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356787 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 356787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 10:51:32 -0000 Author: kib Date: Thu Jan 16 10:51:32 2020 New Revision: 356787 URL: https://svnweb.freebsd.org/changeset/base/356787 Log: MFC r356548, r356630: Resolve relative argv0 for direct exec mode to absolute path for AT_EXECPATH. Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Thu Jan 16 10:44:02 2020 (r356786) +++ stable/12/libexec/rtld-elf/rtld.c Thu Jan 16 10:51:32 2020 (r356787) @@ -5482,9 +5482,12 @@ static int open_binary_fd(const char *argv0, bool search_in_path, const char **binpath_res) { - char *pathenv, *pe, *binpath; + char *binpath, *pathenv, *pe, *res1; + const char *res; int fd; + binpath = NULL; + res = NULL; if (search_in_path && strchr(argv0, '/') == NULL) { binpath = xmalloc(PATH_MAX); pathenv = getenv("PATH"); @@ -5509,21 +5512,31 @@ open_binary_fd(const char *argv0, bool search_in_path, continue; fd = open(binpath, O_RDONLY | O_CLOEXEC | O_VERIFY); if (fd != -1 || errno != ENOENT) { - *binpath_res = binpath; + res = binpath; break; } } free(pathenv); } else { fd = open(argv0, O_RDONLY | O_CLOEXEC | O_VERIFY); - *binpath_res = argv0; + res = argv0; } - /* XXXKIB Use getcwd() to resolve relative binpath to absolute. */ if (fd == -1) { _rtld_error("Cannot open %s: %s", argv0, rtld_strerror(errno)); rtld_die(); } + if (res != NULL && res[0] != '/') { + res1 = xmalloc(PATH_MAX); + if (realpath(res, res1) != NULL) { + if (res != argv0) + free(__DECONST(char *, res)); + res = res1; + } else { + free(res1); + } + } + *binpath_res = res; return (fd); } From owner-svn-src-stable-12@freebsd.org Thu Jan 16 15:33:55 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2343D1EC827; Thu, 16 Jan 2020 15:33:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47z7X304R2z4BN1; Thu, 16 Jan 2020 15:33:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F15F521AAF; Thu, 16 Jan 2020 15:33:54 +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 00GFXs2I027435; Thu, 16 Jan 2020 15:33:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00GFXs3O027434; Thu, 16 Jan 2020 15:33:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001161533.00GFXs3O027434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 Jan 2020 15:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356793 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 356793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 15:33:55 -0000 Author: markj Date: Thu Jan 16 15:33:54 2020 New Revision: 356793 URL: https://svnweb.freebsd.org/changeset/base/356793 Log: MFC r356281: Remove set_page_dirty_lock(). Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mm.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/mm.h Thu Jan 16 15:07:52 2020 (r356792) +++ stable/12/sys/compat/linuxkpi/common/include/linux/mm.h Thu Jan 16 15:33:54 2020 (r356793) @@ -211,14 +211,6 @@ set_page_dirty(struct vm_page *page) } static inline void -set_page_dirty_lock(struct vm_page *page) -{ - vm_page_lock(page); - vm_page_dirty(page); - vm_page_unlock(page); -} - -static inline void mark_page_accessed(struct vm_page *page) { vm_page_reference(page); From owner-svn-src-stable-12@freebsd.org Thu Jan 16 16:00:28 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F38AE1ED4AB; Thu, 16 Jan 2020 16:00:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47z86h6H4Tz4Cq0; Thu, 16 Jan 2020 16:00:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2A1621E5F; Thu, 16 Jan 2020 16:00:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00GG0STJ040031; Thu, 16 Jan 2020 16:00:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00GG0SwB040030; Thu, 16 Jan 2020 16:00:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001161600.00GG0SwB040030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 Jan 2020 16:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356794 - stable/12/sys/compat/linprocfs X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/compat/linprocfs X-SVN-Commit-Revision: 356794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 16:00:29 -0000 Author: markj Date: Thu Jan 16 16:00:28 2020 New Revision: 356794 URL: https://svnweb.freebsd.org/changeset/base/356794 Log: MFC r356494: PR: 240992 Modified: stable/12/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/12/sys/compat/linprocfs/linprocfs.c Thu Jan 16 15:33:54 2020 (r356793) +++ stable/12/sys/compat/linprocfs/linprocfs.c Thu Jan 16 16:00:28 2020 (r356794) @@ -1073,7 +1073,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; vm_offset_t e_start, e_end; - vm_ooffset_t off = 0; + vm_ooffset_t off; vm_prot_t e_prot; unsigned int last_timestamp; char *name = "", *freename = NULL; @@ -1083,6 +1083,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) int error; struct vnode *vp; struct vattr vat; + bool private; PROC_LOCK(p); error = p_candebug(td, p); @@ -1114,17 +1115,21 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) e_start = entry->start; e_end = entry->end; obj = entry->object.vm_object; - for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { + off = entry->offset; + for (lobj = tobj = obj; tobj != NULL; + lobj = tobj, tobj = tobj->backing_object) { VM_OBJECT_RLOCK(tobj); + off += lobj->backing_object_offset; if (lobj != obj) VM_OBJECT_RUNLOCK(lobj); - lobj = tobj; } + private = (entry->eflags & MAP_ENTRY_COW) != 0 || obj == NULL || + ((obj->type == OBJT_DEFAULT || obj->type == OBJT_SWAP) && + (obj->flags & OBJ_NOSPLIT) == 0); last_timestamp = map->timestamp; vm_map_unlock_read(map); ino = 0; if (lobj) { - off = IDX_TO_OFF(lobj->size); vp = vm_object_vnode(lobj); if (vp != NULL) vref(vp); @@ -1161,7 +1166,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) (e_prot & VM_PROT_READ)?"r":"-", (e_prot & VM_PROT_WRITE)?"w":"-", (e_prot & VM_PROT_EXECUTE)?"x":"-", - "p", + private ? "p" : "s", (u_long)off, 0, 0, From owner-svn-src-stable-12@freebsd.org Thu Jan 16 16:01:04 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEE051ED580; Thu, 16 Jan 2020 16:01:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47z87N65k1z4D0G; Thu, 16 Jan 2020 16:01:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCA7621EA0; Thu, 16 Jan 2020 16:01:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00GG14wM044034; Thu, 16 Jan 2020 16:01:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00GG14R9044032; Thu, 16 Jan 2020 16:01:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001161601.00GG14R9044032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 Jan 2020 16:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356795 - in stable/12: sbin/ifconfig sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: sbin/ifconfig sys/net X-SVN-Commit-Revision: 356795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 16:01:05 -0000 Author: markj Date: Thu Jan 16 16:01:03 2020 New Revision: 356795 URL: https://svnweb.freebsd.org/changeset/base/356795 Log: MFC r356554: lagg: Further cleanup of the rr_limit option. Modified: stable/12/sbin/ifconfig/iflagg.c stable/12/sys/net/if_lagg.c stable/12/sys/net/if_lagg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ifconfig/iflagg.c ============================================================================== --- stable/12/sbin/ifconfig/iflagg.c Thu Jan 16 16:00:28 2020 (r356794) +++ stable/12/sbin/ifconfig/iflagg.c Thu Jan 16 16:01:03 2020 (r356795) @@ -114,10 +114,13 @@ setlaggrr_limit(const char *val, int d, int s, const s bzero(&ro, sizeof(ro)); strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); - ro.ro_bkt = (int)strtol(val, NULL, 10); + ro.ro_opts = LAGG_OPT_RR_LIMIT; + ro.ro_bkt = (uint32_t)strtoul(val, NULL, 10); + if (ro.ro_bkt == 0) + errx(1, "Invalid round-robin stride: %s", val); if (ioctl(s, SIOCSLAGGOPTS, &ro) != 0) - err(1, "SIOCSLAGG"); + err(1, "SIOCSLAGGOPTS"); } static void Modified: stable/12/sys/net/if_lagg.c ============================================================================== --- stable/12/sys/net/if_lagg.c Thu Jan 16 16:00:28 2020 (r356794) +++ stable/12/sys/net/if_lagg.c Thu Jan 16 16:01:03 2020 (r356795) @@ -1231,21 +1231,18 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data /* * The stride option was added without defining a corresponding - * LAGG_OPT flag, so we must handle it before processing any - * remaining options. + * LAGG_OPT flag, so handle a non-zero value before checking + * anything else to preserve compatibility. */ LAGG_XLOCK(sc); - if (ro->ro_bkt != 0) { + if (ro->ro_opts == 0 && ro->ro_bkt != 0) { if (sc->sc_proto != LAGG_PROTO_ROUNDROBIN) { LAGG_XUNLOCK(sc); error = EINVAL; break; } sc->sc_stride = ro->ro_bkt; - } else { - sc->sc_stride = 0; } - if (ro->ro_opts == 0) { LAGG_XUNLOCK(sc); break; @@ -1261,6 +1258,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case LAGG_OPT_USE_FLOWID: case -LAGG_OPT_USE_FLOWID: case LAGG_OPT_FLOWIDSHIFT: + case LAGG_OPT_RR_LIMIT: valid = 1; lacp = 0; break; @@ -1286,14 +1284,23 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data LAGG_XUNLOCK(sc); break; /* Return from SIOCSLAGGOPTS. */ } + /* * Store new options into sc->sc_opts except for - * FLOWIDSHIFT and LACP options. + * FLOWIDSHIFT, RR and LACP options. */ if (lacp == 0) { if (ro->ro_opts == LAGG_OPT_FLOWIDSHIFT) sc->flowid_shift = ro->ro_flowid_shift; - else if (ro->ro_opts > 0) + else if (ro->ro_opts == LAGG_OPT_RR_LIMIT) { + if (sc->sc_proto != LAGG_PROTO_ROUNDROBIN || + ro->ro_bkt == 0) { + error = EINVAL; + LAGG_XUNLOCK(sc); + break; + } + sc->sc_stride = ro->ro_bkt; + } else if (ro->ro_opts > 0) sc->sc_opts |= ro->ro_opts; else sc->sc_opts &= ~ro->ro_opts; @@ -1915,6 +1922,7 @@ static void lagg_rr_attach(struct lagg_softc *sc) { sc->sc_seq = 0; + sc->sc_stride = 1; } static int @@ -1924,9 +1932,7 @@ lagg_rr_start(struct lagg_softc *sc, struct mbuf *m) uint32_t p; p = atomic_fetchadd_32(&sc->sc_seq, 1); - if (sc->sc_stride > 0) - p /= sc->sc_stride; - + p /= sc->sc_stride; p %= sc->sc_count; lp = CK_SLIST_FIRST(&sc->sc_ports); Modified: stable/12/sys/net/if_lagg.h ============================================================================== --- stable/12/sys/net/if_lagg.h Thu Jan 16 16:00:28 2020 (r356794) +++ stable/12/sys/net/if_lagg.h Thu Jan 16 16:01:03 2020 (r356795) @@ -63,11 +63,11 @@ struct lagg_protos { #define LAGG_PROTO_DEFAULT LAGG_PROTO_FAILOVER #define LAGG_PROTOS { \ - { "failover", LAGG_PROTO_FAILOVER }, \ + { "failover", LAGG_PROTO_FAILOVER }, \ { "lacp", LAGG_PROTO_LACP }, \ { "loadbalance", LAGG_PROTO_LOADBALANCE }, \ - { "roundrobin", LAGG_PROTO_ROUNDROBIN }, \ - { "broadcast", LAGG_PROTO_BROADCAST }, \ + { "roundrobin", LAGG_PROTO_ROUNDROBIN }, \ + { "broadcast", LAGG_PROTO_BROADCAST }, \ { "none", LAGG_PROTO_NONE }, \ { "default", LAGG_PROTO_DEFAULT } \ } @@ -148,6 +148,7 @@ struct lagg_reqopts { #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ #define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP timeout */ +#define LAGG_OPT_RR_LIMIT 0x100 /* RR stride */ u_int ro_count; /* number of ports */ u_int ro_active; /* active port count */ u_int ro_flapping; /* number of flapping */ From owner-svn-src-stable-12@freebsd.org Thu Jan 16 20:55:16 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11B5A1F5B74; Thu, 16 Jan 2020 20:55:16 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zGfq6ZKqz4ZlD; Thu, 16 Jan 2020 20:55:15 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCBF52588C; Thu, 16 Jan 2020 20:55:15 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00GKtFWQ018805; Thu, 16 Jan 2020 20:55:15 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00GKtFMO018802; Thu, 16 Jan 2020 20:55:15 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202001162055.00GKtFMO018802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 16 Jan 2020 20:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356804 - in stable/12/sys: dev/netmap net X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12/sys: dev/netmap net X-SVN-Commit-Revision: 356804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 20:55:16 -0000 Author: vmaffione Date: Thu Jan 16 20:55:15 2020 New Revision: 356804 URL: https://svnweb.freebsd.org/changeset/base/356804 Log: MFC r356704 netmap: disable passthrough with no hypervisor support The netmap passthrough subsystem requires proper support in the hypervisor. In particular, two PCI device ids (from the Red Hat PCI vendor id 0x1b36) need to be assigned to the two netmap virtual devices. We then disable these devices until the ids have not been assigned, in order to avoid conflicts with other virtual devices emulated by upstream QEMU. PR: 241774 Modified: stable/12/sys/dev/netmap/if_ptnet.c stable/12/sys/dev/netmap/netmap_kern.h stable/12/sys/net/netmap_virt.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_ptnet.c ============================================================================== --- stable/12/sys/dev/netmap/if_ptnet.c Thu Jan 16 20:52:26 2020 (r356803) +++ stable/12/sys/dev/netmap/if_ptnet.c Thu Jan 16 20:55:15 2020 (r356804) @@ -87,6 +87,8 @@ #include #include +#ifdef WITH_PTNETMAP + #ifndef INET #error "INET not defined, cannot support offloadings" #endif @@ -2291,3 +2293,4 @@ ptnet_poll(if_t ifp, enum poll_cmd cmd, int budget) return count; } #endif /* DEVICE_POLLING */ +#endif /* WITH_PTNETMAP */ Modified: stable/12/sys/dev/netmap/netmap_kern.h ============================================================================== --- stable/12/sys/dev/netmap/netmap_kern.h Thu Jan 16 20:52:26 2020 (r356803) +++ stable/12/sys/dev/netmap/netmap_kern.h Thu Jan 16 20:55:15 2020 (r356804) @@ -76,7 +76,6 @@ #define WITH_PIPES #define WITH_MONITOR #define WITH_GENERIC -#define WITH_PTNETMAP /* ptnetmap guest support */ #define WITH_EXTMEM #define WITH_NMNULL #endif Modified: stable/12/sys/net/netmap_virt.h ============================================================================== --- stable/12/sys/net/netmap_virt.h Thu Jan 16 20:52:26 2020 (r356803) +++ stable/12/sys/net/netmap_virt.h Thu Jan 16 20:55:15 2020 (r356804) @@ -44,8 +44,8 @@ /* PCI identifiers and PCI BARs for ptnetmap-memdev and ptnet. */ #define PTNETMAP_MEMDEV_NAME "ptnetmap-memdev" #define PTNETMAP_PCI_VENDOR_ID 0x1b36 /* QEMU virtual devices */ -#define PTNETMAP_PCI_DEVICE_ID 0x000c /* memory device */ -#define PTNETMAP_PCI_NETIF_ID 0x000d /* ptnet network interface */ +#define PTNETMAP_PCI_DEVICE_ID 0xcccc /* memory device */ +#define PTNETMAP_PCI_NETIF_ID 0xcccd /* ptnet network interface */ #define PTNETMAP_IO_PCI_BAR 0 #define PTNETMAP_MEM_PCI_BAR 1 #define PTNETMAP_MSIX_PCI_BAR 2 From owner-svn-src-stable-12@freebsd.org Thu Jan 16 21:53:36 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0B0E1F769D; Thu, 16 Jan 2020 21:53:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zHy85fyrz4fwk; Thu, 16 Jan 2020 21:53:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCE612650C; Thu, 16 Jan 2020 21:53:36 +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 00GLramH063209; Thu, 16 Jan 2020 21:53:36 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00GLraO4063207; Thu, 16 Jan 2020 21:53:36 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001162153.00GLraO4063207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 16 Jan 2020 21:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356814 - stable/12/contrib/tcpdump X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/contrib/tcpdump X-SVN-Commit-Revision: 356814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 21:53:36 -0000 Author: kp Date: Thu Jan 16 21:53:36 2020 New Revision: 356814 URL: https://svnweb.freebsd.org/changeset/base/356814 Log: MFC r339557: tcpdump: Log uid on pflog interfaces If pf logs the user id ('pass out log (user)') have tcpdump also print this. Example output: 00:00:00.000000 rule 0/0(match) [uid 1001]: pass out on vtnet0: (tos 0x0, ttl 64, id 57539, offset 0, flags [none], proto UDP (17), length 55) 172.16.2.2.18337 > 172.16.2.1.53: [bad udp cksum 0x5c58 -> 0x16e4!] 40222+ A? google.be. (27) PR: 122773 Modified: stable/12/contrib/tcpdump/print-pflog.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tcpdump/print-pflog.c ============================================================================== --- stable/12/contrib/tcpdump/print-pflog.c Thu Jan 16 21:50:53 2020 (r356813) +++ stable/12/contrib/tcpdump/print-pflog.c Thu Jan 16 21:53:36 2020 (r356814) @@ -97,8 +97,12 @@ pflog_print(netdissect_options *ndo, const struct pflo else ND_PRINT((ndo, "rule %u.%s.%u/", rulenr, hdr->ruleset, subrulenr)); - ND_PRINT((ndo, "%s: %s %s on %s: ", - tok2str(pf_reasons, "unkn(%u)", hdr->reason), + ND_PRINT((ndo, "%s", tok2str(pf_reasons, "unkn(%u)", hdr->reason))); + + if (hdr->uid != UID_MAX) + ND_PRINT((ndo, " [uid %u]", (unsigned)hdr->uid)); + + ND_PRINT((ndo, ": %s %s on %s: ", tok2str(pf_actions, "unkn(%u)", hdr->action), tok2str(pf_directions, "unkn(%u)", hdr->dir), hdr->ifname)); From owner-svn-src-stable-12@freebsd.org Fri Jan 17 04:11:18 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02E051FFA98; Fri, 17 Jan 2020 04:11:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zSKx6HKYz41N1; Fri, 17 Jan 2020 04:11:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D25BB2B37; Fri, 17 Jan 2020 04:11:17 +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 00H4BHuk088282; Fri, 17 Jan 2020 04:11:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00H4BHZ0088281; Fri, 17 Jan 2020 04:11:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001170411.00H4BHZ0088281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 17 Jan 2020 04:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356823 - stable/12/sys/dev/md X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/md X-SVN-Commit-Revision: 356823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2020 04:11:18 -0000 Author: mav Date: Fri Jan 17 04:11:17 2020 New Revision: 356823 URL: https://svnweb.freebsd.org/changeset/base/356823 Log: MFC r356315: Avoid duplicate I/O statistics accounting. Alike to geom_disk free the provider statistics structure and point GEOM toward local statistics. It allows to save some CPU time. Modified: stable/12/sys/dev/md/md.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/md/md.c ============================================================================== --- stable/12/sys/dev/md/md.c Fri Jan 17 03:44:04 2020 (r356822) +++ stable/12/sys/dev/md/md.c Fri Jan 17 04:11:17 2020 (r356823) @@ -1310,6 +1310,8 @@ mdinit(struct md_s *sc) gp = g_new_geomf(&g_md_class, "md%d", sc->unit); gp->softc = sc; pp = g_new_providerf(gp, "md%d", sc->unit); + devstat_remove_entry(pp->stat); + pp->stat = NULL; pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; pp->mediasize = sc->mediasize; pp->sectorsize = sc->sectorsize; @@ -1325,10 +1327,11 @@ mdinit(struct md_s *sc) } sc->gp = gp; sc->pp = pp; - g_error_provider(pp, 0); - g_topology_unlock(); sc->devstat = devstat_new_entry("md", sc->unit, sc->sectorsize, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); + sc->devstat->id = pp; + g_error_provider(pp, 0); + g_topology_unlock(); } static int From owner-svn-src-stable-12@freebsd.org Fri Jan 17 04:13:17 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61C691FFE5C; Fri, 17 Jan 2020 04:13:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zSNF1wJfz41kB; Fri, 17 Jan 2020 04:13:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D3052CB4; Fri, 17 Jan 2020 04:13:17 +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 00H4DHKZ089907; Fri, 17 Jan 2020 04:13:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00H4DHCI089906; Fri, 17 Jan 2020 04:13:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001170413.00H4DHCI089906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 17 Jan 2020 04:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356825 - stable/12/sbin/devd X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/devd X-SVN-Commit-Revision: 356825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2020 04:13:17 -0000 Author: mav Date: Fri Jan 17 04:13:16 2020 New Revision: 356825 URL: https://svnweb.freebsd.org/changeset/base/356825 Log: MFC r355884: Add missing "ereport." prefixes of ZFS events. I was unable to find time when those were working. I think they have been Broken for at least 5 years or even longer. Modified: stable/12/sbin/devd/zfs.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/zfs.conf ============================================================================== --- stable/12/sbin/devd/zfs.conf Fri Jan 17 04:12:03 2020 (r356824) +++ stable/12/sbin/devd/zfs.conf Fri Jan 17 04:13:16 2020 (r356825) @@ -4,55 +4,55 @@ notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.checksum"; + match "type" "ereport.fs.zfs.checksum"; action "logger -p local7.warn -t ZFS 'checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.io"; + match "type" "ereport.fs.zfs.io"; action "logger -p local7.warn -t ZFS 'vdev I/O failure, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size error=$zio_err'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.data"; + match "type" "ereport.fs.zfs.data"; action "logger -p local7.warn -t ZFS 'pool I/O failure, zpool=$pool error=$zio_err'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.zpool"; + match "type" "ereport.fs.zfs.zpool"; action "logger -p local7.err -t ZFS 'failed to load zpool $pool'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.vdev\..*"; + match "type" "ereport.fs.zfs.vdev\..*"; action "logger -p local7.err -t ZFS 'vdev problem, zpool=$pool path=$vdev_path type=$type'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.io_failure"; + match "type" "ereport.fs.zfs.io_failure"; action "logger -p local7.alert -t ZFS 'catastrophic pool I/O failure, zpool=$pool'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.probe_failure"; + match "type" "ereport.fs.zfs.probe_failure"; action "logger -p local7.err -t ZFS 'vdev probe failure, zpool=$pool path=$vdev_path'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.log_replay"; + match "type" "ereport.fs.zfs.log_replay"; action "logger -p local7.err -t ZFS 'pool log replay failure, zpool=$pool'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.config_cache_write"; + match "type" "ereport.fs.zfs.config_cache_write"; action "logger -p local7.warn -t ZFS 'failed to write zpool.cache, zpool=$pool'"; }; From owner-svn-src-stable-12@freebsd.org Fri Jan 17 15:55:17 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A42761F2779; Fri, 17 Jan 2020 15:55:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zlyF4fL3z4fHN; Fri, 17 Jan 2020 15:55:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81EA1B276; Fri, 17 Jan 2020 15:55:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00HFtH9M009515; Fri, 17 Jan 2020 15:55:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00HFtFEn009503; Fri, 17 Jan 2020 15:55:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001171555.00HFtFEn009503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 17 Jan 2020 15:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356833 - in stable/12/sys: arm/arm arm/conf arm/include conf kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/12/sys: arm/arm arm/conf arm/include conf kern sys X-SVN-Commit-Revision: 356833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2020 15:55:17 -0000 Author: ian Date: Fri Jan 17 15:55:14 2020 New Revision: 356833 URL: https://svnweb.freebsd.org/changeset/base/356833 Log: MFC r354709-r354710, r355069, r355439, r355780, r356273, r356472 r354709: Rewrite arm/stack_machdep.c for EABI; add stack(9) support to arm kernels. The old stack_machdep.c code was written for the APCS ABI (aka "oldabi"). When we switched to ARM EABI (back in freebsd 10) this file never got updated, and apparently nobody noticed that until now. The new implementation uses the same stack unwinder code used by the arm implemenation of the db_trace stuff. r354710: Compile in arm/unwind.c if options STACK is in effect; the new arm stack(9) code now uses unwind.c. r355069: When doing ARM stack unwinding as part of stack_save(9), do not search loaded modules (pass 0/false for the can_lock arg). Searching the unwind info in modules acquires an exclusive sxlock, and the stack(9) functions can be called in a context where unbounded sleeps are forbidden (such as from the witness checkorder code). Just ignoring the existence of modules in stack_save() is not ideal, so I'm looking for a better solution, but this commit will make it possible to boot an ARM kernel with WITNESS enabled again, until I get something better. PR: 242200 r355439: Declare the global kernel symbols created by ldscript.arm in arm's machdep.h, and remove a couple scattered local declarations. Most of these aren't referenced in C code (there are some references in asm code), and they also aren't documented anywhere. This helps a bit with the latter. r355780: Rewrite arm kernel stack unwind code to work when unwinding through modules. The arm kernel stack unwinder has apparently never been able to unwind when the path of execution leads through a kernel module. There was code that tried to handle modules by looking for the unwind data in them, but it did so by trying to find symbols which have never existed in arm kernel modules. That caused the unwind code to panic, and because part of panic handling calls into the unwind code, that just created a recursion loop. Locating the unwind data in a loaded module requires accessing the Elf section headers to find the SHT_ARM_EXIDX section. For preloaded modules those headers are present in a metadata blob. For dynamically loaded modules, the headers are present only while the loading is in progress; the memory is freed once the module is ready to use. For that reason, there is new code in kern/link_elf.c, wrapped in #ifdef __arm__, to extract the unwind info while the headers are loaded. The values are saved into new fields in the linker_file structure which are also conditional on __arm__. In arm/unwind.c there is new code to locally cache the per-module info needed to find the unwind tables. The local cache is crafted for lockless read access, because the unwind code often needs to run in context where sleeping is not allowed. A large comment block describes the local cache list, so I won't repeat it all here. r356273: Since arm/unwind.c s conditionally compiled, only call functions in it when one of those conditions is true. Fixes build failure on kernel configs with no debugging options active. r356472: Add #ifdef option-test wrappers around another call to an arm/unwind.c function which is only compiled-in with certain options. Why is it always the most trivial part of a big commit that takes 3 tries to get right? Modified: stable/12/sys/arm/arm/elf_machdep.c stable/12/sys/arm/arm/mp_machdep.c stable/12/sys/arm/arm/stack_machdep.c stable/12/sys/arm/arm/unwind.c stable/12/sys/arm/conf/std.armv6 stable/12/sys/arm/conf/std.armv7 stable/12/sys/arm/include/machdep.h stable/12/sys/arm/include/stack.h stable/12/sys/conf/files.arm stable/12/sys/kern/kern_linker.c stable/12/sys/kern/link_elf.c stable/12/sys/sys/linker.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/arm/elf_machdep.c ============================================================================== --- stable/12/sys/arm/arm/elf_machdep.c Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/arm/arm/elf_machdep.c Fri Jan 17 15:55:14 2020 (r356833) @@ -47,10 +47,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef VFP #include #endif +#include "opt_ddb.h" /* for OPT_DDB */ +#include "opt_global.h" /* for OPT_KDTRACE_HOOKS */ +#include "opt_stack.h" /* for OPT_STACK */ + static boolean_t elf32_arm_abi_supported(struct image_params *); u_long elf_hwcap; @@ -309,12 +314,25 @@ elf_cpu_load_file(linker_file_t lf) cpu_l2cache_wb_range((vm_offset_t)lf->address, (vm_size_t)lf->size); cpu_icache_sync_range((vm_offset_t)lf->address, (vm_size_t)lf->size); #endif + +#if defined(DDB) || defined(KDTRACE_HOOKS) || defined(STACK) + /* + * Inform the stack(9) code of the new module, so it can acquire its + * per-module unwind data. + */ + unwind_module_loaded(lf); +#endif + return (0); } int -elf_cpu_unload_file(linker_file_t lf __unused) +elf_cpu_unload_file(linker_file_t lf) { +#if defined(DDB) || defined(KDTRACE_HOOKS) || defined(STACK) + /* Inform the stack(9) code that this module is gone. */ + unwind_module_unloaded(lf); +#endif return (0); } Modified: stable/12/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/12/sys/arm/arm/mp_machdep.c Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/arm/arm/mp_machdep.c Fri Jan 17 15:55:14 2020 (r356833) @@ -106,8 +106,6 @@ check_ap(void) return (-2); } -extern unsigned char _end[]; - /* Initialize and fire up non-boot processors */ void cpu_mp_start(void) Modified: stable/12/sys/arm/arm/stack_machdep.c ============================================================================== --- stable/12/sys/arm/arm/stack_machdep.c Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/arm/arm/stack_machdep.c Fri Jan 17 15:55:14 2020 (r356833) @@ -1,8 +1,7 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2005 Antoine Brodin - * All rights reserved. + * Copyright (c) 2019 Ian Lepore * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,63 +28,64 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include - -#include #include #include -/* - * This code makes assumptions about the stack layout. These are correct - * when using APCS (the old ABI), but are no longer true with AAPCS and the - * ARM EABI. There is also an issue with clang and llvm when building for - * APCS where it lays out the stack incorrectly. Because of this we disable - * this when building for ARM EABI or when building with clang. - */ +static void +stack_capture(struct stack *st, struct unwind_state *state) +{ -extern vm_offset_t kernel_vm_end; + stack_zero(st); + while (unwind_stack_one(state, 0) == 0) { + if (stack_put(st, state->registers[PC]) == -1) + break; + } +} -static void -stack_capture(struct stack *st, u_int32_t *frame) +void +stack_save(struct stack *st) { + struct unwind_state state; + uint32_t sp; + + /* Read the stack pointer */ + __asm __volatile("mov %0, sp" : "=&r" (sp)); + + state.registers[FP] = (uint32_t)__builtin_frame_address(0); + state.registers[SP] = sp; + state.registers[LR] = (uint32_t)__builtin_return_address(0); + state.registers[PC] = (uint32_t)stack_save; + + stack_capture(st, &state); } void stack_save_td(struct stack *st, struct thread *td) { - u_int32_t *frame; + struct unwind_state state; - if (TD_IS_SWAPPED(td)) - panic("stack_save_td: swapped"); - if (TD_IS_RUNNING(td)) - panic("stack_save_td: running"); + KASSERT(!TD_IS_SWAPPED(td), ("stack_save_td: swapped")); + KASSERT(!TD_IS_RUNNING(td), ("stack_save_td: running")); - /* - * This register, the frame pointer, is incorrect for the ARM EABI - * as it doesn't have a frame pointer, however it's value is not used - * when building for EABI. - */ - frame = (u_int32_t *)td->td_pcb->pcb_regs.sf_r11; - stack_zero(st); - stack_capture(st, frame); + state.registers[FP] = td->td_pcb->pcb_regs.sf_r11; + state.registers[SP] = td->td_pcb->pcb_regs.sf_sp; + state.registers[LR] = td->td_pcb->pcb_regs.sf_lr; + state.registers[PC] = td->td_pcb->pcb_regs.sf_pc; + + stack_capture(st, &state); } int stack_save_td_running(struct stack *st, struct thread *td) { + if (td == curthread) { + stack_save(st); + return (0); + } return (EOPNOTSUPP); -} - -void -stack_save(struct stack *st) -{ - u_int32_t *frame; - - frame = (u_int32_t *)__builtin_frame_address(0); - stack_zero(st); - stack_capture(st, frame); } Modified: stable/12/sys/arm/arm/unwind.c ============================================================================== --- stable/12/sys/arm/arm/unwind.c Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/arm/arm/unwind.c Fri Jan 17 15:55:14 2020 (r356833) @@ -32,9 +32,13 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include +#include +#include +#include +#include #include #include "linker_if.h" @@ -61,12 +65,6 @@ __FBSDID("$FreeBSD$"); #define EXIDX_CANTUNWIND 1 /* - * These are set in the linker script. Their addresses will be - * either the start or end of the exception table or index. - */ -extern int exidx_start, exidx_end; - -/* * Entry types. * These are the only entry types that have been seen in the kernel. */ @@ -99,79 +97,236 @@ struct unwind_idx { uint32_t insn; }; -/* Expand a 31-bit signed value to a 32-bit signed value */ -static __inline int32_t -expand_prel31(uint32_t prel31) +/* + * Local cache of unwind info for loaded modules. + * + * To unwind the stack through the code in a loaded module, we need to access + * the module's exidx unwind data. To locate that data, one must search the + * elf section headers for the SHT_ARM_EXIDX section. Those headers are + * available at the time the module is being loaded, but are discarded by time + * the load process has completed. Code in kern/link_elf.c locates the data we + * need and stores it into the linker_file structure before calling the arm + * machdep routine for handling loaded modules (in arm/elf_machdep.c). That + * function calls into this code to pass along the unwind info, which we save + * into one of these module_info structures. + * + * Because we have to help stack(9) gather stack info at any time, including in + * contexts where sleeping is not allowed, we cannot use linker_file_foreach() + * to walk the kernel's list of linker_file structs, because doing so requires + * acquiring an exclusive sx_lock. So instead, we keep a local list of these + * structures, one for each loaded module (and one for the kernel itself that we + * synthesize at init time). New entries are added to the end of this list as + * needed, but entries are never deleted from the list. Instead, they are + * cleared out in-place to mark them as unused. That means the code doing stack + * unwinding can always safely walk the list without locking, because the + * structure of the list never changes in a way that would cause the walker to + * follow a bad link. + * + * A cleared-out entry on the list has module start=UINTPTR_MAX and end=0, so + * start <= addr < end cannot be true for any value of addr being searched for. + * We also don't have to worry about races where we look up the unwind info just + * before a module is unloaded and try to access it concurrently with or just + * after the unloading happens in another thread, because that means the path of + * execution leads through a now-unloaded module, and that's already well into + * undefined-behavior territory. + * + * List entries marked as unused get reused when new modules are loaded. We + * don't worry about holding a few unused bytes of memory in the list after + * unloading a module. + */ +struct module_info { + uintptr_t module_start; /* Start of loaded module */ + uintptr_t module_end; /* End of loaded module */ + uintptr_t exidx_start; /* Start of unwind data */ + uintptr_t exidx_end; /* End of unwind data */ + STAILQ_ENTRY(module_info) + link; /* Link to next entry */ +}; +static STAILQ_HEAD(, module_info) module_list; + +/* + * Hide ugly casting in somewhat-less-ugly macros. + * CADDR - cast a pointer or number to caddr_t. + * UADDR - cast a pointer or number to uintptr_t. + */ +#define CADDR(addr) ((caddr_t)(void*)(uintptr_t)(addr)) +#define UADDR(addr) ((uintptr_t)(addr)) + +/* + * Clear the info in an existing module_info entry on the list. The + * module_start/end addresses are set to values that cannot match any real + * memory address. The entry remains on the list, but will be ignored until it + * is populated with new data. + */ +static void +clear_module_info(struct module_info *info) { + info->module_start = UINTPTR_MAX; + info->module_end = 0; +} - return ((int32_t)(prel31 & 0x7fffffffu) << 1) / 2; +/* + * Populate an existing module_info entry (which is already on the list) with + * the info for a new module. + */ +static void +populate_module_info(struct module_info *info, linker_file_t lf) +{ + + /* + * Careful! The module_start and module_end fields must not be set + * until all other data in the structure is valid. + */ + info->exidx_start = UADDR(lf->exidx_addr); + info->exidx_end = UADDR(lf->exidx_addr) + lf->exidx_size; + info->module_start = UADDR(lf->address); + info->module_end = UADDR(lf->address) + lf->size; } -struct search_context { - uint32_t addr; - caddr_t exidx_start; - caddr_t exidx_end; -}; +/* + * Create a new empty module_info entry and add it to the tail of the list. + */ +static struct module_info * +create_module_info(void) +{ + struct module_info *info; -static int -module_search(linker_file_t lf, void *context) + info = malloc(sizeof(*info), M_CACHE, M_WAITOK | M_ZERO); + clear_module_info(info); + STAILQ_INSERT_TAIL(&module_list, info, link); + return (info); +} + +/* + * Search for a module_info entry on the list whose address range contains the + * given address. If the search address is zero (no module will be loaded at + * zero), then we're looking for an empty item to reuse, which is indicated by + * module_start being set to UINTPTR_MAX in the entry. + */ +static struct module_info * +find_module_info(uintptr_t addr) { - struct search_context *sc = context; - linker_symval_t symval; - c_linker_sym_t sym; + struct module_info *info; - if (lf->address <= (caddr_t)sc->addr && - (lf->address + lf->size) >= (caddr_t)sc->addr) { - if ((LINKER_LOOKUP_SYMBOL(lf, "__exidx_start", &sym) == 0 || - LINKER_LOOKUP_SYMBOL(lf, "exidx_start", &sym) == 0) && - LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) - sc->exidx_start = symval.value; + STAILQ_FOREACH(info, &module_list, link) { + if ((addr >= info->module_start && addr < info->module_end) || + (addr == 0 && info->module_start == UINTPTR_MAX)) + return (info); + } + return (NULL); +} - if ((LINKER_LOOKUP_SYMBOL(lf, "__exidx_end", &sym) == 0 || - LINKER_LOOKUP_SYMBOL(lf, "exidx_end", &sym) == 0) && - LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) - sc->exidx_end = symval.value; +/* + * Handle the loading of a new module by populating a module_info for it. This + * is called for both preloaded and dynamically loaded modules. + */ +void +unwind_module_loaded(struct linker_file *lf) +{ + struct module_info *info; - if (sc->exidx_start != NULL && sc->exidx_end != NULL) - return (1); - panic("Invalid module %s, no unwind tables\n", lf->filename); + /* + * A module that contains only data may have no unwind info; don't + * create any module info for it. + */ + if (lf->exidx_size == 0) + return; + + /* + * Find an unused entry in the existing list to reuse. If we don't find + * one, create a new one and link it into the list. This is the only + * place the module_list is modified. Adding a new entry to the list + * will not perturb any other threads currently walking the list. This + * function is invoked while kern_linker is still holding its lock + * to prevent its module list from being modified, so we don't have to + * worry about racing other threads doing an insert concurrently. + */ + if ((info = find_module_info(0)) == NULL) { + info = create_module_info(); } + populate_module_info(info, lf); +} + +/* Handle the unloading of a module. */ +void +unwind_module_unloaded(struct linker_file *lf) +{ + struct module_info *info; + + /* + * A module that contains only data may have no unwind info and there + * won't be a list entry for it. + */ + if (lf->exidx_size == 0) + return; + + /* + * When a module is unloaded, we clear the info out of its entry in the + * module list, making that entry available for later reuse. + */ + if ((info = find_module_info(UADDR(lf->address))) == NULL) { + printf("arm unwind: module '%s' not on list at unload time\n", + lf->filename); + return; + } + clear_module_info(info); +} + +/* + * Initialization must run fairly early, as soon as malloc(9) is available, and + * definitely before witness, which uses stack(9). We synthesize a module_info + * entry for the kernel, because unwind_module_loaded() doesn't get called for + * it. Also, it is unlike other modules in that the elf metadata for locating + * the unwind tables might be stripped, so instead we have to use the + * _exidx_start/end symbols created by ldscript.arm. + */ +static int +module_info_init(void *arg __unused) +{ + struct linker_file thekernel; + + STAILQ_INIT(&module_list); + + thekernel.filename = "kernel"; + thekernel.address = CADDR(&_start); + thekernel.size = UADDR(&_end) - UADDR(&_start); + thekernel.exidx_addr = CADDR(&_exidx_start); + thekernel.exidx_size = UADDR(&_exidx_end) - UADDR(&_exidx_start); + populate_module_info(create_module_info(), &thekernel); + return (0); } +SYSINIT(unwind_init, SI_SUB_KMEM, SI_ORDER_ANY, module_info_init, NULL); +/* Expand a 31-bit signed value to a 32-bit signed value */ +static __inline int32_t +expand_prel31(uint32_t prel31) +{ + + return ((int32_t)(prel31 & 0x7fffffffu) << 1) / 2; +} + /* * Perform a binary search of the index table to find the function * with the largest address that doesn't exceed addr. */ static struct unwind_idx * -find_index(uint32_t addr, int search_modules) +find_index(uint32_t addr) { - struct search_context sc; - caddr_t idx_start, idx_end; + struct module_info *info; unsigned int min, mid, max; struct unwind_idx *start; struct unwind_idx *item; int32_t prel31_addr; uint32_t func_addr; - start = (struct unwind_idx *)&exidx_start; - idx_start = (caddr_t)&exidx_start; - idx_end = (caddr_t)&exidx_end; + info = find_module_info(addr); + if (info == NULL) + return NULL; - /* This may acquire a lock */ - if (search_modules) { - bzero(&sc, sizeof(sc)); - sc.addr = addr; - if (linker_file_foreach(module_search, &sc) != 0 && - sc.exidx_start != NULL && sc.exidx_end != NULL) { - start = (struct unwind_idx *)sc.exidx_start; - idx_start = sc.exidx_start; - idx_end = sc.exidx_end; - } - } - min = 0; - max = (idx_end - idx_start) / sizeof(struct unwind_idx); + max = (info->exidx_end - info->exidx_start) / sizeof(struct unwind_idx); + start = (struct unwind_idx *)CADDR(info->exidx_start); while (min != max) { mid = min + (max - min + 1) / 2; @@ -382,11 +537,17 @@ unwind_tab(struct unwind_state *state) return 0; } +/* + * Unwind a single stack frame. + * Return 0 on success or 1 if the stack cannot be unwound any further. + * + * XXX The can_lock argument is no longer germane; a sweep of callers should be + * made to remove it after this new code has proven itself for a while. + */ int -unwind_stack_one(struct unwind_state *state, int can_lock) +unwind_stack_one(struct unwind_state *state, int can_lock __unused) { struct unwind_idx *index; - int finished; /* Reset the mask of updated registers */ state->update_mask = 0; @@ -395,26 +556,20 @@ unwind_stack_one(struct unwind_state *state, int can_l state->start_pc = state->registers[PC]; /* Find the item to run */ - index = find_index(state->start_pc, can_lock); + index = find_index(state->start_pc); + if (index == NULL || index->insn == EXIDX_CANTUNWIND) + return 1; - finished = 0; - if (index->insn != EXIDX_CANTUNWIND) { - if (index->insn & (1U << 31)) { - /* The data is within the instruction */ - state->insn = &index->insn; - } else { - /* A prel31 offset to the unwind table */ - state->insn = (uint32_t *) - ((uintptr_t)&index->insn + - expand_prel31(index->insn)); - } - /* Run the unwind function */ - finished = unwind_tab(state); + if (index->insn & (1U << 31)) { + /* The data is within the instruction */ + state->insn = &index->insn; + } else { + /* A prel31 offset to the unwind table */ + state->insn = (uint32_t *) + ((uintptr_t)&index->insn + + expand_prel31(index->insn)); } - /* This is the top of the stack, finish */ - if (index->insn == EXIDX_CANTUNWIND) - finished = 1; - - return (finished); + /* Run the unwind function, return its finished/not-finished status. */ + return (unwind_tab(state)); } Modified: stable/12/sys/arm/conf/std.armv6 ============================================================================== --- stable/12/sys/arm/conf/std.armv6 Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/arm/conf/std.armv6 Fri Jan 17 15:55:14 2020 (r356833) @@ -34,6 +34,7 @@ options GEOM_LABEL # Provides labelization options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] 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 Modified: stable/12/sys/arm/conf/std.armv7 ============================================================================== --- stable/12/sys/arm/conf/std.armv7 Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/arm/conf/std.armv7 Fri Jan 17 15:55:14 2020 (r356833) @@ -34,6 +34,7 @@ options GEOM_LABEL # Provides labelization options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] 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 Modified: stable/12/sys/arm/include/machdep.h ============================================================================== --- stable/12/sys/arm/include/machdep.h Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/arm/include/machdep.h Fri Jan 17 15:55:14 2020 (r356833) @@ -61,4 +61,24 @@ void arm_add_efi_map_entries(struct efi_map_header *ef struct mem_region *mr, int *mrcnt); #endif +/* + * Symbols created by ldscript.arm which are accessible in the kernel as global + * symbols. They have uint8 type because they mark the byte location where the + * corresponding data starts or ends (in the end case, it's the next byte + * following the data, so the data size is end-start). These are listed below + * in the order they occur within the kernel (i.e., the address of each variable + * should be greater than any of the ones before it). + */ +extern uint8_t _start; /* Kernel entry point in locore.S */ +extern uint8_t _etext; /* text segment end */ +extern uint8_t _extab_start; /* unwind table start */ +extern uint8_t _exidx_start; /* unwind index start */ +extern uint8_t _exidx_end; /* unwind index end */ +extern uint8_t _start_ctors; /* ctors data start */ +extern uint8_t _stop_ctors; /* ctors data end */ +extern uint8_t _edata; /* data segment end */ +extern uint8_t __bss_start; /* bss segment start */ +extern uint8_t _ebss; /* bss segment end */ +extern uint8_t _end; /* End of kernel (text+ctors+unwind+data+bss) */ + #endif /* !_MACHINE_MACHDEP_H_ */ Modified: stable/12/sys/arm/include/stack.h ============================================================================== --- stable/12/sys/arm/include/stack.h Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/arm/include/stack.h Fri Jan 17 15:55:14 2020 (r356833) @@ -55,6 +55,14 @@ struct unwind_state { #define LR 14 #define PC 15 +#ifdef _KERNEL + int unwind_stack_one(struct unwind_state *, int); + +struct linker_file; +void unwind_module_loaded(struct linker_file *); +void unwind_module_unloaded(struct linker_file *); + +#endif #endif /* !_MACHINE_STACK_H_ */ Modified: stable/12/sys/conf/files.arm ============================================================================== --- stable/12/sys/conf/files.arm Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/conf/files.arm Fri Jan 17 15:55:14 2020 (r356833) @@ -85,7 +85,7 @@ arm/arm/trap-v4.c optional !armv7 !armv6 arm/arm/trap-v6.c optional armv7 | armv6 arm/arm/uio_machdep.c standard arm/arm/undefined.c standard -arm/arm/unwind.c optional ddb | kdtrace_hooks +arm/arm/unwind.c optional ddb | kdtrace_hooks | stack arm/arm/vm_machdep.c standard arm/arm/vfp.c standard arm/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 Modified: stable/12/sys/kern/kern_linker.c ============================================================================== --- stable/12/sys/kern/kern_linker.c Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/kern/kern_linker.c Fri Jan 17 15:55:14 2020 (r356833) @@ -624,6 +624,10 @@ linker_make_file(const char *pathname, linker_class_t lf->ndeps = 0; lf->deps = NULL; lf->loadcnt = ++loadcnt; +#ifdef __arm__ + lf->exidx_addr = 0; + lf->exidx_size = 0; +#endif STAILQ_INIT(&lf->common); TAILQ_INIT(&lf->modules); TAILQ_INSERT_TAIL(&linker_files, lf, link); Modified: stable/12/sys/kern/link_elf.c ============================================================================== --- stable/12/sys/kern/link_elf.c Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/kern/link_elf.c Fri Jan 17 15:55:14 2020 (r356833) @@ -692,6 +692,50 @@ parse_vnet(elf_file_t ef) } #endif +#ifdef __arm__ +/* + * Locate the ARM exception/unwind table info for DDB and stack(9) use by + * searching for the section header that describes it. There may be no unwind + * info, for example in a module containing only data. + */ +static void +link_elf_locate_exidx(linker_file_t lf, Elf_Shdr *shdr, int nhdr) +{ + int i; + + for (i = 0; i < nhdr; i++) { + if (shdr[i].sh_type == SHT_ARM_EXIDX) { + lf->exidx_addr = shdr[i].sh_addr + lf->address; + lf->exidx_size = shdr[i].sh_size; + break; + } + } +} + +/* + * Locate the section headers metadata in a preloaded module, then use it to + * locate the exception/unwind table in the module. The size of the metadata + * block is stored in a uint32 word immediately before the data itself, and a + * comment in preload_search_info() says it is safe to rely on that. + */ +static void +link_elf_locate_exidx_preload(struct linker_file *lf, caddr_t modptr) +{ + uint32_t *modinfo; + Elf_Shdr *shdr; + uint32_t nhdr; + + modinfo = (uint32_t *)preload_search_info(modptr, + MODINFO_METADATA | MODINFOMD_SHDR); + if (modinfo != NULL) { + shdr = (Elf_Shdr *)modinfo; + nhdr = modinfo[-1] / sizeof(Elf_Shdr); + link_elf_locate_exidx(lf, shdr, nhdr); + } +} + +#endif /* __arm__ */ + static int link_elf_link_preload(linker_class_t cls, const char* filename, linker_file_t *result) @@ -747,6 +791,10 @@ link_elf_link_preload(linker_class_t cls, lf->ctors_size = *ctors_sizep; } +#ifdef __arm__ + link_elf_locate_exidx_preload(lf, modptr); +#endif + error = parse_dynamic(ef); if (error == 0) error = parse_dpcpu(ef); @@ -1140,6 +1188,11 @@ link_elf_load_file(linker_class_t cls, const char* fil ef->ddbstrtab = ef->strbase; nosyms: + +#ifdef __arm__ + link_elf_locate_exidx(lf, shdr, hdr->e_shnum); +#endif + error = link_elf_link_common_finish(lf); if (error != 0) goto out; Modified: stable/12/sys/sys/linker.h ============================================================================== --- stable/12/sys/sys/linker.h Fri Jan 17 15:45:39 2020 (r356832) +++ stable/12/sys/sys/linker.h Fri Jan 17 15:55:14 2020 (r356833) @@ -97,6 +97,11 @@ struct linker_file { */ int nenabled; /* number of enabled probes. */ int fbt_nentries; /* number of fbt entries created. */ + +#ifdef __arm__ + caddr_t exidx_addr; /* Unwind data index table start */ + size_t exidx_size; /* Unwind data index table size */ +#endif }; /* From owner-svn-src-stable-12@freebsd.org Fri Jan 17 17:57:37 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22E301F59F1; Fri, 17 Jan 2020 17:57:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zpgP0qtRz3MFw; Fri, 17 Jan 2020 17:57:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0F34CC86; Fri, 17 Jan 2020 17:57:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00HHvaK0085324; Fri, 17 Jan 2020 17:57:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00HHvYAe085312; Fri, 17 Jan 2020 17:57:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001171757.00HHvYAe085312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 17 Jan 2020 17:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356838 - in stable/12: share/man/man4 sys/conf sys/dev/flash sys/dev/iicbus sys/dev/iicbus/mux sys/modules/i2c sys/modules/i2c/mux X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/conf sys/dev/flash sys/dev/iicbus sys/dev/iicbus/mux sys/modules/i2c sys/modules/i2c/mux X-SVN-Commit-Revision: 356838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2020 17:57:37 -0000 Author: ian Date: Fri Jan 17 17:57:34 2020 New Revision: 356838 URL: https://svnweb.freebsd.org/changeset/base/356838 Log: MFC r356086, r356278, r356294, r356519, r356521-r356522, r356525-r356526 r356086: Add comments to a couple i2c device lines in NOTES. r356278: Add support for i2c bus mux hardware. An i2c bus can be divided into segments which can be selectively connected and disconnected from the main bus. This is usually done to enable using multiple slave devices having the same address, by isolating the devices onto separate bus segments, only one of which is connected to the main bus at once. There are several types of i2c bus muxes, which break down into two general categories... - Muxes which are themselves i2c slaves. These devices respond to i2c commands on their upstream bus, and based on those commands, connect various downstream buses to the upstream. In newbus terms, they are both a child of an iicbus and the parent of one or more iicbus instances. - Muxes which are not i2c devices themselves. Such devices are part of the i2c bus electrically, but in newbus terms their parent is some other bus. The association with the upstream bus must be established by separate metadata (such as FDT data). In both cases, the mux driver has one or more iicbus child instances representing the downstream buses. The mux driver implements the iicbus_if interface, as if it were an iichb host bridge/i2c controller driver. It services the IO requests sent to it by forwarding them to the iicbus instance representing the upstream bus, after electrically connecting the upstream bus to the downstream bus that hosts the i2c slave device which made the IO request. The net effect is automatic mux switching which is transparent to slaves on the downstream buses. They just do i2c IO they way they normally do, and the bus is electrically connected for the duration of the IO and then idled when it is complete. The existing iicbus_if callback() method is enhanced so that the parameter passed to it can be a struct which contains a device_t for the requesting bus and slave devices. This change is done by adding a flag that indicates the extra values are present, and making the flags field the first field of a new args struct. If the flag is set, the iichb or mux driver can recast the pointer-to-flags into a pointer-to-struct and access the extra fields. Thus abi compatibility with older drivers is retained (but a mux cannot exist on the bus with the older iicbus driver in use.) A new set of core support routines exists in iicbus.c. This code will help implement mux drivers for any type of mux hardware by supplying all the boilerplate code that forwards IO requests upstream. It also has code for parsing metadata and instantiating the child iicbus instances based on it. Two new hardware mux drivers are added. The ltc430x driver supports the LTC4305/4306 mux chips which are controlled via i2c commands. The iic_gpiomux driver supports any mux hardware which is controlled by manipulating the state of one or more gpio pins. Test Plan Tested locally using a variety of mux'd bus configurations involving both ltc4305 and a homebrew gpio-controlled mux. Tested configurations included cascaded muxes (unlikely in the real world, but useful to prove that 'it all just works' in terms of the automatic switching and upstream forwarding of IO requests). r356294: Explicitly include sys/rman.h instead of relying on getting it via some other header. r356519: Ensure any reserved gpio pins get released if an early exit is taken from the attach function. r356521: Init sc->maxbus to -1, not 0. It represents the highest array index that has a non-NULL child bus stored in it, so the "none" value can't be zero since that's a valid array index. Also, when adding all possible buses because there is no specific per-bus config, there's no need to reset sc->maxbus on each loop iteration, it can be set once after the loop. r356522: Change some KASSERT to device_printf + return EINVAL. There's no need to bring the whole kernel down due to a configuration error detected when a module is loaded, it suffices to just not attach the device. r356525: Split the code to find and add iicbus children out to its own function. Move the decision to take an early exit from that function after adding children based on FDT data into the #ifdef FDT block, so that it doesn't offend coverity's notion of how the code should be written. (What's the point of compilers optimizing away dead code if static analyzers won't let you use the feature in conjuction with an #ifdef block?) Reported by: coverity via vangyzen@ r356526: Remove some trailing whitespace; no functional changes. Added: stable/12/share/man/man4/iic_gpiomux.4 - copied unchanged from r356278, head/share/man/man4/iic_gpiomux.4 stable/12/share/man/man4/iicmux.4 - copied unchanged from r356278, head/share/man/man4/iicmux.4 stable/12/share/man/man4/ltc430x.4 - copied unchanged from r356278, head/share/man/man4/ltc430x.4 stable/12/sys/dev/iicbus/mux/ - copied from r356278, head/sys/dev/iicbus/mux/ stable/12/sys/modules/i2c/mux/ - copied from r356278, head/sys/modules/i2c/mux/ Modified: stable/12/share/man/man4/Makefile stable/12/sys/conf/NOTES stable/12/sys/conf/files stable/12/sys/dev/flash/cqspi.c stable/12/sys/dev/iicbus/iiconf.c stable/12/sys/dev/iicbus/iiconf.h stable/12/sys/dev/iicbus/mux/iic_gpiomux.c stable/12/sys/dev/iicbus/mux/iicmux.c stable/12/sys/modules/i2c/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Fri Jan 17 17:56:31 2020 (r356837) +++ stable/12/share/man/man4/Makefile Fri Jan 17 17:57:34 2020 (r356838) @@ -212,8 +212,10 @@ MAN= aac.4 \ ig4.4 \ igmp.4 \ iic.4 \ + iic_gpiomux.4 \ iicbb.4 \ iicbus.4 \ + iicmux.4 \ iicsmb.4 \ iir.4 \ ${_imcsmb.4} \ @@ -267,6 +269,7 @@ MAN= aac.4 \ lp.4 \ lpbb.4 \ lpt.4 \ + ltc430x.4 \ mac.4 \ mac_biba.4 \ mac_bsdextended.4 \ Copied: stable/12/share/man/man4/iic_gpiomux.4 (from r356278, head/share/man/man4/iic_gpiomux.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/iic_gpiomux.4 Fri Jan 17 17:57:34 2020 (r356838, copy of r356278, head/share/man/man4/iic_gpiomux.4) @@ -0,0 +1,88 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" 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 January 1, 2020 +.Dt IIC_GPIOMUX 4 +.Os +.Sh NAME +.Nm iic_gpiomux +.Nd driver for I2C mux hardware controlled via GPIO +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iic_gpiomux" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +iic_gpiomux_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports any type of I2C bus multiplexer (mux) hardware that +is controlled by manipulating the state of one or more GPIO pins. +It automatically connects an upstream I2C bus to one of the downstream +buses as needed when slave devices on the downstream buses initiate I/O. +More information on the automatic switching behavior is available in +.Xr iicmux 4 . +.Pp +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, an +.Nm +device node may be defined as a child node of any arbitrary bus +in the FDT data. +The +.Va i2c-parent +property indicates the connection to the upstream I2C bus. +The children of the +.Nm +node are additional i2c buses, which will have their own i2c slave +devices described in their child nodes. +.Pp +The +.Nm +driver conforms to the standard +.Bk -words +.Li i2c/i2c-mux-gpio.txt +.Ek +bindings document. +.Sh SEE ALSO +.Xr iicbus 4 , +.Xr iicmux 4 , +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 13.0 . Copied: stable/12/share/man/man4/iicmux.4 (from r356278, head/share/man/man4/iicmux.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/iicmux.4 Fri Jan 17 17:57:34 2020 (r356838, copy of r356278, head/share/man/man4/iicmux.4) @@ -0,0 +1,148 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" 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 January 1, 2020 +.Dt IICMUX 4 +.Os +.Sh NAME +.Nm iicmux +.Nd I2C bus mulitiplexer framework +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iicmux" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +iicmux_load="YES" +.Ed +.Pp +Note that it is usually not necessary to explicitly load the +driver module, as it will be loaded automatically along with +the driver for the specific mux hardware in use. +.Sh DESCRIPTION +The +.Nm +framework provides support code to help implement drivers for various +I2C bus multiplexer (mux) hardware. +.Nm +is not a standalone driver, +it is a collection of support functions and driver methods which are +used by individual mux hardware drivers. +It will be loaded automatically when needed by a mux hardware driver. +This manual page provides an overview of the I2C mux framework and its +behavior. +.Pp +Generally speaking, an I2C mux is connected to an upstream I2C bus, and to +one or more downstream I2C buses, and it can be commanded to connect +any one of the downstream buses to the upstream bus. +Some hardware may be able to connect multiple downstream buses at the +same time, but that concept is not supported by +.Nm . +.Pp +The +.Nm +framework operates automatically when I2C slave devices initiate I/O. +It does not require (or even allow for) any external control to select +the active downstream bus. +.Pp +When there is no I/O in progress, the mux is said to be in the +.Dq idle +state. +Some mux hardware has the ability to disconnect all downstream buses +when in an idle state. +Other hardware must always have one of the downstream buses connected. +Individual mux hardware drivers typically provide a way to select which +downstream bus (if any) should be connected while in the idle state. +In the absence of such configuration, whichever downstream bus was +last used remains connected to the upstream bus. +.Pp +When an I2C slave device on a bus downstream of a mux initiates I/O, +it first requests exclusive use of the bus by calling +.Fn iicbus_request_bus . +This request is communicated to the bus's parent, which is the +.Nm +framework +mux driver. +Once exclusive bus ownership is obtained, the mux driver +connects the upstream I2C bus to the downstream bus which hosts the +slave device that requested bus ownership. +The mux hardware maintains that upstream-to-downstream connection until +the slave device calls +.Fn iicbus_release_bus . +Before releasing ownership, the mux driver returns the mux hardware to +the idle state. +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, an I2C mux device node is defined as a child node of its +upstream I2C bus when the mux device is an I2C slave itself. +It may be defined as a child node of any other bus or device in the +system when it is not an I2C slave, in which case the +.Va i2c-parent +property indicates which upstream bus the mux is attached to. +In either case, the children of the mux node are additional I2C buses, which +will have one or more I2C slave devices described in their child nodes. +.Pp +Drivers using the +.Nm +framework conform to the standard +.Bk -words +.Li i2c/i2c-mux.txt +.Ek +bindings document. +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, these values are configurable for +.Nm +framework drivers : +.Bl -tag -width indent +.It Va hint...at +The upstream +.Xr iicbus 4 +the +.Nm +instance is attached to. +.El +.Pp +When configured via hints, the driver automatically adds an iicbus +instance for every downstream bus supported by the chip. +There is currently no way to indicate used versus unused downstream buses. +.Sh SEE ALSO +.Xr iicbus 4 , +.Sh HISTORY +The +.Nm +framework first appeared in +.Fx 13.0 . Copied: stable/12/share/man/man4/ltc430x.4 (from r356278, head/share/man/man4/ltc430x.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/ltc430x.4 Fri Jan 17 17:57:34 2020 (r356838, copy of r356278, head/share/man/man4/ltc430x.4) @@ -0,0 +1,112 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" 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 January 1, 2020 +.Dt LTC430X 4 +.Os +.Sh NAME +.Nm ltc430x +.Nd driver for LTC4305 and LTC4306 I2C mux chips +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ltc430x" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ltc430x_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports the LTC4305 and LTC4306 I2C bus multiplexer (mux) chips. +It automatically connects an upstream I2C bus to one of several downstream +buses as needed when slave devices on the downstream buses initiate I/O. +More information on the automatic switching behavior is available in +.Xr iicmux 4 . +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, an +.Nm +device node is defined as a child node of its upstream i2c bus. +The children of the +.Nm +node are additional i2c buses, which will have their own i2c slave +devices described in their child nodes. +.Pp +The +.Nm +driver conforms to the standard +.Bk -words +.Li i2c/i2c-mux-ltc4306.txt +.Ek +bindings document, except that the following optional properties +are not currently supported and will be ignored if present: +.Bl -bullet -compact -inset -offset indent +.It +enable-gpios +.It +gpio-controller +.It +#gpio-cells +.It +ltc,downstream-accelerators-enable +.It +ltc,upstream-accelerators-enable +.El +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, these values are configurable for +.Nm : +.Bl -tag -width indent +.It Va hint.ltc430x..at +The upstream +.Xr iicbus 4 +the +.Nm +instance is attached to. +.El +.Pp +When configured via hints, the driver automatically adds an iicbus +instance for every downstream bus supported by the chip. +There is currently no way to indicate used versus unused channels. +.Sh SEE ALSO +.Xr iicbus 4 , +.Xr iicmux 4 , +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 13.0 . Modified: stable/12/sys/conf/NOTES ============================================================================== --- stable/12/sys/conf/NOTES Fri Jan 17 17:56:31 2020 (r356837) +++ stable/12/sys/conf/NOTES Fri Jan 17 17:57:34 2020 (r356838) @@ -2515,12 +2515,17 @@ device jedec_dimm # iicbb generic I2C bit-banging code (needed by lpbb, bktr) # device iicbus # Bus support, required for ic/iic/iicsmb below. -device iicbb +device iicbb # bitbang driver; implements i2c on a pair of gpio pins device ic -device iic +device iic # userland access to i2c slave devices via ioctl(8) device iicsmb # smb over i2c bridge device iicoc # OpenCores I2C controller support + +# I2C bus multiplexer (mux) devices +device iicmux # i2c mux core driver +device iic_gpiomux # i2c mux hardware controlled via gpio pins +device ltc430x # LTC4305 and LTC4306 i2c mux chips # I2C peripheral devices # Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Fri Jan 17 17:56:31 2020 (r356837) +++ stable/12/sys/conf/files Fri Jan 17 17:57:34 2020 (r356838) @@ -1864,6 +1864,10 @@ dev/iicbus/iicsmb.c optional iicsmb \ dev/iicbus/iicoc.c optional iicoc dev/iicbus/isl12xx.c optional isl12xx dev/iicbus/lm75.c optional lm75 +dev/iicbus/mux/iicmux.c optional iicmux +dev/iicbus/mux/iicmux_if.m optional iicmux +dev/iicbus/mux/iic_gpiomux.c optional iic_gpiomux fdt +dev/iicbus/mux/ltc430x.c optional ltc430x dev/iicbus/nxprtc.c optional nxprtc | pcf8563 dev/iicbus/ofw_iicbus.c optional fdt iicbus dev/iicbus/rtc8583.c optional rtc8583 Modified: stable/12/sys/dev/flash/cqspi.c ============================================================================== --- stable/12/sys/dev/flash/cqspi.c Fri Jan 17 17:56:31 2020 (r356837) +++ stable/12/sys/dev/flash/cqspi.c Fri Jan 17 17:57:34 2020 (r356838) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: stable/12/sys/dev/iicbus/iiconf.c ============================================================================== --- stable/12/sys/dev/iicbus/iiconf.c Fri Jan 17 17:56:31 2020 (r356837) +++ stable/12/sys/dev/iicbus/iiconf.c Fri Jan 17 17:57:34 2020 (r356838) @@ -137,6 +137,7 @@ iicbus_poll(struct iicbus_softc *sc, int how) int iicbus_request_bus(device_t bus, device_t dev, int how) { + struct iic_reqbus_data reqdata; struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus); int error = 0; @@ -175,8 +176,11 @@ iicbus_request_bus(device_t bus, device_t dev, int how */ IICBUS_UNLOCK(sc); /* Ask the underlying layers if the request is ok */ + reqdata.dev = dev; + reqdata.bus = bus; + reqdata.flags = how | IIC_REQBUS_DEV; error = IICBUS_CALLBACK(device_get_parent(bus), - IIC_REQUEST_BUS, (caddr_t)&how); + IIC_REQUEST_BUS, (caddr_t)&reqdata); IICBUS_LOCK(sc); if (error != 0) { @@ -201,6 +205,7 @@ iicbus_request_bus(device_t bus, device_t dev, int how int iicbus_release_bus(device_t bus, device_t dev) { + struct iic_reqbus_data reqdata; struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus); IICBUS_LOCK(sc); @@ -213,7 +218,11 @@ iicbus_release_bus(device_t bus, device_t dev) if (--sc->owncount == 0) { /* Drop the lock while informing the low-level driver. */ IICBUS_UNLOCK(sc); - IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, NULL); + reqdata.dev = dev; + reqdata.bus = bus; + reqdata.flags = IIC_REQBUS_DEV; + IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, + (caddr_t)&reqdata); IICBUS_LOCK(sc); sc->owner = NULL; wakeup_one(sc); Modified: stable/12/sys/dev/iicbus/iiconf.h ============================================================================== --- stable/12/sys/dev/iicbus/iiconf.h Fri Jan 17 17:56:31 2020 (r356837) +++ stable/12/sys/dev/iicbus/iiconf.h Fri Jan 17 17:57:34 2020 (r356838) @@ -47,6 +47,25 @@ #define IIC_INTR 0x2 #define IIC_INTRWAIT (IIC_INTR | IIC_WAIT) #define IIC_RECURSIVE 0x4 +#define IIC_REQBUS_DEV 0x8 /* See struct iic_reqbus_data, below. */ + +/* + * The original iicbus->bridge callback api took a pointer to an int containing + * flags. The new api allows a pointer to this struct, with IIC_REQBUS_DEV set + * in the flags to let the implementation know the pointer is actually to this + * struct which has the flags word first, followed by the device_t of the + * requesting bus and device. + * + * Note that the requesting device may not be a i2c slave device which is a + * child of the requested bus -- it may be a mux device which is electrically + * part of the bus hierarchy, but whose driver belongs to some other bus + * hierarchy such as gpio. + */ +struct iic_reqbus_data { + int flags; /* Flags from the set defined above. */ + device_t bus; /* The iicbus being requested. */ + device_t dev; /* The device requesting the bus. */ +}; /* * i2c modes Modified: stable/12/sys/dev/iicbus/mux/iic_gpiomux.c ============================================================================== --- head/sys/dev/iicbus/mux/iic_gpiomux.c Thu Jan 2 17:51:49 2020 (r356278) +++ stable/12/sys/dev/iicbus/mux/iic_gpiomux.c Fri Jan 17 17:57:34 2020 (r356838) @@ -119,6 +119,15 @@ gpiomux_probe(device_t dev) return (rv); } +static void +gpiomux_release_pins(struct gpiomux_softc *sc) +{ + int i; + + for (i = 0; i < sc->numpins; ++i) + gpio_pin_release(sc->pins[i]); +} + static int gpiomux_attach(device_t dev) { @@ -145,13 +154,16 @@ gpiomux_attach(device_t dev) sc->numpins = i; if (sc->numpins == 0) { device_printf(dev, "cannot acquire pins listed in mux-gpios\n"); - return ((err == 0) ? ENXIO : err); + if (err == 0) + err = ENXIO; + goto errexit; } numchannels = 1u << sc->numpins; if (numchannels > IICMUX_MAX_BUSES) { device_printf(dev, "too many mux-gpios pins for max %d buses\n", IICMUX_MAX_BUSES); - return (EINVAL); + err = EINVAL; + goto errexit; } /* @@ -163,13 +175,15 @@ gpiomux_attach(device_t dev) len = OF_getencprop(node, "i2c-parent", &propval, sizeof(propval)); if (len != sizeof(propval)) { device_printf(dev, "cannot obtain i2c-parent property\n"); - return (ENXIO); + err = ENXIO; + goto errexit; } busdev = OF_device_from_xref((phandle_t)propval); if (busdev == NULL) { device_printf(dev, "cannot find device referenced by i2c-parent property\n"); - return (ENXIO); + err = ENXIO; + goto errexit; } device_printf(dev, "upstream bus is %s\n", device_get_nameunit(busdev)); @@ -202,6 +216,11 @@ gpiomux_attach(device_t dev) if ((err = iicmux_attach(dev, busdev, numchannels)) == 0) bus_generic_attach(dev); +errexit: + + if (err != 0) + gpiomux_release_pins(sc); + return (err); } @@ -209,13 +228,12 @@ static int gpiomux_detach(device_t dev) { struct gpiomux_softc *sc = device_get_softc(dev); - int err, i; + int err; if ((err = iicmux_detach(dev)) != 0) return (err); - for (i = 0; i < sc->numpins; ++i) - gpio_pin_release(sc->pins[i]); + gpiomux_release_pins(sc); return (0); } Modified: stable/12/sys/dev/iicbus/mux/iicmux.c ============================================================================== --- head/sys/dev/iicbus/mux/iicmux.c Thu Jan 2 17:51:49 2020 (r356278) +++ stable/12/sys/dev/iicbus/mux/iicmux.c Fri Jan 17 17:57:34 2020 (r356838) @@ -153,7 +153,7 @@ iicmux_intr(device_t dev, int event, char *buf) /* XXX iicbus_intr() in iiconf.c should return status. */ iicbus_intr(sc->busdev, event, buf); - return (0); + return (0); } static int @@ -213,7 +213,7 @@ iicmux_write(device_t dev, const char *buf, int len, i } /*------------------------------------------------------------------------------ - * iicmux helper functions, called by hardware-specific drivers. + * iicmux helper functions, called by hardware-specific drivers. * All these functions return a standard errno value. *----------------------------------------------------------------------------*/ @@ -222,10 +222,16 @@ iicmux_add_child(device_t dev, device_t child, int bus { struct iicmux_softc *sc = device_get_softc(dev); - KASSERT(busidx < sc->numbuses, - ("iicmux_add_child: bus idx %d too big", busidx)); - KASSERT(sc->childdevs[busidx] == NULL, - ("iicmux_add_child: bus idx %d already added", busidx)); + if (busidx >= sc->numbuses) { + device_printf(dev, + "iicmux_add_child: bus idx %d too big", busidx); + return (EINVAL); + } + if (sc->childdevs[busidx] != NULL) { + device_printf(dev, "iicmux_add_child: bus idx %d already added", + busidx); + return (EINVAL); + } sc->childdevs[busidx] = child; if (sc->maxbus < busidx) @@ -234,32 +240,10 @@ iicmux_add_child(device_t dev, device_t child, int bus return (0); } -int -iicmux_attach(device_t dev, device_t busdev, int numbuses) +static int +iicmux_attach_children(struct iicmux_softc *sc) { - struct iicmux_softc *sc = device_get_softc(dev); - int i, numadded; - - /* - * Init the softc... - */ - KASSERT(numbuses <= IICMUX_MAX_BUSES, - ("iicmux_attach: numbuses %d exceeds max %d\n", - numbuses, IICMUX_MAX_BUSES)); - - sc->dev = dev; - sc->busdev = busdev; - sc->numbuses = numbuses; - - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, - "debugmux", CTLFLAG_RWTUN, &sc->debugmux, 0, "debug mux operations"); - - /* - * Add children... - */ - numadded = 0; - + int i; #ifdef FDT phandle_t child, node, parent; pcell_t idx; @@ -286,12 +270,12 @@ iicmux_attach(device_t dev, device_t busdev, int numbu */ for (child = OF_child(parent); child != 0; child = OF_peer(child)) { if (OF_getencprop(child, "reg", &idx, sizeof(idx)) == -1) { - device_printf(dev, + device_printf(sc->dev, "child bus missing required 'reg' property\n"); continue; } if (idx >= sc->numbuses) { - device_printf(dev, + device_printf(sc->dev, "child bus 'reg' property %d exceeds the number " "of buses supported by the device (%d)\n", idx, sc->numbuses); @@ -301,22 +285,48 @@ iicmux_attach(device_t dev, device_t busdev, int numbu sc->childnodes[idx] = child; if (sc->maxbus < idx) sc->maxbus = idx; - ++numadded; } + + /* If we configured anything using FDT data, we're done. */ + if (sc->maxbus >= 0) + return (0); #endif /* FDT */ /* - * If we configured anything using FDT data, we're done. Otherwise add - * an iicbus child for every downstream bus supported by the mux chip. + * If we make it to here, we didn't add any children based on FDT data. + * Add an iicbus child for every downstream bus supported by the mux. */ - if (numadded > 0) - return (0); - for (i = 0; i < sc->numbuses; ++i) { sc->childdevs[i] = device_add_child(sc->dev, "iicbus", -1); - if (sc->maxbus < i) - sc->maxbus = i; + sc->maxbus = i; } + + return (0); +} + +int +iicmux_attach(device_t dev, device_t busdev, int numbuses) +{ + struct iicmux_softc *sc = device_get_softc(dev); + int err; + + if (numbuses >= IICMUX_MAX_BUSES) { + device_printf(dev, "iicmux_attach: numbuses %d > max %d\n", + numbuses, IICMUX_MAX_BUSES); + return (EINVAL); + } + + sc->dev = dev; + sc->busdev = busdev; + sc->maxbus = -1; + sc->numbuses = numbuses; + + if ((err = iicmux_attach_children(sc)) != 0) + return (err); + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, + "debugmux", CTLFLAG_RWTUN, &sc->debugmux, 0, "debug mux operations"); return (0); } Modified: stable/12/sys/modules/i2c/Makefile ============================================================================== --- stable/12/sys/modules/i2c/Makefile Fri Jan 17 17:56:31 2020 (r356837) +++ stable/12/sys/modules/i2c/Makefile Fri Jan 17 17:57:34 2020 (r356838) @@ -17,6 +17,7 @@ SUBDIR = \ isl \ isl12xx \ jedec_dimm \ + mux \ nxprtc \ rtc8583 \ s35390a \ From owner-svn-src-stable-12@freebsd.org Fri Jan 17 21:57:06 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F4BB1FC0A7; Fri, 17 Jan 2020 21:57:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zvzj6k3Gz48h7; Fri, 17 Jan 2020 21:57:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8FCFFA88; Fri, 17 Jan 2020 21:57:05 +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 00HLv5JA031413; Fri, 17 Jan 2020 21:57:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00HLv5kW031412; Fri, 17 Jan 2020 21:57:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001172157.00HLv5kW031412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 17 Jan 2020 21:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356850 - stable/12/sys/riscv/include X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/riscv/include X-SVN-Commit-Revision: 356850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2020 21:57:06 -0000 Author: jhb Date: Fri Jan 17 21:57:05 2020 New Revision: 356850 URL: https://svnweb.freebsd.org/changeset/base/356850 Log: MFC 353931: Fix atomic_*cmpset32 on riscv64 with clang. The lr.w instruction used to read the value from memory sign-extends the value read from memory. GCC sign-extends the 32-bit comparison value passed in whereas clang currently does not. As a result, if the value being compared has the MSB set, the comparison fails for matching 32-bit values when compiled with clang. Use a cast to explicitly sign-extend the unsigned comparison value. This works with both GCC and clang. There is commentary in the RISC-V spec that suggests that GCC's approach is more correct, but it is not clear if the commentary in the RISC-V spec is binding. Sponsored by: DARPA Modified: stable/12/sys/riscv/include/atomic.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/atomic.h ============================================================================== --- stable/12/sys/riscv/include/atomic.h Fri Jan 17 21:39:28 2020 (r356849) +++ stable/12/sys/riscv/include/atomic.h Fri Jan 17 21:57:05 2020 (r356850) @@ -116,7 +116,7 @@ atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval "bnez %1, 0b\n" "1:" : "=&r" (tmp), "=&r" (res), "+A" (*p) - : "rJ" (cmpval), "rJ" (newval) + : "rJ" ((long)(int32_t)cmpval), "rJ" (newval) : "memory"); return (!res); @@ -141,7 +141,7 @@ atomic_fcmpset_32(volatile uint32_t *p, uint32_t *cmpv "sw %0, %3\n" /* Save old value */ "2:" : "=&r" (tmp), "=&r" (res), "+A" (*p), "+A" (*cmpval) - : "rJ" (*cmpval), "rJ" (newval) + : "rJ" ((long)(int32_t)*cmpval), "rJ" (newval) : "memory"); return (!res); From owner-svn-src-stable-12@freebsd.org Fri Jan 17 22:02:35 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D01691FC348; Fri, 17 Jan 2020 22:02:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zw6358qjz498y; Fri, 17 Jan 2020 22:02:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABD83FC65; Fri, 17 Jan 2020 22:02:35 +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 00HM2ZJp037041; Fri, 17 Jan 2020 22:02:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00HM2ZKs037040; Fri, 17 Jan 2020 22:02:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001172202.00HM2ZKs037040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 17 Jan 2020 22:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356851 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 356851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2020 22:02:35 -0000 Author: jhb Date: Fri Jan 17 22:02:35 2020 New Revision: 356851 URL: https://svnweb.freebsd.org/changeset/base/356851 Log: MFC 353932: Strip "sf" suffix when generating a target triple. This fixes the target triple used when compiling riscv64sf with clang. Sponsored by: DARPA Modified: stable/12/Makefile.inc1 Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Fri Jan 17 21:57:05 2020 (r356850) +++ stable/12/Makefile.inc1 Fri Jan 17 22:02:35 2020 (r356851) @@ -126,9 +126,9 @@ TARGET_ABI= gnueabi .endif .endif MACHINE_ABI?= unknown -MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.1 +MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.1 TARGET_ABI?= unknown -TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.1 +TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.1 KNOWN_ARCHES?= aarch64/arm64 \ amd64 \ arm \ From owner-svn-src-stable-12@freebsd.org Fri Jan 17 22:21:39 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E4531FC9FC; Fri, 17 Jan 2020 22:21:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zwX30RtWz4B9b; Fri, 17 Jan 2020 22:21:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ABF0FFB6; Fri, 17 Jan 2020 22:21:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00HMLcVa045027; Fri, 17 Jan 2020 22:21:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00HMLcxj045026; Fri, 17 Jan 2020 22:21:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001172221.00HMLcxj045026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 17 Jan 2020 22:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356853 - stable/12/sys/arm/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/sys/arm/conf X-SVN-Commit-Revision: 356853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2020 22:21:39 -0000 Author: ian Date: Fri Jan 17 22:21:38 2020 New Revision: 356853 URL: https://svnweb.freebsd.org/changeset/base/356853 Log: MFC r356295: Add the xdma framework and pl330 dma drivers to arm lint build. Modified: stable/12/sys/arm/conf/NOTES Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/conf/NOTES ============================================================================== --- stable/12/sys/arm/conf/NOTES Fri Jan 17 22:04:11 2020 (r356852) +++ stable/12/sys/arm/conf/NOTES Fri Jan 17 22:21:38 2020 (r356853) @@ -42,3 +42,7 @@ nodevice mps # Add devices which are specific to various arm platforms... device twsi # i2c controller on Marvel and Allwinner + +device pl330 # ARM PL330 dma controller +device xdma # xDMA framework for SoC on-chip dma controllers + From owner-svn-src-stable-12@freebsd.org Fri Jan 17 22:24:57 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 389571FCAA7; Fri, 17 Jan 2020 22:24:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zwbs0pSJz4BTG; Fri, 17 Jan 2020 22:24:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16D221800B; Fri, 17 Jan 2020 22:24:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00HMOuoP049808; Fri, 17 Jan 2020 22:24:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00HMOuDZ049807; Fri, 17 Jan 2020 22:24:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001172224.00HMOuDZ049807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 17 Jan 2020 22:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356854 - stable/12/sys/cddl/dev/dtrace/arm X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/sys/cddl/dev/dtrace/arm X-SVN-Commit-Revision: 356854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2020 22:24:57 -0000 Author: ian Date: Fri Jan 17 22:24:56 2020 New Revision: 356854 URL: https://svnweb.freebsd.org/changeset/base/356854 Log: MFC r356574: Remove scary-looking printf output that happens when you kldload dtrace on arm. Replace it with a comment block explaining why the function is empty on 32-bit arm. Modified: stable/12/sys/cddl/dev/dtrace/arm/dtrace_subr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/dev/dtrace/arm/dtrace_subr.c ============================================================================== --- stable/12/sys/cddl/dev/dtrace/arm/dtrace_subr.c Fri Jan 17 22:21:38 2020 (r356853) +++ stable/12/sys/cddl/dev/dtrace/arm/dtrace_subr.c Fri Jan 17 22:24:56 2020 (r356854) @@ -123,7 +123,18 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trap void dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) { - printf("IMPLEMENT ME: dtrace_toxic_ranges\n"); + + /* + * There are no ranges to exclude that are common to all 32-bit arm + * platforms. This function only needs to exclude ranges "... in + * which it is impossible to recover from such a load after it has been + * attempted." -- i.e., accessing within the range causes some sort + * fault in the system which is not handled by the normal arm + * exception-handling mechanisms. If systems exist where that is the + * case, a method to handle this functionality would have to be added to + * the platform_if interface so that those systems could provide their + * specific toxic range(s). + */ } void From owner-svn-src-stable-12@freebsd.org Sat Jan 18 10:44:33 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEFFE22FA95; Sat, 18 Jan 2020 10:44:33 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480F1F4Syjz3LBc; Sat, 18 Jan 2020 10:44:33 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9488520BC8; Sat, 18 Jan 2020 10:44:33 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00IAiXdM095623; Sat, 18 Jan 2020 10:44:33 GMT (envelope-from syrinx@FreeBSD.org) Received: (from syrinx@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00IAiXJU095621; Sat, 18 Jan 2020 10:44:33 GMT (envelope-from syrinx@FreeBSD.org) Message-Id: <202001181044.00IAiXJU095621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: syrinx set sender to syrinx@FreeBSD.org using -f From: Shteryana Shopova Date: Sat, 18 Jan 2020 10:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356864 - stable/12/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: stable-12 X-SVN-Commit-Author: syrinx X-SVN-Commit-Paths: stable/12/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Commit-Revision: 356864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2020 10:44:33 -0000 Author: syrinx Date: Sat Jan 18 10:44:32 2020 New Revision: 356864 URL: https://svnweb.freebsd.org/changeset/base/356864 Log: MFC r349264: Unbreak snmp_pf(3) after the changes introduced in r338209 PR: 237011 Event: Vienna Hackathon 2019 Modified: stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Jan 18 04:48:05 2020 (r356863) +++ stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Jan 18 10:44:32 2020 (r356864) @@ -907,7 +907,7 @@ pf_tbladdr(struct snmp_context __unused *ctx, struct s } int -pf_altq(struct snmp_context __unused *ctx, struct snmp_value *val, +pf_altq_num(struct snmp_context __unused *ctx, struct snmp_value *val, u_int sub, u_int __unused vindex, enum snmp_op op) { asn_subid_t which = val->var.subs[sub - 1]; Modified: stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def ============================================================================== --- stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def Sat Jan 18 04:48:05 2020 (r356863) +++ stable/12/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def Sat Jan 18 10:44:32 2020 (r356864) @@ -174,7 +174,7 @@ ) ) (10 pfAltq - (1 pfAltqQueueNumber INTEGER32 pf_altq GET) + (1 pfAltqQueueNumber INTEGER32 pf_altq_num GET) (2 pfAltqQueueTable (1 pfAltqQueueEntry : INTEGER32 pf_altqq (1 pfAltqQueueIndex INTEGER32) From owner-svn-src-stable-12@freebsd.org Sat Jan 18 10:55:38 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E55C822FE28; Sat, 18 Jan 2020 10:55:38 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480FG25hCFz3Lk9; Sat, 18 Jan 2020 10:55:38 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCDC820DA1; Sat, 18 Jan 2020 10:55:38 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00IAtcwP002090; Sat, 18 Jan 2020 10:55:38 GMT (envelope-from syrinx@FreeBSD.org) Received: (from syrinx@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00IAtcG0002089; Sat, 18 Jan 2020 10:55:38 GMT (envelope-from syrinx@FreeBSD.org) Message-Id: <202001181055.00IAtcG0002089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: syrinx set sender to syrinx@FreeBSD.org using -f From: Shteryana Shopova Date: Sat, 18 Jan 2020 10:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356865 - stable/12/usr.sbin/bsnmpd/modules/snmp_lm75 X-SVN-Group: stable-12 X-SVN-Commit-Author: syrinx X-SVN-Commit-Paths: stable/12/usr.sbin/bsnmpd/modules/snmp_lm75 X-SVN-Commit-Revision: 356865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2020 10:55:39 -0000 Author: syrinx Date: Sat Jan 18 10:55:38 2020 New Revision: 356865 URL: https://svnweb.freebsd.org/changeset/base/356865 Log: MFC r349265: No need for each bsnmpd(1) module to open connection to syslog bsnmpd(1) main does that early on init and the connection is available to all loaded modules PR: 233431 , 221487 Event: Vienna Hackathon 2019 Modified: stable/12/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c ============================================================================== --- stable/12/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c Sat Jan 18 10:44:32 2020 (r356864) +++ stable/12/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c Sat Jan 18 10:55:38 2020 (r356865) @@ -100,7 +100,6 @@ lm75_init(struct lmodule *mod, int argc __unused, char module = mod; lm75_sensors = 0; - openlog("snmp_lm75", LOG_NDELAY | LOG_PID, LOG_DAEMON); return(0); } From owner-svn-src-stable-12@freebsd.org Sat Jan 18 23:26:16 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E7A923568D; Sat, 18 Jan 2020 23:26:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480Yw82l01z4YQ9; Sat, 18 Jan 2020 23:26:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5915319B9; Sat, 18 Jan 2020 23:26:16 +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 00INQGsY068375; Sat, 18 Jan 2020 23:26:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00INQGtt068374; Sat, 18 Jan 2020 23:26:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001182326.00INQGtt068374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Jan 2020 23:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356870 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 356870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2020 23:26:16 -0000 Author: jhb Date: Sat Jan 18 23:26:15 2020 New Revision: 356870 URL: https://svnweb.freebsd.org/changeset/base/356870 Log: MFC 355634: Emulate reads of the PCI command register for passthrough devices. VFs return zero for the memory enable bit even if it has been set by a prior write. After r348779 this caused the annoying behavior that a guest OS would unintentionally disable memory decoding on a future read-modify-write operation on the command register. Instead, return the shadow value of the command register for reads. This ensures that the guest will only toggle the state of the memory enable bit when it specifically intends to do so. Sponsored by: Chelsio Communications Modified: stable/12/usr.sbin/bhyve/pci_passthru.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_passthru.c Sat Jan 18 22:58:32 2020 (r356869) +++ stable/12/usr.sbin/bhyve/pci_passthru.c Sat Jan 18 23:26:15 2020 (r356870) @@ -806,6 +806,19 @@ passthru_cfgread(struct vmctx *ctx, int vcpu, struct p } #endif + /* + * Emulate the command register. If a single read reads both the + * command and status registers, read the status register from the + * device's config space. + */ + if (coff == PCIR_COMMAND) { + if (bytes <= 2) + return (-1); + *rv = pci_get_cfgdata16(pi, PCIR_COMMAND) << 16 | + read_config(&sc->psc_sel, PCIR_STATUS, 2); + return (0); + } + /* Everything else just read from the device's config space */ *rv = read_config(&sc->psc_sel, coff, bytes); From owner-svn-src-stable-12@freebsd.org Sat Jan 18 23:30:43 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78785235BF9; Sat, 18 Jan 2020 23:30:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480Z1H3HHKz4YXr; Sat, 18 Jan 2020 23:30:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BC7619CB; Sat, 18 Jan 2020 23:30:43 +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 00INUhOY068674; Sat, 18 Jan 2020 23:30:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00INUhVO068673; Sat, 18 Jan 2020 23:30:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001182330.00INUhVO068673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Jan 2020 23:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356871 - in stable/12/share/man: man4 man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/12/share/man: man4 man9 X-SVN-Commit-Revision: 356871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2020 23:30:43 -0000 Author: jhb Date: Sat Jan 18 23:30:42 2020 New Revision: 356871 URL: https://svnweb.freebsd.org/changeset/base/356871 Log: MFC 355866,355871: Update the crypto(4) and crypto(9) manpages. 355866: Update the crypto(4) and crypto(9) manpages. There are probably bits that are still wrong, but this fixes some things at least: - Add named arguments to the functions in crypto(9). - Add missing algorithms. - Don't mention arguments that don't exist in crypto_register. - Add CIOGSESSION2. - Remove CIOCNFSESSION. - Clarify some stale language that assumed an fd had only one sesson. - Note that you have to use CRIOGET and add a note in BUGS lamenting that one has to use CRIOGET. - Various other cleanups. 355871: Bump Dd for changes in r355866. Sponsored by: Chelsio Communications Modified: stable/12/share/man/man4/crypto.4 stable/12/share/man/man9/crypto.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/crypto.4 ============================================================================== --- stable/12/share/man/man4/crypto.4 Sat Jan 18 23:26:15 2020 (r356870) +++ stable/12/share/man/man4/crypto.4 Sat Jan 18 23:30:42 2020 (r356871) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 21, 2017 +.Dd December 17, 2019 .Dt CRYPTO 4 .Os .Sh NAME @@ -78,7 +78,7 @@ The .Nm driver gives user-mode applications access to hardware-accelerated -cryptographic transforms, as implemented by the +cryptographic transforms as implemented by the .Xr crypto 9 in-kernel interface. .Pp @@ -87,15 +87,15 @@ The special device provides an .Xr ioctl 2 based interface. -User-mode applications should open the special device, +User-mode applications open the special device and then issue .Xr ioctl 2 calls on the descriptor. User-mode access to .Pa /dev/crypto -is controlled by three +is controlled by two .Xr sysctl 8 -variables, +variables: .Ic kern.userasymcrypto and .Ic kern.cryptodevallowsoft . @@ -103,8 +103,8 @@ and The .Nm device provides two distinct modes of operation: one mode for -symmetric-keyed cryptographic requests, and a second mode for -both asymmetric-key (public-key/private-key) requests, and for +symmetric-keyed cryptographic requests and digests, and a second mode for +both asymmetric-key (public-key/private-key) requests and modular arithmetic (for Diffie-Hellman key exchange and other cryptographic protocols). The two modes are described separately below. @@ -113,12 +113,22 @@ Regardless of whether symmetric-key or asymmetric-key to be performed, use of the device requires a basic series of steps: .Bl -enum .It -Open a file descriptor for the device. -See -.Xr open 2 . +Open the +.Pa /dev/crypto +device. .It -If any symmetric operation will be performed, -create one session, with +Create a new cryptography file descriptor via +.Dv CRIOGET +to use for all subsequent +.Xr ioctl 2 +commands. +.It +Close the +.Pa /dev/crypto +device. +.It +If any symmetric-keyed cryptographic or digest operations will be performed, +create a session with .Dv CIOCGSESSION . Most applications will require at least one symmetric session. Since cipher and MAC keys are tied to sessions, many @@ -134,11 +144,13 @@ or .Dv CIOCKEY (asymmetric). .It -Destroy one session with +Optionally destroy a session with .Dv CIOCFSESSION . .It -Close the device with +Close the cryptography file descriptor with .Xr close 2 . +This will automatically close any remaining sessions associated with the +file desriptor. .El .Sh SYMMETRIC-KEY OPERATION The symmetric-key operation mode provides a context-based API @@ -196,9 +208,9 @@ struct session_op { u_int32_t mac; /* e.g. CRYPTO_MD5_HMAC */ u_int32_t keylen; /* cipher key */ - void * key; + const void *key; int mackeylen; /* mac key */ - void * mackey; + const void *mackey; u_int32_t ses; /* returns: ses # */ }; @@ -241,12 +253,36 @@ and the key value in the octets addressed by .Fa sessp-\*[Gt]mackeylen . .\" .Pp -Support for a specific combination of fused privacy and +Support for a specific combination of fused privacy and integrity-check algorithms depends on whether the underlying hardware supports that combination. Not all combinations are supported by all hardware, even if the hardware supports each operation as a stand-alone non-fused operation. +.It Dv CIOCGSESSION2 Fa struct session2_op *sessp +.Bd -literal +struct session2_op { + u_int32_t cipher; /* e.g. CRYPTO_DES_CBC */ + u_int32_t mac; /* e.g. CRYPTO_MD5_HMAC */ + + u_int32_t keylen; /* cipher key */ + const void *key; + int mackeylen; /* mac key */ + const void *mackey; + + u_int32_t ses; /* returns: ses # */ + int crid; /* driver id + flags (rw) */ + int pad[4]; /* for future expansion */ +}; + +.Ed +This request is similar to CIOGSESSION except that +.Fa sessp-\*[Gt]crid +requests either a specific crypto device or a class of devices (software vs +hardware). +The +.Fa sessp-\*[Gt]pad +field must be initialized to zero. .It Dv CIOCCRYPT Fa struct crypt_op *cr_op .Bd -literal struct crypt_op { @@ -261,9 +297,6 @@ struct crypt_op { .Ed Request a symmetric-key (or hash) operation. -The file descriptor argument to -.Xr ioctl 2 -must have been bound to a valid session. To encrypt, set .Fa cr_op-\*[Gt]op to @@ -315,21 +348,8 @@ but provides additional data in .Fa cr_aead-\*[Gt]aad to include in the authentication mode. .It Dv CIOCFSESSION Fa u_int32_t ses_id -Destroys the /dev/crypto session associated with the file-descriptor -argument. -.It Dv CIOCNFSESSION Fa struct crypt_sfop *sfop ; -.Bd -literal -struct crypt_sfop { - size_t count; - u_int32_t *sesid; -}; - -.Ed -Destroys the -.Fa sfop-\*[Gt]count -sessions specified by the -.Fa sfop -array of session identifiers. +Destroys the session identified by +.Fa ses_id . .El .\" .Sh ASYMMETRIC-KEY OPERATION @@ -435,8 +455,10 @@ algorithm, you must supply a suitably-sized buffer. .Pp The scheme for passing arguments for asymmetric requests is baroque. .Pp -The naming inconsistency between .Dv CRIOGET -and the various +should not exist. +It should be possible to use the .Dv CIOC Ns \&* -names is an unfortunate historical artifact. +commands directly on a +.Pa /dev/crypto +file descriptor. Modified: stable/12/share/man/man9/crypto.9 ============================================================================== --- stable/12/share/man/man9/crypto.9 Sat Jan 18 23:26:15 2020 (r356870) +++ stable/12/share/man/man9/crypto.9 Sat Jan 18 23:30:42 2020 (r356871) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2018 +.Dd December 17, 2019 .Dt CRYPTO 9 .Os .Sh NAME @@ -26,35 +26,35 @@ .Sh SYNOPSIS .In opencrypto/cryptodev.h .Ft int32_t -.Fn crypto_get_driverid device_t size_t int +.Fn crypto_get_driverid "device_t dev" "size_t session_size" "int flags" .Ft int -.Fn crypto_register uint32_t int uint16_t uint32_t "int \*[lp]*\*[rp]\*[lp]void *, uint32_t *, struct cryptoini *\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, uint64_t\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, struct cryptop *\*[rp]" "void *" +.Fn crypto_register "uint32_t driverid" "int alg" "uint16_t maxoplen" "uint32_t flags" .Ft int -.Fn crypto_kregister uint32_t int uint32_t "int \*[lp]*\*[rp]\*[lp]void *, struct cryptkop *\*[rp]" "void *" +.Fn crypto_kregister "uint32_t driverid" "int kalg" "uint32_t flags" .Ft int -.Fn crypto_unregister uint32_t int +.Fn crypto_unregister "uint32_t driverid" "int alg" .Ft int -.Fn crypto_unregister_all uint32_t +.Fn crypto_unregister_all "uint32_t driverid" .Ft void -.Fn crypto_done "struct cryptop *" +.Fn crypto_done "struct cryptop *crp" .Ft void -.Fn crypto_kdone "struct cryptkop *" +.Fn crypto_kdone "struct cryptkop *krp" .Ft int -.Fn crypto_find_driver "const char *" +.Fn crypto_find_driver "const char *match" .Ft int -.Fn crypto_newsession "crypto_session_t *" "struct cryptoini *" int +.Fn crypto_newsession "crypto_session_t *cses" "struct cryptoini *cri" "int crid" .Ft int -.Fn crypto_freesession crypto_session_t +.Fn crypto_freesession "crypto_session_t cses" .Ft int -.Fn crypto_dispatch "struct cryptop *" +.Fn crypto_dispatch "struct cryptop *crp" .Ft int -.Fn crypto_kdispatch "struct cryptkop *" +.Fn crypto_kdispatch "struct cryptkop *krp" .Ft int -.Fn crypto_unblock uint32_t int +.Fn crypto_unblock "uint32_t driverid" "int what" .Ft "struct cryptop *" -.Fn crypto_getreq int +.Fn crypto_getreq "int num" .Ft void -.Fn crypto_freereq void +.Fn crypto_freereq "struct cryptop *crp" .Bd -literal #define CRYPTO_SYMQ 0x1 #define CRYPTO_ASYMQ 0x2 @@ -160,33 +160,48 @@ For session initialization and teardown no callback me .Pp The .Fn crypto_find_driver -function may be called to return the specific id of the provided name. -If the specified driver could not be found, the returned id is -1. +returns the driver id of the device whose name matches +.Fa match . +.Fa match +can either be the exact name of a device including the unit +or the driver name without a unit. +In the latter case, +the id of the first device with the matching driver name is returned. +If no matching device is found, +the value -1 is returned. .Pp The .Fn crypto_newsession routine is called by consumers of cryptographic services (such as the .Xr ipsec 4 stack) that wish to establish a new session with the framework. -The second argument contains all the necessary information for +The +.Fa cri +argument points to a +.Vt cryptoini +structure containing all the necessary information for the driver to establish the session. -The third argument is either a specific driver id, or one or both -of +The +.Fa crid +argument is either a specific driver id or a bitmask of flags. +The flags are .Dv CRYPTOCAP_F_HARDWARE , to select hardware devices, or .Dv CRYPTOCAP_F_SOFTWARE , to select software devices. -If both are specified, a hardware device will be returned -before a software device will be. -On success, the value pointed to by the first argument will be the opaque -session handle. -The various fields in the +If both are specified, hardware devices are preferred over software +devices. +On success, the opaque session handle of the new session will be stored in +.Fa *cses . +The .Vt cryptoini -structure are: +structure pointed to by +.Fa cri +contains these fields: .Bl -tag -width ".Va cri_next" .It Va cri_alg -Contains an algorithm identifier. +An algorithm identifier. Currently supported algorithms are: .Pp .Bl -tag -width ".Dv CRYPTO_RIPEMD160_HMAC" -compact @@ -194,14 +209,19 @@ Currently supported algorithms are: .It Dv CRYPTO_AES_192_NIST_GMAC .It Dv CRYPTO_AES_256_NIST_GMAC .It Dv CRYPTO_AES_CBC +.It Dv CRYPTO_AES_CCM_16 +.It Dv CRYPTO_AES_CCM_CBC_MAC .It Dv CRYPTO_AES_ICM .It Dv CRYPTO_AES_NIST_GCM_16 .It Dv CRYPTO_AES_NIST_GMAC .It Dv CRYPTO_AES_XTS .It Dv CRYPTO_ARC4 +.It Dv CRYPTO_BLAKE2B +.It Dv CRYPTO_BLAKE2S .It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CAST_CBC +.It Dv CRYPTO_CHACHA20 .It Dv CRYPTO_DEFLATE_COMP .It Dv CRYPTO_DES_CBC .It Dv CRYPTO_3DES_CBC @@ -210,43 +230,52 @@ Currently supported algorithms are: .It Dv CRYPTO_MD5_KPDK .It Dv CRYPTO_NULL_HMAC .It Dv CRYPTO_NULL_CBC +.It Dv CRYPTO_POLY1305 +.It Dv CRYPTO_RIPEMD160 .It Dv CRYPTO_RIPEMD160_HMAC .It Dv CRYPTO_SHA1 .It Dv CRYPTO_SHA1_HMAC .It Dv CRYPTO_SHA1_KPDK +.It Dv CRYPTO_SHA2_224 +.It Dv CRYPTO_SHA2_224_HMAC +.It Dv CRYPTO_SHA2_256 .It Dv CRYPTO_SHA2_256_HMAC +.It Dv CRYPTO_SHA2_384 .It Dv CRYPTO_SHA2_384_HMAC +.It Dv CRYPTO_SHA2_512 .It Dv CRYPTO_SHA2_512_HMAC .It Dv CRYPTO_SKIPJACK_CBC .El .It Va cri_klen -Specifies the length of the key in bits, for variable-size key -algorithms. +For variable-size key algorithms, the length of the key in bits. .It Va cri_mlen -Specifies how many bytes from the calculated hash should be copied back. -0 means entire hash. +If non-zero, truncate the calculated hash to this many bytes. .It Va cri_key -Contains the key to be used with the algorithm. +The key to be used. .It Va cri_iv -Contains an explicit initialization vector (IV), if it does not prefix +An explicit initialization vector if it does not prefix the data. This field is ignored during initialization .Pq Nm crypto_newsession . If no IV is explicitly passed (see below on details), a random IV is used by the device driver processing the request. .It Va cri_next -Contains a pointer to another +Pointer to another .Vt cryptoini structure. -Multiple such structures may be linked to establish multi-algorithm sessions -.Xr ( ipsec 4 -is an example consumer of such a feature). +This is used to establish dual-algorithm sessions, such as combining a +cipher with a MAC. .El .Pp The .Vt cryptoini -structure and its contents will not be modified by the framework (or -the drivers used). +structure and its contents will not be modified or referenced by the +framework or any cryptographic drivers. +The memory associated with +.Fa cri +can be released once +.Fn crypto_newsession +returns. .Pp .Fn crypto_freesession is called with the session handle returned by @@ -260,28 +289,22 @@ The various fields in the structure are: .Bl -tag -width ".Va crp_callback" .It Va crp_session -Contains the session handle. +The session handle. .It Va crp_ilen -Indicates the total length in bytes of the buffer to be processed. +The total length in bytes of the buffer to be processed. .It Va crp_olen On return, contains the total length of the result. For symmetric crypto operations, this will be the same as the input length. This will be used if the framework needs to allocate a new buffer for the result (or for re-formatting the input). .It Va crp_callback -This routine is invoked upon completion of the request, whether -successful or not. -It is invoked through the -.Fn crypto_done -routine. -If the request was not successful, an error code is set in the +Callback routine invoked when a request is completed via +.Fn crypto_done . +The callback routine should inspect the .Va crp_etype -field. -It is the responsibility of the callback routine to set the appropriate -.Xr spl 9 -level. +to determine if the request was successfully completed. .It Va crp_etype -Contains the error type, if any errors were encountered, or zero if +The error type, if any errors were encountered, or zero if the request was successfully processed. If the .Er EAGAIN @@ -296,8 +319,7 @@ This mechanism is used by the framework to perform session migration (move a session from one driver to another, because of availability, performance, or other considerations). .Pp -Note that this field only makes sense when examined by -the callback routine specified in +This field is only valid in the context of the callback routine specified by .Va crp_callback . Errors are returned to the invoker of .Fn crypto_process @@ -306,19 +328,17 @@ routine (i.e., if the pointer passed is .Dv NULL or if no callback routine was specified). .It Va crp_flags -Is a bitmask of flags associated with this request. +A bitmask of flags associated with this request. Currently defined flags are: .Bl -tag -width ".Dv CRYPTO_F_CBIFSYNC" .It Dv CRYPTO_F_IMBUF -The buffer pointed to by -.Va crp_buf -is an mbuf chain. +The buffer is an mbuf chain pointed to by +.Va crp_mbuf . .It Dv CRYPTO_F_IOV -The buffer pointed to by -.Va crp_buf -is an +The buffer is a .Vt uio -structure. +structure pointed to by +.Va crp_uio . .It Dv CRYPTO_F_BATCH Batch operation if possible. .It Dv CRYPTO_F_CBIMM @@ -344,18 +364,31 @@ Only relevant if the flag is set and if the operation is synchronous. .El .It Va crp_buf -Points to the input buffer. -On return (when the callback is invoked), -it contains the result of the request. -The input buffer may be an mbuf -chain or a contiguous buffer, -depending on +Data buffer unless +.Dv CRYPTO_F_IMBUF +or +.Dv CRYPTO_F_IOV +is set in .Va crp_flags . +The length in bytes is set in +.Va crp_ilen . +.It Va crp_mbuf +Data buffer mbuf chain when +.Dv CRYPTO_F_IMBUF +is set in +.Va crp_flags . +.It Va crp_uio +.Vt struct uio +data buffer when +.Dv CRYPTO_F_IOV +is set in +.Va crp_flags . .It Va crp_opaque -This is passed through the crypto framework untouched and is +Cookie passed through the crypto framework untouched. +It is intended for the invoking application's use. .It Va crp_desc -This is a linked list of descriptors. +A linked list of descriptors. Each descriptor provides information about what type of cryptographic operation should be done on the input buffer. @@ -429,9 +462,7 @@ operations the offset of the IV is provided by the field. This flag is typically used when the IV is calculated .Dq "on the fly" -by the consumer, and does not precede the data (some -.Xr ipsec 4 -configurations, and the encrypted swap are two such examples). +by the consumer, and does not precede the data. .It Dv CRD_F_KEY_EXPLICIT For encryption and authentication (MAC) algorithms, this bit is set when the key is explicitly provided by the consumer in the @@ -468,9 +499,10 @@ block of data. .Fn crypto_getreq allocates a .Vt cryptop -structure with a linked list of as many +structure with a linked list of +.Fa num .Vt cryptodesc -structures as were specified in the argument passed to it. +structures. .Pp .Fn crypto_freereq deallocates a structure @@ -500,10 +532,10 @@ This variable indicates whether lower level reasons for operation failure. .It Va krp_iparams -Number if input parameters to the specified operation. +Number of input parameters to the specified operation. Note that each operation has a (typically hardwired) number of such parameters. .It Va krp_oparams -Number if output parameters from the specified operation. +Number of output parameters from the specified operation. Note that each operation has a (typically hardwired) number of such parameters. .It Va krp_kvp An array of kernel memory blocks containing the parameters. @@ -540,7 +572,7 @@ The .Dv CRYPTOCAP_F_SYNC may also be specified, and should be specified if the driver does all of it's operations synchronously. -Drivers must pass the size of their session struct as the second argument. +Drivers must pass the size of their session structure as the second argument. An appropriately sized memory will be allocated by the framework, zeroed, and passed to the driver's .Fn newsession @@ -551,14 +583,6 @@ For each algorithm the driver supports, it must then c The first two arguments are the driver and algorithm identifiers. The next two arguments specify the largest possible operator length (in bits, important for public key operations) and flags for this algorithm. -The last four arguments must be provided in the first call to -.Fn crypto_register -and are ignored in all subsequent calls. -They are pointers to three -driver-provided functions that the framework may call to establish new -cryptographic context with the driver, free already established -context, and ask for a request to be processed (encrypt, decrypt, -etc.); and an opaque parameter to pass when calling each of these routines. .Pp .Fn crypto_unregister is called by drivers that wish to withdraw support for an algorithm. From owner-svn-src-stable-12@freebsd.org Sat Jan 18 23:42:58 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 781EA236D0C; Sat, 18 Jan 2020 23:42:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480ZHQ2ZjBz4ZDv; Sat, 18 Jan 2020 23:42:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53CFB1D3D; Sat, 18 Jan 2020 23:42:58 +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 00INgwo4079941; Sat, 18 Jan 2020 23:42:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00INgwXQ079940; Sat, 18 Jan 2020 23:42:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001182342.00INgwXQ079940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Jan 2020 23:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356872 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 356872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2020 23:42:58 -0000 Author: jhb Date: Sat Jan 18 23:42:57 2020 New Revision: 356872 URL: https://svnweb.freebsd.org/changeset/base/356872 Log: MFC 356209: Formatting fixes for tables, no content changes. - Add missing .Pp after the end of some lists so that there is a blank line before the subsequent paragraph. - Use a more typical '-tag' bullet list of the make variable descriptions at the end. This adds separation between bullets and is the formatting typically used in manpages for this sort of list. Modified: stable/12/share/man/man7/arch.7 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/arch.7 ============================================================================== --- stable/12/share/man/man7/arch.7 Sat Jan 18 23:30:42 2020 (r356871) +++ stable/12/share/man/man7/arch.7 Sat Jan 18 23:42:57 2020 (r356872) @@ -139,6 +139,7 @@ and .Vt void * are 8 bytes. .El +.Pp Compilers define the .Dv _LP64 symbol when compiling for an @@ -162,6 +163,7 @@ Examples are: .It Dv powerpc64 Ta Dv powerpc .It Dv mips64* Ta Dv mips* .El +.Pp .Dv aarch64 currently does not support execution of .Dv armv6 @@ -181,6 +183,7 @@ On all supported architectures: .It float Ta 4 .It double Ta 8 .El +.Pp Integers are represented in two's complement. Alignment of integer and pointer types is natural, that is, the address of the variable must be congruent to zero modulo the type size. @@ -396,8 +399,9 @@ Most of the externally settable variables are defined man page. These variables are not otherwise documented and are used extensively in the build system. -.Bl -column -offset indent "Sy Variable" "Sy Meaning and usage" -.It Dv MACHINE Represent the hardware platform. +.Bl -tag -width "MACHINE_CPUARCH" +.It Dv MACHINE +Represent the hardware platform. This is the same as the native platform's .Xr uname 1 .Fl m @@ -432,7 +436,8 @@ Generally, .Dv MACHINE should only be used in src/sys and src/stand or in system imagers or installers. -.It Dv MACHINE_ARCH Represents the CPU processor architecture. +.It Dv MACHINE_ARCH +Represents the CPU processor architecture. This is the same as the native platforms .Xr uname 1 .Fl p @@ -463,7 +468,8 @@ It is unfortunate that amd64 specifies the 64-bit evol platform (it matches the 'first rule') as everybody else uses x86_64. There is no standard name for the processor: each OS selects its own conventions. -.It Dv MACHINE_CPUARCH Represents the source location for a given +.It Dv MACHINE_CPUARCH +Represents the source location for a given .Dv MACHINE_ARCH . For example, .Dv MACHINE_CPUARCH @@ -475,25 +481,29 @@ The FreeBSD source base supports amd64 and i386 with t distinct source bases living in subdirectories named amd64 and i386 (though behind the scenes there's some sharing that fits into this framework). -.It Dv CPUTYPE Sets the flavor of +.It Dv CPUTYPE +Sets the flavor of .Dv MACHINE_ARCH to build. It is used to optimize the build for a specific CPU / core that the binaries run on. Generally, this does not change the ABI, though it can be a fine line between optimization for specific cases. -.It Dv TARGET Used to set +.It Dv TARGET +Used to set .Dv MACHINE in the top level Makefile for cross building. Unused outside of that scope. It is not passed down to the rest of the build. Makefiles outside of the top level should not use it at all (though some have their own private copy for hysterical raisons). -.It Dv TARGET_ARCH Used to set +.It Dv TARGET_ARCH +Used to set .Dv MACHINE_ARCH by the top level Makefile for cross building. Like -.Dv TARGET , it is unused outside of that scope. +.Dv TARGET , +it is unused outside of that scope. .El .Sh SEE ALSO .Xr src.conf 5 , From owner-svn-src-stable-12@freebsd.org Sat Jan 18 23:46:30 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D38ED237156; Sat, 18 Jan 2020 23:46:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480ZMV5DD3z4ZTY; Sat, 18 Jan 2020 23:46:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9AB31D40; Sat, 18 Jan 2020 23:46:30 +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 00INkUWR080258; Sat, 18 Jan 2020 23:46:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00INkULd080257; Sat, 18 Jan 2020 23:46:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001182346.00INkULd080257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Jan 2020 23:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356874 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 356874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2020 23:46:30 -0000 Author: jhb Date: Sat Jan 18 23:46:30 2020 New Revision: 356874 URL: https://svnweb.freebsd.org/changeset/base/356874 Log: MFC 356274: Some minor tweaks to arch(7). - Drop mention of _LP64. FreeBSD's source generally uses __LP64__ instead of _LP64, and the relevant macros are better covered in the "Predefined Macros" section. - Fix a noun/verb disagreement. Modified: stable/12/share/man/man7/arch.7 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/arch.7 ============================================================================== --- stable/12/share/man/man7/arch.7 Sat Jan 18 23:43:36 2020 (r356873) +++ stable/12/share/man/man7/arch.7 Sat Jan 18 23:46:30 2020 (r356874) @@ -140,12 +140,6 @@ and are 8 bytes. .El .Pp -Compilers define the -.Dv _LP64 -symbol when compiling for an -.Dv LP64 -ABI. -.Pp Some machines support more than one .Fx ABI. @@ -401,7 +395,7 @@ These variables are not otherwise documented and are u in the build system. .Bl -tag -width "MACHINE_CPUARCH" .It Dv MACHINE -Represent the hardware platform. +Represents the hardware platform. This is the same as the native platform's .Xr uname 1 .Fl m